As long as it works with windows.h I'll not change anything
😉But I just ran into another problem. I did some reading on the integration of dll functions (
How Can I Access DLL Functions in a LabWindows/CVI Program without Including the Import Library in t...) and tried to access my LibOpto functions the described way. After some trial and error I just got one last compile error stating Missing prototype for the CloseDriver function. OpenDriver and DAQ_Info worked fine but they both take parameters.
Since CloseDriver doesn't take parameters I suspect it has to do something with that... but I've got NO idea what exactly could cause the problem.
LibOpto.h:
...
__declspec(dllexport) int OptoPCI_OpenDriver ( char szShortPath[260] );
__declspec(dllexport) int OptoPCI_CloseDriver ( );
__declspec(dllexport) int OptoPCI_DAQ_Info ( VXD_VERSION_INFO *VersionInfo );
...
typedef int (*OPTO_OPENDRIVER)(char szShortPath[260]);
typedef int (*OPTO_CLOSEDRIVER)();
typedef int (*OPTO_DAQ_INFO)(VXD_VERSION_INFO *VersionInfo);
...
LibOpto_dll_test.c:
...
OPTO_OPENDRIVER OpenDriver = (OPTO_OPENDRIVER) GetProcAddress ( hinstLib, "OptoPCI_OpenDriver" );
OPTO_CLOSEDRIVER CloseDriver = (OPTO_CLOSEDRIVER) GetProcAddress ( hinstLib, "OptoPCI_CloseDriver" );
OPTO_DAQ_INFO DAQ_Info = (OPTO_DAQ_INFO) GetProcAddress ( hinstLib, "OptoPCI_DAQ_Info" );
...
iRet = OpenDriver(""); //No Error here
iRet = DAQ_Info(&VersionInfo); //No Error here
iRet = CloseDriver ( ); //Error: Missing prototype
...
Any ideas?