Solved

# How do I refernce objects from tlb library in my code using VB?

Posted on 2013-01-18
259 Views
I have a tlb library which I've added to my project as an 'existing item'.  I can object browse to some of the components and the one I would like to use.

If I object browse I can find it:

Class CustomerWebAssistant
Member of EncryptionSupport

then if I try to instantiate the class in my code:

Dim cwAssistant As New EncryptionSupport.CustomerWebAssistant

I get the error that it is undefined.

0
Question by:UnderSeven
• 3
• 2

LVL 75

Expert Comment

ID: 38794537
Did you add a reference to the file?
0

Author Comment

ID: 38794655
I can't do an imports on it, says includes no public namespace or cannot be found.

Also I am already inheriting another class.

If I try to add it as a reference it states it is not a valid assembly or com component.
0

Author Comment

ID: 38794679
This tlb is actually used in legacy code using the following statements:

cwAssistant = Server.CreateObject("Cogsdale.Encryption.CustomerWebAssistant")
result = cwAssistant.getDecryptedValue(result, Session("KeysFileLocation"))

but these do not work,it errors on the first one if I tried using those stating it cannot create the object.
0

LVL 75

Accepted Solution

käµfm³d   👽 earned 500 total points
ID: 38794701
Run the following in a command prompt:

regsvr32 C:\path\to\file.tlb


If you're running 64-bit Windows, then you may need to reference the full path to the 32-bit version of regsvr32.

Once you register the type library, your late-bound examples above should work.
0

Author Closing Comment

ID: 38794811
Thanks,

That did it.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

#### Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!