?
Solved

Importing .Net DLLs into Delphi 7

Posted on 2006-07-05
5
Medium Priority
?
203 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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