Board index » Visual Studio » VB6 crashes after writing exe

VB6 crashes after writing exe

Visual Studio31
I have a VB6 application carefully tested in the IDE and often compiled

while expanding the source code step by step. Now VB crashes after compiling

and writing the exe file.



I know, of course, that nobody can tell me why. But maybe someone could give

me a hint what could be the reason for it?



It might not be a simple code error: I have tested over and over during code

expanding, and the crash happens at compile and not at run time. I'm using

Options Explicit, no subclassing, only some carefully checked and often

tested API calls.



Thnaks for each idea.


-
 

Re:VB6 crashes after writing exe

Do you get error like "instruction at 0x16168259 referenced memory at

0x106168259. The memory could not be read... Click OK to terminate or Cancel

to debug... something like that.... I have been having this problem for a

while now. I did everything from upgrading from VB SP5 to 6, uninstalling

and reinstalling Visual Studio 6 and service packs... Reformating and

reinstalling everything in my system. The problem persisted. The wierd part

is I have been compiling this project on the same system for over 3 years.

Finally, I transfered the IDE to another system and it compiled OK. The

system that compiled has about 512 MB Ram while the system that kept

crashing has about 256 mb shared RAM. I too would like know what is causing

this. My (un)expert guess (in my case) might be something to do with the

RAM.







"Bruno Köller" <mydevicenull@onlinehome.de>wrote in message

Quote
I have a VB6 application carefully tested in the IDE and often compiled

while expanding the source code step by step. Now VB crashes after

compiling

and writing the exe file.



I know, of course, that nobody can tell me why. But maybe someone could

give

me a hint what could be the reason for it?



It might not be a simple code error: I have tested over and over during

code

expanding, and the crash happens at compile and not at run time. I'm using

Options Explicit, no subclassing, only some carefully checked and often

tested API calls.



Thnaks for each idea.









-

Re:VB6 crashes after writing exe

I have had the similar experience. I do not know however the exact reason

why this phenomenon apppears. In my case it always went away after some

time. I assume this is due to code that runs OK in the IDE but causes the

VB.exe to crash after compiling and writing the exe.



Code that for some reason has a flaw that the compiler can not digest. The

best example I know of is using the END statement in a UNLOAD event,

assigning improper values to a variable or OCX property (a SINGLE to a LONG

or an INTEGER to a LONG) or the different behaviour of events in the IDE and

the exe file (especially interdependent LOSTFOCUS and GOTFOCUS events). The

best thing to do is look careful at Your code and see where it could be

improved or optimized. Change it and see if the crashing disappears.



Furthermore it is a good pratice to have a history af backups, so You can go

back to the point where the crashing did not appear.



Yours friendly,



Hans Heezemans/Iservi

www.iservi.com





"Bruno Köller" <mydevicenull@onlinehome.de>schreef in bericht

Quote
I have a VB6 application carefully tested in the IDE and often compiled

while expanding the source code step by step. Now VB crashes after

compiling and writing the exe file.



I know, of course, that nobody can tell me why. But maybe someone could

give me a hint what could be the reason for it?



It might not be a simple code error: I have tested over and over during

code expanding, and the crash happens at compile and not at run time. I'm

using Options Explicit, no subclassing, only some carefully checked and

often tested API calls.



Thnaks for each idea.







-

Re:VB6 crashes after writing exe



Another guess:



It could be that something is amiss with your development environment.



Do you have another PC with VB6 on it that you can use to test this?



Does this happen with just one project?



If you you want to debug the code, make a backup of your project and

start removing code util either you run out of code or the error no

longer

happens. If the project contains many forms, try removing form by form

first.





When it no longer crashes, make another copy of your original project

and remove just the code/form that you removed last from the first test

(backup) project. Does the crash still happen? If it does not, then you

have isolated the problem. If it is a form that you removed, now you

have

to start removing code within that form to determine what code is

causing

the problem.



If you find that the problem is being caused by "code" outside your own

code, then that is another issue altogether.



Good luck!

Saga







"Bruno Köller" <mydevicenull@onlinehome.de>wrote in message

Quote
I have a VB6 application carefully tested in the IDE and often compiled

while expanding the source code step by step. Now VB crashes after

compiling and writing the exe file.



I know, of course, that nobody can tell me why. But maybe someone

could give me a hint what could be the reason for it?



It might not be a simple code error: I have tested over and over

during code expanding, and the crash happens at compile and not at run

time. I'm using Options Explicit, no subclassing, only some carefully

checked and often tested API calls.



Thnaks for each idea.







-

Re:VB6 crashes after writing exe

On Fri, 17 Jun 2005 19:17:17 +0200, "Bruno Köller"

<mydevicenull@onlinehome.de>wrote:



Quote
I have a VB6 application carefully tested in the IDE and often compiled

while expanding the source code step by step. Now VB crashes after compiling

and writing the exe file.



I know, of course, that nobody can tell me why. But maybe someone could give

me a hint what could be the reason for it?



It might not be a simple code error: I have tested over and over during code

expanding, and the crash happens at compile and not at run time. I'm using

Options Explicit, no subclassing, only some carefully checked and often

tested API calls.



I've experienced similar problems in the past.



Not very often - but they can be disconcerting.



Generally I've found that shunting the code round in a Class/Module

gets things working, IIRC moving code out of a Class_Initialize into a

separate procedure sorted out one mystery.



Also try compiling to PCode



One other thing, after a failure, shut down and restart the machine.



I know this sounds ridiculous, but I suspect that VB still suffers

from a few 64k problems.

-

Re:VB6 crashes after writing exe

Well, now I succeeded.



The strange thing is that restoring an old image of my C: partition didn't

help - the image was made at a time where all worked fine. This makes one

believe that the code changes since image backup would cause the error, and

not some changes in registry or dlls or so.



The good thing is that after deinstalling VS6 and reinstalling VS6 it

worked, with the same code. This would mean that the growing code isn't the

reason but propably changements in registry or dll versions.



As far as I see these two results contradict themselves. Strange world that.



Nevertheless, thanks for all answers.

Bruno





-

Re:VB6 crashes after writing exe



"Bruno Köller" <mydevicenull@onlinehome.de>wrote in message

Quote
Well, now I succeeded.



The strange thing is that restoring an old image of my C: partition didn't

help - the image was made at a time where all worked fine. This makes one

believe that the code changes since image backup would cause the error,

and

not some changes in registry or dlls or so.



The good thing is that after deinstalling VS6 and reinstalling VS6 it

worked, with the same code. This would mean that the growing code isn't

the

reason but propably changements in registry or dll versions.



As far as I see these two results contradict themselves. Strange world

that.



Nevertheless, thanks for all answers.

Bruno





Curiousity makes me ask.



You restored the C partition. Is that the only partition you have?, No D, E

etc?



Galen





-

Re:VB6 crashes after writing exe



Quote
You restored the C partition. Is that the only partition you have?, No D,

E

etc?



C: is the only system partition.



There are more partitions for user data but C: is the only partition where

programs are installed. So I can easily crash my system (although Windows is

so friendly to do this for me from time to time :-)) and restore a running

status.



The only significant difference between my C:'s crashing status and my C:'s

restored image is my network connection (and maybe some small differences in

reinstalling some VS options, there might by not all options reinstalled

which have been installed the first time).

Although the development PC is generally used as stand alone it has a

network connection to a second backup PC, but this connection is physically

separated and only in rare circumstances activated (cable plugged in into a

switch) for file transfers. This backup PC has a similar rare used

connection to an internet PC (and when I say rare I do mean so). Internet PC

and development PC have different OS versions, and had been assigned fix IP

numbers. These fix IPO numbers have been changed short time ago to

dynamically assigned IP numbers - I don't know if compiling did succeed or

not after this - by using the network assistant's installation disk. I

didn't check till now what this disk exactly does, but possibly it could

overwrite dlls or registry entires - but why on heaven should VB6 need to

create a internet connection after successfully creating an exe and writing

it out to disk and then crash down, and if that, why should they let allow

VB to crash without meaningful information instead of notifying the user?



This is the only explanation I could serve with, but I don't believe that

this is the true reason for the crash.





-

Re:VB6 crashes after writing exe



"Bruno Köller" <mydevicenull@onlinehome.de>wrote in message

Quote


>You restored the C partition. Is that the only partition you have?, No

D,

>E

>etc?



C: is the only system partition.



There are more partitions for user data but C: is the only partition where

programs are installed. So I can easily crash my system (although Windows

is

so friendly to do this for me from time to time :-)) and restore a running

status.



The only significant difference between my C:'s crashing status and my

C:'s

restored image is my network connection (and maybe some small differences

in

reinstalling some VS options, there might by not all options reinstalled

which have been installed the first time).

Although the development PC is generally used as stand alone it has a

network connection to a second backup PC, but this connection is

physically

separated and only in rare circumstances activated (cable plugged in into

a

switch) for file transfers. This backup PC has a similar rare used

connection to an internet PC (and when I say rare I do mean so). Internet

PC

and development PC have different OS versions, and had been assigned fix

IP

numbers. These fix IPO numbers have been changed short time ago to

dynamically assigned IP numbers - I don't know if compiling did succeed or

not after this - by using the network assistant's installation disk. I

didn't check till now what this disk exactly does, but possibly it could

overwrite dlls or registry entires - but why on heaven should VB6 need to

create a internet connection after successfully creating an exe and

writing

it out to disk and then crash down, and if that, why should they let allow

VB to crash without meaningful information instead of notifying the user?



This is the only explanation I could serve with, but I don't believe that

this is the true reason for the crash.





Can't answer about your problem but it has been my experience to never

install anything in the C: partition. I do install programs on C: if they

are related to the computer itself. Sound, Graphics cards, etc.



Since a little bit of every program ends up on C:, it needs defragmenting

more often than any other partition. If all your programs go on C:, then

everything you do creates more confusion.



Personal opinion

Galen





-