cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ICE999
Level 5

Error

I'm trying to show a custom Dialog with following code in my script. But it always gets in case DLG_ERR.
I've created a new dialog added to check boxes and gave it ID 99999 in the dialog table. I defined RES_DIALOG_ID as 9999 and the two buttons to check the state. Something is wrong with the WaitOnDialog function but i can't find it. I already browsed the helpfiles and the IS scripts under Script\isrt\src.
I tried with the EzDefineDialog and the Define Dialog, i tried with the ID and with the name from the table, but always the same result ...

Does anyone has an idea what i'm doing wrong?

szDialogName = "CustDialogSQL2";
sResult = EzDefineDialog (szDialogName, "", "", RES_DIALOG_ID);
if (nResult < 0) then
// Report an error; then terminate.
MessageBox ("Error in defining dialog", SEVERE);
abort;
endif;
bDone = FALSE;
repeat
nCmdValue = WaitOnDialog(szDialogName);
switch (nCmdValue)
case DLG_CLOSE:
Do (EXIT);
case DLG_ERR:
MessageBox ("Unable to display dialog. Setup canceled. " + szDialogName, SEVERE);
abort;
case DLG_INIT: ;
case RES_PBUT_CANCEL:
Do (EXIT);
case RES_PBUT_NEXT:
bDone = TRUE;
szSqlInst = "0";
If (CtrlGetState(szDialogName, ID_OP1_CHECK ) = BUTTON_CHECKED) then
szSqlInst = "1";
else
szSqlInst = "0";
endif;
case RES_PBUT_BACK:
bDone = TRUE;
endswitch;
until bDone;
EndDialog (szDialogName);
ReleaseDialog (szDialogName);
if szSqlInst = "1" then
MessageBox ( "SQL Install here", INFORMATION);
else
MessageBox ( "SQL is NOT selected", INFORMATION);
endif;
Labels (1)
0 Kudos
(1) Reply
Fred_Oisund
Level 4

Perhaps you could try:
sResult = EzDefineDialog (szDialogName, ISUSER, "", RES_DIALOG_ID);
instead of:
sResult = EzDefineDialog (szDialogName, "", "", RES_DIALOG_ID);

I can't remember why, but I did it this way in my code, and ISUSER in parameter 2 is the only real difference I can see.
0 Kudos