Results 1 to 7 of 7

Thread: Random Vb6 error , usually for 'load control(array)' statement

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Random Vb6 error , usually for 'load control(array)' statement

    "Failed to load control 'A' from B.OCX. Your version of B.OCX may be outdated. Make sure you are using the version of the control that was provided with your application."
    This error comes randomly in vb6 application exe, will not repeat when application is closed and opened (i.e can't recreate error) usually comes for 'load control(array)' statement

    What is the cause for this error? (registration of ocx file is done properly, also it works most of the time)

    tried the solution given here , but same error repeats.

  2. #2
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,167

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Can you look in task manager how many GDI handles your process is using when this error occurs. There is a hard limit of 10k

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Quote Originally Posted by wqweto View Post
    Can you look in task manager how many GDI handles your process is using when this error occurs. There is a hard limit of 10k
    GDI handles are less than 2000

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,167

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Quote Originally Posted by winman View Post
    GDI handles are less than 2000
    You have less than 2k GDI handles in use just *when* the Load statement is failing?

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Quote Originally Posted by wqweto View Post
    Can you look in task manager how many GDI handles your process is using when this error occurs. There is a hard limit of 10k
    GDI handles are between 2k to 3k when the program is running.

  6. #6
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,167

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Quote Originally Posted by winman View Post
    GDI handles are between 2k to 3k when the program is running.
    Can you instrument your error handling code on the failing Load statement to dump GDI and OS objects counts? Might want to include RAM used by process too.

    Doubt you can investigate this problem w/o some coding effort.

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

    Re: Random Vb6 error , usually for 'load control(array)' statement

    Do you have the source code for the ocx?
    Was the ocx registered via a setup.exe or manually? Or if using SxS manifests?
    Do you know if the ocx removed the option to dynamically "upgrade activex controls" (which is default to true)?
    Is there any chance that the ocx is dynamically registering/unregistering stuff?
    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}

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
  •  



Click Here to Expand Forum to Full Width