I am currently facing issues when trying to compile my code that contains this WinProc function which is being used to process messages from our program. For example if a WM_DESTROY message is received via windows I want it to call PostQuitMessage(0) to signal Windows that the application has made a request to quit. Which will cause the WM_QUIT message to cause the WinMain to exit.
I have only been learning C++ a few weeks and don't have the experience or knowledge to fix this and would appreciate any help. I have looked around but so far I cannot find any solutions. I'm pretty new to this so I may have missed something really obvious.
LRESULT WINAPI WinProc (hWnd, msg, UNIT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY;
// Tell windows to kill the program
PostQuitMessage(0);
return 0;
}
return DefWindowProc (hWnd, msg, wParam, lParam );
}
Below is the errors I experience wit the code that I have provided.
error: 'LRESULT WinProc' redeclared as different kind of symbol error: previous declaration of 'LRESULT WinProc(HWND__*, UINT, WPARAM, LPARAM)' error: 'hWnd' was not declared in this scope error: 'msg' was not declared in this scope error: 'UNIT' was not declared in this scope
Any help would be greatly appreciated.
Thanks