Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
v2

1 solution

In C++ equivalent of adding reference is using #import "comserverdllname" ex:#import "test.dll"
 
Share this answer
 
Comments
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?

Thanks.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900