Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
My question is related with InstallShield. I am trying to provid support adding one more dialog in my project. So I would need any tutorials or step by steps to add custom dialog.

It would be more helpful to share the information.

My advance thanks!!!!

What I have tried:

1. I am creating one custom dialog, User Interface -> Dialogs -> New Dialog.
2. I keep one Listbox and push button in my dialog.
3. I have created method like below :- 

#include "Sdint.h"
#include "Str.h"
#include "CustomDlg.h"
#include "Winapi.h"
#include "Misc.h"
#include "DialogsPriv.h"
#include "Sdrc.h"

//private constants
#define DLG_FINISHERRORSUMMARY "FinishWithErrorSummary" //My Custom Dialog Name
#define DLG_FINISHERRORSUMMARY_ID 1431 //Dialog ID
#define FINISHBUTTON_ID 1304
#define LISTBOXERROR_ID 1302

//private globals

prototype FinishErrorSummary();

function FinishErrorSummary()
NUMBER nOptions, nControl, nReturn, nResult;
BOOL bDone, bChecked;
HWND hwndDlg, hItem;
LIST listString;
begin

listString = ListCreate(STRINGLIST);
ListAddString(listString, "Monday", AFTER);
ListAddString(listString, "Wednesday", AFTER);
ListAddString(listString, "Friday", AFTER);

nResult = EzDefineDialog("DLG_FINISHERRORSUMMARY", ISUSER, "", 1431); 

if (nResult < 0) then
// Report an error; then terminate.
MessageBox ("Error in defining dialog", SEVERE);
abort;
endif;

// Loop in dialog until the user selects a standard button
bDone = FALSE;

while (!bDone)
nControl = WaitOnDialog("DLG_FINISHERRORSUMMARY");
switch (nControl)
case DLG_INIT:
// Initialize the back, next, and cancel button enable/disable
// states for this dialog and replace %P, %VS, %VI with
// IFX_PRODUCT_DISPLAY_NAME, IFX_PRODUCT_DISPLAY_VERSION, and
// IFX_INSTALLED_DISPLAY_VERSION, respectively, on control IDs 700-724 and 202.
hwndDlg = CmdGetHwndDlg("DLG_FINISHERRORSUMMARY"); 
SdGeneralInit("DLG_FINISHERRORSUMMARY", hwndDlg, 0, ""); 

CtrlSetList("DLG_FINISHERRORSUMMARY", 1302, listString); 
bDone = TRUE; 

case DLG_ERR:
nControl = ISERR_GEN_FAILURE;
bDone = TRUE;
SdError(nControl, DLG_FINISHERRORSUMMARY);

case DLG_CLOSE:
SdCloseDlg(hwndDlg, nControl, bDone); 

default:
// check standard control handling
if (SdIsStdButton(nControl) && SdDoStdButton(nControl)) then
bDone = TRUE;
endif;

endswitch;
endwhile;
EndDialog(DLG_FINISHERRORSUMMARY);
ReleaseDialog(DLG_FINISHERRORSUMMARY); 

end;

4. Calling this method from OnFirstUIAfter() like below 
nResult = FinishErrorSummary(); 
if (nResult = 0) then 
SetDialogTitle (DLG_ASK_OPTIONS, szTitle); 
endif;


5. Responses for the above custom functions mentioned below:
i) nResult = EzDefineDialog("DLG_FINISHERRORSUMMARY", ISUSER, "", 1431); 
nResult I am getting the value as '0'. Hope this is right response.

ii) nControl = WaitOnDialog("DLG_FINISHERRORSUMMARY");
nControl I am getting the value as '-100'. Hope this too right response.

Issue:
But the custom dialog not getting display.

Please let me know if anything I missed out here. It would be more helpful.....

Help me!!! Help me!!! Help me!!!
Posted
Comments
[no name] 26-Feb-19 16:51pm    
A lot of C# tags and no C#. No VB.NET either.

"... anything I missed out ..."

More tags?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900