Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Accessing Borland C++ created DLLs from C#



Permlink Replies: 1 - Last Post: Oct 10, 2017 9:55 AM Last Post By: Remy Lebeau (Te... Threads: [ Previous | Next ]
Andy Stobirski

Posts: 17
Registered: 6/12/16
Accessing Borland C++ created DLLs from C#
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 3:01 AM
Hi there

I have a DLL containing a bunch of functions written using in C++ using Borland C++ Builder v5.0, the code is written in C++ and Delphi. Is it possible to use this DLL is C#?

Obviously, I could rewrite the stuff I need, but that would be rather time consuming, and would be a last resort.

Cheers

Andy
Remy Lebeau (Te...


Posts: 8,715
Registered: 12/23/01
Re: Accessing Borland C++ created DLLs from C#
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2017 9:55 AM   in response to: Andy Stobirski in response to: Andy Stobirski
Andy Stobirski wrote:

I have a DLL containing a bunch of functions written using in C++
using Borland C++ Builder v5.0, the code is written in C++ and
Delphi. Is it possible to use this DLL is C#?

It depends on what the signatures of the exported DLL functions look
like. If they are written to follow C semantics, and only use basic
interop-safe data types, then yes, you can use it in C# via PInvoke.
Otherwise, no.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02