VB6 application causes install to show up - vb6

I got a weird problem with my VB app that has got me very confused. I am updating an existing program. I had to add some processing queue capabilities. On my system, unit testing worked great but when I compile it and run it on a different computer (a network server machine) it first tries to open an office install. If I cancel this, the program seems to run fine. The problem is that this program will be run in the background and I can't be hitting cancel each time it runs.
So my question is this: what is going on here? I'm usually a java developer we eclipse so I'm used to being able to include all the needed libs into the jar files automatically. It doesn't seem like the case with VB6. it seems like it expects all the same libs to be on all the systems. Is there any way to tell what might be triggering this?
The only thing I can think of that is causing it is that I'm using the "OpenProcess" function in the kernal32 lib. that the only major change I have made.
any help would be very appricated. thanks!
EDIT:
It seems that multiple versions of word were installed on the system and it was screwing things up somehow. We uninstalled one and it fixed it.

I ran into this a while ago and it was related to my installer for the VB6 app overwriting some system files for Office that it shouldn't have. Any time one of the System dlls was accessed Windows would determine that something was wrong and the Office installer would start up.
The short-term fix was to let the Office Installer repair the broken chain of dlls.
The long-term fix was to never overwrite built-in Windows System dlls.
You could also check out the Microsoft Fix it Center.

Related

How do I create an installer exe with system ocx and dlls for a VB6 exe?

This question may seem really dumb, my apologies for having very minimal programming experience. We just need to make an inventory system exe given to us run and "work" on some computers.
The exe file itself is an inventory system made using Visual Basic 6. It runs fine on computers that have visual basic 6 installed.
However, on computers without VB6, we encounter crashes. The exe's themselves run fine but as soon as we perform something (logging in/clicking buttons/etc.), we get runtime errors 339. On one machine it says, "Component 'MSCOMCT2.OCX' or one of its dependencies not correctly registered: a file is missing or invalid. on another machine, we have a similar error but points to MSFLXGRD.OCX
I figured these problems may be caused by missing system files/dependencies and we need to first install those. How do I make an installer wizard (similar to those Windows app installers that installs system files alongside the actual app) for installing these missing dependencies?
You could do a lot worse than the free Inno Setup. I've used it for many VB6 projects and it's never failed me. There's a learning curve but it's a very flexible package.
I used to use (and contributed to) the WiX toolkit for this purpose.
This will build a standard .msi installer for you. Start with the heat program which will inspect your software and generate much of the WiX project for you, be sure to use the -svb6 option.
You will need to source the appropriate merge modules for VB6 as well, which will provide the components you are missing.

VC++ app fails to start — but there's no error

I made a minor change to a legacy Visual C++ / MFC app built with VS 2008. I changed some UI resources in the .rc file and compiled without any problems, then deployed it on my client's system. However, the program which was previously doing fine now fails to run on exactly one of their servers. It works fine on my laptop and on their other servers, many of whom are basically identical to the one having the trouble.
The weird thing however is that there is absolutely no error message whatsoever. No message box, no errorlevel set (when run on command prompt), no Dr. Watson entry, no nothing.
It's an MFC app that does not really comprise anything very special. It does link in some external libraries – e.g., some old version of the Xerces C++ XML parser. But this is probably not too relevant, right?
The program has a class derived from CWinApp, and I tried to add some logging in its constructor. Based on this, it looks like not even this constructor is reached.
The server in question is running Windows Server 2003 Standard Edition Service Pack 2, and we are trying to run the program in a Remote Desktop session. (Because of the client's environment, I cannot easily test in a console session right now.)
I reverted my changes from version control, which did not help – but I do not know if I had built myself the previously installed version (which ran just fine even on this server) or if it had been built by someone else.
Have also tried to reinstall the Visual C++ runtime libraries and of course reboot Windows, but neither helped. Now I'm really running out of ideas... Any clues on what I could try or check?
Probably some error occurs but is surpressed e.g. empty catch() statement or similar.
You could try and install Debugging tools for Windows WinDbg to see if you could get more info when trying to run it. Since the download is rather small 25Mb maybe it is possible to install it on your client's PC.
But first check the eventview log for your app, maybe there is something in there that can shed some light.

VB6 crashes after build

Visual Basic 6 is crashing after a new build of my program. Whenever I Start (F5 or Ctrl-F5) my program after making changes to the code, VB6 crashes with the following message:
An unhandled win32 exception occured in VB6.EXE [XXXX].
I can't make any pattern out of XXXX. It's been 5168, 5012, 1488, etc; it changes every crash.
The JIT debugger then offers to let me debug VB6 in VS2010 (which shows nothing but a bunch of disassembly.) If I say no, VB6 shuts down. I can then open and Start my program immediately, and it runs just fine; my changes from before the crash were saved. Alternatively, I can make changes, save them, exit VB6, restart VB6, then run them without a problem. But it seems like as soon as I make any changes, a "crash" flag is set, and if I try and build it before restarting VB6, it simply dies.
I'm only having this problem with specific projects. Most projects work completely normally. It's just this one, and it's branch, that both act in the same manner.
Does anyone have any clue what's going on? Obviously, saving works. And building works. And running works. They just don't seem to work together.
I reinstalled VB6 to no avail.
I ended up on this page after installing VS2010, and just one of many VB6 project wouldn't compile.
Simply go to Project Properties / Compile tab, and uncheck "Create Symbolic Debug Info".
Hope it works for you.
Try to open vb6 project with compability mode as XP. We had some issues related to "make exe" command. Then I started to run VB6.exe with XP compability mode.
Since you're asking for any clues, possible clues may include:
The surprises VB6 experiences when run on Vista/7. Try running elevated/remove elevation.
Same, but applied to a third party ActiveX control you're using.
Not having the Service Pack 6 installed. Install it.
Subclassing issues. Make sure your subclassing, if any, is actually correct.
Whatever problems you'll never figure out. Try reinstalling.
Reinstall VB6, delete the workspace files and then create a new project adding in all your current code files. Then go out and get a job where they use a modern SDK :)

SDL.Net application not working without SDL.NET SDK

I have a game that I have made in C# and it installs and runs as expected under Windows XP. However when I install it on a Windows 7 machine, then it either simply doesn't work (without any error message) or it gives a generic error message. Is there anything special that I have to do in order to be able to use SDL.Net with a Windows 7 computer?
UPDATE: I have just been informed that it doesn't even work on XP. Both XP machines I tried it on had SDL.NET installed (I didn't know that one of them already had it when I used it for testing). So pretty much if SDL.NET SDK is not installed on a computer my program doesn't work. Does anyone have some insight into what exactly needs to accompany my program from SDL in order to make it work properly? right now I have all the base SDL_*.dll and SdlDotNet.dll and Tao.Sdl.dll. More needed? Or is there some kind of SDL runtime that I have to install with my program in order to use it? I am really stuck with this one.
Have you tried running it as admin? I don't mean happening to be logged in as an admin account, I mean right click the exe and Run As Administrator? If you do that and don't get the error, then your problem will be quite easily solved, without requiring it to always Run As Admin.
Added every Dll including those that weren't explicitly needed and it now works. Apparently there are some hidden links between dll's that I didn't know about.

Compiling the software problem

Using VB6
i created a software in vb6 with xp operating system, In my system, software is working perfectly. When i run my software in other system(xp operating system), it showing error as cannot find project or library, showing error in Date, Left...,
Now i moved to vista operating system, i try to run my software, It showing the same error.
How to solve this issue.
My software is running in my system, when i try to run my software other system it showing error and also i try to run my software in vista also it showing a same error.
What happen in my code. There is any system32 file problem?
How to solve this issue.
Sounds like you need to create an installation for your VB6 project, to install the VB6 runtime and any non-standard components used. The runtime should be present by default on Vista, so it's probably non-standard components that are missing.
Consult the answers to your own previous question in August, when you asked how to make an installation for a VB6 program. (Even that August question was already a duplicate.)
You need to also copy the controls, and referenced files to the machine running your code. Some controls and referenced files will already be on the machine, but without experience you generally will not know which files are already installed. You can look at the checked files in the Project|References and Projects|Components dialogs to see what is included in your project. You will need to scroll through the components dialog to find all referenced files, but in the references dialog all the references are organized at the top. Also, to confirm what file(s) a machine is missing you can look at the Events log. An error with the missing file will be logged. A drawback of this approach is that you will only get one missing file at a time as the Application quits on the first missing reference encountered.
Also MarkJ and Konamiman are both correct in that the VB6 runtimes are required, although it is common for other VB6 programs to have already installed it. If you are not building in-house applications you do not want to take anything granted and should build a complete install for your application.
The other computers must have the VB6 runtime in order to run applications generated with VB6. Maybe is this the problem?
The VB6 runtime can be donwloaded from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=bf9a24f9-b5c5-48f4-8edd-cdf2d29a79d5&displaylang=en
Use the Package and Deployment Wizard to create a setup.exe. The Wizard will automatically include all the files you might need for distribution.

Resources