why SwapBuffers crashes with HDC*?

why SwapBuffers crashes with HDC*?


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.

Thanks a lot

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

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)