tags:

views:

21

answers:

2
case WM_LBUTTONDOWN:
    x1=LOWORD(z);
    y1=HIWORD(z);
    d=GetDC (w);
    TextOut(d,x1,y1,"AMITA",6);
    ReleaseDC (w,&d);
    break;

Error:: error C2664: 'ReleaseDC' : cannot convert parameter 2
    from 'struct HDC__ ** ' to 'struct HDC__ *
+2  A: 

Use:

ReleaseDC (w,d);

instead.

It's because GetDC returns an HDC and ReleaseDC is expecting an HDC as well, but you're giving it the address of your HDC.

Cannot convert from X** to X* and Cannot convert from X* to X** are two of the canonical error messages you will hopefully be able to spot immediately at some point in your life :-) It's almost always the same problem (too many, or too few, levels of indirection).

paxdiablo
+3  A: 

ReleaseDC (w,&d); should be ReleaseDC (w,d);

sharptooth