Passing a VARIANT from mac OS X Excel 2011 VBA to c++

早过忘川 提交于 2020-01-07 01:22:13

问题


I am under mac OS X, and using excel-2011 vba. I know how to pass various types from VBA to c++ and inversely, mainly thanks to this.

Now, I would like to know if it is possible to somehow pass a VBA variant to c++ (I am using gcc 5.2). Of course, there's no VARIANT in gcc but, after all, VARIANT is "just" a union. (The optimistic guy.) Have you guys heared about classes mimicking microsoft's VARIANT and allowing to achieve this ? (In the first time, I could accept to forget about IUnknown and IDispatch !)

I am aware of mono, and looked what I could get from it, as they also have a VARIANTclass, but I don't know if it wise. I looked for a document explaining in detail the object model of excel-2011 for mac, without any success.

Precision. I am not saying that microsoft's VARIANT is, under windows, the optimal way to exchange data between c++ and excel but, with COM and ATL and stuff, I am quite used to it and it works well for what I do, so I am trying to stick to something of the "same kind" under mac OS X. I may be wrong, but in this case, I would really like to know how I could do what I want to do.


回答1:


I finally opted for porting VARIANTto mac os x, see here :

BSTR's and VARIANT's under... mac os x

where I described how I am now trying to do it.



来源:https://stackoverflow.com/questions/32301783/passing-a-variant-from-mac-os-x-excel-2011-vba-to-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!