I've recently started to have some strange problems with windows programming. I also recently installed the new windows sdk so I can't help wondering whether or not this is my problem. Anyway, the issue is that when I try to create an empty window it will open and there are no problems; however, the next time I try to recompile, it gives me this message:
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'C:\Programing\KaBoom\Release\KaBoom.exe'
I am also unable to delete the file because it is "in use" which I'm guessing is because it is still running. I then open task manager and look through the current processes, but the program is not there. I don't understand this! I have to log out of my account and log back on before I can recompile which is extremely annoying.
I've never had this problem before, so I'm just wondering why this is now happening. Has something in windows programming changed? Am I missing something?
The problem that I described above happens for any blank window. I actually have another problem. I wrote a very simple windows program, but this window won't even open. I don't know what is wrong. I'll post the code. It produces both the first and second problems:
int PASCAL wWinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPWSTR lpCmdLine, int nCmdShow)
{
MSG msg = {0};
WNDCLASS wc;
//Copy hinst
g_hInst = hInst;
//Initialize COM
if(FAILED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))
{
MessageBox(NULL, "Failed to initialize COM.", "Error", MB_OK);
return FALSE;
}
//Create and register the window class
ZeroMemory(&wc, sizeof(wc));
wc.hInstance = hInst;
wc.lpfnWndProc = WindowProc;
wc.lpszClassName = "KaBoom";
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
if(!RegisterClass(&wc)) {
MessageBox(NULL, "Failed to register window class.", "Error", MB_OK);
CoUninitialize();
return FALSE;
}
//Create the main window
g_hWnd = CreateWindow("KaBoom!", "KaBoom!",
WS_OVERLAPPEDWINDOW,
0, 0,
300, 300,
0, 0, g_hInst, 0);
//Succeeded, continue into app
if(g_hWnd)
{
// Main message loop
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} else {
MessageBox(NULL, "Failed to create main window", "Error", MB_OK);
}
CoUninitialize();
return TRUE;
}
When I run it I get "Failed to create main window" and then I am unable to rebuild. Thank you very much.