日期:2014-05-19  浏览次数:20840 次

System.Drawing.Image类型的接口怎么用在VC.NET的win32程序中?
用C#做了一个COM,其中一个接口返回类型是通过调用System.Drawing.Bitmap.GetHIcon()得到的IntPtr。

在VC.NET的win32程序中,当调用该接口时,会发生0x80131600错误,即_com_error   &错误:

ex {0x80131600} _com_error   &
__vfptr 0x0041c2d8   const   _com_error::`vftable ' *m_hresult 0x80131600 const   HRESULT
m_perrinfo 0x001d0a2c IErrorInfo   *
m_pszMsg 0x00000000   <错误的指针> wchar_t   *


说到底,就是接口中返回的System.Drawing.Bitmap的位图如何在vc.net   win32程序中正确返回?

------解决方案--------------------
心有余而力不足,帮楼主顶顶
------解决方案--------------------
其中一个接口返回类型是通过调用System.Drawing.Bitmap.GetHIcon()得到的IntPtr。
=======================
作为参数传递,一般com 接口返回的是HRESULT