简体   繁体   English

在Windows 7 64位上使用VS 2008访问COM DLL

[英]Access COM DLL using VS 2008 on Windows 7 64 bit

I am using Windows 7 64 bit OS and VS 2008 SP1 as development environment. 我正在使用Windows 7 64位OS和VS 2008 SP1作为开发环境。

One of the console application uses a COM component. 控制台应用程序之一使用COM组件。 When I try to create an instance of a class from the COM component, I got following error: 当我尝试从COM组件创建类的实例时,出现以下错误:

Creating an instance of the COM component with CLSID {CE92C3B9-9A93-40E1-85AB-6A49170AEF7F} from the IClassFactory failed due to the following error: 80010105. 由于以下错误,从IClassFactory创建具有CLSID {CE92C3B9-9A93-40E1-85AB-6A49170AEF7F}的COM组件实例失败,原因是:80010105。

I assume that you're building an managed .NET application from the fact that you added a C# tag to the question. 我假设您是根据向问题中添加C#标记而构建的托管.NET应用程序。 Managed applications are started in the as a 64-bit process unless you explicitly define it to be launched as a 32 bit application through ProjectProperties - Build - Platform Target. 除非您通过ProjectProperties-Build-Platform Target明确定义将其作为32位应用程序启动,否则托管应用程序将以64位过程启动。 If the COM component you're loading (in-process?) comes from a 32-bit native DLL then the instantiation will fail since you obviously cannot mix CPU models in 1 process. 如果要加载的COM组件(进程内?)来自32位本机DLL,则实例化将失败,因为您显然无法在1个进程中混合使用CPU模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM