-
[RESOLVED] My old EXEs don't work
Hi. My question isn't a coding one. It's about the EXEs I have made with VB5. I had no problem opening them before. However, I recently formatted my pc and I have reinstalled VB5 on it. However, I can't seemed to open the EXEs I have previously made with VB5. These EXEs were different beta versions of my game to see how it was progressing. I actually had to open up my project and recompile the lastest version I was working on and it works fine. However, when I try to open the old EXEs, I get a MSGBOX telling me "unexpected error" and once I click OK, it closes. Anyone ever have this problem?
I have winXP SP2, which I had before.
-
Re: My old EXEs don't work
Most likely there are some references that are not good anymore.
Like some controls that you had a better version, and now that you formated your computer, you have the old version for the control.
Either way... when you make your programs, you should add error handlers in EVERY sub/funtion, with line numbers also. That way, when you get an error (even when it's compiled) you can see precisly where the error is, down to the line number in code. So then you can go back to the code, and see where the problem is.
The error message you got is a standard VB error, that is not descriptive at all, and ends the program right away.
You should use a tool like MZ-Tools to add line numbers to the code, and also Error handlers.
-
Re: My old EXEs don't work
If you were missing a reference or a different version then you would get a "Cant create object" error.
Without knowing what code changed or even seeing the code we can not do anything more then guess.
-
Re: My old EXEs don't work
Do you at least have the vbp for the old exe's? You can look in it to see what references you have then check the registry to find out if they are missing. That's a start.
-
Re: My old EXEs don't work
@RobDog888 - So I'm not missing references?
@CVMichael - I'll have to look into the Mz-Tools addin. So adding line numbers will show up along with the error?
@randem - I don't have the vbp files. I did save the actual previous versions of the form itself. I could remove the current form and add the old form. Would this cause unreversible effects? Could I undo that and add the new form back?
The main thing that has me stumped is that this is a very "basic" program. I use the main controls that come in the TOOLBOX like: btn, cmb, lst, txt, dialog box, lbl, winsock, tabs & timers. I'm only using one custom user control that I added in the last version of my program. I'm not using any classes or anything advanced like that. I'm just using if/then & select case for decision making. I also use the winsock commands to send/receive data. That is the most "advanced" code I use.
It's very frustrating because the people who I sent this program out to can use it but not me!
PS - the only reference that could be a problem is that after I formatted and opened my project for the first time, it said it was missing the comdlg32.ocx (not sure if that one was it specifically) reference. But I did noticed that the dialog control was not in the project. I had to add it. Which is weird because the other controls like winsock & tabs were there and they aren't normally there, you have to add them.
-
Re: My old EXEs don't work
You can also use *******. It very comprehensive in what you can add and it can trace your program also.
How could you add or remove forms without the actual VBP project file?
-
Re: My old EXEs don't work
randem, I have the original vbp file. When you said if I had each vbp file for each version of the program, then I don't have those. I only have one project file. I've saved the different versions of the forms. Cause I added/removed more controls. Now, I do also have the *.frx files, which are the files for the forms. I use vb5. Did the extension change in vb6?
Also, I added a PS to the previous post. Please read, it has some more info on possibly helping me solve this problem.
-
Re: My old EXEs don't work
The only code that has changed in the different versions of the program have been more if/thens & select cases.
-
Re: My old EXEs don't work
It's not your code as was stated it is your references that do not exist anymore. That is why when you recompile VB takes the new references to the objects and uses them and that is why the new exe works. The old references don't exist and can't be used by the old exe.
-
Re: My old EXEs don't work
Ok, I must be slow or something cause I don't understand. Once a program is made into an EXE, doesn't it just require the runtime files to be installed so it can run? Having installed vb5, I have those runtime files installed yet my program doesn't work? I would understand what you were saying about references if no one could use the program. However, I've moved the old EXE to my other pc and it runs fine. That pc doesn't have vb5, just the ocx's for tab, winsock & comdlg32. So what reference are you refering to? Aren't the ocx's & dll's in the SYSTEM32 folder? After installing vb again, that's where those files are still at. So I don't understand why it's not running on my main pc. If those files were missing, wouldn't it say something like: "component "name" not registered: file is missing or invalid" ...?
-
Re: My old EXEs don't work
Old references do not always mean ORIGINAL references/components. Those references could have be updated and are no longer compatible with original references/components.
IE. VB Service Packs...
-
Re: My old EXEs don't work
Well, this is very frustrating. I have vb5, I don't know if any service packs were made for it. However, I personally haven't gone looking for its updates and I believe but I'm not sure that vb5 doesn't go looking for updates by itself. I also don't think windows update does this for vb5 either. Also, if the old components were somehow updated, how come when I put the new EXE in the other pc, which has the old components, it works there as well? :confused: :ehh: :(
-
Re: My old EXEs don't work
Just because you don't remember does mean it didn't happen. You can not like it all you want, the reason will remain the same and constant.
-
Re: My old EXEs don't work
References are not only just controls but also dlls and other COM exposed programs. Why not just post some of your form_load code so we can see what else may be the issue. Also, if you have any references in the Project > References... menu.
-
Re: My old EXEs don't work
The best case would be to just open the old vbp file in notepad and post that.
-
Re: My old EXEs don't work
Here is the code for the LOAD event. It's really basic code. I'm only an amateur programmer. I'm not referencing any dlls or other stuff. I'm just working within my program and the "needed regular controls". The subs being called at the end are just to disable buttons that are not available during the start of the game. The first subs are to load data into a variable array.
VB Code:
Private Sub Form_Load()
'make sure winsock is closed
Winsock.Close
'x is for/loop counter
Dim x As Integer
'set form & tab size
frmMain.Width = 13305
frmMain.Height = 9930
tbTabs.Width = 13215
tbTabs.Height = 9255
'fill instructions in txtInstruct
txtInstruct.Text = "To view a card's description, click the card once. To add a " _
& "card to your deck, click the card and then click the ""plus"" " _
& "button. You could also double click the card. To remove a card " _
& "from your deck, click the card and then click on the ""minus"" " _
& "button. You could also double click the card. To change the order " _
& "of a card in your deck, click the card and then click the red " _
& """up"" or ""down"" button. To save your deck, click ""save"". To open " _
& "your deck, click ""open"". To close a deck, click ""close""."
Call subPopulateRegular
Call subPopulateSpecial
Call subPopulateIntro
'counter to add items to lstRegCards
For x = 100 To 165
lstRegCards.AddItem regCards(x).cardName
Next x
'counter to add items to lstSpcCards
For x = 200 To 219
lstSpcCards.AddItem spcCards(x).cardName
Next x
'counter to add items to lstEnhCards
For x = 300 To 305
lstIntCards.AddItem intCards(x).cardName
Next x
'add #s for MOVE
For x = 1 To 14
cmbSlotAU1.AddItem x
cmbSlotAU2.AddItem x
cmbSlotBU1.AddItem x
cmbSlotBU2.AddItem x
Next x
'disable both buttons in game until a deck is opened
Call subDisableAllButtons("both")
Call subDisableAllOnline
I do not have the old vbp file. I only have the current one. I have continued work on my game so it's not the same. However, the code added is just a bunch of if/thens.
I'm close to just calling it quits for this mystery. I don't really "need" to see the old EXEs. Plus, I can run them on the other pc without any probs. However, the fact that I can run it on a different pc that it wasn't even made on is the part that bugs me.
-
Re: My old EXEs don't work
The ones with the red dots are the standard references. Your app probably would not work at all if there are not checked. Those are the runtime libraries and we know for sure they have constantly changed over time.
Now, one thing I see right off is all of your controls are version 5. Which seems kind of strange that the other controls in your list are not even close to version 5. Check further down in your list to see if you see other such anomalies.
-
Re: My old EXEs don't work
Try running the Universal VB Runtime SP on the computer that doesn't work. I would be curious for the results.
-
Re: My old EXEs don't work
@ randem - unless you weren't being literal, I don't see anything with "universal" on your site. Did you mean the vb5 runtime files? The vb6 runtime files?
I'll scroll through references to see if any others are lower than version 5.
-
Re: My old EXEs don't work
No, actually they are Universal VB Runtime files. They were not all released at the same time and other files that were released at the same time can't be used.
-
Re: My old EXEs don't work
In regards to the references, you are right about the other controls not being close to version 5. Most are version 1. However, if I'm not using them, could it possibly be the problem? :confused:
So I should download the vb5 runtime files?
-
Re: My old EXEs don't work
What I mean about that is those control were obviously updated... Either by you or another app that installed them.
-
Re: My old EXEs don't work
Okay. So do you still want me to download the runtime file? If so, should I just download vb5 runtime?
-
Re: My old EXEs don't work
If you are running VB5 then yes.
-
Re: My old EXEs don't work
But I would almost be certain your issue stems from those updated controls.
-
Re: My old EXEs don't work
Ran the vb runtime files. Tried the old exes. Same error. The references seemed to have stayed the same version numbers.
-
Re: My old EXEs don't work
Yes, That is what I figured Those control were updated and the old exe cannot use them. If you had a BACKUP of your old releases you could verify this by looking in the vbp file.
-
Re: My old EXEs don't work
Ok, found a backup from what I used to get my files back. This is the version of the vbp file before I formatted. Now what do I have to do in the registry?
-
Re: My old EXEs don't work
Nothing. This app uses Winsock Version 1.0 and you currently use Winsock Version 5.0. That is why your old exe's don't work. If you go to the registry on the other computer you will see the version of Winsock that is installed on that machine and I would bet it isn't Version 1.0.
Post what your current vbp file is...
-
Re: My old EXEs don't work
You're theory is sort of proving right. There is only one version of the controls that is not the same and it is just by a .1. I seem to now have an older version of COMDLG32.OCX. In the new one, I have 1.1. In the old one, it's 1.2. This is what I've gotten from the text file. I don't know where in the registry to look for this...
-
Re: My old EXEs don't work
I checked the actual ocx file properties. In the version tab, the pc that doesn't work has version 5.x. The pc that does work has version 6.x.
-
Re: My old EXEs don't work
Now that I think of it, I believe at one point in time I tried to install vb6 but it wouldn't install right. I also did install vb2005 express edition but uninstalled it after seeing that it was a big change from vb5. Does .net use version 6 of that ocx?
So this is the whole root of the problem? Different versions of COMDLG32.OCX? This was the file that was stated in the loading error the first time I opened my project after formatting.
Now my question is, since I guess I have been using version 6 for my old programs and now I'm using version 5, does this mean the people who I sent this program out to with the "old ocx files" will not be able to use it unless they replace that ocx with version 5?
-
Re: My old EXEs don't work
That all depends on what they already have installed. If they have a later version and you are attempting to install an earlier version that version will not get installed (unless you force it) and that would not be a good idea for the client for their other software may require the later version and not work with the earlier one.
-
Re: My old EXEs don't work
I understand what you are saying.
I still want to try one last thing. I'm going to register this new ocx on the pc that doesn't work and see if the program does work. If it does, then I will be 100% satisfied with the file version being the cause of the error. Then I'll update my project to point the to the new comdlg32.ocx control.
I'll post my results soon.
-
Re: My old EXEs don't work
Check the registry on the computers that it does work on and you will see the current version it works with. You can use ********** to look specifically at the shared dlls and the registered components to see whats there.
-
Re: My old EXEs don't work
Well, registering the new ocx didn't make the old exe work. I tried searching the registry on the pc that it does work on for the registry key stated in the vbp file but it didn't find anything. Where exactly in the registry should I be looking?
-
Re: My old EXEs don't work
Use ********** it will take you to the exact location where the data is stored.
View->Registered Components
View->Shared Dll's
-
Re: My old EXEs don't work
I'll run the inno thing when I am less frustrated by this issue and see how it goes. I'm marking this thread resolved since I give up on this for now. Thank you randem and everyone for taking the time to help me out.