Click here to Skip to main content
11,922,534 members (31,782 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ COM DLL
I've got a C++ client accessing some registry-free C++ COM DLLs.

I followed instructions here:

Registration-Free Activation of COM Components: A Walkthrough[^]

and got my client working almost OK.

However, my side-by-side DLL calls into many other COMs.
These internal COMs appear not to be working.

To clarify, I have COM A and COM B.
I do a CreateInstance inside my client to COM A and it works.
Inside COM A there is a CoCreateInstance to COM B and this appears not to work.

The manifest file describes all the COMs involved, and I have made sure the manifest file is being read (if I deliberately mess up the entry for COM A, the client says it can't find the specified module).

I've only ever managed to get this set of DLLs to work as registry-free COMs from a .NET C# application, where you stick all relevant DLLs in as references, register the COMs at build time, unregister at run time and they work.

However, in C++ I don't know what the equivalent of adding references is.

Any help, greatly appreciated!
Posted 11-Apr-13 0:16am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

In C++ equivalent of adding reference is using #import "comserverdllname" ex:#import "test.dll"
PaulowniaK 15-Apr-13 2:51am
Thanks for the tip. That makes sense!
However, I have another problem. #import "mydll.dll" is fine, but the dll's name and the type library's name are different so causes a compilation error.

Basically, it can find mydll.dll but it can't find its type library which is mydllobject (although the actual file name is mydll.tlb).

When I do all this in C#, adding mydll.dll to references automatically lists up mydllobject.

Could you please help?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 453
1 Dave Kreskowiak 335
2 Sergey Alexandrovich Kryukov 263
3 Richard MacCutchan 225
4 ppolymorphe 175
0 OriginalGriff 7,231
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,356
3 George Jonsson 2,865
4 Suvendu Shekhar Giri 2,216

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100