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

WaitOnDialog returns -1


9 replies to this topic

dreeves

dreeves
  • Members
  • 18 posts

Posted 12 October 2001 - 21:58

I want to create a custom dialog. Here's what I did. (Using IS 7.0)

1. Created a new dialog using the dialog view of IS. I named it SdWait.
2. Used the Example Custom Password Dialog script as a guide for defining the functionality of my SdWait dialog.
3. I call EzDefineDialog and I pass "SdWait" as the szDialogID. I do not use the numerical nDialogID because IS does not let me see the dialogID of my SdWait dialog...it only lets me see a name.
4. When I call WaitOnDialog, I get a -1.
5. I opened the _IsUser1033.rc using Visual Studio and tried to get the dialogID...but, the dialogID is "SDWAIT".

What should I do?

I think the reason that the WaitOnDialog call is failing is because of the EzDefineDialog() is not being called properly.

Please help!

Thank you,

Drue


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 13 October 2001 - 20:18

If you are using visual studio, you can search for sdwait in resource.h under the file view tab. (Probably see it right off after selecting it from the workspace pane, this file usually isn't very big).  I find it easier to just number the dialog and use the number in a define in your script.  (Be sure not to use a number already in use in the sdrc.h file.)

dreeves

dreeves
  • Members
  • 18 posts

Posted 14 October 2001 - 23:33

Thank you for the reply.

I forgot to mention that I am using IS 7.0 (if that makes a difference).

However, I am using the dialog editor in IS 7 to create my new dialog. IS does not let you assign a number to any new dialogs...only names...or at least I can't see a place to assign it a number. The only reason I opened VS is to see if it was assigned a number in the _ISUser1033.rc file. The dialog was named SDWAIT there as well.

I have searched EVERY .h file associated with my setup. There is no mention of SDWAIT as a defined constant in any file....or any of the other dialogs for that matter.

Drue


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 October 2001 - 08:49

#Moderation Mode

Moved to IS 7 forum

Moved here


Christof

Christof
  • Members
  • 56 posts

Posted 15 October 2001 - 12:00

Hi,
if use only one language all should work. But if use a second language (e.g. german and english) you will always get -1. I reported this bug two weeks ago and it will be fixed with MP1. For more details you can contact me or if you need code this will work with only one language.
Greetings
Christof

Williams

Williams
  • Members
  • 8 posts

Posted 17 October 2001 - 18:42

I noticed that the documentation is wrong stating that if you leave the second parameter null that the isuser.dll will be assumed.  That is not the case, you need to place the word "ISUSER" as the second parameter.

Enoch Chum

Enoch Chum
  • Members
  • 12 posts

Posted 18 October 2001 - 15:14

Do you need to call EzDefineDialog before you call WaitOnDialog?

Christof

Christof
  • Members
  • 56 posts

Posted 19 October 2001 - 08:08

Hi,
try this:

szDialogName = "MyDialog1";
szDialogID = "MyDialog1";
EzDefineDialog(szDialogName, ISUSER, szDialogID, NULL );

repeat
// Display the dialog and return the next dialog event.
 nCmdValue = WaitOnDialog(szDialogName);
 // Respond to the event.
 switch (nCmdValue)
     case DLG_CLOSE:
         Do (EXIT);
     case DLG_ERR:
        MessageBox ("Unable to display dialog. Setup canceled.", SEVERE);
        abort;
//////////////////////////////////////////////////////////////////////////////
     case DLG_INIT:
   // Do init Code here              
     case SD_PBUT_CONTINUE:
           nResult = nCmdValue;
           bDone = TRUE;
     case SD_PBUT_BACK:
          nResult = nCmdValue;
          bDone = TRUE;
     case SD_PBUT_EXITSETUP:
          nResult = nCmdValue;
          Do (EXIT);
     endswitch;
until bDone;  
EndDialog("MyDialog1");
ReleaseDialog("MyDialog1");

I got a ISWIBuild.dll which can handle more then one language. so i'm able to create custom dialogs with more the n one language. If you it, please let me know  and mail it...

Greetings
Christof


afisk2

afisk2
  • Members
  • 5 posts

Posted 02 November 2001 - 01:38

You can set the numeric id of your custom dialog in the direct editor under "Advanced Views."  If you click on the "Dialog" table on the left, you'll see your custom dialog appear on the right.  If you then scroll all the way to the right, you can set the resource id in the last column.  This is the number you can use in your script.

Careful what you put for this number though -- for some reason puting 99999, for example, does not work on 98 (that took me about 3 days to figure out...).  Using 12345 has worked for me.


afisk2

afisk2
  • Members
  • 5 posts

Posted 02 November 2001 - 01:43

I forgot to mention that you should pass ISUSER in the second parameter, so it should be:

EzDefineDialog (szDialogName,ISUSER,szDialogID,NULL );

where szDialogID is the id you entered in the direct editor.