From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use InstallCtrlCallback with a class member function in Visual C 6.0?

I'm using Visual C++ 6.0.
I have a class definition with the following private member function declaration.

private:
int CVICALLBACK commandRoll(int panel,
int control,
int event,
void *callbackData,
int eventData1,
int eventData2);

Within another member function of the same class, I'm trying to call:

status = InstallCtrlCallback (itcsHandle,
ITCSGui_rollProp,
commandRoll, &callbackData);

I get following compiler error:

error C2664: 'InstallCtrlCallback' : cannot convert parameter 3 from 'int (int,int,in
t,void *,int,int)' to 'int (__cdecl *)(int,int,int,void *,int,int)'
None of the functions with this name in scope match the target type.
0 Kudos
Message 1 of 3
(2,803 Views)
You will most probably get this question answered at the Develope Studio Forum.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 3
(2,803 Views)
Hello

I believe the callback member function needs to be static. Check out this article for more information.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 3 of 3
(2,803 Views)