Results 1 to 8 of 8

Thread: [RESOLVED] vb6 create objects without registration

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2008
    Posts
    24

    Resolved [RESOLVED] vb6 create objects without registration

    I got an applications source code I found which uses references to controls. I want to be able to make the application portable and be able to run on other systems even if the controls are not installed or registered into the windows directory.
    Several months back I found a way to use DLL and OCX in an application without referencing them in design time. this worked out very sucessful with my own programs, but I can't seem to work out how to use it with this. I'm trying to load TabCtl32.ocx at runtime with SSTab control using this code
    Code:
    Dim SSTab As Object
    
    Set SSTab = CreateObjectFromFile("TabCtl32.ocx", "SSTab")
    If SSTab Is Nothing Then Debug.Print " couldnt create object" Else Debug.Print "Created"
    If I run this it says that it has been created, but I have no idea how to make it add tabs to my application. I can't work out how to add the object to my form.
    The original article is no longer online. The attached zip file contains the articles files with example project.

    Any help would be appreciated
    Attached Files Attached Files

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: vb6 create objects without registration

    1. The control should require registration if it is an ActiveX control, which it is.

    2. Does this post help at all? Another problem you may encounter is after you successfully add the control, will be getting events for the control like click and mouse events for example.

    Edited:
    Why not just reference/add it in your project, build a Setup.exe and have it installed on the target PCs? Much easier and doing so will ensure it exists to be used.
    Last edited by LaVolpe; Feb 1st, 2009 at 11:27 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,482

    Re: vb6 create objects without registration

    There are a couple of versions of that floating around, perhaps all by the same guy. I never cared for them because they are "desperation ploys" in my opinion. You can't use the Form or UserControl designers in the IDE with those techniques at all, you have to add the created controls to the Form/UserControl at runtime, you can't use design-time properties and property pages, wiring up events is a mess... the list goes on and on and on.

    Beginning with WinXP there is an approved method of doing this. However Microsoft never bothered to create any VB6 IDE extensions to support it directly even though they developed the technique for VB6 to help alleviate DLL Hell. The only Microsoft tools with any support for it are in Visual Studio .Net versions starting with 2005 (I believe), where it is used to support COM Interop.

    Microsoft has a number of articles on the subject of Registration-Free COM but they do not deal with the subject from a VB6 perspective directly. They offer little in the way of "how to" information of use to a VB6 programmer.


    I know of two 3rd party tools for providing this capability:

    Side-by-Side Manifest Maker (commercial)

    Make My Manifest (beta freeware)

    As the names more than suggest, a key to this involves application and assembly manifests. Most VB6 programmers are probably only familiar with manifests in terms of a single use: selecting "XP styles" by loading the Common Controls version 6. But a lot more than just the CC6 element can go into an application manifest.

    The concepts are simple enough, but the details are numerous and somewhat difficult to root out from published documentation. However I am a little surprised that there aren't additional tools for creating VB6 Reg-Free COM manifests yet. I can only assume that the VB6 community has shrunk to a point that few people are actually deploying applications to non-development machines anymore.


    But to reiterate and amplify:

    Reg-Free COM requires Windows XP (Home or Pro) or later. Some functionality is incomplete until XP SP2 (or Server 2003 R2). However from there onward it is stanadrd in Windows and fully supported in Vista, Server 2008, and has been tested and found working in Windows 7 Public Beta.


    Also see:

    Simplify App Deployment with ClickOnce and Registration-Free COM

    Registration-Free Activation of COM Components: A Walkthrough

    Deploying COM Components with ClickOnce

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2008
    Posts
    24

    Re: vb6 create objects without registration

    Thanks for the info, Will have to look into that

  5. #5
    Member
    Join Date
    Feb 2006
    Posts
    42

    Re: [RESOLVED] vb6 create objects without registration

    Quote Originally Posted by aztectrev View Post
    I got an applications source code I found which uses
    Set SSTab = CreateObjectFromFile("TabCtl32.ocx", "SSTab")
    If SSTab Is Nothing Then Debug.Print " couldnt create object" Else Debug.Print "Created"[/CODE]
    Any help would be appreciated
    Thanks a million for your contribution.
    Wonderful solution.

  6. #6
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,872

    Question Re: [RESOLVED] vb6 create objects without registration

    What's so wonderful about that solution? It creates an "SSTab" object at runtime but how do you place it on a form and populate it with other controls?

    As far as I know, in order to add a new control on a form at runtime you need to use the "Controls.Add" method but that requires the control's ProgId as a parameter and you do not have a ProgId if the control is not registered.

  7. #7
    Member
    Join Date
    Feb 2006
    Posts
    42

    Re: [RESOLVED] vb6 create objects without registration

    Quote Originally Posted by VanGoghGaming View Post
    What's so wonderful about that solution? It creates an "SSTab" object at runtime but how do you place it on a form and populate it with other controls?

    As far as I know, in order to add a new control on a form at runtime you need to use the "Controls.Add" method but that requires the control's ProgId as a parameter and you do not have a ProgId if the control is not registered.
    The point is not about headed component on headless style.
    I was looking for CreateObjectFromFile() VB6 function to to add unregistered directshow filters on my video graph.

  8. #8
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,180

    Re: [RESOLVED] vb6 create objects without registration

    it's too old,please make new ask page

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