关于托管VC++ Dll升级的问题

Sunday1984 2007-08-10 10:36:15
有劳各位看看这个问题:
我有一个Visual Stdio 2003托管的C++的dll程序,之后我把它升级到Visual Studio 2005,在VS2005用一个C#程序调用这个托管的dll文件,但是它总是提示"BadImageFormatException was unhanlded(is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"错误,我已经把它配置成Win32 Platform了.
错误表现是我的C#程序引用这个dll,只要在C#代码中出现使用这个dll中的类时(不调用它的方法)C#程序就提示这个错误,不知各位对此有什么高见!
...全文
194 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jeremy 2007-08-14
  • 打赏
  • 举报
回复
帮顶,接分!!
真相重于对错 2007-08-10
  • 打赏
  • 举报
回复
我有一个Visual Stdio 2003托管的C++的dll程序,之后我把它升级到Visual Studio 2005,在VS2005用一个C#程序调用这个托管的dll文件,但是它总是提示"BadImageFormatException was unhanlded(is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"错误,我已经把它配置成Win32 Platform了.
====
托管是托管,win32 platform 是win32 platform ,不一样的东西,你到底做成了什么??
如果是win32 platform 的,C#是用需要用dllimport方式,而不是引用??

lizhizhe2000 2007-08-10
  • 打赏
  • 举报
回复
First, make sure you are compiling in the proper mode. Check Visual Studio 2005's Configuration Manager (Build menu, Configuration Manager item) and select Win32.

Second, if you are missing a dll that the code references inside your Managed C++ dll (this is typically what happens), use Dependency Walker to find out what's missing.

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧