Your first problem, as you said, was that the program continued to run after the window was closed. I think I found the problem in the application's message loop. In main.cpp, on line 89, I changed
while((bRet = GetMessage(&Msg, Wnd, 0, 0 )) != 0)
to
while((bRet = GetMessage(&Msg, NULL, 0, 0 )) != 0).
As for the icon problem: The name of the icon resource is "IDI_ICON", a string.
On line 12 of application.cpp, MAKEINTRESOURCE attempts to convert a resource identifier to something LoadImage can work with:
= (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 32, 32, 0);.
The thing is, there is no icon with an identifier of IDI_MAINICON; just an icon with a name "IDI_MAINICON".
The problem can be resolved by removing the double quotes from around the resource name in the resource editor, so that "IDI_MAINICON" becomes IDI_MAINICION.
Alternatively, it can be fixed by removing MAKEINTRESOURCE(IDI_MAINICON) on line 12 of application.cpp, and specifying just "IDI_MAINICON" with quotes:
WndClsEx.hIcon = (HICON)LoadImage(GetModuleHandle(NULL),
...
...
WndClsEx.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), "IDI_MAINICON", IMAGE_ICON, 16, 16, 0);

New Topic/Question
Reply





MultiQuote



|