11-12-2012 11:21 AM
Pardon my beginner questions.
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?
Solved! Go to Solution.
11-12-2012 12:18 PM - edited 11-12-2012 12:19 PM
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
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
11-12-2012 12:25 PM
That's good enough for me, Roberto! I just didn't want to be skipping over something important. Looks like I can skip it.