This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- the ids
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 30, 2009
05:18 PM
Custom Dialogs (DialogID)
I'm just needing an understand of the DIALOG_ID when creating custom dialogs. Do I need to create custom dialog id's for each custom dialog I have or do these ID's reference a type of dialog it's based on?
I have 3 custome dialogs on the first 2 are fine, but the third fails as soon as I call:
nCmdValue = WaitOnDialog (szDialogName);
nCmdValue returns -1; //_FAILED
---- CODE STARTS ----
I have 3 custome dialogs on the first 2 are fine, but the third fails as soon as I call:
nCmdValue = WaitOnDialog (szDialogName);
nCmdValue returns -1; //_FAILED
---- CODE STARTS ----
#define DESTINATION_DLG_ID 12013
#define DESTINATION_TITLE 50
#define DESTINATION_TITLE_TEXT "Destination Location and Instance Name"
#define DESTINATION_DESCRIPTION 51
#define DESTINATION_DESCRIPTION_TEXT "Select Install and then select whether you are installing a New Installation or upgrading an existing instance."
#define DESTINATION_DESCRIPTION_FOLDER 1303
#define DESTINATION_DESCRIPTION_DERNAME 1302
#define DESTINATION_DESCRIPTION_FULLPATH 1304
//declare methods
prototype NUMBER dlg3_DestinationFolder( STRING );
//methods
function NUMBER dlg3_DestinationFolder( szDialogCaption )
string szDialogName, szFullPath, svTmp;
BOOL bDone;
number nCmdValue, nResult;
string szMsg;
HWND hTimesNewRoman14Bold;
number hwndDlg;
begin
// Name of Dialog
szDialogName = "dlg3_Destination";
hTimesNewRoman14Bold = GetFont("Arial", 14, STYLE_BOLD);
nResult = EzDefineDialog (szDialogName, ISUSER, szDialogName, DESTINATION_DLG_ID);
// Initialize the indicator used to control the loop.
bDone = FALSE;
repeat
nCmdValue = WaitOnDialog (szDialogName);
// Respond to the event.
switch (nCmdValue)
case _DLG_CLOSE:
// The user clicked the window's Close button.
Do (EXIT);
case DLG_INIT:
hwndDlg = CmdGetHwndDlg (szDialogName);
//change font
CtrlSetFont(szDialogName, hTimesNewRoman14Bold, DESTINATION_TITLE);
//set Dialog Caption
SetWindowText (hwndDlg, szDialogCaption);
// Set static text description displayed above check boxes.
CtrlSetText (szDialogName, DESTINATION_TITLE, DESTINATION_TITLE_TEXT);
// Set static text description displayed above check boxes.
CtrlSetText (szDialogName, DESTINATION_DESCRIPTION, DESTINATION_DESCRIPTION_TEXT);
case _BUTTON_NEXT:
bDone = TRUE;
case _BUTTON_CANCEL:
Do (EXIT);
case _BUTTON_BACK:
bDone = TRUE;
case _FAILED:
//Failed to create
MessageBox("Error creating Destination dialog.", SEVERE);
abort;
default:
//NumToStr(svCmdValue, nCmdValue);
SprintfBox(SEVERE, szDialogCaption, "'%d' is not a valid case.", nCmdValue);
abort;
endswitch;
until bDone;
//destroy dialog
EndDialog ( szDialogName );
return nCmdValue;
end;
(16) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 30, 2009
06:31 PM
The EzDefineDialog help topic has more information: for a new custom dialog box, you can set the third argument to EzDefineDialog to the string dialog name in the Dialogs view, and the fourth argument is ignored.
If you're modifying an existing dialog box, you'll apparently need to ensure the numeric IDs match up between your code and the Dialogs view...
If you're modifying an existing dialog box, you'll apparently need to ensure the numeric IDs match up between your code and the Dialogs view...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 01, 2009
09:21 AM
Ok, that confused things even more.. If I can go without an ID, then what would cause the error? This is the same code, just different name and ID for the other dialogs.
#define WELCOME_DLG_ID 12011
szDialogName = "dlg1_Welcome";
#define INSTALL_TYPE_DLG_ID 12012
szDialogName = "dlg2_InstallationType";
#define DESTINATION_DLG_ID 12013
szDialogName = "dlg3_Destination";
#define WELCOME_DLG_ID 12011
szDialogName = "dlg1_Welcome";
#define INSTALL_TYPE_DLG_ID 12012
szDialogName = "dlg2_InstallationType";
#define DESTINATION_DLG_ID 12013
szDialogName = "dlg3_Destination";
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 01, 2009
10:22 AM
Ok, here is an update..
I've tried:
nResult = EzDefineDialog (szDialogName, ISUSER, "", DESTINATION_DLG_ID);
Didn't work..
I copy/pasted the code from my Welcome, changing on the var names from WELCOME_ TO DESTINATION_ and it failed. I then changed the variable, szDialogName = "dlg3_Destination"; to, szDialogName = "dlg1_Welcome"; and it works.
So it looked like a dialog issue. I then deleted the dialog and created a new one with the same name, "dlg3_Destination", but nothing custom on it. It also failed. I then renamed from "dlg3_Destination" to "dlg2_Welcome" to see if it's possibly a naming issue, no luck..
I've tried with and without ISUSER..
I've modified the look to be more like how IS does it with other dialogs..
// ensure general initialization is complete
if ( !bSdInit ) then
SdInit( );
endif;
if (EzDefineDialog( szDialogName, ISUSER, szDialogName, DESTINATION_DLG_ID ) = DLG_ERR) then
return -1;
endif;
EzDefineDialog is failing and return -1 occurs. I've tried creating cloaning other dialogs with nothing custom and calling them, they also fail. Its like the Welcome is the ONLY one that works..
I'm so confused..
I've tried:
nResult = EzDefineDialog (szDialogName, ISUSER, "", DESTINATION_DLG_ID);
Didn't work..
I copy/pasted the code from my Welcome, changing on the var names from WELCOME_ TO DESTINATION_ and it failed. I then changed the variable, szDialogName = "dlg3_Destination"; to, szDialogName = "dlg1_Welcome"; and it works.
So it looked like a dialog issue. I then deleted the dialog and created a new one with the same name, "dlg3_Destination", but nothing custom on it. It also failed. I then renamed from "dlg3_Destination" to "dlg2_Welcome" to see if it's possibly a naming issue, no luck..
I've tried with and without ISUSER..
I've modified the look to be more like how IS does it with other dialogs..
// ensure general initialization is complete
if ( !bSdInit ) then
SdInit( );
endif;
if (EzDefineDialog( szDialogName, ISUSER, szDialogName, DESTINATION_DLG_ID ) = DLG_ERR) then
return -1;
endif;
EzDefineDialog is failing and return -1 occurs. I've tried creating cloaning other dialogs with nothing custom and calling them, they also fail. Its like the Welcome is the ONLY one that works..
I'm so confused..
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 01, 2009
03:11 PM
Ok, I think it's 2010.... I created a new project with the same Welcome window and it fails.. I then realized that every window that works was created by 2009 and converted by 2010.
I'm now dead in the water with any installations, please help.
I'm now dead in the water with any installations, please help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 02, 2009
03:04 PM
I've been doing as much as I can, guess this thread is dead..
Just in case someone reads is, I found I only have the error when I clone from an existing. If I create a new one from scratch I dont have this issue.
Just in case someone reads is, I found I only have the error when I clone from an existing. If I create a new one from scratch I dont have this issue.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 02, 2009
05:30 PM
Looking at the attached sample project, the numerical ID for the Welcome dialog needs to be used (the reason being the dialog resource is built with a numerical ID and not a string name). In the case of the Welcome dialog, the dialog ID is 10205. Changing the code in the sample project to not pass a string dialog ID and instead passing 10205 as the numerical ID resolved the error creating the dialog.
For edited standard dialogs or cloned standard dialogs, these will receive a numerical dialog ID which then needs to be used when calling EzDefineDialog. For custom dialogs created new in a project, these receive a dialog ID of 0. In this case, the name of the dialog in the dialog tree is built into the resource DLL instead of a numerical ID. The dialog can be set to use a numerical ID instead of a string ID by providing a dialog ID other than 0.
For edited standard dialogs or cloned standard dialogs, these will receive a numerical dialog ID which then needs to be used when calling EzDefineDialog. For custom dialogs created new in a project, these receive a dialog ID of 0. In this case, the name of the dialog in the dialog tree is built into the resource DLL instead of a numerical ID. The dialog can be set to use a numerical ID instead of a string ID by providing a dialog ID other than 0.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
04:03 PM
Are you saying do this:
EzDefineDialog( szDialogName, ISUSER, "", DESTINATION_DLG_ID)
I went base on the Help.. I was trying different ways.. My original is the numerical ID, but based on me creating a new dialog without cloning and using the same code it works fine. This tells me something weird happening during modifying cloned dialogs.
EzDefineDialog( szDialogName, ISUSER, "", DESTINATION_DLG_ID)
I went base on the Help.. I was trying different ways.. My original is the numerical ID, but based on me creating a new dialog without cloning and using the same code it works fine. This tells me something weird happening during modifying cloned dialogs.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
04:15 PM
The basic rule for determining what value to pass to EzDefineDialog would be as follows:
- For dialogs in the Dialog Editor that have a dialog ID of 0 (or a blank ID field), pass the string name of the dialog as the third (szDialogID) parameter. The string name is typically the name of the dialog listed in the center panel in the list of available dialogs.
- For dialogs in the Dialog Editor that have a dialog ID not equal to 0 (and not blank), pass the ID value provided in the dialog editor as the fourth parameter (nDialogID) to EzDefineDialog. In this case, pass an empty string ("") to szDialogID to prevent the runtime dialog code from attempting to look up the dialog based on the string ID.
- For dialogs in the Dialog Editor that have a dialog ID of 0 (or a blank ID field), pass the string name of the dialog as the third (szDialogID) parameter. The string name is typically the name of the dialog listed in the center panel in the list of available dialogs.
- For dialogs in the Dialog Editor that have a dialog ID not equal to 0 (and not blank), pass the ID value provided in the dialog editor as the fourth parameter (nDialogID) to EzDefineDialog. In this case, pass an empty string ("") to szDialogID to prevent the runtime dialog code from attempting to look up the dialog based on the string ID.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
04:31 PM
Thank you for that clarification.
When ever I create a dialog or clone a dialog from another dialog, how do I know if it has an ID or not? I never see the ID in the dialog properties. I've only seen the ID in the Dialog Preview, which is always the same ID, so I assumed that was just part of the picture, not really the ID for that dialog.
- For dialogs in the Dialog Editor that have a dialog ID of 0 (or a blank ID field)
When ever I create a dialog or clone a dialog from another dialog, how do I know if it has an ID or not? I never see the ID in the dialog properties. I've only seen the ID in the Dialog Preview, which is always the same ID, so I assumed that was just part of the picture, not really the ID for that dialog.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
05:11 PM
You can see the dialog ID for each dialog that has been edited by selecting one of the dialog's languages in the center panel, then click on the dialog's title bar in the editor. In the list of properties for the dialog is "Resource Identifier". In the attached screenshot, the dialog ID (Resource Identifier) is 0, and the dialog name (which should be dlg3_Destination) would need to be passed to EzDefineDialog.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
05:46 PM
Thank you for this clarification.. I've been struggling around the understanding of when and when not to do this.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2009
05:48 PM
I now see when creating a clone, the ID that shows up.. That explains so much.
Thanks again..
Thanks again..
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2010
02:05 AM
you see those identifiers because youre using installscript msi project and not Basic msi project
how can i do it with basic msi project???????
how can i do it with basic msi project???????
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2010
07:11 PM
With Basic MSI, you don't need dialog IDs, EzDefineDialog, or any script, for that matter; please see the help topics under Creating Installations > Defining the End-User Interface > Working with Dialogs > Working with Dialogs in Basic MSI Projects for information about processing MSI dialog controls.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)