Oly Ens

Registrado: 07 Jul 2003Mensajes: 44Ubicación: Barcelona
|
Publicado: Mie 30 Jul, 2003 11:14 am Asunto: Error en este código (sobre DLL's) |
|
|
Hola, tengo este código:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
typedef int(__stdcall *PFUNC)(char *, unsigned short);
HINSTANCE hinstDLL = LoadLibrary("midll.dll");
PFUNC getInfo;
bool bRet;
int iValor;
if ( hinstDLL) {
getInfo = reinterpret_cast<PFUNC> (GetProcAddress(hinstDLL,"getInfo"));
if(getInfo)
iValor = getInfo(IP,puerto);
FreeLibrary(hinstDLL);
}
}
Parece bastante sencillo no? Pero esta parte parece que la hace bien pero a la hora de salir/cerrar el formulario me da un error de Access Violation.
¿Alguien sabe pq?
Merci |
|