Im too lazy to fill in these parameters over and over when I always make them the same thing. So I made this function which gets a lot of errors.
error C2228: left of '.cbSize' must have class/struct/union typeCode:int FillWindow(WNDCLASSEX *wcl, LRESULT CALLBACK WndProc) { wcl.cbSize = sizeof(WNDCLASSEX); wcl.hInstance = GetModuleHandle(NULL); wcl.lpszClassName = "classname"; wcl.lpfnWndProc = WndProc; wcl.style = 0; wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION); wcl.hIconSm = LoadIcon(NULL, IDI_WINLOGO); wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.lpszMenuName = NULL; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hbrBackground = (HBRUSH) GetStockObject(0); return 0; }
c:\program files\microsoft visual studio\vc98\include\mywindows.h(22) : error C2228: left of '.hInstance' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(24) : error C2228: left of '.lpszClassName' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(26) : error C2228: left of '.lpfnWndProc' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(28) : error C2228: left of '.style' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(30) : error C2228: left of '.hIcon' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(32) : error C2228: left of '.hIconSm' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(34) : error C2228: left of '.hCursor' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(36) : error C2228: left of '.lpszMenuName' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(38) : error C2228: left of '.cbClsExtra' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(40) : error C2228: left of '.cbWndExtra' must have class/struct/union type
c:\program files\microsoft visual studio\vc98\include\mywindows.h(42) : error C2228: left of '.hbrBackground' must have class/struct/union type




Reply With Quote