VS2008 exe-VC6 dll互操作
我听说在 VS2005 和 VC6 之间传递 wchar_t 是相当危险的。 我试图从 VS2008 exe 中删除从 VC6 dll 分配的内存,它引发了断言。在参考 创建 wstring 时出现错误的指针或链接问题之后从vc6 dll开始,我在VC6 dll中添加了一个函数,该函数将用于删除内存。它解决了我的问题。
但是VS2008和VC6之间whcar_t的内部结构有什么区别吗..请帮忙..Rgrds
, 神东
I heard somewhere that passing of wchar_t across VS2005 and VC6 is quite dangerous.
I tried to delete memory which was allocated from VC6 dll from VS2008 exe, and it raised assertion. After referring Bad pointer or link issue when creating wstring from vc6 dll, i added one func in VC6 dll which shall be used to delete memory. And it solved my issue.
But is there any difference between internal sturcture of whcar_t between VS2008 and VC6.. Please help..
Rgrds,
Jinto
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,VC6 没有
wchar_t
类型。不过,两者都是 16 位类型,因此不会造成重大问题。这可能与您使用malloc()
和free()
遇到的问题无关,它们适用于原始的、无类型的内存。VC6 didn't have a
wchar_t
type, to start with. However, on both it's a 16 bits type, so that shouldn't cause major issues. It's likely unrelated to the problems you have withmalloc()
andfree()
, which work on raw, untyped memory.