LINK : fatal error LNK1104: cannot open .exe - visual-c++

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

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.

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?

Related

How do deal with Installshield installations that extract an MSI with pywinauto?

I am trying to automate an installation that starts out with an InstallShield setup.exe. That kicks off the installation of a MS Visual C++ redistributable. That leads to an error about Adobe Flash not being up to date. I have asked about how to deal with that here:
Error during automated software install using pywinauto
Once I click OK for the Adobe dialog(have to use pyautogui.click() for this for now) I see that there is an .msi being extracted. I have followed the install and it puts it into a new Temp folder under my Users\AppData directory.
How do you get pywinauto to find this new application? I have tried using
adobe = Application().connect(title_re="MyInstaller",class_name="#32770", visible_only=True)
And then try to print_control_identifiers() but get this error:
AttributeError: Neither GUI element (wrapper) nor wrapper method 'print_control_identifiers' were found (typo?)
I have checked Spy++ and Inspect and AutoIT to find the class which I can. I can't use the procid as it will always change.
Any thoughts on how to attach to the .msi process so I can then connect() to it?
Edit:
Is there a way to regex pywinauto to point to a path if I know where MyProgram.msi is? It seems to be in C:\Users\me\AppData\Local\Temp{xxx}\MyProgram.msi as I found several copies there. Thanks!
Add timeout=10 or whatever you need to connect() params. Current default timeout is zero, but it should be timings.Timings.window_find_timeout which is 5 sec by default.
Auto detection of spawned child process is planned for next major release (as well as default timeout fix).
For running an unpacked .msi file you need msiexec standard Windows command in method .start(). Play with it in cmd.exe manually first starting from msiexec /?.
Here is how I deal with the fact that InstallShield exe extracts to an .msi in (into my DownloadedInstallations folder). Yes, timeout is important, but also identifying the new msi window that opens is too. (Also, I found that wait_for_idle had to be FALSE but don't remember why. YMMV :) ).
exe = pywinauto.Application(backend="uia").start(exepath, wait_for_idle=False)
Now it's going to unzip the .exe into .msi installer and that could take a while, and since the .exe window might be named the same as the .msi window must be careful not to attach to the exe window too early and must wait for the .msi window to open!! So, add an appropriate timeout in seconds. The dialog window may not exist yet here, so it's CRITICAL to use class_name of MsiDialogCloseClass especially if the title of the exe and msi are the same. This will identify the .msi window specifically, whenever it arrives.
title = "Enter Title of your App - InstallShield Wizard"
msi = pywinauto.Application(backend="uia").connect(title=title,
class_name="MsiDialogCloseClass",timeout=120)
And for the final touch, in a line I always forget, must use the title again to get the dialog window (for reasons I don't yet understand)
dlg = msi[title]
EXTREMELY HELPFUL way to view all control identifiers at this point is:
print(dlg.print_control_identifiers())
This is what hours of trial and error yielded. To continue on, now you can click buttons, like this:
dlg.Next.wait("ready",timeout=2)
dlg.Next.click()
And to click on radio buttons, this works (there may be other ways that do, but I could never find how to get a handle on the buttons by name)
dlg['I &accept the terms in the License Agreement'].wait('enabled').click()
Then moving on
dlg.Next.click()
dlg.Install.wait("enabled",timeout=5)
dlg.Install.click()

Linux - Eclipse cpp 2019 06 - unhandled event loop exception when opening files

When I install a fresh Eclipse, I can open the program, but when I attempt to create a new blank cpp file or open a file, the program stalls, I get a popup as seen below, and the terminal from which I launched the application looks like the 2nd attached pic. Can anyone help me with this? I'm not sure how to interpret these errors.
Popup:
Terminal:
I solved this myself. In case this comes in useful to anyone else, the answer was found
here
Essentially, before launching eclipse I type:
export GTK_IM_MODULE=ibus
The default value seems to be xim, and apparently is responsible for a number of issues. A small script could be made to automatically do this assignment, and then call eclipse.
This solved my issue.

"Run|Debug" Buttons Not Appearing on Visual Studio Code Java Programs

A couple days ago I tried to initialize Visual Studio Code to be able to code in C++ using online instructions. They ended up not working at all, but I had edited some settings files (such as a .json file) in Visual Studio Code that I thought were all C++ specific. Afterwards, however, I no longer have the convenient "run | debug" buttons appearing above any "main" functions that I make in java files. In the past I used to be able to just click run and my program would run in the terminal at the bottom of the screen, as opposed to manually compiling and running the program using a terminal. I am running Windows 10. Does anyone know of any way to get these buttons back?
This is an example of what the two buttons look like, appearing above any main functions in a java program.
I also found on the Visual Studio Code website a description of how to begin debugging, attached here, that describes that you need Language Support for Java(TM) by Redhat in order to get these two buttons. I have this extension downloaded, but it is still not working. Please help if you recognize this issue!
What worked for me:
Make sure you have Java extensions, Java Debugger and other basic Java packages installed.
Then making sure the main function is formatted properly like below allowed the Run|Debug buttons to be seen.
public static void main(String[] args) {}
First of all, for troubleshooting, actually we need to have a reproduce steps which can understand what happened in your environment. So can you tell us what you have done to your settings first?
Second, there is a setting under common setting tab, that is Java>Debug>Settings>Enable Run Debug Code Lens. Please check whether this option has been unchecked. Although I think it should not be changed by you.

Visual C++ Debugging Error - wuser32.pdb not loaded

I have made a form (GUI) in Visual C++ & while debugging it step by step, I got the following error, which stopped further debugging of the code.
The screenshot of the error is shown below.
How to solve this?
Good chance further debugging is in fact not stopped - seems you tried to step into a system function (implemented in wuser32.dll), and you can't debug this without matching symbols. You can post a screenshot of the stack window at this point to help us verify.
First, try to just continue (F5 or Shift+F11 to step out).
If for some reason you must view at least function names at this location - check the 'microsoft symbol server' at the screen you show. and click load. After a brief download pause, you should be able to see at least a disassembly window, and hopefully a meaningful name for the current stack frame.

Python IDLE GUI not starting

I feel like I have been coming the internet for days with absolutely no result.
I have taken some web programming classes, and would like to learn some python, just because programming is wicked interesting altogether, and have run into a fairly large hurdle given my experience.
the problem is this: Python.exe (or is is more properly pythonw.exe?) v3.3.3, running on windows 8.1 used to launch fine. Typed up a simple program to roll various sided die, worked out well. Then I changed the key bindings for 'Run Module' from 'ctrl+f5' to 'crtl+alt+spacebar.'
As soon as I did this IDLE crashed and so did the shell. Now the process will not run AT ALL. I cannot access it through the desktop icon to go back and revert the settings. I also attempted to look at the .def files and change it from there but could not find the 'run module' command. It looked like all the key bindings in the .def files were for the shell.
When I double click, nothing, when I run as admin, nothing. run from the start menu, nothing. I uninstalled and re-installed, rebooted, everything low tech I can think of. Now i'm out of my element and could use one of you brilliant social programmers!!
I've found information about checking with some tool called 'Windows Process Manager' some stuff about what to do with the CMD prompt (something about a path problem ...it intuitivly sounds like I very well could have created a 'path problem' but I'm not 100% I know what that is exactly).
I'm sorry for the lack of links, the pages were farther back in my browsing history than I expected. Hopefully i'm not asking an instant many down vote question here, most of the resources online are for either an older version of windows, Lunix, or an older version of python (which is actually where the path problem hint came from)
Thanks any and all greatly for any time spend reading/answering.
Immensely appreciated.
Find file HOME/.idlerc/config-keys.cfg, where on Win7 HOME would be 'C:/Users/yourloginname', and delete the key binding or, if there is nothing else in the file or nothing you want to keep, the whole file.
If you were to run Idle from a console with python -m idlelib, you would probably see an error message. (Yes, you were probably running with pythonw, as when using the start menu or icon. This works better in 3.4.2 and I am working or more improvements.)
I do not know the specific reason for your crash. I set Zoom-height to --space, restarted, and it works, no problem.

Resources