thanks
> Does anyone know how to use C# DLL in Delphi program?
OB,
You have to use .NET to "wrap" the C# code as a COM object. Then
your Delphi code can use it like any other COM object. There's a
great article showing how to do this in this month's Delphi
Informant (you have to be a subscriber to access the article,
however):
There is also a lot of non-Delphi related information on how to do
this on MSDN:
Search for "com interop". This should return a list of articles
to get you stared.
HTH,
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xns924F8D06CB946cr...@207.105.83.65...
Try to do the following in C#. before compiling the dll project, right click
on the project name, click on configuration properties, click on build and
set
"Register for COM interop" to TRUE.
Compile the DLL
Let's assume the DLL name is: C#DLL, and the class name within the DLL is:
C#Class And the class has an "ADD" function that you want to call and pass
it two params: 45 , 33 and finally the return value is an integer
Then in Delphi, do the following:
// Assign object reference to variable
OleObj = CreateOLEObject('C#DLL.C#Class');
//call the ADD function found in the C# DLL
ShowMEssage(InttoStr(OleObj.Add(45, 33)));
Omar Bondogji
"OB" <ob55...@yahoo.com> wrote in message news:3d37048f_2@dnews...