dcsimg
Results 1 to 11 of 11

Thread: [RESOLVED] VB Crashing on Compile

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,503

    Resolved [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.



  2. #2
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,963

    Re: VB Crashing on Compile

    Do you have UserControls?

  3. #3

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,503

    Re: VB Crashing on Compile

    Quote Originally Posted by Eduardo- View Post
    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.



  4. #4
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,963

    Re: VB Crashing on Compile

    Quote Originally Posted by some1uk03 View Post
    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.

  5. #5
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,678

    Re: VB Crashing on Compile

    Quote Originally Posted by some1uk03 View Post
    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?

  6. #6

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,503

    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.



  7. #7
    Addicted Member
    Join Date
    Apr 2014
    Location
    Munich, Germany
    Posts
    129

    Re: VB Crashing on Compile

    Quote Originally Posted by some1uk03 View Post
    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

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,798

    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.

  9. #9

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,503

    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.



  10. #10
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,963

    Re: VB Crashing on Compile

    Quote Originally Posted by Wolfgang Enzinger View Post
    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.

  11. #11
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,947

    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. 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
  •  



Featured


Click Here to Expand Forum to Full Width