Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Exposing dotnet dll to Borland
New Posts  All Forums:Forum Nav:

Exposing dotnet dll to Borland

post #1 of 6
Thread Starter 
Story is at bottom. Can I write a dll in Mono C# that can call functions in a dotnet dll which can be used by Borland Builder C++? I am porting the software to Mono C# anyway but this will hopefully get us by in the meantime.

A company which shall remain nameless decided to surprise us after we sent some hardware in for an upgrade. They changed interface protocols which broke our software that has been in development for 4 years. They refuse to gives us the protocol information they gave us in the past and are requiring we use their API. In their email they mentioned they could sent a quote for targeting our compilers . This also has killed an embedded project of mine that I have spent 6 months on.
post #2 of 6
If the dll created by Borland Builder C++ is correct, then you should be able call it the functions in that library. I don't have Mono IDE here but the concept should be the same. Let's you have test.dll, and you want to call dispayData.

1. Make sure you specs System and System.Runtime.InteropServices namespace.
2. Create a static class.

class MyTest
{
[DllImport("test.dll")]
public static extern bool displayData(string msg........);

}

3. Because the class is declared as static so you don't need to initialize and just call the displayData directly.
me.textbox=displayData("this is a test")
post #3 of 6
Are you going from managed to unmanaged or vice-versa?
post #4 of 6
Thread Starter 
It's a managed dll that was built in VS.net C# that i need to get into Borland.
post #5 of 6
Borland's DLLImport will only work with UnManaged DLL's... That's where your problem lies. There are some work arounds tho...

If you have access to your Unmanaged DLL Source, make a COM out of it, and then use it as a COM in Borland OR Create a unmanaged DLL that wraps that in VS for use in Borland

Sorry for taking so long in my response, I was away for the weekend.
post #6 of 6
Thread Starter 
Thank you for your response. The company has decided to give us COM dll so hopefully that works out.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Exposing dotnet dll to Borland