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;
}

Reply via email to