hi mrbean,
You probable should be using should be using the LoadPanelEx function rather than the LoadPanel. Read the help for the LoadPanelEx for explanation.
If it a panel callback its going to look like:
int CVICALLBACK PanelCB (int panel, int event, void *callbackData,
int eventData1, int eventData2)
If it is a control callback its going to look like:
int CVICALLBACK ControlCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
Not sure what QuitLoginInstCB is a callback for.
But if you have exported it, an you are calling it from TestStand via the DLL adapter, then I dont see how your callback can work. Surely you will want a function that you call from TestStand which when loaded will run and load your panel, diaplay it, and Run the User Interface. Then Your Callback QuitLoginInstCB will come in to play when you press the required control.
For instance
TestStand step calls QuitLoginInst()
When the user panel is displayed and the User Interface is running.
User Presses the QuitLoginInst control which calls the QuitLoginInstCB(), this perform removing of the panel and QuitUserInterface() and thus allows QuitLoginInst() to complete and return to TestStand.
Here is a typical example of displaying a modal panel from TestStand (its uses TestStand Ver2.0 prototypes)
This is the function that will be called from TestStand
void __declspec(dllexport) TX_TEST DisplayModalDialog(tTestData *testData, tTestError *testError)
{
// Getting the Engine object from the Seq Context
TS_SeqContextGetProperty (testData->seqContextCVI, &errorInfo,
TS_SeqContextEngine, CAVT_OBJHANDLE,
&engine);
// Loading the interface panel into memory
panelHandle = LoadPanelEx (0, "ModalDialog.uir", PANEL, __CVIUserHInst);
// TS_StartModalDialog function causes the dialog box to be modal
// with respect to the application that created the TestStand
// Engine object you specify (i.e. Seq Editor or Oper Interface)
TS_StartModalDialog (engine, &errorInfo, &modalData);
// Displays and activates a panel as a modal dialog box.
InstallPopup(panelHandle);
// RunUserInterface() runs the User Interface and issues events to
// callback functions.
RunUserInterface();
Error:
// If an error occurred, set the error flag to cause a run-time error in TestStand.
if (error < 0)
{
testError->errorFlag = TRUE;
CA_DiscardObjHandle(engine);
}
return;
}
This is the Callback function that is assigned to the Quit button in the UIR
int CVICALLBACK Quit (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2){
switch (event)
{
case EVENT_COMMIT:
// Removes either the active pop-up panel or all pop-up panels.
RemovePopup(panelHandle);
// Causes RunUserInterface() to return.
QuitUserInterface(0);
// Call this function after you discard or hide the dialog box
// panel
TS_EndModalDialog(&errorInfo, &modalData);
// Removes a panel and any of its child panels from memory and
// clears them from the screen if visible
DiscardPanel (panelHandle);
// This function releases resources associated with the object and
// calls the Release method of the Automation server object.
CA_DiscardObjHandle(engine);
break;
}
return 0;
}
Finally you dont need the LIB file on your target system, this is only required to build your EXE | DLL file.
You have dont need to have a H file. If in your CVI setting, in the Target Setting, if the 'Export What' control is set to 'Symbols Marked for Export', then you dont need an H file, but you probably will have a H file because you have an UIR file but you dont what to export the callback function within that H file as you would not be calling them direct from some external process. ( the example above comes from a project which has an include file for the UIR and the Target Settings are set for Symbols Marked for Export.)
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer