Microsoft C ++异常:内存位置为_com_error [英] Microsoft C++ exception: _com_error at memory location

查看:816
本文介绍了Microsoft C ++异常:内存位置为_com_error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在.Net中创建了一个COM dll,并在任何CPU下构建它。我在Vcpp代码中使用该COM dll,但在创建指向COM类的指针引用时遇到了Microsoft C ++异常:_com_error在内存位置错误。如果Build配置为Win32,则VCPP代码可以正常工作,但是如果我将配置更改为X64模式,则应用程序崩溃。

I have created a COM dll in .Net and build it under Any CPU. I am using that COM dll in Vcpp code but getting Microsoft C++ exception: _com_error at memory location error when creating the pointer reference to COM class. The VCPP code works perfectly fine if the Build configuration is Win32 but if i change the configuration to X64 mode then teh application crashes.

请帮助

推荐答案

由于您正在使用所谓的处理中的 DLL,因此您必须在该DLL中使用该DLL的64位版本您的程序。

Since you're using a so-called in process DLL, you have to use the 64 bits version of that DLL in your program.

这个问题对其进行了讨论。看来您必须使用64位重排工具来注册.NET DLL。

This question discusses it. It seems that you have to use the 64 bit regasm tool to register your .NET DLL.

这篇关于Microsoft C ++异常:内存位置为_com_error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆