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.
Related
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.
What is dclsmpedit package (Embarcadero Editor Script Enhancements)?
Do I need it?
I am not sure what 'Editor Script Enhancements' does.
It's a sample of adding key bindings (your own code editor keyboard assignments), the ability to save keyboard macros (keystrokes recorded for playback), and an edit buffer list to the IDE using the ToolsAPI. You only need it if you want to use it 's functionality. The source is useful if you want to extend the IDE via the parts of the ToolsAPI that they demonstrate. The key binding functionality in BufferList.pas implements the New IDE Classic key mapping in the IDE itself (as pointed out by #LURD in the comment below).
If you're using Delphi 2007, you can find the source in the Delphi Demos folder (by default on Windows 7 in C:\Users\Public\Documents\RAD Studio\5.0\Demos\DelphiWin32\VCLWin32\ToolsAPI\Edit Keybinding), and more easily found with the Start->CodeGear RAD Studio->Samples menu item. The source for the added functionality is there as well, so you can see what they do and how they are implemented.
In XE3, the source code can be found in C:\Users\Public\Documents\RAD Studio\10.0\Samples\Delphi\VCL\ToolsAPI\Editor KeyBinding, or via Start->All Programs->Embarcadero RAD Studio XE->Samples.
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.
I'm trying to generate _TLB import units for Outlook 2003, 2007 and 2010 (and also other OLE servers) analogous to the ones bundled with Delphi for Outlook 2000 and 2002. However, I couldn't get the type library importer to also generate the code for capturing events from the OLE servers that is found in the bundled units. The option to "Generate component wrappers" only creates wrappers for servers that are directly instantiatable but not for objects that are only returned via methods of other objects like TInspector, TExplorer, etc.
I could of course create the event handling code myself but that would be really tedious work.
Does anyone know if the importer contained with Delphi 2010 (tlibimp.exe) can be tweaked to generate that code? I really doubt that back in the day Borland created the existing Outlook2000.pas and OutlookXP.pas units manually...
Are there maybe any other tools around that can do this?
Good question! I never noticed that those components were not created (I only use Word_TLB). After playing a bit with tlibimp I found out that you need the -Yc+ flag. Probably all ignore flags are default on.
NB: this is on Delphi 7 with tlibimp.exe version 7.0.4.453
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.