win7下 winform程序调用COM组件 运行提示 “访问内存位置失效”

ponydph 2014-12-26 11:31:24
一个winForm程序,加载了一ActiveX控件,用来显示图形,程序编译完成后,在xp下运行正常,
但是在Win7 总是提示 内存位置访问无效,追踪代码报错的位置为:
((System.ComponentModel.ISupportInitialize)(this.axvg)).EndInit();
就是控件 结束初始化的地方。

采用管理员权限运行也不行,什么原因。

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.BadImageFormatException: 内存位置访问无效。 (异常来自 HRESULT:0x800703E6)
在 System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
在 System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
在 System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
在 System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
在 System.Windows.Forms.AxHost.CreateInstance()
在 System.Windows.Forms.AxHost.GetOcxCreate()
在 System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
在 System.Windows.Forms.AxHost.CreateHandle()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


...全文
452 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zlcpyy 2016-07-15
  • 打赏
  • 举报
回复
我也遇到了这样的问题,有谁知道怎么解决不
丹东老李 2015-12-13
  • 打赏
  • 举报
回复
请问解决了吗,如有解决方法的,可以提供捐赠
qwioer 2015-03-23
  • 打赏
  • 举报
回复
我也遇到了这样的问题,有谁知道怎么解决不
ponydph 2014-12-29
  • 打赏
  • 举报
回复
有没有人遇到这个问题???
ponydph 2014-12-27
  • 打赏
  • 举报
回复
引用 1 楼 devmiao 的回复:
你的操作系统是不是64bit的,强制你的程序集在32bit下运行。
不是 ,32位的win7,
ponydph 2014-12-27
  • 打赏
  • 举报
回复
请高手指点一下 。。。。
devmiao 2014-12-26
  • 打赏
  • 举报
回复
你的操作系统是不是64bit的,强制你的程序集在32bit下运行。

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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