I have a Delphi client (exe) and .NET COM dll which I am trying to run without the need for registering the dll. I have followed the steps here and my Delphi client compiles fine. However, I'm not a Delphi expert and I'm unable to figure out how to consume the object in Deplhi. Taking the Skype4COM.dll example linked to, how would I access the dll and it's methods from Delphi 7? Thanks in advance.
1 Answers
This is not an answer, but I want to include a code sample and this is the only way I know how on Stack Overflow.
In case it may help you, here's a sample of how we included a reference to the MS Flex Grid control in one of our VB6 projects that we deployed in SxS. The client is AbbottMST.exe, the COM server is MSTEngine.dll, and this is a cut-down sample from the client manifest file, AbbottMST.exe.manifest.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="AbbottMST" version="4.0.0.7"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="MSTEngine" version="4.0.0.4"/>
</dependentAssembly>
</dependency>
<file name="msflxgrd.ocx">
<comClass clsid="{6262D3A0-531B-11CF-91F6-C2863C385E30}"
tlbid="{5E9E78A0-531B-11CF-91F6-C2863C385E30}"
progid="MSFlexGridLib.MSFlexGrid.1"
description="Microsoft FlexGrid Control, version 6.0 (SP6)"
/>
</file>
</assembly>
Note that if you include the manifest then you must deploy it as side-by-side. For this project we needed to have both a normal registered version for Windows 2000, which doesn't support SxS, and a side-by-side version for XP. The version of the EXE with this manifest bound to it will not run in a non-SxS installation. (There might be some magic incantation that we don't know about, but that was our experience.)
CoCreateInstance()
(whichCreateCOMObect()
calls internally) to the manifest instead of the Registry/GAC. Your app's code never knows the difference. So make sure your manifests are correct. – Remy Lebeau