Click here to Skip to main content
15,035,600 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
We have a product that is partly written in VB6. It is built up of
many dlls that are activeX dlls. I'm trying to reduce our dependence on
registered COM objects. Since all the components are used inprocess
there is no need for items to be registered and during run-time, using
reg free com I can deploy everything without registering it.

Problem is I can't find a way to build the VB6 Code without it
automatically registering the activeX dlls during the build. Anyone
know if it is possible to build but not regisiter a VB6 ActiveX dll?
Posted
Updated 3-Mar-11 4:39am
v2
Comments
CPallini 3-Mar-11 7:55am
   
"Problem is I can't find a way to build the VB6 Code without it
automatically registering the activeX dlls during the build"

That means the DLLs are registered only on the development machine or am I wrong?
ARopo 3-Mar-11 8:09am
   
This is correct only on the development machine. Problem we have with this is that we may be working on more than one version at a time so building updates the registry to the last version built.
R. Giskard Reventlov 3-Mar-11 10:48am
   
It's been many, many years but I'm sure there was a command line switch that handled that. Probably wrong but might be worth a look.

There is no way to prevent this. VB6 will register the controls on every time they are built. You cannot stop it from doing so.
   
Write a batch file to do your building, including unregistering the DLL afterwards, we use:

VB
subst Z: .
vb6 /make %ProjectFile% /out "%LogSuccess%\%PROJECTNAME%_Log.txt" /outdir Z:\bin
IF ERRORLEVEL 1 MOVE "%LogSuccess%\%PROJECTNAME%_Log.txt" "%LogFail%"
regsvr32 /u Z:\bin\Constants.dll
subst Z: /D
   
Comments
ARopo 3-Aug-11 4:51am
   
That is pretty much what we do
Short answer: ActiveX sucks! VB6 too.

I bet you cannot do anything about it. If you finally trash VB6, you may have a chance to get away from ActiveX, at least in many cases.

—SA
   
Comments
CPallini 3-Mar-11 13:25pm
   
You're wrong ActiveX (and COM) doesn't suck (just a personal point of view, of course).
   
Yes, of course, this is my personal view, too, let's take if for granted. However, I can compare with better things and used to point out some real fallacies.

Such negative point of view is vulnerable by definition, because my argument would be like "it would be much better if" and you would ask "and where is you if..?" and you would be right, as you would not easily prof my next step. Now you can compare with .NET. I can only say that I have a long experience "skipping" technologies that I did not like; and my decision was justified years after.

--SA
   
Also, don't mix up COM and ActiveX. My statement as about ActiveX. COM (kernel) part suck much less!
--SA
CPallini 3-Mar-11 13:39pm
   
I haven't. They (MS) did. :-D
   
Appreciate it :-) I mean, you can use COM subset without ActiveX.
--SA
ARopo 4-Mar-11 3:58am
   
I wouldn't be using ActiveX or VB6 code if I could help it. Unfortunatitly I can't make a business case for spending a year or 2 porting everything to .net. So we take a steady migration approach and make the best of what we have.
   
I don't mind, just sorry for you.
I appreciate your work because you probably are reducing amount of Evil in the World.
Good luck, and thank you for accepting my Answer :-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900