string vs. w/char*
Tyro[a.c.edwards]
nospam at home.com
Thu Mar 3 12:43:38 PST 2011
On 3/1/2011 8:25 PM, Tyro[a.c.edwards] wrote:
> On 3/1/2011 7:18 PM, Bekenn wrote:
>> On 3/1/2011 12:25 AM, Tyro[a.c.edwards] wrote:
>>> Nevertheless, execution haults
>>> at the very next line following/catch and Create() never returns.
>>
>> CreateWindow sends a few messages to your window proc; anything
>> interesting happening there?
>
> Not sure how to check those messages, but I guess that's a cue for me to
> do some more research. Off to Google land I go...
After much searching, I've finally located the actual cause of the problem:
class TopWinClass: WinClass
{
this(ushort resId, HINSTANCE hInst, WNDPROC wndProc)
{
super(resId, hInst, wndProc);
SetResIcons(resId);
wc.lpszMenuName = MAKEINTRESOURCEA(resId); // [PROBLEM]
}
}
The root cause of the problem begins with a lack of understanding of how
to create a proper resource file for D. I simply took the C++ version,
compiled it with rcc and linked it to my project: No changes whatsoever.
Turn out that made the compiler/linker stop complaining, however
MAKEINTRESOURCEA(resId) still cannot locate the correct resources or
cannot properly use the resource it finds to initialize wc.lpszMenuName.
Every access to wc.lpszMenuName after this point fails. If initialize
wc.lpszMenuName with one of the default strings, say "STATIC" at this
point, the program runs to completion. I've attached the resource file,
it hopes that someone could help me with it's conversion.
Thanks.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Generic.rc
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110304/f6119126/attachment.ksh>
More information about the Digitalmars-d-learn
mailing list