Article View: borland.public.cppbuilder.nativeapi
Article #11858Using DialogBox api.
From: Mike Collins
Date: Tue, 13 Jan 2004 13:17
Date: Tue, 13 Jan 2004 13:17
34 lines
2640 bytes
2640 bytes
First off, thanks Remy for the reply regarding dialogs in GINA. As you
summised, you have to use the WLX supplyed functions to create and display
your Dialog box, using a resource define image as the templete.
So with that in mind, and due to the difficulty in debugging GINA's I set to
to make a test application to check that I could infact create a dialog box
for and resource, and to test the layout. Now I've tried defining my dialog
box in one of several ways, firstly, as you suggested, by simply creating a
.rc file with the dialog define in there. I also tried using VC++ (I'm
sorry, let me not burn in hell - I may add that this sees to only thing that
VC++ is any use for i.e. creating resource files). I've also tried
identifying them with a name and / or a numeric ID.
Problems is that when I call DialogBox api, I get nothing and GetLastError
returns the message stating "The specified image file did not contain a
resource section". Now when I load the exe up in ResourceHacker or
ExeScope, right as rain the resources are there and the dialogs are defined.
I had to remove the default autogenerated .res file from the project because
RLINK was complaining about confilcting ID's, but I always remove this as it
always conflicts with my other resource.
I'm calling the api like this (not sure if the two handles are correct):
if (DialogBox(Application->Handle,
MAKEINTRESOURCE (1),
MainForm->Handle,
(DLGPROC)DialogFunc) == -1)
ShowMessage(SysErrorMessage(GetLastError()).c_str());
- and this the fun begines. does anyone have any suggestions? Should I be
using DialogBoxParam instead?
Thanks in advance, mike c
Technical Details
Message-ID:
<4003ecbc$2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,369c982ee23b43f4,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-13 05:09:57 PST Reply-To: "Mike Collins" <mikec@kr8.co.uk> From: "Mike Collins" <mikec@kr8.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Using DialogBox api. Date: Tue, 13 Jan 2004 13:17:26 -0000 Lines: 36 Organization: kr8 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 81.2.78.34 Message-ID: <4003ecbc$2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1073999036 81.2.78.34 (13 Jan 2004 05:03:56 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail