Question

How to register tlb files

Asked by: RAJz

Hi Experts!

We are facing a problem when registering a tlb file.  Through Visual Basic 6.0, we can register a tlb file by adding it on the reference section but we want to register it without visual basic 6.0 through our installer.

Thanks you in advance

RAJz

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-06-14 at 02:06:53ID20648136
Tags

register

,

tlb

,

file

Topic

Visual Basic Programming

Participating Experts
6
Points
125
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. TLB problem
    While implementing a ActiveX DLL, I've used COM interfaces, defined in interfaces.tlb file. After this, I need to somehow register information from the TLN file. Regsvr32 dosn't do the job. How can I distribute information from TLB? Thanks!
  2. tlb, oca, and olb files
    You can use Regsvr32 to register dll's and ocx'es, but what about tlb's, oca's and olb's? Need a fast answer please
  3. TLB dependancies
    If I add a TLB file to my references for an Standard EXE project will I need that TLB file if I compile the application. For example if I distribute my program will the TLB file need to be installed with my program?
  4. Create a .TLB file from a .NET DLL?
    I am using adodb.dll in a C# class. why am I not able to do this: regasm adodb.dll /tlb I get the following error: [[command line output]] C:\EES\BIN\RELEASE>regasm adodb.dll /tlb Microsoft (R) .NET Framework Assembly Registration Utility 1.0.3705.288 Copyright (C) ...
  5. problem with registering tlb files in client machine
    hii all i have done a sample application .for this i am using dll files i have problem with some tlb file i register the tlb file and vbr files in client machine but by running the application i got an error in tlb file some methid is wrong because some version compatabili...
  6. Using a tlb file in .Net 2005 solution
    Hello experts, see if you can help me on this one. I have a .TLB file that I need to interract with. Not sure when or where this TLB file was made, but I have API documentation on it, and I need to use it in a C# .Net VS 2005 app. I tried adding a reference to this .tlb fi...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: onlyshizaPosted on 2003-06-14 at 03:56:32ID: 8723314

hi,

when you reference the tlb from the project you don't actually register it, and in fact you are referencing the dll not the tlb, so you will be able to access the tlb through the dll. If you want to regirster the dll you can use a regsvr32 command from the command line. However if your vb project is referencing your tlb or dll there is no need to register it, just include that inside the directory when your project resides. does this make sense?

onlyshiza

 

by: vbbuffPosted on 2003-06-14 at 04:06:54ID: 8723325

What is the filename?

 

by: EDDYKTPosted on 2003-06-14 at 04:52:24ID: 8723403

tlb file is type library and you don't have to registry it

Type lib doesn't nor contain any code inside and only the prototype of programming

 

by: inthedarkPosted on 2003-06-14 at 05:15:13ID: 8723430

I think that this was one of the things that was not included with VS 6 Professional. You needed the Enterprise edition, which comes with a type lib registry program.  The problem is when you want to deploy remote com+ objects, each client needs the tlb, or you have to install & register the dll on each client pc.  But I did find some source code that did the trick.

After compile use like this:

RegTLIB c:\myfolder\MyDLL.DLL

or Unreg like this:

RegTLIB MyDLL.DLL /U




I hope this works for you too:~)


----------------------RegTLIB.bas
Option Explicit


Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(0 To 7) As Byte
End Type
Private Enum eSYSKIND
   SYS_WIN16 = 0&
   SYS_WIN32 = 1&
   SYS_MAC = 2&
End Enum

Private Declare Function LoadTypeLib Lib "oleaut32.dll" ( _
    pFileName As Byte, pptlib As Object) As Long
Private Declare Function RegisterTypeLib Lib "oleaut32.dll" ( _
    ByVal ptlib As Object, szFullPath As Byte, _
    szHelpFile As Byte) As Long
Private Declare Function UnRegisterTypeLib Lib "oleaut32.dll" ( _
      libID As GUID, _
      ByVal wVerMajor As Integer, _
      ByVal wVerMinor As Integer, _
      ByVal lCID As Long, _
      ByVal tSysKind As eSYSKIND _
   ) As Long
Private Declare Function CLSIDFromString Lib "ole32.dll" (lpsz As Byte, pclsid As GUID) As Long

Sub Main()

Dim cmd$
Dim opt$

cmd = Command

If Len(cmd) = 0 Or InStr(cmd, "/?") Or InStr(cmd, "-?") > 0 Then
    opt = "REGTLB Command Line Options" + vbCrLf + vbCrLf
    opt$ = opt + "To register: REGTLB YourDLL.DLL" + vbCrLf
    opt$ = opt + "To unregister: REGTLB YourDLL.DLL /U"
    MsgBox opt$, vbInformation, "REGTLB"
    End
End If

Dim HF As New zHandy

Dim UnReg As Boolean
UnReg = InStr(UCase(cmd), "/U") = 0
cmd = Trim(HF.LeftPart(cmd, "/"))
Dim ok
ok = Not RegTypelib(cmd, UnReg)

If Not ok Then
        ' place message here
End If

End Sub

Public Function RegTypelib(sLib As String, ByVal bState As Boolean) As Long

Dim suLib() As Byte
Dim errOK As Long
Dim tlb As Object
   If bState Then
      ' Basic automatically translates strings to Unicode Byte arrays
      ' but doesn't null-terminate, so you must do it yourself
      suLib = sLib & vbNullChar
      ' Pass first byte of array
      errOK = LoadTypeLib(suLib(0), tlb)
      If errOK = 0 Then
         errOK = RegisterTypeLib(tlb, suLib(0), 0)
         
      End If
      RegTypelib = errOK
   Else
      Dim cTLI As TypeLibInfo
      Dim tGUID As GUID, sCLSID As String
      Dim iMajor As Integer, iMinor As Integer
      Dim lCID As Long

      Set cTLI = TLI.TypeLibInfoFromFile(sLib)
      sCLSID = cTLI.GUID
      iMajor = cTLI.MajorVersion
      iMinor = cTLI.MinorVersion
      lCID = cTLI.lCID
      Set cTLI = Nothing
     
      suLib = sCLSID & vbNullChar
      errOK = CLSIDFromString(suLib(0), tGUID)
      If errOK = 0 Then
         errOK = UnRegisterTypeLib(tGUID, iMajor, iMinor, lCID, SYS_WIN32)
         RegTypelib = errOK
      End If
     
   End If
   
End Function

--------------------------zHandy.cls
Option Explicit

' Handy Functions
'
Dim dummy

Dim ErrorMessage As String
Dim ErrorNumber  As Long

Public Function RightPart(WholeString, FindString) As String

' Find the right part of a string
' A$=RightPart("ABC-EFG","-") ' returns "EFG"

Dim pos As Long

pos = InStr(1, WholeString, FindString, vbTextCompare)
If pos = 0 Then
    RightPart = ""
ElseIf pos = Len(WholeString) Then
    RightPart = ""
Else
    RightPart = Mid$(WholeString, pos + Len(FindString))
End If

End Function

Public Function ReadFile(filename As String) As Variant
' Reads a whole file into a string
' string contains ERROR if file not found or error

Dim wlfn As Long

wlfn = FreeFile
On Error Resume Next
If Len(Dir(filename)) > 0 Then
    If Err.Number Then
        ReadFile = Null
        ErrorNumber = Err.Number
        ErrorMessage = Err.Description
        Exit Function
    End If
    Open filename For Input Shared As #wlfn
    ReadFile = Input(LOF(wlfn), wlfn)
    Close wlfn
Else
    ReadFile = Null
    ErrorNumber = Err.Number
    ErrorMessage = Err.Description
End If

End Function
Public Function LeftPart(WholeString, FindString) As String

' Find the left part of a string
' A$=LeftPart("ABC-EFG","-") ' returns "ABC"

Dim pos As Long

pos = InStr(1, WholeString, FindString, vbTextCompare)
If pos = 0 Then
    LeftPart = WholeString
ElseIf pos = 1 Then
    LeftPart = ""
Else
    LeftPart = Left$(WholeString, pos - 1)
End If

End Function


Public Function WriteFileOK(filename As String, DataString) As Boolean

' saves DataString to a file FileName
' returns True if OK

Dim wlfn As Long

wlfn = FreeFile
On Error Resume Next
Err.Clear
WriteFileOK = False
Open filename For Output As #wlfn
If Err.Number <> 0 Then
    ErrorMessage = Err.Description
    ErrorNumber = Err.Number
    Exit Function
End If
Print #wlfn, DataString;
Close wlfn
If Err.Number <> 0 Then
    Exit Function
End If
WriteFileOK = True

End Function

 

by: inthedarkPosted on 2003-06-14 at 05:17:02ID: 8723433

To be exact about syntax:

RegTLIB DLLPath  [/U]

 

by: webJosePosted on 2003-06-14 at 14:26:50ID: 8724885

I made a small application to register and unregister type libraries.  The code is in C++, though.  This is the URL:

http://www.developerfusion.com/show/3359/

 

by: GPrentice00Posted on 2003-08-16 at 23:59:26ID: 9167842

This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in approximately one week.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer

 

by: GPrentice00Posted on 2003-09-14 at 21:28:02ID: 9360119

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Split between inthedark and webJose

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...