Solved

Importing .Net DLLs into Delphi 7

Posted on 2006-07-05
5
195 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
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:ciuly
Comment Utility
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
Comment Utility
Ok, I've registered it, and now I'm gettings "Interface not supported"

0
 
LVL 28

Expert Comment

by:ciuly
Comment Utility
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
Comment Utility
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
Comment Utility
Turns out the correct DLL was not installed.

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now