We help IT Professionals succeed at work.

How to create ::DialogBoxIndirectParam( ) 2nd parameter

BeefJerky8732
on
How do I create the second parameter in ::DialogBoxIndirectParam function?

I need a Win32 method that will work on VC++ and Bordland C++ which will create the DLGTEMPLATE parameter for DialogBoxIndirectParam.

Please NO MFC or VC++ IDE methods.  I need a method that is code only, and I need to know the signaficants of the values entered.

This is related to the following question:
http://experts-exchange.com/jsp/qManageQuestion.jsp?ta=cplusprog&qid=20189278

Thanks in advance
Comment
Watch Question

First of all, that related question is now considered a "Previously Asked Question", and people will need to spend points to view it, which many will not do.

Second, it sounds like you're asking for someone to write a function for you to generate a DLGTEMPLATE in memory from scratch.  That's not only a fairly tedious task, but the function would completely depend on what you wanted the dialog to look like.  A DLGTEMPLATE is just a block of memory in a certain format - and what it looks like depends on the number of controls in the dialog, the type of controls in the dialog, whether or not the dialog has a menu, etc.

See the documentation for DLGTEMPLATE in MSDN for more info.

Good luck!
CERTIFIED EXPERT
Author of the Year 2009

Commented:
Here is a class that is overkill for your needs (simple InputText box), so I did not mention it in the previous Q.

http://www.codeguru.com/dialog/DynDlg.html

Also there is a sample in MSDN I did not review:

Dialog Templates in Memory (Q155257)
http://support.microsoft.com/support/kb/articles/Q155/2/57.asp

And of course, it is thoroughly documented in MSDN.  These two links:
http://msdn.microsoft.com/library/en-us/winui/dlgboxes_8nzm.asp
and
http://msdn.microsoft.com/library/en-us/winui/dlgboxes_971u.asp

...describe all that you need to know.

-- Dan
CERTIFIED EXPERT
Author of the Year 2009

Commented:
And I did no mention how I got the data for the previous Q:  I just used the dialog editor to create a dialog box.  Then ran the program and used:

HRSRC hrsrc = ::FindResource(NULL, MAKEINTRESOURCE(IDD_DIALOG1), RT_DIALOG);
DWORD nSize= SizeofResource( NULL, hrsrc );

HGLOBAL hglb = LoadResource( NULL, hrsrc);
DLGTEMPLATE * prDT= (DLGTEMPLATE *)LockResource(hglb);

Then I used the binary memory viewer to get the hex codes for the data.  Also I found that the value of nSize was larger than necessary.

-- Dan

Author

Commented:
The Master,
>>Second, it sounds like you're asking for someone to
>>write a function for you to generate a DLGTEMPLATE
>>in memory from scratch.  

No where in my question did I ask for a function to be generated.

>>See the documentation for DLGTEMPLATE in MSDN for more
>>info.
The MSDN site provides almost the same information that you get in the VC++ help file.
Both the MSDN site and the help file do not explain how to create the required parameter.

If you don't know the answer, then don't participate, because this type of input is not useful nor desired.

Author

Commented:
Dan,
I'll review the links and get back to you.
CERTIFIED EXPERT
Author of the Year 2009

Commented:
hi BeefJerky8732,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
CERTIFIED EXPERT
Author of the Year 2009
Commented:
hi BeefJerky8732,
Do you have any additional questions?  Do any comments need clarification?

-- Dan