05-01-2006 07:35 AM
CVI is generally very compatible with windows.h and the windows sdk (as long as windows.h is included first), so I have never tried changing a header to avoid the windows.h dependancies. But I don't know of any reason why changes to the header would not work.
05-01-2006
09:33 AM
- last edited on
08-06-2026
10:23 AM
by
Content Cleaner
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?
05-01-2006 10:27 AM - edited 05-01-2006 10:27 AM
Message Edited by Alex D on 05-01-2006 10:28 AM
Message Edited by Alex D on 05-01-2006 10:29 AM
05-01-2006 10:37 AM
05-02-2006 03:59 AM