Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 727513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:34:34+00:00 2026-05-14T06:34:34+00:00

I have a VB6 program which I’ve been maintaining for ten years. There is

  • 0

I have a VB6 program which I’ve been maintaining for ten years. There is a subroutine in the program called “Prepare Copy”, which looks like this (Edited to add changes):

Public Sub PrepareCopy()

On Local Error GoTo PrepareCopyError

MsgBox "in modeldescription preparecopy"

Set CopiedShapes = New Collection

MsgBox "leaving preparecopy"
Exit Sub
PrepareCopyError:
    MsgBox Err.Description, , Err.Number
    Resume Next
End Sub

Where CopiedShapes is dimmed out as a VB6 Collection.

That code is now kicking out a Runtime Error 5 — Invalid Procedure Call or Argument. It appears from the interstitial debugging code that the error arises between the MsgBox "in modeldescription preparecopy" and the MsgBox "leaving preparecopy" lines, and that the On Error code path never executes.

Once the Error 5 dialog box is cleared, then the MsgBox "leaving preparecopy" dialog appears, after which the program closes out.

It’s behaving this way on my development machine and two client computers.

It is only happening in runtime code, and does not appear to make a difference whether I compile it or use P-Code

What I’m asking for here is speculation as to what causes this sort of thing to happen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:34:34+00:00Added an answer on May 14, 2026 at 6:34 am

    Procmon was not helpful. Microsoft took a deep-dive image of the system at the point the problem was occurring.

    They found a bad HRESULT failure code. Something deep in the VB6 runtime was attempting to access a late-bound but undeclared object through an IDispatch interface. They swiftly scheduled a call with me. I asked which object was being called through IDispatch; there are no late-bound calls in the VB6 portions of my project. (“option explicit”)

    In the call, they told me to go away. They refused to help identify further root causes, because VB6 code was involved and the support department is forbidden to troubleshoot VB6 problems. I countered that this was clearly a problem in the supported runtime, to no avail.

    Instead, I got a 20 minute lecture on the economies of supporting something when there was no money to be made. I replied with a war story about a thrice-virtualized application still running after 35 years at a phone company.

    They were good guys; they wanted to help me solve the problem but their policies forbade it. I’m no closer to a root cause today than I was when I posted the question.

    However, if you call MsgBox from the VB6 runtimes, it sends WM_USER messages to other VB6 forms in the project. That, in turn, in my case, triggered MDIForm_Activate in which there was this code:

    Me.TreeView1.SetFocus
    

    And that, in spite of the fact that TreeView1 was by definition declared explicitly, was what they declared as the cause of the failed late-bind IDispatch call, all the while refusing to explain how that could be. The guy on the phone even went so far as to say that he absolutely could figure it out, but Microsoft policy forbade it, because that’s VB6, there.

    Removing the SetFocus call removed the circumstance which produced the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 379k
  • Answers 379k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Membership, Roles and Profiles are all ASP.Net technologies and require… May 14, 2026 at 9:26 pm
  • Editorial Team
    Editorial Team added an answer Here is a simple example: try { sub.ps1 } catch… May 14, 2026 at 9:26 pm
  • Editorial Team
    Editorial Team added an answer This is sort of a repeat question: jQuery UI Dialog… May 14, 2026 at 9:26 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.