Solved

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

Posted on 2013-01-18
5
263 Views
Last Modified: 2013-01-18
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.

Please help
0
Comment
Question by:UnderSeven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38794537
Did you add a reference to the file?
0
 

Author Comment

by:UnderSeven
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

by:UnderSeven
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

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

regsvr32 C:\path\to\file.tlb

Open in new window


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

by:UnderSeven
ID: 38794811
Thanks,

That did it.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question