Solved

Importing .Net DLLs into Delphi 7

Posted on 2006-07-05
5
197 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: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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 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