RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Call CoCreateInstance (directly or indirectly) to create an instance of a COM object that is implemented in a module which was built with some Isolated COM settings in its manifest. There are several wrapper classes that could have been used to make the CoCreateInstance (or CoCreateInstanceEx) call indirectly, or you could have a call directly to that function.
The HRESULT return code may be 0x8007007b (ERROR_INVALID_NAME), if the COM sub-system was not able to load the DLL that implements the COM object.
In cases where the Registration-Free COM was not correctly completed, and the embedded manifest is not correct or complete, the LoadLibrary call may fail. Ole32 attempts to load the DLL as part of the process of creating the object, but an incorrect manifest may cause it to return STATUS_OBJECT_NAME_INVALID (0xc0000033). This error gets propagated back to the return from CoCreateInstance as ERROR_INVALID_NAME (0x8007007b). This may be misleading, since the path and filename of the DLL may be perfectly correct.
If the Registration-Free COM is desired, it should be implemented correctly. Here are some articles that may be helpful in correctly implementing this feature:
If Reg-Free COM was not intended, there may be some properties unintentionally specified in the Isolated COM page of the Manifest Tool configuration properties for the project. The "Type Library File" (/tlb) and "Component File Name" (/dll) properties will result in <file>, <comClass>, <comInterfaceExternalProxyStub>, and such tags being added to the assembly manifest embedded in the DLL. Removing the unwanted properties and then rebuilding the project should resolve the issue.
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Microsoft Visual Studio 2005 Professional Edition, Microsoft Visual Studio 2005 Service Pack 1, Microsoft Visual Studio 2005 Standard Edition, Microsoft Visual Studio 2005 Team Edition for Database Professionals, Microsoft Visual Studio 2005 Team Edition for Software Architects, Microsoft Visual Studio 2005 Team Edition for Software Developers, Microsoft Visual Studio 2005 Team Edition for Software Testers, Microsoft Visual Studio 2005 Team Suite, Microsoft Visual Studio 2005 Express Edition