My C# application calls a function in a C++ DLL at run-time and throws an exception. The error code generated is 262. Unfortunately, the Microsoft documentation is a bit lacking for this code.
Oddly, this exception is not thrown when running the DLL from the C++ test application that is part of the same Visual Studio solution as the DLL (separate project). (The C# application is in an entirely separate solution.) The error code is returned by a call to CoInitializeEx
, which initializes the COM and is the first step my application uses to query the WMI.
The only other thing seems to be related is when I open the DLL with Dependency Walker I get these error and warnings:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
The only thing that occurs to me is that the missing "required implicit or forwarded dependency" has what is needed ot make CoInitializeEx
work. According to Dependency Walker, these modules could not be found:
- MSVCR90D.DLL
- IESHIMS.DLL
- WER.DLL
Any thoughts or suggestions are appreciated. Thanks.