Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with type library .tlb file

Posted on 2011-02-19
3
Medium Priority
?
556 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
[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
  • 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 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

670 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