LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetPanelAttribute ATTR_CALLBACK_FUNCTION_POINTER

Hi folks!

I need to call a menu by cliking the mouse's right button .

The menu must appears when I am click and I am on the tabControl.

I tried to set the calling the function to open the menu using this command:

SetPanelAttribute ( panelHandleFromTabPage, ATTR_CALLBACK_FUNCTION_POINTER, BackgroundMenuCallback);
...

It follows the function's prototype that i want to call.
int CVICALLBACK BackgroundMenuCallback (int panel, int control, int event,
        void *callbackData, int eventData1, int eventData2)

The error that appears when I try to execute this command line is:
Invalid argument type: found ' pointer to __cdecl int function ( int, int, int, pointer to void, int, int)', expected '__cdecl int function ( int, int, int, pointer to void, int, int)'

What is it wrong?!

Thank you in advance!

0 Kudos
Message 1 of 2
(3,041 Views)
The call to SetPanelAttribute() is expecting a pointer to a panel callback function, not a control one. If you change your prototype to:

int CVICALLBACK BackgroundMenuCallback (int panel, int event,   // NOTE: 'int control' removed
        void *callbackData, int eventData1, int eventData2)

it might work.
 
JR
Message 2 of 2
(3,028 Views)