cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
willstephens1
Level 2

EzDefineDialog and WaitOnDialog not showing dialog

Hi

I have created a new Custom Dialog and am trying to display it.

I run the following code however the Dialog does not display.

nCtrl = EzDefineDialog( szDlgName , ISUSER, szDlgName ,0);
NumToStr(szMessage, nCtrl);
MessageBox(szMessage,INFORMATION);

nCtrl = WaitOnDialog(szDlgName);
CtrlSetText( szDlgName, 1305, "ready");

NumToStr(szMessage, nCtrl);
MessageBox(szMessage,INFORMATION);

The first szMessage result is 0, and the next is -100, which i believe means the Dialog is ready, but it does not appear. I am calling this from within a function that is called from the OnFirstUIBefore.

This is a new Dialog so i believe the ID used should be 0, and i have also made sure that szDlgName is identical to the name of the Dialog. I have also made sure that 1305 is the ID of a text field on the Dialog.

Any help would be appreciated.
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

Right, that WaitOnDialog return value is DLG_INIT, which fires before the dialog appears, and it's the next call that makes the dialog appear.

Please see the help topics "Using InstallScript to Implement Custom Dialogs" and "Using InstallScript to Process Dialog Controls" for a slow walkthrough, and "WaitOnDialog Example" for a faster one.

P.S. An unrelated tip: you can use SprintfBox to display numeric values without having to go through NumToStr and MessageBox.
0 Kudos
willstephens1
Level 2

Ahh, its the Windows Handle.

Thanks for the advice, i've spent most of today trying to get this working.

Will
0 Kudos