Results 1 to 23 of 23

Thread: VB6 exe

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    VB6 exe

    What are some possible reasons a VB6 created executable will not run on a machine that does not have VB6 installed?

    Said program only has these references:
    Visual Basic For Applications
    Visual Basic runtime objects and procedures
    Visual Basic objects and procedures
    OLE Automation

  2. #2
    Frenzied Member
    Join Date
    Dec 2014
    Posts
    1,931

    Re: VB6 exe

    some machine will not run without installing Visual Basic 6.0 Runtime (vbrun6)
    they will tell theres a missing DLL.

    but a empty project, should run.
    its some of the components that can cause issues.

  3. #3
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,258

    Re: VB6 exe

    As Baka has said, there is probably a support file missing on the target machine. If you run the Package & Deployment Wizard, it will tell you what is needed. The ones you have listed are usually present on most modern machines. One that I have found missing in the past is the Common Dialog Control.

    J.A. Coutts

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    3,373

    Re: VB6 exe

    The VB6 runtime is included on newer Windows versions, but that could be an issue on older ones.

    If those are the only references (do you have any references in the code that wouldn't appear in the references menu? e.g. APIs, CreateObject, etc), I don't think the problem is a missing dependency. What's the exact error?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    Many APIs used.
    Perhaps a CreateObject (I will have to check later as I am here on my phone)

    2 Forms are supposed to be displayed at startup.
    1st form displays as it should,
    a MsgBox correctly appears stating "Windows 10",
    then app "quitely" shuts down without reporting error, or without displaying 2nd form.

  6. #6
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    2,018

    Re: VB6 exe

    If the first form is displayed, and it displays a MsgBox, then it obviously runs, which contradicts your original post.

    What you apparently meant to ask is, what could be the reasons that a VB6 program begins to run on a machine without VB6 installed, and then unexpectedly terminates on its own? And, of course, there are an abundance of potential reasons, very few of which involve VB6 being or not being installed on said machine, and the vast majority of which involve what your code is doing when the program terminates. If you don't know what line of code is running when the program terminates, then you'll have to do something along the lines of adding some sort of debugging code to your program that generates a log file as it runs, writes information about what code is being executed, and see where that log file ends, and that should indicate where in your program the termination is happening.

    Good luck.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    I am currently doing exactly that; implementing a log file to try and find exactly where the program crashes.

    I created risk thread, to find out if there were other reasons that might cause this (on machines without VB)

  8. #8
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    2,018

    Re: VB6 exe

    Quote Originally Posted by mms_ View Post
    I am currently doing exactly that; implementing a log file to try and find exactly where the program crashes.

    I created risk thread, to find out if there were other reasons that might cause this (on machines without VB)
    Then you should have probably been much more clear and detailed in your original post as far as what the exact behavior is, and what you are already doing to try to track down the problem. Hope you get it sorted.

    Good luck.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    Does comctl32.dll ship with Windows?

    I call this, and cannot find anything stating this does or does not ship with Windows.
    If it does not, maybe that is my problem.

  10. #10
    Addicted Member
    Join Date
    Jul 2017
    Location
    Exeter, UK
    Posts
    171

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    So it does ship with Windows.
    Thanks.

    I could not find it listed on VB6 support page as shipping or not shipping.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    So I tried something else.

    I ran Package & Deployment Wizard on my development machine,
    and these files are contained in SETUP.LST file
    Code:
    [Bootstrap Files]
    File1=@VB6STKIT.DLL,$(WinSysPathSysFile),,,7/15/00 12:00:00 AM,101888,6.0.84.50
    File2=@COMCAT.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,5/31/98 12:00:00 AM,22288,4.71.1460.1
    File3=@STDOLE2.TLB,$(WinSysPathSysFile),$(TLBRegister),,6/3/99 12:00:00 AM,17920,2.40.4275.1
    File4=@ASYCFILT.DLL,$(WinSysPathSysFile),,,3/8/99 12:00:00 AM,147728,2.40.4275.1
    File5=@OLEPRO32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,3/8/99 12:00:00 AM,164112,5.0.4275.1
    File6=@OLEAUT32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,4/12/00 12:00:00 AM,598288,2.40.4275.1
    File7=@msvbvm60.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,10/22/21 10:08:35 AM,1436032,6.0.98.48
    
    [Setup1 Files]
    File1=@SHCore.dll,$(WinSysPath),,$(Shared),4/22/22 9:21:26 AM,545984,6.2.19041.1645
    File2=@GdiPlus.dll,$(WinSysPath),,$(Shared),4/30/22 3:23:30 PM,1449984,6.2.19041.1706
    File3=@comctl32.dll,$(WinSysPath),,$(Shared),10/5/21 8:22:36 PM,568144,5.82.19041.1110
    File4=@Project1.exe,$(AppPath),,,7/2/22 9:49:48 AM,13041664,1.0.0.0
    The first 7 files all list on VB6 Support Statement as supported and shipping with Windows.
    The next 3 files I assume all ship with Windows.
    The last 1 file Project1.exe is my executable.

    So am I correct in assuming Project1.exe (on it's own) should run on any Windows machine,
    regardless if Visual Basic 6.0 is installed or not?

  13. #13
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    2,018

    Re: VB6 exe

    It should run on any quasi-modern Windows OS, some crazy old OS's like Windows NT 4.0 or Windows 98 didn't include the VB6 required dll files out of the box.

    That being said, if you still suspect that the root cause of the issue is tied to one or more files missing, you could use something like Process Monitor, have it capture all events while your program is running, stop capturing events once the problem takes place, and then make use of filtering to only show events stemming from your .exe file, where the result is not Success, and examine any events shown for what look like attempts to access a .dll/.ocx/etc file that couldn't be found.

    Good luck.

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    OK thanks.
    I've tried on two different non-VB installed Windows10 laptops.
    Both fail to open the 2nd Form.

    I've created my own event logger to try, but won't have access to these laptops until the weekend.

    Where can I find this Process Monitor?
    nevermind... found it (Process Monitor)

    That being said, if you still suspect that the root cause of the issue is tied to one or more files missing...
    I really have no idea at all as to root cause... just trying different things I can think of.
    Last edited by mms_; Jul 4th, 2022 at 01:16 PM.

  15. #15
    Frenzied Member
    Join Date
    Nov 2017
    Posts
    2,018

    Re: VB6 exe

    You would be much more likely to get help if you were to post code from your 2nd form or at least a specific description of what that form is doing.

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    Ya, still no luck for me on this...
    I will try to pare down form load code and post here for help in solving this.
    (this might take awhile)

  17. #17
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,248

    Re: VB6 exe

    These are routines I use in all my applications
    https://www.vbforums.com/showthread....=1#post5204355

    And then in the form load/initialize you can add a debuglog statement before each code line

  18. #18

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    OK thanks.

    In a subclassed project, does the err information display correctly in the log file?

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    So I made a minimal project to reproduce the CRASH bug on non-VB machines.
    I created and used a RuntimeLog.txt file to help narrow down where/why crashing on non-VB machines.

    I determined the cause of crash and it was simply a MsgBox call in my CreateMenuBarForm1 sub.
    So all is good ... almost.

    If I run the project on a VB-installed machine,
    2 MsgBox's first appear, a Splash Screen will display for 5 seconds, another MsgBox displays, and finally Form3 displays atop a Maximized Form1

    If I run the exe version of this project on a non-VB machine,
    the MsgBox's and Splash Screen appear behind any open Window (should be on top),
    and the Splash Screen window appears the correct size, but the bitmap that is displayed, is cut off.

    Is someone able to see what the problem might be in the attached project?
    I spent the weekend trying to determine the problem, and cannot.
    The code is only 14 KB
    Attached Files Attached Files
    Last edited by mms_; Jul 12th, 2022 at 07:02 AM.

  20. #20
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,258

    Re: VB6 exe

    To speed up applications, MS long ago modified VB to postpone form display until after the form load process was complete. A MsgBox halts program execution until the user responds to the MsgBox. As such MsgBoxs should be avoided in any form load routine, as the timimg will be different between running in the IDE and running an executable.

    J.A. Coutts

  21. #21

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    I see there have been a number of downloads of the attached test project.

    Does anyone else experience the "cropped" Splash Screen bitmap?

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    So, still haven't solved my problem but I've learned 2 things.

    1.
    If I add the bitmap to Form0 (the Splash Screen) at design time, the bitmap is not "cropped" and displays properly,
    but it is not sized the same size as Form0
    The bitmap is 431 x 331 pixels, and in Form0's Load Event I do:
    Me.Width = Screen.TwipsPerPixelX * 431 'must match bmp EXACTLY or white artifact shows
    Me.Height = Screen.TwipsPerPixelY * 331 'must match bmp EXACTLY or white artifact shows


    2.
    If I don't set my app as being DPI Aware via
    bAware = SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE)
    all is good with my Splash Screen and bitmap,
    except that Form0 size is 646 x 496 pixels which is 50% larger than the 431 x 331 pixels I set it to.
    Last edited by mms_; Jul 16th, 2022 at 10:28 PM.

  23. #23

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2018
    Posts
    474

    Re: VB6 exe

    .and last night I noticed

    3.
    The "cropped" bitmap issue only happens on a non-VB laptop with a 1920x1080 res screen and a recommended Scale setting of 150%
    I tested on non-VB laptop with a 1920x1080 res screen and a recommended Scale setting of 125% and bitmap splash screen is OK

    Could this perhaps be a clue as to what the problem is?
    Last edited by mms_; Jul 18th, 2022 at 07:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width