string vs. w/char*
Tyro[a.c.edwards]
nospam at home.com
Mon Feb 28 08:35:47 PST 2011
On 2/28/2011 11:08 PM, J Chapman wrote:
> == Quote from Tyro[a.c.edwards] (nospam at home.com)'s article
>> Both implementations results in error code 1812 being returned from
>> GetLastError. explanation of the code reads:
>> ERROR_RESOURCE_DATA_NOT_FOUND
>> 1812 (0x714)
>> The specified image file did not contain a resource section.
>> The code I'm porting initially consisted of a resource.h file, a
>> generic.rc file and two icons. I have not tried to include the icons and
>> generic.rc file in the compilation because I do not know how to as yet
>> and I've only used half of the resource.h file: didn't think I need the
>> whole thing. Could this be the reason for the error? If so could you
>> direct me to the explanation of how to prepare these files for inclusion
>> in the compilation process?
>> Thanks,
>> Andrew
>
> You need to compile the .rc file (see
> http://www.digitalmars.com/ctg/rcc.html), then add the resulting .res file
> to dmd's command line.
Awesome, this does the trick. However I get get a "GP Fault"? during
execution. Using windbg, I tracked it down to this piece of code:
void Create()
{
_hwnd = CreateWindowExA(
_exStyle,
cast(const(char*))_wc.GetName(), // returns string
cast(const(char*))_windowName, // string variable
_style,
_x,
_y,
_width,
_height,
_hWndParent,
_hMenu,
_wc.GetInstance(),
_data);
assert(_hwnd, "Internal error: Window Creation Failed.");
}
The program craps at assert() but the error is generated. It just
displays a dialog box with the message: "test.exe has stopped working,
Windows is checking for a solution to the problem..."
I'm thinking that _hwnd was never initialized and that assert is access
a null pointer but I cannot be sure. Any suggestions or ideas?
More information about the Digitalmars-d-learn
mailing list