Solved

Importing .Net DLLs into Delphi 7

Posted on 2006-07-05
5
202 Views
Last Modified: 2010-05-18
I am currently maintaining a product in the Delphi 7 environment that requires additional functionality implemented in a .net (c#, I believe) dll library.

So during development I imported the type library which created the TLB file, wrote the code, and on the developement machine it works fine.  Then I try to move this application to another machine it doesn't work, claiming an OLEError, "Class not registered"

Most likely I'm missing something, but I don't really know much about how the .net DLLs work, except that I can't register them in the normal way.

So my question is, what am I doing or not doing that I should be or shouldn't be?

How do I register this dll?
0
Comment
Question by:fbk2000
[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
  • 2
5 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 17044778
you have to get that .NET dll on the other machine and register it with regasm.exe(it's in the .net framework directory) (you must use the same .NET framework as on the development machine, though it might be compatible with newer .net version, but I never tried such thing.)
0
 

Author Comment

by:fbk2000
ID: 17046147
Ok, I've registered it, and now I'm gettings "Interface not supported"

0
 
LVL 28

Expert Comment

by:2266180
ID: 17046500
I've done some searching as I suppose that if you didn't get any errors and it said successfull at dll registration, then there might be an error in system configuration.

I suggest to first do the following before attempting to do anything else:
- restart pc, try again
- use a COM explorer utility and see that indeed the interface you are using is there (you might be missing some assemblied for that .net dll) (one such utility is: http://www.4developers.com/com/index.htm )

if that does not fix it, then try the info from the following pages:
http://www.delphi32.com/info_facts/faq/faq_132.asp
http://www.distribucon.com/dcom95.html
0
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 500 total points
ID: 17093387
If your .Net dll is registered in GAC, you can write in Delphi 7, the following code :
procedure xxx
var
  ExtFunction: Variant;
begin
  ExtFunction:= CreateOleObject('your dll namespace');
  ExtFunction.DoSomeMethod(xxx);
end;

But you must know exactly the methods and parameter type, because you won't be able to see them in Delphi 7.

Good luck,

Mishu
0
 

Author Comment

by:fbk2000
ID: 17543526
Turns out the correct DLL was not installed.

0

Featured Post

Technology Partners: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month5 days, 20 hours left to enroll

626 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