1
votes

I've created a Delphi COM dll that implements two different interfaces, each with its own class id. It didn't register correctly in the Delphi (XE7) IDE but regsvr32 in an elevated command prompt was quite happy and said it succeeded.

However, only one of the two interfaces was registered and there's no sign of the other interface's clsid in the registry and confirmed by attempts to connect to failing with Not registered errors. Naturally I would like both interfaces registered. What's my best course of action?

1
Use TRegSvr rather than revsvr32, and single-step through it to verify that each interface is registered? - MartynA
Interesting idea. Sadly it failed with Failed to load ... dll. This from an elevated prompt. Meanwhile regsvr32 still succeeded. I did it again just to check. So maybe I need to check my dll. I have the source code so will step through it.. - David Bolton
Well, bear in mind that you have the source of TRegSvr and can transplant it directly into your own app to get to the bottom of what's (not) happening ... - MartynA
In either case with or without the -c parameter it gets through RegisterAxLib to the line OutputFmt(SRegSuccessful) but blows up on ther FreeLibrary in the finally on line 130. The library loads fine in the LoadLibrary but blows up on freeing. I tried wrapping that freeLibrary with try except but it just goes bam. - David Bolton
Please add code to your question, maybe you did something wrong... - whosrdaddy

1 Answers

1
votes

Well I'm not saying this is the right answer, but I exported the clsid of the interface that worked, edited the file, changed the GUID and merged it back into the registry. It works now on both interfaces, though they are on different threads (the dll is multithreaded- never a dull moment!).

It doesn't feel right though doing it this way! Here is my edited file. Only the GUIDs were changed.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{C5EF04CB-63D6-4184-9873-2ADCF6C26EF8}]
@="MyRDP"

[HKEY_CLASSES_ROOT\CLSID\{C5EF04CB-63D6-4184-9873-2ADCF6C26EF8}\InprocServer32]
@="C:\\dev\\VirtualChannels\\Client2\\Client2.dll"
"ThreadingModel"="Free"

[HKEY_CLASSES_ROOT\CLSID\{C5EF04CB-63D6-4184-9873-2ADCF6C26EF8}\ProgID]
@="Client2.Plugin"