LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DLLEXPORT, DLLSTDCALL and both

Solved!
Go to solution
Hi,
The CVI (8.0.1) help provides 2 examples in topic "Using the Export Qualifier Method":

int DLLEXPORT DLLSTDCALL MyFunc (int param)  { }
int DLLEXPORT myVar;

Are those declaration differ because one is for a function and the other one is for a variable?
Well, in my project I used only DLLEXPORT for my functions and I can compile them and call them from TestStand 3.5 without any problems.

Can someone please clarify the usage and meaning of those macros?
Thanks.

S. Eren BALCI
IMESTEK
0 Kudos
Message 1 of 2
(4,162 Views)
Solution
Accepted by topic author ebalci
Eren,


DLLEXPORT is a macro which refers to "__declspec(dllexport)" (refer to this link), which means that this variable/function is exported for usage even outside the DLL.


DLLSTDCALL is a macro from LabWindows/CVI for calling conventions of functions. Here a little extract of the CVI-help:
"Other platforms, such as UNIX, do not recognize the __stdcall keyword. If you work with source code that you might use on other platforms, you must use a macro in place of __stdcall. The cvidef.h include file defines the DLLSTDCALL macro for this purpose."
"Calling convetion" describes how parameters are put on the stack during switching between the code from the caller to the called function. There are quite many conventions, but the most important from Windows are: cdecl and stdcall (sometimes there is fastcall also used).
If you want to know more about this, maybe you want to take a look here.

hope this helps,
Norbert B.
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(4,159 Views)