QCW9204006: Incorrect Code Generated for Some Unlinked Dialogs

ID Number: Q83941

1.00

WINDOWS

buglist1.00

Summary:

PROBLEM ID: QCW9204006

SYMPTOMS

When using the QuickCase:W utility that comes with the Microsoft

QuickC for Windows Graphical Development System version 1.0, the

code for calling an unlinked dialog box may be generated

incorrectly if the following conditions occur:

1. The dialog box has a symbolic name that is different from the

name of the dialog box script file.

2. The dialog box was created without a symbolic name (for example,

it has an ID number but no symbol name).

CAUSE

This problem occurs because QuickCase:W creates the DialogBox() [or

CreateDialog()] function call with a quoted string to identify the

dialog box. This string contains the name of the dialog box file,

not the symbolic name (this accounts for case 1 above). In case 2,

the DialogBox function call should contain a call to

MakeIntResource() with the ID number passed as a parameter to that

call. The return value should then be used as the string name for

the dialog box resource.

The above conditions generate the following code respectively:

1. Code generated:

DialogBox(hInst,(LPSTR)"FILENAME",hWnd,lpfnSYMBOL2MsgProc);

It should appear as:

DialogBox(hInst,(LPSTR)"SYMBOL_NAME",hWnd,lpfnSYMBOL2MsgProc);

2. Code generated:

DialogBox(hInst,(LPSTR)"FILENAME",hWnd,lpfnNOSYMBOLMsgProc);

It should be:

DialogBox(hInst,MAKEINTRESOURCE(100),hWnd,

lpfnNOSYMBOLMsgProc);

Note: "FILENAME" is is the name of the dialog box resource file,

"SYMBOL_NAME" is the name typed into the Symbol edit box when

creating the dialog box, and 100 is the ID number given to the

dialog box.

RESOLUTION

To work around the problem, ensure that all dialog boxes have a

symbol name (but no ID number). For more information, query on the

following in the Microsoft Knowledge Base:

QCW9201002

You can edit the code generated by QuickCase:W to call DialogBox()

with the correct parameters, but it is recommended to correct the

problem in the Dialog Editor. This will also prevent other possible

problems concerning dialogs without symbolic names. For more

information, query on the following in the Microsoft Knowledge

Base:

dialog and display

Additional reference words: symbolic display fail qcwin qcw