Importing .net dll to Delphi 6 loses information - delphi

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 of 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.

Related

Embed com obj in delphi's exe

I've made a dll in c# an made it com visible then used it in delphi. In order to do that i had to register the dll so that i could install that as a component in my delphi ide. (I registered the dll with the interop thing then in delphi went to install component > type library > selected my com dll and it created everything for use of it.)
The problem i'm facing now is that i want to use the exe on another machine without having to register the dll. Is it possible to compile the exe file with the registered com dlls?
I have a solution to this is to not use the com obj but just go with unmanaged dll and export all the methods i want but i would prefer embedding the dll/com into my exe and i can't seem to find a solution to this, i don't know if it's possible.
Use dynamic loading of CLR technique to load and use DLL. refer to this Hosting the .NET runtime in a Delphi Program you might get your answer.
In dynamic loading technique you need not register the DLL you just have to generate a TLB and interface for your DLL and through that use the DLL.

Delphi desktop sharing

I want to provide desktop sharing from within my Delphi application (remote viewing essentially).
In my research I have found C# source that does exactly what I want: http://blogs.msdn.com/b/rds/archive/2007/03/23/writing-a-desktop-sharing-application.aspx
However I cannot find any reference to accessing rdpcomapi (rdpencom.dll) from Delphi.
Can anyone point me to a Delphi interface to this COM object?
You should be able to get the required Delphi interfaces by importing the COM type library for rdpencom.dll. In Delphi XE2, select the View | Registered Type Libraries menu, sort by "Description" and find the rdpcomapi 1.0 Type Library. Click Import on the toolbar to create the Delphi interface/type definitions.

Import COM component: Difference c# vs. Delphi XE

I need to work with a COM component. Unfortunately its producer explicitly doesn't support Delphi and delivers only C# and VB.NET examples. There is no type library available for that component.
OTOH it's quite straightforward in VS2010 because the respective COM library (WinSig.exe) is listed as a reference.
In the VS2010 IDE this is in "Project - Add reference - COM tab". In Delphi XE I cannot find that entry in "Component - Import Component - ActiveX".
I have inspected the entries in the two IDEs and found that there are some COM components included in the Delphi IDE which are also in the VS IDE but there are a lot of COM components missing in the Delphi IDE.
See for screenshot file which shows that the first seven COM components are not displayed within the Delphi IDE.
Can one explain why this is so and maybe a help for that specific problem?
Did you checked Import a Type Library option in Import Component wizard (on the first page)? ActiveX is narrower thing than COM. Also, you can use Add button to choose a file if you know library location.

how to use system.xml.dll in delphi

I downloaded the system.xml.dll, then added it to my Delphi code as following:
uses system.xml;
etc...
When I try to compile the project, the following message appears:
file not found system.xml.dcu.
Can anyone guide me how to solve this problem?
Thanks.
The uses clause in Delphi refers to Delphi units, either compiled in a *.dcu file or a *.pas source file that the compiler will use to generate the corresponding *.dcu that is needed.
You cannot just reference the DLL itself.
To use your DLL, you would need at least a unit that would expose in a Pascal way the DLL interface or parts of it.
It can be the Pascal translation of a C header file or just declaring some external routines from the dll to load statically with your program...
What you probably need to reference to work with XML in Delphi are XMLIntf and maybe xmldom.
Have you looked at what the XML Data binding wizard or the XML Mapper Tool can do for you?
Note: I assumed you were working with Delphi Win32. And AFAIK system.xml.dll is part of the .NET world.
If you are using Delphi for .Net you need to add a reference to the system.xml.dll assembly to your project.
If you are using Delphi (Win32), then in order to be able to use .NET assemblies (DLLs), you have the option of using COM interfaces. Follow below steps:
Open the project you want to use it in.
Use Component menu.
Select "Import Type Library"
Select the DLL you want to use.
Follow the next steps as given by wizard.
This will generate a source file which is essentially a wrapper. You can call function of that wrapper as you need.
Please note that using above method will mean that .NET framework must be present on the computer running your application.

How to consume and re-expose a Win32 type library using Delphi Prism

I currently have a Win32 type library created in Delphi which I need to consume, implement and re-expose via .NET. What are the steps necessary to bring the TLB into Prism so the interface can be implemented?
the .NET 2.0 sdk tool TLBIMP can create an assembly from a TLB file. Something like:
tlbimp.exe mytlb.tlb /out:MyTLB.Import.dll /namespace:MyTLBImport
Make sure you use /publickey /keyfile or /keycontainer if you want to sign it later on.
After the import, just reference the dll and use it as a regular library.

Resources