Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / June 2004



Tip: Looking for answers? Try searching our database.

Cannot create ActiveX object after breaking compatibliity

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lee Schipper - 24 Jun 2004 23:01 GMT
I am developing an out-of-process ActiveX server (ActiveX EXE) and have a
standard application that references it.  Both are VB6 projects.

I have specified binary compatibility for the ActiveX server, but needed to
make a change that broke binary compatibility.  I know that this causes
existing app to stop working, but I thought that recompiling those apps
would make them work again.

Now, even after removing and replacing the ActiveX reference in my
application and recompiling, the application gives an error when trying to
create the object:
   ------------------------------------------
   Error: Automation Error
   %1 is not a valid Win32 application.
   ------------------------------------------

How do I recover from this?

Here's what I did:
1) Before changing my ActiveX class, I went to my client application
   and de-referenced the ActiveX server.
2) Closed the application project.
3) Opened the ActiveX server project, made my change and compiled.
   3a) When prompted, opted to break binary compatibility
   3b) When prompted that the project had the same
         name as an existing project, selected continue.
4) Closed the ActiveX server project
5) Opened the application project
   5a) Added a reference to the ActiveX server
   5b) Compiled and ran -- got error.

TIA!
   Lee
Ken Halter - 24 Jun 2004 23:32 GMT
> I am developing an out-of-process ActiveX server (ActiveX EXE) and have a
> standard application that references it.  Both are VB6 projects.
[quoted text clipped - 10 lines]
>     Error: Automation Error
>     %1 is not a valid Win32 application.

That doesn't look like the error message you should be getting. Sounds
like a corrupt file to me. You might want to recompile. If you do,
unregister that one and delete it.

VB will do everything it can to create a reference to the component you
have specified in the references dialog... that includes re-registering
it automatically... even if that's not what you want. That causes big
problems when you've broken compatibility. It's better to unregister and
delete (don't forget to empty the recycle bin)

>     ------------------------------------------
>
[quoted text clipped - 3 lines]
> 1) Before changing my ActiveX class, I went to my client application
>     and de-referenced the ActiveX server.

at this point, it's best (imo) to exit VB, unregister the component
(optionally zip it up) and delete it.. empty the recycle bin too.

This avoids registry garbage that can have a very bad effect on the
project. If you have RegClean, run that too.

> 2) Closed the application project.
> 3) Opened the ActiveX server project, made my change and compiled.
[quoted text clipped - 4 lines]
> 5) Opened the application project
>     5a) Added a reference to the ActiveX server

No extra entries for the server in the references dialog? Unregister and
delete all versions of that server, run RegClean and rebuild... then,
setup compatibility.

>     5b) Compiled and ran -- got error.
>
> TIA!
>     Lee

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.