LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

callback syntax explanation

Solved!
Go to solution

Pardon my beginner questions.  Smiley Sad

 

I'm trying to understand the syntax of the callback functions that are auto-inserted into my source by CVI.  I'm not fully understanding what the point of "CVICALLBACK" is in front of my callback function name.

 

int CVICALLBACK ControlCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)

As I dig down into cvidef.h, I see that it's defined as CVICDECL, which in turn is defined as __cdecl, which apparently is a "calling convention".  So CVICALLBACK is just a secondary typedef for the callback function? 

0 Kudos
Message 1 of 3
(2,976 Views)
Solution
Accepted by topic author ElectroLund

You were right in coming from CVICALLBACK to the corresponding calling convention. The calling convention is a very technical beast to explain so unless you are specifically interested in it (e.g. because you want / need to produce DLLs to be used ion other compilers or symmetrically you need to use DLLs created in other languages) you can simply ignore it and happily live and work with CVI Smiley Wink

 

Nevertheless, informations on the calling convention can be easily found on the internet: here and here two wikipedia pages on the subject, while here you can find a KnowledgeBase page specifically oriented to CVI



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,970 Views)

That's good enough for me, Roberto!  I just didn't want to be skipping over something important. Looks like I can skip it.

0 Kudos
Message 3 of 3
(2,964 Views)