I support the VS2010 project, which has several cross-referenced COM libraries. I am trying to configure a project so that it is created on a random workstation where VS2010 is installed. The workstation can be either 32 or 64 bits, so if I set the project to "register output", the assembly will not be able to build a 32-bit machine, since the 64-bit DLL will not be available for download to call DllRegisterServer.
Here is an example: Typelib from project B refers to typelib from project A. Project C will refer to project B using the following statement:
#import "B.tlb"
Since library B references A when B.tlb is imported, the compiler tries to load types from A. So, if A is not registered, compilation will end with:
error C4772:
I tried to open B.tlb using the OleView application, and it is sure that the devil knows only the file name for the library. Link if registered with regsvr32.
So my question here is: is there an alternative way for library references to resolve themselves correctly, without having to register a TLB, simply placing all the files in the same directory or binding some kind of manifest? For example, rename the TLB for the library as .tlb or something like that.
source
share