Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Display custom dialog


6 replies to this topic

Heike

Heike
  • Members
  • 20 posts

Posted 29 May 2002 - 13:02

Hi!
First time using custom dialogs ...
I've created a custom Dialog in which I want the user to select a file and type in a name; this should be saved in registry.
First I have problems to display the dialog from Installscript:
Code Sample

nResult = EzDefineDialog (szDialogName, "", "", RES_DIALOG_ID);

nResult = WaitOnDialog( szDialogName );


szDialog contains the name of the dialog and RES_DIALOG_ID is an constant assigned from me because I couldn't find an id assigned to the dialog.

OK. First nResult = 0 and second time -1, WaitOnDialog fails.

Can anybody tell me what's wrong and how can I react on control states and get the content of the controls?

THX
// Heike ???

Stefan Secker

Stefan Secker
  • Members
  • 46 posts

Posted 29 May 2002 - 15:58

Hi Heike,

in IS 5.5 i've used something like this.

Code Sample

   szID = "";
   szDialog = "Checking";
   szDLL = DEF_CUSTDIALOG_DLL;
   nID = 30001;
   
   //Start Dialog
   EzDefineDialog(szDialog, szDLL, szID, nID);
   while (bDone = FALSE)

     //Dialog will be shown until variable bDone set TRUE
     nCmdValue = WaitOnDialog(szDialog);

     //checking return values of WaitonDialog-function
     switch (nCmdValue)

       //Dialog initialized
       case DLG_INIT:

       //error while creating Dialog
       case DLG_ERR:
               //your code

       // X-button pressed
       case DLG_CLOSE:
               //your code

       //CancelButton pressed
       case 30004:
               if (AskYesNo(@QUE_ABORT, YES) = YES) then
                   abort;
               endif;

       //NextButton Pressed
       case 30005:
                bDone = TRUE;
                nResult = NEXT;
   
      //BackButton Pressed
       case 30003:
                   bDone = TRUE;
                   nResult = BACK;

   endswitch;

  endwhile;


   // Close dialog
   EndDialog(szDialog);

   // Remove dialog out of memeory
   ReleaseDialog(szDialog);


I set the id's of "Next","Back" and "Cancel" button during the creation of the dialog (back then in VC++). Maybe 7.0x is slightly different, i haven't looked at standard projects yet, but i hope this will help you to get clue. :D

Cheers
         Stefan

Stefan Secker

Stefan Secker
  • Members
  • 46 posts

Posted 29 May 2002 - 16:03

I forgot...
...how to get a control state:
Code Sample

       //NextButton Pressed
       case 30005:

                 CtrlGetText (szDialog, 30022, svText);

                  if svText = "" then
                       MessageBox(@ERR_01,INFORMATION);
                  else
                        bDone = TRUE;
                       // Close dialog
                       EndDialog(szDialog);

                       // Remove dialog out of memeory
                       ReleaseDialog(szDialog);
                       nResult =  NEXT;
                   endif;


In this case 30022 is the id of a textbox.
Same thing here: :p
This is from IS 5.5, i don't know if it will work on 7.0x.

Cheers
       Stefan

Heike

Heike
  • Members
  • 20 posts

Posted 31 May 2002 - 06:55

Hi Stefan!
Thank you very much for your replies but it doesn't work.
Probably something is missing ...
In your code you're using DEF_CUSTDIALOG_DLL. Is this a constant of Installshield, because in V 7 it isn't known.
I have another question. The Ids. Where do you get the Ids of the dialog itself and then of the components?

bye
//Heike

:(

Heike

Heike
  • Members
  • 20 posts

Posted 31 May 2002 - 10:18

Hi!
You can forget all, because I'm using a MSI project and can not use the install script functions in this way. I must add my dialog in the User Interface sequence.

But thanks for helping

// Heike

denis.melique

denis.melique
  • Members
  • 5 posts

Posted 04 June 2002 - 17:23

hi Heike
I have the same problem than you to use a dialog i have created in MSI project:(EzDefineDialog don t work) do you have find a solution of this problem?

tl0

tl0
  • Members
  • 49 posts

Posted 08 July 2002 - 19:57

i'm somewhat of a newbie to installshield.  i've been working with the the user interface sequence option as well.  does anyone know if installscript can handle everything the  UI sequence can and vice versa?

The one beef I have with the user interface sequence option is that it is relatively easy to use, but not so intuitive to get working/debugging.

Any thoughts?