Re: Create a VB6 SP5 ActiveX component from a form?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ken Halter (Ken_Halter_at_Use_Sparingly_Hotmail.com)
Date: 05/22/04

  • Next message: Eduardo A. Morcillo [MS MVP VB]: "Re: step into a C++ dll from VB6"
    Date: Fri, 21 May 2004 21:35:27 -0700
    
    

    "Michael D. Ober" <obermd-.@.-alum-mit-edu-nospam> wrote in message
    news:OxcXMhDPEHA.1512@TK2MSFTNGP10.phx.gbl...
    > I need to create an ActiveX component (either in-process or
    out-of-process)
    > from a VB form that has a simple user interface. The underlying code can
    be
    > called in such a way that the interface (a login in dialog) never gets
    > displayed. Can anyone point me in the correct direction?
    >
    > Thanks,
    > Mike Ober.

    If you start a new project, click Project/Add Usercontrol, then click
    Add-Ins/Add-In Manager, scroll down to 'VB6 ActiveX Ctrl Interface Wizard',
    dbl-click it to load it, hit Ok, click Add-Ins (again) The wizard should
    show in the list (don't start it yet).

    Open the usercontrol designer and plop a few controls on its surface. Now,
    fire up the wizard. You'll see a list of properties/methods and events that
    can be added to the control. You'll notice that the wizard figures out what
    controls you have on the usercontrol and, at least tries to, show all
    properties (etc) that the controls expose.

    Just select a few for use, hit the Next button and add a couple of Custom
    properties (or whatever you want) and keep hitting Next (answering or
    skipping questions along the way) until you hit the Finish button. After
    that, you should be able to open the usercontrols code window and start
    looking at the code required to make all of the options you selected work.
    It's a pretty good wizard imo. Try to ignore all of the comments the wizard
    inserts. They're mostly for the wizards use (so you can run it again on the
    same control).

    Once you get used to how the wizard and usercontrols work in general, you
    can pretty much copy all controls on the form you're wanting to convert,
    paste them on the usercontrols surface, and run the wizard to get you fairly
    close to a finished control. One thing to remember... if it's going to be a
    stand-alone control (ocx), try your best to keep as much of the interface
    Private (or Friend) as you can. That makes it easier to maintain
    compatibility later.

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

  • Next message: Eduardo A. Morcillo [MS MVP VB]: "Re: step into a C++ dll from VB6"
  • Quantcast