PDA

View Full Version : why SwapBuffers crashes with HDC*?



10-06-2002, 07:39 PM
why SwapBuffers crashes with HDC*?

[CODE]
HDC myHDC;
HDC *p_HDC;

createMywindow(); // works ok
p_HDC = &myHDC; // myHDC its ok.

SwapBuffers(*p_HDC); // crashes the application, but with myHDC runs fine.
[CODE]

Thanks a lot

The same code works fine with HDC instead of HDC*, why?

kaysoft
10-07-2002, 02:27 AM
SwapBuffers doesnt take a pointer to an HDC structure, you might want to use SwapBuffers(&hDC) (the hDC is considered a pointer in my example) or SwapBuffers(hDC) (if hDC is just an instance)