将一个VARIANT从mac OS X Excel 2011 VBA传递给c ++ [英] Passing a VARIANT from mac OS X Excel 2011 VBA to c++

查看:149
本文介绍了将一个VARIANT从mac OS X Excel 2011 VBA传递给c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS X下,并使用excel-2011 vba。我知道如何将各种类型从VBA传递给c ++并且相反,主要是由于这个



现在,我想知道是否可能以某种方式将VBA变体传递给c ++(我使用gcc 5.2)。当然,在gcc中没有 VARIANT ,但毕竟, VARIANT 是只是一个联合。 (乐观的人。)你有没有听说过类似微软的 VARIANT 的类,并允许实现这一点? (第一次,我可以接受忘记 IUnknown IDispatch !)



我知道 mono ,并看看我可以从中得到什么,因为他们也有一个 VARIANT 类,但我不知道它是否明智。我寻找一个文档,详细解释了excel-2011的mac的对象模型,没有任何的成功。



精准。我不是在说微软的 VARIANT 是在Windows下,在c ++和excel之间交换数据的最佳方式,但是使用COM和ATL和东西,我很习惯它,它的工作原理为了我做什么,所以我试图坚持在Mac OS X下的同类的东西。我可能是错的,但在这种情况下,我真的很想知道我该怎么做我想做的。

解决方案

我终于选择将 VARIANT 移植到mac os x这里:



BSTR的和VARIANT的... mac os x



我描述了我现在正在尝试的方式。


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.

解决方案

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.

这篇关于将一个VARIANT从mac OS X Excel 2011 VBA传递给c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆