Results 1 to 24 of 24

Thread: Problems with IDE and W10

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Problems with IDE and W10

    Hello!

    In a VB6 program several API's are in use. The IDE for this is on a W10 system. Until exactly February 4, 2020 this was no problem, since February 5, 2020 the IDE can be used, but not to execute the program (F5). Then the IDE is closed without any message. If an .exe is created from the code, it runs without any problems on the exactly identical machine.

    Then we have packed the whole thing on an old XP environment - wonderful, everything works as desired.

    So the suspicion arises that this has something to do with 32/64-bit. And after some trial and error, it was clear that the application would drop out at an API. So far so bad - because up to the date mentioned the application worked perfectly in the IDE.

    And now the question if anyone has an idea what this could be?!?

    Thanks in advance!
    Ralf

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Problems with IDE and W10

    32/64 bit shouldn't be a problem since VB runs in a 32 bit process, even on 64 bit machines. There really isn't a lot of information to go on from your description though.

    Many IDE issues can be resolved by always running the IDE elevated, specifically "As Administrator". If all else fails, reinstalling VB may be an option since that is a relatively fast and easy process.

    If you believe the problem is related to an API, you can place logging code before and after each of the API calls to try to narrow down which may be causing the crash. If that seems to pinpoint an API, then you can post the API declaration and the line of code that caused the crash. We can take a look-see.

    Welcome to the forums
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    First of all: thanks!

    Quote Originally Posted by LaVolpe View Post
    "As Administrator"
    - I tried - but nothing changed

    Quote Originally Posted by LaVolpe View Post
    "reinstalling VB may be an option since that is a relatively fast and easy process."
    - fast and easy?!? Here I held a two side "story" to install VB6 at W10. Have I missed something? Can you give me a quick and easy guide?!?

    Thanks!

  4. #4
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Problems with IDE and W10

    I dont believe its the IDE but the API u are using.
    I know that I have issues sometimes with API, that could work and suddenly not work.
    the reason could be complex, maybe something before the API calls would cause a crash.

    the suggestion LaVolpe posted is the correct way to narrow down the issue.
    I usually do:
    I put a
    Code:
    msgbox "HELLO"
    at the beginning of the code, and if I can read "hello" it means, so far so good. from there I move the msgbox to another location further in the program, until theres no "HELLO" message showed and I know the crash happened before, this I do until I found the "line" that made the crash. after that I look into it and I try to figure out why it crashed. usually I see the problem, a human error. a misplaced variable, a global variable I used for something else.
    if an windows API got updated, and maybe in a way its more sensible, it means u need to check that API and compare to the API declaration in docs.microsoft.com and make changes.
    could be a simple thing a "byval" or "integer > long" or something else.

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    Thanks a lot - but that's all tried and tested. We know exactly where the IDE gets out. But this can't be because of the call, because the exe runs without problems...

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Problems with IDE and W10

    Why don't you share the call to the API and the API declaration?

    Can you replicate the problem with a trimmed down test project?

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Problems with IDE and W10

    Quote Originally Posted by RalfD View Post
    Thanks a lot - but that's all tried and tested. We know exactly where the IDE gets out. But this can't be because of the call, because the exe runs without problems...
    That's not as definitive as you might hope for. The IDE does run the code, but not always the way that the exe would run the code. Certain things, including breakpoints, can cause execution in the IDE to take different paths from what it would take in the exe.
    My usual boring signature: Nothing

  8. #8
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Problems with IDE and W10

    exactly. I remember one time that it was the reverse, it worked on IDE but after compiling, I got a crash.
    I also know that in windows 10 I can avoid crashes for some "situations" that would crash to oblivion in windows 7.

    show the API declaration and the lines where this API is used and that caused the crash.
    maybe someone of us knows about this API and do have experience with it.
    if not, maybe we can help to change the API to something else. remember theres a lot of experts here that knows a lot.

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    So - I did it with some boxes and at

    lngThread = API_GetCurrentThreadId()

    declared as

    Dim lngThread As Long (within the Function)

    Private Declare Function API_GetCurrentThreadId Lib "kernel32" Alias _
    "GetCurrentThreadId" () As Long

    the application chrashes...

  10. #10
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Problems with IDE and W10

    Is this the first API call executed in the IDE that is trashing it? Could it be that OS decided to shim the vb6.exe when it misbehaved for it’s own compatibility reasons? Other might chime in how to check, add and/or remove these on any executable.

  11. #11
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Problems with IDE and W10

    are you really sure this is the API that crashed it?
    its a very simple API that should not crash at all.
    what about

    Code:
    Msgbox "Before"
    lngThread = API_GetCurrentThreadId()
    Msgbox "After"
    if u only see "Before", u know 100% its that line that crashed it.

    and why are you using this API, when u can get the same result using: App.ThreadID

  12. #12

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    I'm not sure - I'm more then sure - because I did it in that way...

    And: I try using "App.ThreadID" now...

  13. #13
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Problems with IDE and W10

    Quote Originally Posted by RalfD View Post
    ...
    Private Declare Function API_GetCurrentThreadId Lib "kernel32" Alias _
    "GetCurrentThreadId" () As Long

    the application chrashes...
    What happens if you you declare it like one of these two:
    Code:
    Private Declare Function APIGetCurrentThreadId Lib "kernel32" Alias "GetCurrentThreadId" () As Long
    Private Declare Function API_GetCurrentThreadId Lib "kernel32.dll" Alias "GetCurrentThreadId" () As Long
    Like others, I find it very unlikely the API is the culprit. I believe VB recommends not to name functions using underscores (but don't recall where I read that); not saying that alone can cause a problem. Also, if the "dll" library extension is not used, I don't recall if VB automatically assumes "dll". If that API is causing the problem, it sounds as if VB is not recognizing it as kernel32.dll or is having problems aliasing it. Kernel32.dll is loaded in the process of every IDE instance.

    You aren't running some kind of crazy IDE add-in that may be hooking/injecting kernel32.dll are you?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #14

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    All add-in's are unloaded - restart - same problem

    Underscore - no problem when making an exe; the runs properly - and: with XP there is no problem

    kernel32.dll - thats - I guest is the reason - but I do not understand why the exe runs; the same API, the same Call, the same parameters...

  15. #15
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Problems with IDE and W10

    Quote Originally Posted by RalfD View Post
    ...
    kernel32.dll - thats - I guest is the reason - but I do not understand why the exe runs; the same API, the same Call, the same parameters...
    So, including the ".dll" in the declaration fixed the crashing?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  16. #16

  17. #17

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    writing the extension ".dll" has changed nothing

    Microsoft Visual Basic 6.0 (SP6)
    Version 9782, VBA: Retail 6.0.9782, Forms3: 16.0.12228.20

  18. #18
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Problems with IDE and W10

    now u say ".dll" changed nothing. did u make it work or not?
    also, did u try using App.ThreadID?

  19. #19

  20. #20

    Thread Starter
    New Member
    Join Date
    Oct 2020
    Posts
    8

    Re: Problems with IDE and W10

    .dll - of course trying wether it works or not - within IDE no, within exe yes

    I have setup a "white" laptop with W10 and then VB6 & SP6 - the same result...

  21. #21
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Problems with IDE and W10

    I dont want to repeat myself, did u try App.ThreadID?

    also, if u made a new installation and u get the same result it most be something else, that API itself is harmless, but together with something else it could be devastating.
    did u do any memory hacking somewhere else? do u use hooking or similar?

    did u try to make a small project, add just that function and see if its working?
    sometimes the problem is elsewhere and not where you think it is.

  22. #22
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Problems with IDE and W10

    The ".dll" is assumed unless an override has been provided. These aren't the droids you're looking for.

  23. #23
    New Member
    Join Date
    Sep 2020
    Posts
    4

    Re: Problems with IDE and W10

    vb6 ide freezes and closes since Win10 20H2 Windows Feature Experience Pack 120.2212.551.0 - turning off virus real-time protection makes no difference - something else seems to be actively blocking vb6 calling dll's or api's since last update

  24. #24
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Problems with IDE and W10

    Do what I do, and do all of your development on a PC running an older version of windows (one where MS is not stuffing around with W10 updates).
    I use XP, but I have another PC running W8,1
    There are very few updates to W8.1
    W8 got a bad rap (which it deserved)
    W8.1 is great
    Rob
    PS I use an alternate Start Menu
    That PC is old, so I install Avast Free to prevent Win Defender running whenever it flippin feels like it.
    Also I turn off indexing

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