[RESOLVED] VB Crashing on Compile
Hello,
Something really strange. My project that I've exported many many times before without issues.
This time however, VB crashes whilst writing the Exe... around 50% of the way...
So all .OBJ's get written, but the final stage, when it joins them it crashes VB....
I don't have any external objects / links / 3rd party controls.
Any ideas?
Re: VB Crashing on Compile
Do you have UserControls?
Re: VB Crashing on Compile
Quote:
Originally Posted by
Eduardo-
Do you have UserControls?
Yes, few custom userControls. But never had any issue previously.
Re: VB Crashing on Compile
Quote:
Originally Posted by
some1uk03
Yes, few custom userControls. But never had any issue previously.
OK. Previously is previously, may be some change, even an small one made the difference.
The issue is that code is executed during compile time.
What I do in such cases is to add code for logging to a file. I would pay attention specially to the code in UserControl_ReadProperties and UserControl_WriteProperties events.
Or, may be some MsgBoxes instead, to try to find the section where the code crashes.
Re: VB Crashing on Compile
Quote:
Originally Posted by
some1uk03
Hello,
My project that I've exported many many times before without issues.
Exported? From <where>? To <where> ?
- different computer, drive or folder ?
If you run the project using CTRL + F5, start without issues?
Re: VB Crashing on Compile
Program runs fine in IDE. No crash. No issues.
I'm referring to when compiling to .EXE. (File>>Make .EXE)
Re: VB Crashing on Compile
Quote:
Originally Posted by
some1uk03
This time however, VB crashes whilst writing the Exe... around 50% of the way...
So all .OBJ's get written, but the final stage, when it joins them it crashes VB....
I had this very same problem a couple of years ago with a big project, and it took me a couple of weeks to find the reason. In the IDE, everything was normal, but then, constantly, this crash during the linking process. A comparison with the last working version showed nothing really suspicious.
Well, one thing was a little bit suspicious, however. Once in a while, when starting the program in the IDE, it complained about "circular dependencies between modules". Restarting the IDE seemed to solve the problem. For a few days, at least.
Since I had no better idea what to do regarding the crash during linking, one day I started cleaning up my declarations. All declarations (Types, Enums, Constants, Declares, Public variables) were spread over dozens of modules at that point; so I moved them all into one single module, in a certain order:
1. Constants
2. Enums
3. Types
4. Declares
5. Public variables.
When I was done with that, the crash was gone.
Not sure if the same applies for your project; but maybe worth checking.
HTH, Wolfgang
Re: VB Crashing on Compile
In the ReadProperties event you must be careful not to execute any code that requires the control to be sited on its Container.
During a compile instances of your UserControl get created but not fully sited.
So you need to "guard" some code with tests for Ambient.UserMode, and other things may need to be deferred until the first time the Show event is raised. It all depends on what you try to do in your ReadProperties handler.
Often the culprit can be things that you do within your Property Let/Set procedures if you invoke these during ReadProperties.
But without seeing your code it is hard to do anything but make guesses.
Re: VB Crashing on Compile
well.... issue resolved....
it seems VB was running out of Memory.
1 Module had waaay to much coding there.
I split it to 2 modules and now all back to normal :)
Re: VB Crashing on Compile
Quote:
Originally Posted by
Wolfgang Enzinger
Once in a while, when starting the program in the IDE, it complained about "circular dependencies between modules". Restarting the IDE seemed to solve the problem. For a few days, at least.
That seems to be a VB bug.
I have a program that when I break the binary compatibility, and then change to project compatibility, I start receiving this error message. I need to close the IDE and reopen it to get rid of the error message.
Re: [RESOLVED] VB Crashing on Compile
Say some1uk03,
Have you tried compiling from the command line? That's the only way I compile my primary project. I just have a batch file I use. You can just type VB6/? from your Program Files (or Program Files (x86)/Microsoft Visual Studio/VB98 path, and it'll tell you all the options.
It seems that if it's a "code running during compile" problem, that should fix it.
Good Luck,
Elroy