SetBlitz3DHWND casts from into to HWD

Archives Forums/Blitz3D SDK Programming/SetBlitz3DHWND casts from into to HWD

n.allan(Posted 2012) [#1]
I wrote a wrapper for livecode/runrev using the Blitz3D sdk some while back.

In it I would call the function bbSetBlitz3DHWND(int hwndparent);

I passed in the hwndparent as an integer and the SDK would draw to my livecode/runrev window no problem.

Does anyone know how the SDK casts the hwndparent integer over to a proper HWND Type?

I am asking this because in my new wrapper I need to create an openGL context on win32. I am still passing the hwndparent as an integer but I cant seem to cast it to an HWND (which of course I need to get the device context using GetDC(hwndparent).

int intparent = 123456; // hwndparent as integer
HWND hwndparent = (HWND)intparent; // cast to HWND type
HDC context = GetDC(hwndparent); // GetDC() returns NULL here
DWORD err = GetLastError(); // GetLastError() return "8"
HRESULT res = HRESULT_FROM_WIN32(err); // this macro returns
"res = 0x80070008 Not enough storage is available to process this command"

Any insight as to how the SDK casts the HWND from int to HWND would be appreciated.

Cheers