|
-
Apr 10th, 2018, 05:22 PM
#1
Thread Starter
Frenzied Member
[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?
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Apr 10th, 2018, 05:45 PM
#2
Re: VB Crashing on Compile
Do you have UserControls?
-
Apr 10th, 2018, 05:57 PM
#3
Thread Starter
Frenzied Member
Re: VB Crashing on Compile
 Originally Posted by Eduardo-
Do you have UserControls?
Yes, few custom userControls. But never had any issue previously.
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Apr 10th, 2018, 06:13 PM
#4
Re: VB Crashing on Compile
 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.
-
Apr 11th, 2018, 04:31 AM
#5
Re: VB Crashing on Compile
 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?
-
Apr 11th, 2018, 07:18 AM
#6
Thread Starter
Frenzied Member
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)
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Apr 11th, 2018, 07:37 AM
#7
Re: VB Crashing on Compile
 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
-
Apr 11th, 2018, 09:52 AM
#8
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.
-
Apr 11th, 2018, 01:21 PM
#9
Thread Starter
Frenzied Member
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
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Apr 11th, 2018, 01:36 PM
#10
Re: VB Crashing on Compile
 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.
-
Apr 11th, 2018, 06:56 PM
#11
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
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|