Board index » cppbuilder » CreateDialogIndirect and DLGTEMPLATE

CreateDialogIndirect and DLGTEMPLATE


2007-07-07 06:41:09 AM
cppbuilder74
I would appreciate a small working sample using DLGTEMPLATE and
CreateDialogIndirect.
The sample in the win32.hlp compiles but always returns -1.
Thanks!
~ JD
 
 

Re:CreateDialogIndirect and DLGTEMPLATE

JD wrote:
Quote
I would appreciate a small working sample using DLGTEMPLATE and
CreateDialogIndirect.

The sample in the win32.hlp compiles but always returns -1.
That's odd.
CreateDialogIndirect is supposed to return NULL or an HWND
Which example would that be?
The one under
Creating a Modal Dialog Box
or the next page:
Creating a Modeless Dialog Box
Or
Creating a Template in Memory
I can't find help example for CreateDialogIndirect
 

Re:CreateDialogIndirect and DLGTEMPLATE

CreateDialogIndirect is a macro that converts to CreateDialogIndirectParam
(with A or W at the end for ascii or unicode).
Look here for more info and continue on to the following entries.
blogs.msdn.com/oldnewthing/archive/2005/03/29/403298.aspx
It might be a convenient time to also step back and review the subject:
msdn2.microsoft.com/en-us/library/ms632588.aspx
. Ed
Quote
JD wrote in message
news: XXXX@XXXXX.COM ...

I would appreciate a small working sample using DLGTEMPLATE and
CreateDialogIndirect.

The sample in the win32.hlp compiles but always returns -1.
 

{smallsort}

Re:CreateDialogIndirect and DLGTEMPLATE

Bob Gonder < XXXX@XXXXX.COM >wrote:
Quote

>The sample in the win32.hlp compiles but always returns -1.

That's odd.
CreateDialogIndirect is supposed to return NULL or an HWND
My win32.hlp says -1 if it fails as does MSDN:
msdn2.microsoft.com/en-us/library/ms645457.aspx
although I see now from MSDN that I can call GetLastError
which I have not done.
Quote
Which example would that be?
Creating a Template in Memory
Quote
I can't find help example for CreateDialogIndirect
Sounds like you did just fine to me <g>.
Thanks!
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote

CreateDialogIndirect is a macro that converts to CreateDialogIndirectParam
(with A or W at the end for ascii or unicode).

Look here for more info and continue on to the following entries.
blogs.msdn.com/oldnewthing/archive/2005/03/29/403298.aspx
That's an interesting link but I can't get the Resource
Compiler to compile the sample dialog in RC.hlp because it
keeps puking on 'DIALOG'.
Quote
It might be a convenient time to also step back and review the subject:
msdn2.microsoft.com/en-us/library/ms632588.aspx
I hadn't seen that page.
Thanks!
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

JD wrote:
Quote
Bob Gonder wrote:
>That's odd.
>CreateDialogIndirect is supposed to return NULL or an HWND

My win32.hlp says -1 if it fails as does MSDN:

msdn2.microsoft.com/en-us/library/ms645457.aspx
Re-read your Subject, as well as your original post.
That link is for is
DialogBoxIndirect()
which is something different from the current topic of
CreateDialogIndirect()
msdn2.microsoft.com/en-us/library/ms645436.aspx
Quote
>I can't find help example for CreateDialogIndirect

Sounds like you did just fine to me <g>.
Nope, sorry, still not found an example of CreateDialogIndirect()
(other than Ed's very interesting links)
 

Re:CreateDialogIndirect and DLGTEMPLATE

JD wrote:
Quote
"Ed Mulroy [TeamB]" wrote:
>
>Look here for more info and continue on to the following entries.
>blogs.msdn.com/oldnewthing/archive/2005/03/29/403298.aspx

That's an interesting link but I can't get the Resource
Compiler to compile the sample dialog in RC.hlp because it
keeps puking on 'DIALOG'.
There must be some pretty interesting {*word*110} in your area...
I can't see a single DIALOG or RC.hlp, or mention of the Resource Compiler in those
articles? And why would you run the Resource Compiler an a *.hlp file anyway?
Ok, so you are probably off on another tangent, having nothing to do with the subject at
hand. I just did a complete file scan, and have 0 copies of rc.hlp on my system, so
really have no idea what your complaint is about.
However, this is a small portion of a working rc file
(Actually, I never got the abort dialog to work to my satisfaction, so I have it turned
off in the code, but this still compiles, and would function as a dialog.)
#include "C:\CPP\BCC55\INCLUDE\winuser.rh"
// <these also get included in the application>
#define IDD_FILE 3333
#define IDD_TEXT 3334
#define IDD_CANCEL 3335
#define AbortDlg 1
// </ these also get included in the application>
ICON_1 ICON "256.ico"
ICON_16 ICON "16.ico"
ICON_32 ICON "32.ico"
AbortDlg DIALOG 33, 32, 160, 70
STYLE WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "My Abort Dialog"
BEGIN
CONTROL "Now Printing: ", IDD_TEXT, "static", SS_CENTER | WS_CHILD, 0, 10, 160, 8
CONTROL "", IDD_FILE, "static", SS_CENTER | WS_CHILD, 0, 25, 160, 8
DEFPUSHBUTTON "Cancel", IDD_CANCEL, 60, 45, 45, 15
END
 

Re:CreateDialogIndirect and DLGTEMPLATE

Bob Gonder < XXXX@XXXXX.COM >wrote:
Quote

Re-read your Subject, as well as your original post.

That link is for is DialogBoxIndirect() which is something
different from the current topic of CreateDialogIndirect()
You're right! My applogies for the confusion!
DialogBoxIndirect is the correct subject.
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

Bob Gonder < XXXX@XXXXX.COM >wrote:
Quote

>That's an interesting link but I can't get the Resource
>Compiler to compile the sample dialog in RC.hlp because it
>keeps puking on 'DIALOG'.

There must be some pretty interesting {*word*110} in your area...
If only ....
Quote
I can't see a single DIALOG
'DIALOG' is a win32 KeyWord and not a win32 #define(s).
Quote
or RC.hlp, or mention of the Resource Compiler in those
articles?
That link used a resource which means that I would need to
compile the dialog into a resource which means using the
Resource Compiler which leads to RC.hlp (scan your hard
drive) for the correct syntax.
Plain and simple ... the RC pukes on 'DIALOG'.
Quote
And why would you run the Resource Compiler an a *.hlp file
anyway?
I wouldn't and why would you think that I would?
Quote
Ok, so you are probably off on another tangent,
Good chance but not today - I'm completely sober! :-( .
Quote
I just did a complete file scan, and have 0 copies of rc.hlp
on my system, so really have no idea what your complaint is
about.
All I can say is that I have BCB6+ on my system and that
earlier posts suggest that RC.hlp has been around for
several years. In any event, I have it. If you want it ....
Quote
However, this is a small portion of a working rc file [...]
<snip>
Quote
AbortDlg DIALOG <---
This is where the RC pukes on me.
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

Quote
>or RC.hlp, or mention of the Resource Compiler in those
>articles?

That link used a resource which means that I would need to
compile the dialog into a resource which means using the
Resource Compiler which leads to RC.hlp (scan your hard
drive) for the correct syntax.
The rc.hlp file is a help file for the system that creates help files, not
resource files. It is in the directory "\program files\borland
shared\mshelp". The contents of that directory are not related to resources
or resource file.
The resource compiler is brcc32.exe and it happily accepts the word DIALOG.
. Ed
Quote
JD wrote in message
news: XXXX@XXXXX.COM ...

>>That's an interesting link but I can't get the Resource
>>Compiler to compile the sample dialog in RC.hlp because it
>>keeps puking on 'DIALOG'.
>
>There must be some pretty interesting {*word*110} in your area...

If only ....

>I can't see a single DIALOG

'DIALOG' is a win32 KeyWord and not a win32 #define(s).

>or RC.hlp, or mention of the Resource Compiler in those
>articles?

That link used a resource which means that I would need to
compile the dialog into a resource which means using the
Resource Compiler which leads to RC.hlp (scan your hard
drive) for the correct syntax.

Plain and simple ... the RC pukes on 'DIALOG'.

>And why would you run the Resource Compiler an a *.hlp file
>anyway?

I wouldn't and why would you think that I would?

>Ok, so you are probably off on another tangent,

Good chance but not today - I'm completely sober! :-( .

>I just did a complete file scan, and have 0 copies of rc.hlp
>on my system, so really have no idea what your complaint is
>about.

All I can say is that I have BCB6+ on my system and that
earlier posts suggest that RC.hlp has been around for
several years. In any event, I have it. If you want it ....

>However, this is a small portion of a working rc file [...]

<snip>

>AbortDlg DIALOG <---

This is where the RC pukes on me.
 

Re:CreateDialogIndirect and DLGTEMPLATE

"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote

The rc.hlp file is a help file for the system that creates
help files, not resource files.
When launched, the caption reads "Help Topics: Resource
Compiler User's Guide" and when I look at the contents,
it's clear to me to be a help file for the resource
compiler.
Quote
It is in the directory "\program files\borland shared\mshelp".
I found mine in "\Program Files\Common Files\Borland Shared\MSHelp\"
Quote
The contents of that directory are not related to resources or resource
file.
I have no response to that.
Quote
The resource compiler is brcc32.exe and it happily accepts
the word DIALOG.
I'm using MS RC v3.51.1016.1 and I have no idea why I don't
have brcc32 on my drive. Looks like time to install BDS and
get it over with.
Thanks.
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

Quote
When launched, the caption reads "Help Topics: Resource
Compiler User's Guide" ...
The Windows help system also uses "resource" for the name of the source used
to create a help file. It is a different type of resource than the one for
which you were looking.
Quote
>It is in the directory "\program files\borland shared\mshelp".

I found mine in "\Program Files\Common Files\Borland Shared\
MSHelp\"
The directory that you show is correct. The one I showed is not. I typed
in the directory name from memory - so much for the quality of my memory :-(
Quote
>The resource compiler is brcc32.exe ...

I'm using MS RC v3.51.1016.1 and I have no idea why I don't
have brcc32 on my drive...
The machine I am on right now has BCB version 6 on it. Here is a screen
capture of a directory search.
--------------------------
C:\Program Files\Borland\CBuilder6\Bin
Quote
ver
Microsoft Windows XP [Version 5.1.2600]
C:\Program Files\Borland\CBuilder6\Bin
Quote
dir brcc*.exe
Volume in drive C has no label.
Volume Serial Number is FC8D-A209
Directory of C:\Program Files\Borland\CBuilder6\Bin
02/01/2002 10:00 AM 168,992 brcc32.exe
1 File(s) 168,992 bytes
0 Dir(s) 11,433,058,304 bytes free
C:\Program Files\Borland\CBuilder6\Bin
Quote

--------------------------
There also is another, brc32.exe (only one 'c' in the name). It supposedly
is a shell for brcc32.exe. I don't know of any reasons to use it.
. Ed
Quote
JD wrote in message
news: XXXX@XXXXX.COM ...
>
>The rc.hlp file is a help file for the system that creates
>help files, not resource files.

When launched, the caption reads "Help Topics: Resource
Compiler User's Guide" and when I look at the contents,
it's clear to me to be a help file for the resource
compiler.

>It is in the directory "\program files\borland shared\mshelp".

I found mine in "\Program Files\Common Files\Borland Shared\MSHelp\"

>The contents of that directory are not related to resources or resource
>file.

I have no response to that.

>The resource compiler is brcc32.exe and it happily accepts
>the word DIALOG.

I'm using MS RC v3.51.1016.1 and I have no idea why I don't
have brcc32 on my drive. Looks like time to install BDS and
get it over with.
 

Re:CreateDialogIndirect and DLGTEMPLATE

"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
>When launched, the caption reads "Help Topics: Resource
>Compiler User's Guide" ...

The Windows help system also uses "resource" for the name of the source
used to create a help file. It is a different type of resource than the
one for which you were looking.
Please see the attachment group for a screen shot.
~ JD
 

Re:CreateDialogIndirect and DLGTEMPLATE

Yes, it looks as if there is an incorrect entry in that list.
In any case, the help compiler is not related to the type of resources
stored in a compiled resource, *.res, file and linked into a executable or
dll.
. Ed
Quote
JD wrote in message
news: XXXX@XXXXX.COM ...

Please see the attachment group for a screen shot.
 

Re:CreateDialogIndirect and DLGTEMPLATE

JD wrote:
Quote
Please see the attachment group for a screen shot.
The Borland RC is discussed in the BCB5TOOL.hlp
And I believe it was Remy posted this link a year or three ago...
msdn.microsoft.com/library/en-us/tools/tools/resource_definition_statements.asp