2

We have a COM dll written in delphi in our bin folder that call 2 static dll in the system32 folder (also COM in delphi).

My question is, how can we transform that dll in delphi into an interop dll ? Or is there any better way to do this ?

Thanks !

1
  • 2
    You shouldn't have to "transform" the DLL at all, unless it's using Delphi-specific types in the interface. Otherwise, it should work as-is; you just need to write the proper interop code on the .NET side. (If this is what you meant, would you mind editing your question for clarity?) Commented Jun 2, 2011 at 16:06

2 Answers 2

2

.net consumes COM objects with ease. There's no need for interop, just import the type libraries and off you go!

MSDN has a comprehensive tutorial.

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

1 Comment

Be aware than some DotNet types (at least struct) can't be understood from the Delphi side. The VT_RECORD type is not handle by Delphi yet. You should rely on low-level types like Delphi string double integer.
2

@David: I think that the import in dotNET is ultimately using InterOp. That said, as long as all the COM interface contracts are respected, a Delphi COM object is just like a C++, ATL object.

Andrea

2 Comments

Should probably be a comment on David's answer instead of a new answer.
I agree, but I had no points to do that and the same applies to other answers of mine that have been deleted. No one bothered to check how many points I had at the time of writing!

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.