Solved

Help with type library .tlb file

Posted on 2011-02-19
3
549 Views
Last Modified: 2012-05-11
Hi,

I was wondering if someone can help. I have created a class library and have generated and registered a type library (.tlb) file and have successfully managed add this in a project that I need to use this file.
The only problem is when I make the call to the class within this file it’s now looking for files that I have referenced within that library. I have tried copying all the files from my release folder to the location where I have the application without any success.
Any help would be appreciated.

Regards,

Ross
0
Comment
Question by:ross13
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34939186
Ross,

I am confused what you are really working with, and I need to ask some preliminary questions:

1) .NET version?

2) Are you trying to create a .NET assembly that is accessible in COM?
0
 

Author Comment

by:ross13
ID: 34939360
Hi,

I initially created a library file (.dll) using visual studio 2008 (.NET 3.5) and was trying to reference this using a Microsoft access application (version 2003) that someone else has developed.

I asked another question the other day that allowed me to add this reference this via the access application by creating a .TBL file:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26831994.html
I then tried to call a class within this and the access application gave the following message:
"could not load file or assembly or one of its dependencies. The system can not find the specified file”

The message gave the name of a file that I reference in the visual studio application that I compiled as a .TBL file.

Cheers,

Ross
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 34939400
Have you read anything like this?

Calling a .NET Component from a COM Component
http://msdn.microsoft.com/en-us/library/ms973802.aspx

There are two prerequisites to keep in mind when creating a .NET class that will be used by COM clients.

First, explicitly define an interface in your Visual Basic .NET code, and have the class implement the interface.


Secondly, any class that is to be visible to COM clients must be declared public. The tools that create the CCW only define types based on public classes. The same rule applies to methods, properties, and events that will be used by COM clients.


Register the Assembly and Create a Type Library
At this point, you could use the new assembly and the NET_Temperature class from another .NET application. But, you still have to make the class and its members available to your COM applications. Open a Visual Studio .NET command prompt (Click Start, then Programs, then Microsoft Visual Studio .NET 7.0, then Visual Studio .NET Tools, and then Visual Studio .NET Command Prompt), change to the project directory for PhysServer2, and type:

     regasm /tlb:PhysServer2.tlb PhysServer2.dll

The regasm utility will create a type library and register it in your Windows registry to make the classes in PhysServer2.dll available to COM clients.

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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