开发者

Using boost to handle COM variants

开发者 https://www.devze.com 2023-04-06 10:33 出处:网络
I\'m working with a c++ project that has a lot of COM functions. The majority of the inputs and outputs are VARIANTs. Is there an easy way to serialize/开发者_StackOverflowdeserialize these into long,

I'm working with a c++ project that has a lot of COM functions. The majority of the inputs and outputs are VARIANTs. Is there an easy way to serialize/开发者_StackOverflowdeserialize these into long, string, etc using Boost?


Boost has absolutely nothing with regards to Microsoft's COM technology. The closest thing to COM's variant in Boost would be boost::any. You can write COM's variant_t to boost::any converter, then you can serialize, cast etc.


There is an open source OPC (OLE for Process Control) server implementation called FatRat library. It uses boost and pushes a lot of VARIANTs around. Very inspirational.

0

精彩评论

暂无评论...
验证码 换一张
取 消