NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display non modal dialog in DLL in MSVisual C 6 called from teststand

Hello
My problem is that when i call a Dll, made in MS VC++ from TestStand and that Dll creates a non modal dialog box with following statements

1-TSSeqFileViewerGUIPtr = new TSSeqFileViewerGUI(CWnd::FromHandle((HWND)modalId));

2-TSSeqFileViewerGUIPtr->Create(IDD_DIALOG1,CWnd::FromHandle((HWND)modalId));
(-TSSeqFileViewerGUIPtr is an object of class which is derived from CDialog
- IDD_DIALOG1 is dialog ID
- modalId is a long obtained by following statement:
long modalId = (seqContext->Engine)->NotifyStartOfModalDialogEx(seqContext , &shouldAbort);
seqContext is object of class SequenceContext )

3-TSSeqFileViewerGUIPtr->ShowWindow( SW_SHOWNORMAL );

After this non modal dialog bo
x appears and system hangs.

Please tell me how to create non modal dialog box.
You can also email me at fahadejaz2000@yahoo.com
Thankyou very much.
Fahad Ejaz
0 Kudos
Message 1 of 2
(4,498 Views)
Hi Mkehret,

In your question, you asked "how to display a NON MODAL DIALOG", is this really what you want to do? If so, you do not need to use the "NotifyStartOfModalDialog" method of the TestStand engine in order to correctly use your dialog. This method is specifically used for making your dialog MODAL to the process' windows that launched it. Basically, when you create an instance of your dialog object you only need to do the following:

TSSeqFileViewerGUIPtr = new TSSeqFileViewerGUI();

And on the call to Create, do this:

TSSeqFileViewerGUIPtr->Create(IDD_DIALOG1,NULL);

Passing NULL for pParentWND causes the main application window to be set as the dialog's parent. Once you have done the above two calls you can call ShowWindow. For more informatio
n on deriving classes from CDialog and using them refer to the Microsoft Developer Network documentation here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cdialog.3a3a.cdialog.asp

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(4,498 Views)