Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-02-2009
Member
 
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?
Reply With Quote
  #2  
Old 28-02-2009
Member
 
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
Reply With Quote
  #3  
Old 28-02-2009
Member
 
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.
Reply With Quote
  #4  
Old 28-02-2009
Member
 
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
'************************************************************
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 12:28 PM.