Results 1 to 4 of 4

Thread: VB6 Reg-Free COM Discussion

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    VB6 Reg-Free COM Discussion

    I'd like to open a discussion of VB6 reg-free COM if people are interested. By this I mean VB6 programs, as opposed to any kind of .Net-interop scenario.

    Yes, one could consider it an ActiveX/COM topic. And yes, one might also consider it a deployment topic.


    Once some of the issues are resolved we'll have a nice, simple XCopy deployment technology. Of course there are many issues.

    I'm not talking about yet another desire to install without creating installer packages, though in theory we can do that too. That is probably more applicable to installing VB6 programs onto a runnable CD or flash memory drive - which reg-free COM enables, with a few restrictions.

    No, in the most general terms I'm talking about a package one might still wrap up in an installer, but with dependencies isolated so that installing your WhizBang 2012 on somebody's machine doesn't deposit anything into System32 and doesn't make any registry entries. This can also ease Vista deployment.


    Reg-free COM isn't available until Windows XP or later. It really wasn't viable until XP SP1, and it really didn't support VB6 fully until XP SP2 with the VB6 SP6 runtimes.

    Escape DLL Hell:
    Incidentally, existing code does not generally need to be altered to take advantage of Reg-Free COM. Setting up the proper configuration of manifests is all that may be required. In fact, the original intent of Reg-Free COM was to enable existing native applications, such as ones written in Visual Basic 6.0, C++, or some combination of languages.
    It also doesn't apply in a number of scenarios, see the sidebar item The Limitations of Reg-Free COM at the link above.


    I wouldn't bring it up at all, but I'm having some decent success with it. Much more success than people trying to use VS2005 for this purpose - even when they use it for interop! It seems that VS2005 isn't really very smart about reg-free COM, in particular regarding VB6 controls. .Net doesn't actually use OS-provided SxS isolation itself except in a vestigial way, except in the case of interop - where it can fall down hard. Over there they use something called Fusion/CLR isolation for their ClickOnce and XCopy packages.

    I suspect VS2008 may improve on its handling of reg-free COM.


    I wonder who else has been working with Reg-Free COM and VB6? What successes have you had? What approach have you taken?

    I've gone the route of creating a post-build tool that processes your program's VBP to create a resulting XCopy package. I've been working at it off and on about two years now, and I'm approaching the late "alpha" stages. The utility works for many programs already, but I have more things to add before it'll be feature-complete enough for a beta release. But it can handle isolating late-bound libraries and non-COM DLLs now as well as early-bound COM libraries - and even works when you have PublicNotCreatable classes.

    I started talking about this and posting code over at VBCity a long while back. The truth is though that place is a bit of a ghost ship today. Since my little utility has vastly matured since then and I've discovered a lot I thought about bringing the discussion here where things are more lively.

    I've noticed some Visual FoxPro guys have been beavering away trying to beat us to the finish line!
    Last edited by dilettante; Nov 22nd, 2007 at 06:49 AM.

  2. #2
    New Member
    Join Date
    Jun 2010
    Posts
    1

    Re: VB6 Reg-Free COM Discussion

    Hi,

    I am trying to create a Reg Free Deployment for my VB6 projects.

    Issue:

    I have a container control (User Control), example: MyCtrls.ContainerCtrl

    I am trying to add another control in this.

    'Code:
    'Add Container control in User Control

    Dim objParentCtrl As VBContolExtender
    Dim objChildCtrl As VBContolExtender

    Set objParentCtrl = UserControl.Controls.Add("MyCtrls.ContainerCtrl", "objParentCtrl", Me)

    'Add Child control in Parent control
    Set objChildCtrl = UserControl.Controls.Add("MyChilds.ChildCtrl", "objChildCtrl", objParentCtrl)

    This statement generates a run-time error 721. Error message is 'ContainerCtrl' is not a valid control container

    Funny thing is that it works well if I do not use Manifest files (using normal COM activation). Error is generated if I create Manifest file for MyCtrls component.

    Any ideas how to fix this!!!

  3. #3
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: VB6 Reg-Free COM Discussion

    You shouldn't bump old threads, or hijack other threads. If you have a question it's common practice to open a new thread for it.

  4. #4

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 Reg-Free COM Discussion

    Quote Originally Posted by baja_yu View Post
    You shouldn't bump old threads, or hijack other threads. If you have a question it's common practice to open a new thread for it.
    I agree.

    However...

    It looks like you are trying to add controls by ProgId rather than by ClassID. Many manifest makers do not put ProgID info into the manifest, or put it in correctly. Some only insert the version-specific ProgID, so you might try using that.

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