Jump to content
  • Advertisement
Sign in to follow this  
andrew_wardobe

Recieving warnings in window code

This topic is 4868 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i get these warnings when i compile my code i wonder if any one knows how to solve them g:\CodeBase\C++\GLWindow\GLWindow.cpp(364) : warning C4312: 'type cast' : conversion from 'LONG' to 'CGLWindow *' of greater size g:\CodeBase\C++\GLWindow\GLWindow.cpp(389) : warning C4312: 'type cast' : conversion from 'LONG' to 'HINSTANCE' of greater size g:\CodeBase\C++\GLWindow\GLWindow.cpp(392) : warning C4311: 'type cast' : pointer truncation from 'CGLWindow *' to 'LONG' heres the code that get the waring LRESULT APIENTRY WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { CGLWindow *pWin = (CGLWindow*)GetWindowLong(hWnd, GWL_USERDATA); // make sure window has been created if ((pWin == NULL) && (msg != WM_CREATE)) { return DefWindowProc(hWnd, msg, wParam, lParam); } . . . case WM_CREATE: // window creation { HINSTANCE hInst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); pWin = (CGLWindow*)(((LPCREATESTRUCT)lParam)->lpCreateParams); ::SetWindowLong(hWnd, GWL_USERDATA, (LONG)pWin); pWin->m_hWnd = hWnd; return pWin->Create(); } . . . return ::DefWindowProc(hWnd, msg, wParam, lParam); } i've trimmed out the unessary to save having to read loads i would be grateful of any help cheers wardrobe (i was'nt quite awake when i sign up and missed a 'r' out my username)

Share this post


Link to post
Share on other sites
Advertisement
If you are using VC.NET make sure you have disabled 64-bit portability issues. To do so go to project properties->C/C++->detect 64bit portability issues.

Share this post


Link to post
Share on other sites
Cheers guys you both helped although i'm not going for 64bit support untill i can get driver for my modem that works with64 window i mite wait untill longhorn comes out

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!