Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External DLL not recognized. 1

Status
Not open for further replies.

marcello62

Technical User
Jun 19, 2006
42
0
0
NL
Hello,

I have written a very simple dll in Delphi, it only contains one procedure which generates a message. I have done this for test-purposes, because I want to call the .dll from C#. I registered the .dll with regsvr32, and I try to set a reference to it in C#. However, I get the error message: 'a reference to Testdllproject.dll could not be added. Please make sure that the file is accessible, and that it's a valid assembly or .COM component.' However, I can use the DLL without any problem from another Delphi application and I have registered it without any problems. So why can't I set a reference?

Any help will be greatly appreciated.

Thanks.
 
You can't reference native binaries like that in .net.
You can use pinvoke calls to call your function in native dll.
Search msdn or google for pinvoke example...
 
Hi Monkhandle,

I wrote a class which invokes the .dll and it works. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top