Hi all,
I tried to get the name and pointer of a callback programatically by using:
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name) and
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_FUNCTION_POINTER, fkt)
In my programm the function always returned bad data. After a day of searching, I found that the functions work fine until easytab_controls were used.
I modified the CVI sample program "simpdemo.c" and added the five marked lines. Before calling "EasyTab_ConvertFromCanvas" I can get the callback-name.
After calling "EasyTab_ConvertFromCanvas" I can't get a result
Any suggestions?
Thank in advance
Willi
And here the example code:
#include /* Needed if linking in external compiler; harmless otherwise */
#include
#include "easytab.h"
#include "simpdemo.h"
int main (int argc, char *argv[])
{
int panel, tabCtrl;
char name[256]; //@@@@@
if (InitCVIRTE (0, argv, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */
return -1; /* out of memory */
panel = LoadPanel(0, "simpdemo.uir", PANEL);
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name); //@@@@@
printf("Name: %s\n",name); //@@@@@
/* Two function calls and, Voila!, a tab sheet dialog */
tabCtrl = EasyTab_ConvertFromCanvas(panel, PANEL_CANVAS);
EasyTab_LoadPanels (panel, tabCtrl, 1, "simpdemo.uir", __CVIUserHInst, CONTROL, 0,
VALVES, 0, MONITOR, 0, CONFIG, 0, HELP, 0, 0);
InstallPopup(panel);
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name); //@@@@@
printf("Name: %s\n",name); //@@@@@
RunUserInterface();
return 0;
}
int CVICALLBACK DoneCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
if (event == EVENT_COMMIT)
QuitUserInterface(0);
return 0;
}
Hi all,
I tried to get the name and pointer of a callback programatically by using:
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name) and
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_FUNCTION_POINTER, fkt)
In my programm the function always returned bad data. After a day of searching, I found that the functions work fine until easytab_controls were used.
I modified the CVI sample program "simpdemo.c" and added the five marked lines. Before calling "EasyTab_ConvertFromCanvas" I can get the callback-name.
After calling "EasyTab_ConvertFromCanvas" I can't get a result
Any suggestions?
Thank in advance
Willi
And here the example code:
#include /* Needed if linking in external compiler; harmless otherwise */
#include
#include "easytab.h"
#include "simpdemo.h"
int main (int argc, char *argv[])
{
int panel, tabCtrl;
char name[256]; //@@@@@
if (InitCVIRTE (0, argv, 0) == 0) /* Needed if linking in external compiler; harmless otherwise */
return -1; /* out of memory */
panel = LoadPanel(0, "simpdemo.uir", PANEL);
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name); //@@@@@
printf("Name: %s\n",name); //@@@@@
/* Two function calls and, Voila!, a tab sheet dialog */
tabCtrl = EasyTab_ConvertFromCanvas(panel, PANEL_CANVAS);
EasyTab_LoadPanels (panel, tabCtrl, 1, "simpdemo.uir", __CVIUserHInst, CONTROL, 0,
VALVES, 0, MONITOR, 0, CONFIG, 0, HELP, 0, 0);
InstallPopup(panel);
GetCtrlAttribute (panel, PANEL_DONE, ATTR_CALLBACK_NAME, name); //@@@@@
printf("Name: %s\n",name); //@@@@@
RunUserInterface();
return 0;
}
int CVICALLBACK DoneCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
if (event == EVENT_COMMIT)
QuitUserInterface(0);
return 0;
}