now I didn't have RegisterClassExW, how to import that ?

John Chapman johnch_atms at hotmail.com
Sun Jan 27 11:31:58 PST 2013


On Sunday, 27 January 2013 at 19:29:03 UTC, John Chapman wrote:
> On Sunday, 27 January 2013 at 18:58:59 UTC, rsk82 wrote:
>> On Sunday, 27 January 2013 at 18:26:04 UTC, John Chapman wrote:
>>> This must be declared at module level (not inside a function).
>>
>> Ok, I've put it into module, linked in the module
>> pragma(lib, "user32.lib");
>> and
>> pragma(lib, "gdi32.lib");
>>
>> all this works until I put
>>
>> extern(Windows) ATOM RegisterClassExW(const WNDCLASSEXW 
>> *lpwcx);
>>
>> on line 30, then I get as if this was a code not a new 
>> function import:
>>
>> .\mod\myModule.d(30): Error: undefined identifier WNDCLASSEXW, 
>> did you mean struct WNDCLASSEXA?
>
> Because WNDCLASSEXW is not defined. So define it above 
> RegisterClassExW.
>
> struct WNDCLASSEXW {
>   UINT      cbSize = WNDCLASSEXW.sizeof;
>   UINT      style;
>   WNDPROC   lpfnWndProc;
>   int       cbClsExtra;
>   int       cbWndExtra;
>   HINSTANCE hInstance;
>   HICON     hIcon;
>   HCURSOR   hCursor;
>   HBRUSH    hbrBackground;
>   LPCTSTR   lpszMenuName;
>   LPCTSTR   lpszClassName;
>   HICON     hIconSm;
> }

Actually, replace "LPCTSTR" above with "LPCWSTR".


More information about the Digitalmars-d mailing list