2

Which mean I want to call function in delphi VCL/ DLL to retrieve information. Is this possible?

0

1 Answer 1

2

Yes, if the dll is not .Net you will need to use Platform Invoke [DllImport] calls.

Have a look here for windows API examples here (http://pinvoke.net/) which should help you call your delphi dlls.

Sign up to request clarification or add additional context in comments.

8 Comments

And it also depends on the types you are exporting. Make sure they are not Delphi specific types (no string, no TStringList, etc).
Instead of PInvoke you could also make a COM/ActiveX library in Delphi which then can be called from C# using interop.
@Lars This comment is worthy of being an answer
@David: As fas as I know creating COM/ActiveX libraries requires registration of the library, which may cause additional issues depending on the situation. Sometimes its just easier to access the existing dll driectly without the additional layer.
@Mark I'm not advocating one over the other. I'm just saying that both are worthy of consideration. The corresponding downside of P/invoke is that it can be quite hard to get right.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.