c++ - Access violation reading location using WndClass -
i have 1 problem, using code:
bool registerapp(hinstance hinst) { wndclass wc; wc.style = cs_hredraw | cs_vredraw; wc.lpfnwndproc = wndproc; wc.cbclsextra = 0; wc.cbwndextra = 0; wc.hinstance = hinst; wc.hicon = loadicon(null, idi_application); wc.hcursor = loadcursor(null, idc_arrow); wc.hbrbackground = (hbrush)getstockobject(gray_brush); wc.lpszclassname = szclassname; // // return registerclass(&wc); }
when i'm trying using &wc
, have error:
unhandled exception @ 0x763adf81 in lab3.exe: 0xc0000005: access violation reading location 0xcccccccc.
please me, need this?
you have not initialized of data members of wc.
refer http://msdn.microsoft.com/en-us/library/windows/desktop/ms633576(v=vs.85).aspx
Comments
Post a Comment