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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

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"

    Relevant Pages

    • Overriding .Enabled
      ... I have some nasty little controls that needs to behave in a non- ... Public Interface ITypeable ... Inherits UserControl ... I've tried overloading, overriding, shadowing, and just about every ...
      (microsoft.public.dotnet.languages.vb)
    • Re: Generics and user controls
      ... controls that actually render data and interact with the user. ... handle events on the UserControl through event registration. ... if your UserControls share some common interface you might want to abstract the details from each of the UserControls ... public partial class EntryDetailsControl: UserControl, ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Interface question
      ... > treeview (ie, if a node is clicked in the treeview, I'll load a certain ... > page of controls in the data pane) so I wanted to use usercontrols. ... > somewhat aware of the usercontrol that is loaded. ... To create an interface you will definately be using a class. ...
      (microsoft.public.vb.general.discussion)
    • Re: Sub-forms
      ... You cannot have a form inside another form AFAIK in that way, ... have to use a UserControl. ... Now I remember that sometime ago somebody posted an announcement of Wizard ... > I currently don't want MDI, rather a wizard-style interface... ...
      (microsoft.public.dotnet.languages.vb)
    • Re: Sub-forms
      ... You cannot have a form inside another form AFAIK in that way, ... have to use a UserControl. ... Now I remember that sometime ago somebody posted an announcement of Wizard ... > I currently don't want MDI, rather a wizard-style interface... ...
      (microsoft.public.dotnet.framework.windowsforms)