0
votes

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
1) if you have a COM .dll, why not just get with the program and run "regsvr32 mydll.dll"? 2) If you actually have a .Net .dll, how do you hope to run it from a Delphi7 Win32 (unmanaged) .exe?paulsm4
Currently we register it programmatically via "regasm mydll.dll" but we are investigating a registration free approach. Why wouldn't I be able to run it from Delphi 7? The MSDN walkthroughs demo how to do it via C++ and VB6.user1365081
Not quite sure what problem you've got. Is it (a) when you register the DLL your client can consume objects OK, and you want to know how to set up the registration-free stuff, or (b) your client is not able to consume the objects at all, even when you register the DLL?Ciaran Keating
It's (a). The dll is registered and my client can consume it without any problems. We want to move to side-by-side deployment, therefore we've unregistered it, set-up the manifests detailed and compiled the project. The existing code looks something like this: ReportFramework := CreateCOMObject(CLASS_ID) as IReportFramework but I'm assuming I need to replace this as CreateCOMObject looks in the registry (or the GAC) for the dll.user1365081
If you set up the SxS (side-by-side) manifests correctly for Registration-free COM, you don't have to change your code at all. That is the whole point. SxS redirects CoCreateInstance() (which CreateCOMObect() 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

1 Answers

0
votes

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