Results 1 to 4 of 4

Thread: How to register a component in vb?

  1. #1
    Join Date
    Feb 2009
    Posts
    7

    How to register a component in vb?

    Hi

    How to register a component in vb? To find out if my machine has some component or not?

  2. #2
    Join Date
    May 2008
    Posts
    115

    Re: How to register a component in vb?

    WIth the Help of Revser32.exe
    Write Following Command in
    Start Menu -->Run
    e.g. Regsver32 C:TestMyOcx.Ocx

  3. #3
    Join Date
    May 2008
    Posts
    63

    Re: How to register a component in vb?

    How to: Register a Component for COM Interop

    The Register for COM interop project property specifies whether your managed application will expose a COM object (a COM-callable wrapper) that allows a COM object to interact with your managed application.

    The Register for COM interop property is set on the Compile page of the Visual Basic Project Designer or the Build page of the C# Project Designer. This property is not available for Windows Application or Console Application projects.
    To register a component for COM interop

    1. With a project selected in Solution Explorer, on the Project menu, click Properties.
    2. Click the Compile tab in Visual Basic. Click the Build tab in C#.
    3. Select the Register for COM interop check box.

  4. #4
    Join Date
    May 2008
    Posts
    44

    Re: How to register a component in vb?

    This code sample shows how to Register and Unregister ActiveX Components directly through VB Code - useful if you write your own Setup/Installation routines for projects.

    Code:
    public Function RegisterComponent(byval FileName$, _
    byval RegFunction as REGISTER_FUNCTIONS) as STATUS
    
    '************************************************************
    'Author: Vasudevan S
    'Helena, MT
    'Function: RegisterComponent
    'Purpose: Registers/Unregisters any ActiveX DLL/EXE/OCX
    'component
             'Entry Points in ActiveX DLL/EXE/OCX are DllRegisterServer
             'and DllUnRegisterServer
    'input: FileName:       Any valid file with complete path
            'RegFunction:   Enumerated Type(DllRegisterServer,
            'DllUnregisterServer)
    'Returns: Returns the status of the call in a enumerated type
    'Comments: The utility REGSVR32.EXE need not be used to
    'register/unregister ActiveXcomponents.
               'This code can be embedded inside any application
               ' that needs to register/unregister any ActiveX
               'component from within the code base
    'SAMPLE FORM is INCLUDED
    'WORKS IN VB5.0/6.0
    
    'HOW to CALL:
    '-----------
    'Dim mEnum as STATUS
    '
    'to REGISTER A COMPONENT USE
    'mEnum = RegisterComponent("C:\windows\system\filename.dll",
    'DllRegisterServer) 'to Register
    '
    'If mEnum = [File Could Not Be Loaded Into Memory Space] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [Not A Valid ActiveX Component] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [ActiveX Component Registration Failed] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [ActiveX Component Registered Successfully] _
    'then
    '   MsgBox "Your Message Here", vbExclamation
    'End If
    '
    'to UNREGISTER A COMPONENT USE
    'mEnum = RegisterComponent("C:\windows\system\filename.dll", _
    'DllUnRegisterServer) 'to UnRegister
    '
    'If mEnum = [File Could Not Be Loaded Into Memory Space] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [Not A Valid ActiveX Component] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [ActiveX Component Registration Failed] then
    '   MsgBox "Your Message Here", vbExclamation
    'ElseIf mEnum = [ActiveX Component UnRegistered Successfully] _
    'then
    '   MsgBox "Your Message Here", vbExclamation
    'End If
    '************************************************************

Similar Threads

  1. How to Register Nintendo 3ds
    By Joshe in forum Portable Devices
    Replies: 1
    Last Post: 29-03-2011, 06:11 PM
  2. What is a EOL Component
    By Abbie in forum Monitor & Video Cards
    Replies: 6
    Last Post: 12-03-2010, 11:09 AM
  3. How to register ASP.Net with iis
    By Zombi in forum Software Development
    Replies: 3
    Last Post: 08-08-2009, 11:42 AM
  4. How to register a .DLL file?
    By Animorc in forum Operating Systems
    Replies: 2
    Last Post: 25-06-2009, 03:33 PM
  5. How to register channel on irc
    By dalsandhu in forum Networking & Security
    Replies: 2
    Last Post: 19-06-2009, 01:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,671,566.16651 seconds with 17 queries