高分请教如何传递一个结构体从VC COM组件-〉.NET VB程序?(在线等待)

herochuangxin herochuangxin 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
struct tstruct_t {
int i;
BSTR str;
int j;
};
typedef
[
uuid(633CCB72-AFD2-4904-98D4-5788AE81147B),
helpstring("tstruct_t structure")
]
struct tstruct_t datat;

HRESULT testfunc1([in,out] VARIANT *ptests);

在com中定义如下:
在调试时发现在com中返回的是安全数组,可以取可以取到vb.net端传过来的字符数据,但是在vb端调用时会出现以下错误:
"The specified record cannot be mapped to a managed value class."
参考以下链接:http://support.microsoft.com/default.aspx?scid=kb;en-us;309329
解决方案是说:"To resolve this problem, construct a custom marshaler that adds this functionality. "
不知怎么解决?
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
herochuangxin
ATL 3,248 成员 48,530 内容