Link to home
Start Free TrialLog in
Avatar of BeefJerky8732
BeefJerky8732

asked on

How to create ::DialogBoxIndirectParam( ) 2nd parameter

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:
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=cplusprog&qid=20189278

Thanks in advance
Avatar of The Master
The Master

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!
Avatar of DanRollins
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
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
Avatar of BeefJerky8732

ASKER

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.
Dan,
I'll review the links and get back to you.
hi BeefJerky8732,
Do you have any additional questions?  Do any comments need clarification?

-- Dan
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial