🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11792

Re: WlxDialogBox and GINA stub...

#11792
From: Remy Lebeau (TeamB)
Date: Wed, 14 Jan 2004 18:40
46 lines
2598 bytes
"Mike Collins" <mikec@kr8.co.uk> wrote in message
news:400534cd@newsgroups.borland.com...

> (LPWSTR)"IDD_CUSTOM_WELCOME_DIALOG",

That is not the correct way to hand-code a wide string.  LPWSTR is a typedef
for a wchar_t* pointer, but you are specifying a char* string instead and
then trying to cast it as a wchar_t*.  You cannot do that, they are not
compatible types to begin with.  A char is 1 byte whereas a wchar_t is 2
bytes, thus the resulting memory will be formatted incorrect.

To specify a true wide string, you need to do one of the following instead:

    L"IDD_CUSTOM_WELCOME_DIALOG"

Or

    WideString("IDD_CUSTOM_WELCOME_DIALOG")

In the first case, the 'L' tells the compiler that the following string
should be treated as a wchar_t* string instead of a char* string.

> However I still get the same error message stating: "The
> specified image file did not contain a resource section".

As well it should.  You did not pass in a valid name, thus it could not be
found.

BTW, in your actual dialog template, did you really name your dialog as
"IDD_CUSTOM_WELCOME_DIALOG", or is that actually a #define for a numerical
ID instead?  If it is numeric, then you should be using the
MAKEINTRESOURCEW() macro instead, ie:

    MAKEINTRESOURCEW(IDD_CUSTOM_WELCOME_DIALOG)

> Last time I received this message was when using the DialogBox api
> and resulted from passing it the wrong handle.  Now I've tried changing
> "hInst" Handle value from hInst to HInstance to Application->Handle
> but no joy.

This time around, it is not related to the handles.  Using the DLL's hinst
is the correct handle to use.


Gambit
Technical Details
Message-ID: <40058bb0$1@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-mail
References: <400534cd@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5bc05edd06bcd13c
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-01-14 10:40:46 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <400534cd@newsgroups.borland.com>
Subject: Re: WlxDialogBox and GINA stub...
Date: Wed, 14 Jan 2004 10:40:36 -0800
Lines: 48
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: 67.22.138.253
Message-ID: <40058bb0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074105264 67.22.138.253 (14 Jan 2004 10:34:24 -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