03-06-2002 04:00 AM
03-06-2002 11:22 AM
05-27-2004 09:42 AM
08-08-2008 05:38 AM
08-08-2008 06:07 AM
Hi,
You dont need to modify the OI.
you should be able do the same from the command line eg
SeqEdit.exe /run MainSequence "c:\My Seqs\test\seq" /quit
This is for the SeqEditor but the same should hold true of the Operator Interface.
Regards
Ray Farmer
08-08-2008 06:17 AM
Thanks for the quick reply.
I think that isn't what I have in mind.
I really want to programmatically close teststand using TSUI_AplicationMgrShutdown ().
The thing is that I need to click close twice in orden to close.
Any ideas on how to close teststand on the first click?
Thanks for you time.
Daniel Coelho
08-11-2008 04:51 PM
08-12-2008 03:17 AM
Thank you for your reply.
I did a loop but it wouldn't work :s
I managed to create an ActiveX button to exit test stand.
I found an example within the TestStand Course I and II.
...
static void ExitApplication(void)
{
VBOOL canExitNow;
TSUI_ApplicationMgrShutdown (AppManagerHandle, &errorInfo,&canExitNow);
if (canExitNow)
QuitUserInterface(0);
}
// the ApplicationMgr control sends this event when it is ok to exit the application.
HRESULT CVICALLBACK ApplicationMgr_OnExitApplication(CAObjHandle caServerObjHandle, void *caCallbackData)
{
ExitApplication();
return S_OK;
}
void CreateTSEngineHandle ()
{
GetObjHandleFromActiveXCtrl (panelHandle, PANEL_APPLICATIONMGR,&AppManagerHandle);
GetObjHandleFromActiveXCtrl (panelHandle, PANEL_EXIT, &AppExit );
TSUI__ApplicationMgrEventsRegOnExitApplication (AppManagerHandle, ApplicationMgr_OnExitApplication, NULL, 1, NULL);
TSUI_ApplicationMgrConnectCommand (AppManagerHandle, &errorInfo, AppExit, TSUIConst_CommandKind_Exit, 0,
TSUIConst_CommandConnection_NoOptions, NULL);
TSUI_ApplicationMgrGetEngine (AppManagerHandle, &errorInfo,&EngineHandle);
TSUI_ApplicationMgrStart (AppManagerHandle, &errorInfo);
TS_EngineGetGlobals(EngineHandle,NULL,&Globals);
}
...
This way I click my QuitButton and it calls the the ActiveXExitButton witch calls the ExitApplication function.
The ApplicationMgr control sends ApplicationMgr_OnExitApplication event when it is ok to exit the application.
Hope this was clear enough and I hope this may be helpfull for someone else.
I apreaciate all the help.
Regards,
Daniel Coelho