开发者

Importing .net dll to Delphi 6 loses information

开发者 https://www.devze.com 2023-02-18 10:28 出处:网络
I have a .net dll which I could import to Delphi 6. But it loses some information. I have a demo application in VB.net to use this dll which shows 2 interfaces called

I have a .net dll which I could import to Delphi 6. But it loses some information.

I have a demo application in VB.net to use this dll which shows 2 interfaces called IRedeemTransactionItemBundle and ITransactionItemBundle. In Visual Studio 2008 I could see that ITransactionItemBundle is the base type of IRedeemTransactionItemBundle. So when I declare a variable of type IRedeemTransactionItemBundle, I could access all properties of both interfaces.

But when I import the dll to Delphi 6, I could see both IRedeemTransactionItemBundle and ITransactionItemBundle declaration part. But there is no information that shows ITransactionItemBundle is the base type o开发者_如何学Cf IRedeemTransactionItemBundle. Also when I declare a variable of type IRedeemTransactionItemBundle in Delphi, I am not able to access properties of ITransactionItemBundle (the base type).

When I tried to register the library in tlb editor by setting the base type of IRedeemTransactionItemBundle to ITransactionItemBundle, I am getting the error: “Parent Interface already has a member with id:1610743808”. I could see properties of both interfaces have same ID in the tlb editor.

I tried to import the same dll using Delphi 7 also. But no help.

Is that a problem with Delphi? Have any of you experienced such a problem in importing kindly give me some thoughts?


I would suggest you to make COM visible wrapper for the DLL in C# or VB.NET which will import necessary functionality in the way Delphi can interact with correctly.


Apart from using COM interop, you can do an unmanaged export. Simply put, you need a new specific version of the .net dll.

Please head to this post for details of the technique using Delphi.

0

精彩评论

暂无评论...
验证码 换一张
取 消