64bit warning resolution...

SephirothSephiroth Fayetteville, NC, USA
I've got three minor problems with my windowing library that I am now sure how to fix off the top of my head. The library gets a pointer or sets a pointer at several places in the code, but due to the class being pointed to, I get C4312 or C4311, conversion warnings.
//This line causes a 4312
if((pBase = (BaseWindow*)::GetWindowLong(hwndWindow, 0)) != 0)

//This line causes a 4311
::SetWindowLong(hwndWindow, 0, (LONG)pBase);

//This is another 4312
::CreateWindowEx(dwExStyle, this->GetClass(), pTitle, dwStyle, iX, iY, iWidth, iHeight, hwndParent, (HMENU)uiChildID, hModule, this)
The last line has a problem converting from an unsigned integer to an HMENU. However, when you create a child window, you have to specify an ID. How can I get around this one? The other two I have ideas on that I am about to try, but I still need help if they fail.


No go. My idea of using a LONG* instead of a BaseWindow* for "GetWindowLong()" failed, since I couldn't cast it to a BaseWindow pointer and call methods in it later in the code. I do need this resolved so that I can compile this in 64bit and 32bit.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!