BSTR,如何自己制作?
我需要将 Linux 应用程序连接到使用 bstr 数据的服务器。我可以“滚动”自己的代码来制作 bstr 吗?我知道 bstr 的基础知识,它的标头的字节大小减去空终止符,并且由于标头的原因,它可以在字符串中间包含空值,并且基本上遵循 bstr 的所有其余规则。
我不确定对标头进行字节排序或更详细的细节,例如我是否像 com 那样传递指向标头或第 5 个字节的数据?有谁知道我可以从哪里获得这些信息,或者是否有人为 linux 编写过 bstr 类型类?或者一般来说,我可以在哪里找到有关 bstr 详细信息的信息,而不仅仅是基于 Microsoft 库的一般概述?
谢谢
I need to interface a Linux app to a server that uses bstr data. Can I "roll" my own code to make a bstr? I know the basics of a bstr, that it has a header with the byte size minus the null terminator and because of the header it can contain nulls in the middle of the string and basically all the rest of the rules that follow a bstr.
I am not sure on byte ordering the header or more intimate details such as do I pass the data on pointing to the header or the 5th byte like com does? Does anyone know where I can get this information or if anyone has written a bstr type class for linux? Or in general where I can find info on bstr details rather than just general overviews based on the Microsoft libs?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能对此感兴趣:
Eric 的完整指南BSTR语义
编辑:更多细节,从那篇文章中收集到:
免责声明:这是我的想法,并且我包含严重错误,直至但不限于因果关系的破坏和已知的结束宇宙。
这应该可以让您很好地了解正在发生的事情。请注意,如果与 Win32 的交叉比较很重要,则需要使用 SysAllocString 等来代替此代码。
This may be interesting for you:
Eric's Complete Guide To BSTR Semantics
EDIT: Some more details, as gleaned from that article:
DISCLAIMER: This is off the top of my head, and my contain serious errors, up to but not limited the destruction of causality and the end of the known universe.
This should give you a good idea of what's going on. Note that if cross-comparability with Win32 is important, you need to use SysAllocString, etc instead of this code.