PDA

Click to See Complete Forum and Search --> : Error 374


zemp
May 25th, 2002, 09:48 AM
I have an app with two instances of the same VB user control. when the main form loads there is no problem. Th euser control works great. When I try to access the second form I get "run-time error 374: Failed to activate control 'VB.UserControl'...."

Inside the VB IDE there is no problem. If I run the exe on my development machine there is no problem. BUT when the app is run on another machine I get the error. Both machines have the same OS setup (WIN2000).

I have been unable to find any specific information on this error. Both in these forums and at the msdn site. Can anyone help.

Rick Bull
May 25th, 2002, 11:05 AM
Are you running the user control from an OCX file, or is it part of the project's source code? I've heard here that compiling to P-Code has cured a problem before, but I think it's slower to execute or something.

Ottman001
Feb 18th, 2008, 07:10 PM
I recently had a 374 error. I had modified an .OCX file in my application and as I had changed the arguments for a public function within the control, i had recompiled the application as well. All was working on my test system so the new files were distributed using an automatic update system as has always worked before. Most of the computers worked fine except for two.

On these two computers, there was a copy of the outdated .OCX file in the windows directory. Windows was using this file instead of the updated versions which were contained within the application directory. Deleting the copies in the windows directories solved the problem.

The problem only occurs if the old and new versions of the ocx have different APIs (e.g added or removed public subs or functions, modified arguements or return data types, etc.).

I hope this information helps others.