Build, using, or manifest issues about using a registration-free COM DLL

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
(If this thread is on a wrong sub-forum, please help to move to correct one)
1. Our project needs to use a 3rd party COM (registration-free), e.g. iQOpen.dll (which is installed to winsxs successfully, and I am sure that it can work fine.)
2. Our project structure is an executable (e.g: Proj1.exe) and several plug-in DLLs (one of plug-in such as plugA.dll will use the iQOpen.dll)
Proj1.exe will load plugA.dll by LoadLibrary() API, and plugA.dll will export a function such as funcA() to create and access COM objects in iQOpen.dll
plugA.dll will depend on iQOpen.dll
Proj1.exe should *not* depend on plugA.dll and iQOpen.dll, I think.
3. in plugA.dll I use like this
<pre style="font-family:Consolas; background-color:silver <span style="color:blue #pragma <span style="color:blue comment(linker, <span style="color:#a31515 ""/manifestdependency:type=win32 name=FARO.LS version=1.1.406.0 processorArchitecture=amd64 publicKeyToken=1d23f5635ba800ab"")
<span style="color:blue #import <span style="color:#a31515 "iQOpen.dll" no_namespace[/code]
3. for plugA.dll, I set the manifest options like
Configuration Properties=>Linker=>Manifest File=> Generate Manifest: Yes
Configuration Properties=>Manifest Tool=>Input and Output=>Embed Manifest: Yes
And I used visual studio 2010 to open the plugA.dll to verify that the RT_MANIFEST2 exist and the content is correct.
4. Then compile the plugA.dll. Then release the plugA.dll to the folder of proj1.exe
5. proj1.exe should *not* have dependency on plugA.dll and iQOpen.dll. So, manifest of proj1.exe will not contain the information of iQOpen.
The result is proj1.exe failed to create COM interface through funcA() of plugA.dll, the _com_err is "<span style="font-size:11.0pt; font-family:Calibri,sans-serif; color:#003300 0x80040154 Class not registered"

6. But, If I add the iQOpen.dll information (such as the following #pragma) into the manifest of proj1.exe, everything works fine. the funcA() of plugA.dll will create COM interface and return the pointer successfully. And in proj1.exe, I can use the returned
pointer to use the COM correctly.
<pre style="font-family:Consolas; background-color:silver <span style="color:blue #pragma <span style="color:blue comment(linker, <span style="color:#a31515 ""/manifestdependency:type=win32 name=FARO.LS version=1.1.406.0 processorArchitecture=amd64 publicKeyToken=1d23f5635ba800ab"")[/code]


Summary:
The iQOpen.dll is installed correctly, and the plugA.dll can workfine if proj1.exe also add the dependency into the manifest.
but according our design, proj1.exe will load plugA.dll by LoadLibrary, it should not depend on iQopen.dll.

I am not sure if I miss configured something of the build/link parameters of plugA.dll and proj1.exe, or I ignored some settings.

I suffered this problem for a long time but failed to resolve it. Any comment will be much appreciated.

thx.
<br/>
<br/>

View the full article
 
Back
Top