When I compile this I get no compiler errors, but get runtime error. I think this is related with bad data type viaVAR. I tryed (I think this is correct) something like this:Code:#define _WIN32_WINNT 0x0500 #define WINVER 0x0500 #include <iostream.h> #include <Windows.h> #include <stdio.h> typedef int (__stdcall *viaBOOL) (void); typedef int (__stdcall *viaVAL) (void); //<---- Something is wrong here int main() { HINSTANCE hLib; hLib = LoadLibrary("viahm.dll"); if(hLib) { viaBOOL vOpen = GetProcAddress(hLib,"VIAHMOpen"); if(vOpen()) { viaBOOL vClose, vInit = GetProcAddress(hLib,"VIAHMInit"); vInit(); viaVAL vT1Reg = GetProcAddress(hLib,"VIAHMGetTsens1Reg"); vT1Reg(); //<---- And here too vClose = GetProcAddress(hLib,"VIAHMClose"); vClose(); } } FreeLibrary(hLib); return(0); }but after that I get compiler error: "error C2440: 'initializing' : cannot convert from 'int (__stdcall *)(void)' to 'void (__stdcall *)(unsigned long *)'"Code:typedef void (__stdcall *viaVAL) (PDWORD);
Thanks. Regards.