Hola, estoy haciendo un programilla de VB 6.0 a partir de una dll en C++, y me da este error en la siguiente linea:
Alguien sabe el motivo o como solucionarlo?
Gracias.
Adjunto codigo:
Option Explicit
Private Sub Command1_Click()
Dim name As String
Dim cpu As Single
Dim mem As Long
name = " "
name_in.Text = name
cpu_in.Text = cpu
mem_in.Text = mem
DLLpon_imageName (name)
DLLpon_cpuUsage (cpu)
DLLpon_memUsage (mem)
MsgBox "Datos introducidos correctamente"
End Sub
Private Sub Command2_Click()
Dim palabra As String
Dim cpuUsage As Single
Dim memUsage As Long
palabra = " "
DLLdame_imageName (palabra)
DLLdame_cpuUsage (cpuUsage)DLLdame_memUsage (memUsage)
name_out.Text = palabra
cpu_out.Text = cpuUsage
mem_out.Text = memUsage
End Sub
Codigo C++
typedef char Tpalabra [20];
class CProcess
{
private:
Tpalabra imageName;
float cpuUsage;
int memUsage;
public:
void pon_imageName(Tpalabra name);
Tpalabra* dame_imageName();
void pon_cpuUsage(float cpu);
float dame_cpuUsage();
void pon_memUsage(int mem);
int dame_memUsage();
float valor_inicial_cpu();
int valor_inical_mem();
};
#include "CProcess.h"
#include <string.h>
float CProcess::valor_inicial_cpu()
{
return cpuUsage;
}
int CProcess::valor_inical_mem()
{
return memUsage;
}
void CProcess::pon_imageName(Tpalabra name)
{
strcpy(imageName,name);
}
Tpalabra* CProcess::dame_imageName()
{
return (&imageName);
}
void CProcess::pon_cpuUsage(float cpu)
{
cpuUsage=cpu;
}
float CProcess::dame_cpuUsage()
{
return (cpuUsage);
}
void CProcess::pon_memUsage(int mem)
{
memUsage=mem;
}
int CProcess::dame_memUsage()
{
return (memUsage);
}
LIBRARY CProcess.dll
DESCRIPTION 'Dll CProcess'
HEAPSIZE 4024
EXPORTS
DLLpon_imageName @1
DLLdame_imageName @2
DLLpon_cpuUsage @3
DLLdame_cpuUsage @4
DLLpon_memUsage @5
DLLdame_memUsage @6
#include "Windows.h"
#include "CProcess.h"
CProcess my_Process;
void FAR PASCAL DLLpon_imageName(Tpalabra name)
{
my_Process.pon_imageName(name);
}
void FAR PASCAL DLLdame_imageName(Tpalabra name)
{
strcpy(name,*my_Process.dame_imageName());
}
void FAR PASCAL DLLpon_cpuUsage(float cpu)
{
my_Process.pon_cpuUsage(cpu);
}
float FAR PASCAL DLLdame_cpuUsage()
{
return my_Process.dame_cpuUsage();
}
void FAR PASCAL DLLpon_memUsage(int mem)
{
my_Process.pon_memUsage(mem);
}
int FAR PASCAL DLLdame_memUsage()
{
return my_Process.dame_memUsage();
}