10-20-2003 02:12 AM
10-20-2003 07:27 AM
09-24-2009 06:01 PM
09-25-2009 01:36 AM
@darnell,
You must prefix each declaration of the functions you want to export, with "DLLEXPORT _VI_FUNC". In this case your dll target setting for exports should be set to "symbols marked for export". Only these functions will be exported.
If you want to export all the files in an include file, your dll target settings for exports should be set to "include file symbols" than choose the desired include file.
Only than your lib file will be also created.
Regards.
09-25-2009 02:54 AM
09-25-2009 03:14 AM - edited 09-25-2009 03:16 AM
#define DLLEXPORT __declspec(dllexport)
(this is defined in <cvidef.h>, which should be automatically included...)
on the other hand, _VI_FUNC is nowhere to be found. but i would suggest using DLLSTDCALL (which i bet resolves to the same function decorator):
#define DLLSTDCALL __stdcall
(this is also defined in <cvidef.h>)
use those when declaring the functions you want to export:
int DLLEXPORT DLLSTDCALL sample_function(void);
09-25-2009 03:25 AM
@darnell,
Assume, that inside a dll, we have following functions:
void myFunc1 (int i);
void myFunc2(int i);
If want to export function just myFunc1, you have to change its declaration as follows:
void DLLEXPORT _VI_FUNC myFunc1 (int i);
If Exports is set to: Symbols marked for export, than only myFunc1 will be exported. "DLLEXPORT" is defined in cvidef.h and "_VI_FUNC" is defined in visatype.h
Regards
09-25-2009 04:46 AM
okay its coming together , i started over from scratch and tried a basic program, I have two functions that i call, only function is working.
my PRINT(); is not working, meaning its not print out my string;
check the cvi pro out . to see what im talking about.
09-25-2009 05:23 AM
09-25-2009 06:15 AM
you need the DLLEXPORT to compile the DLL, in order to tell the compiler you want to export the function.
once it is in the dll, the function declaration does not need the DLLEXPORT anymore, so remove it from your CVI code. in the program which is using the dll, you don't need to export anything, you need to import the function.