vin
vin

Reputation: 869

LINK : fatal error LNK1104: cannot open .exe

My question is not a duplicate of this, in fact its a extension of the same question, This is the code snippet, due to which the error occurs,

BOOL CMyApp::InitInstance() {
   m_pMainWnd = new CMainWindow;
   m_pMainWnd->ShowWindow(SW_NORMAL);
   m_pMainWnd->UpdateWindow();
   return TRUE;
}

So, when I use m_pMainWnd->ShowWindow(SW_NORMAL); the prgoram runs without any error, the window opens in normal size and I can see the output, but when I do m_pMainWnd->ShowWindow(SW_MAX); even after the program runs without errors I cannot see the output window, also when I try to rebuild, VC throws an error saying

LINK : fatal error LNK1104: cannot open .exe

I have followed a few answers of this question as well, the first answer in this question suggests

You might have not closed the the output. Close the output, clean and rebuild the file. You might be able to run the file now.

which is quite correct but what I have to do is log off my computer and log in again in order to terminate the output process, I have to do this because I can neither find an application window that is open, nor I can see any program running in the Application's tab in 'Task Manager'. I even followed the second answer which says

You have to put Application Experience on Manual startup(you can do it by searching services in windows 7 start menu, and then find Application Experience and click properties).

except when I got there, I found the Application was already put on Manual Startup, and the problem still persists. Along with the solution what I want to know is why does the program not show output when I write m_pMainWnd->ShowWindow(SW_MAX);

If it helps I am using VC++ 6.0 and my OS is Windows-7 Professional 32-bit

Upvotes: 1

Views: 6219

Answers (2)

TheSteve
TheSteve

Reputation: 1158

The VC++ 6.0 debugger does not work correctly under Windows 7 due to changes.
When you attempt to kill the process from the debugger, the process doesn't end correctly and gets stuck.

See the following topic for more info.

How to debug with Visual C++ 6 on Windows 7 x64?

Upvotes: 0

Jeeva
Jeeva

Reputation: 4663

SW_MAX is same as SW_FORCEMINIMIZE the documentation states that

Minimizes a window, even if the thread that owns the window is not responding. This flag should only be used when minimizing windows from a different thread.

It infact minimize the window and the application still run's in the task bar. I checked it in Win7 machine.

if your objective is to display the window in maximized state use SW_SHOWMAXIMIZED instead.

Upvotes: 3

Related Questions