site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Organization: Kenny Millar Thread-index: AcZyfXNyzC1n1o0OQoSBIPTmmz61FwAAIHXg A VARIANT in Microsoft world is simply a 'union' with all the different types laid on top of each other, and a member variable to say which type is in use. You could do something similar like this..... (typed in mail) typedef struct _VARIANT { int vt; union { float fltVal; double dblVal; int intVal; // and so on } }VARIANT, *PVARIANT; And then #define your vt's like this.... #define VT_FLOAT 1 #define VT_DOUBLE 1 #define VT_INT 1 Or you could just copy and paste all the relevant structures and definitions from oaidl.h on your windows machine. -Kenny -----Original Message----- From: darwin-dev-bounces+kennymillar=mac.com@lists.apple.com [mailto:darwin-dev-bounces+kennymillar=mac.com@lists.apple.com] On Behalf Of Peter Seebach Sent: 08 May 2006 09:59 To: darwin-dev@lists.apple.com Subject: Re: How to use VARIANT Structure of C on MAC OSX and XCODE2.2............... In message <WM5257A1A31158427aA6F64CE631ACF26E@spsoftindia.com>, "Gaurav Kumar" writes:
I want Variant type structure as is in C which can accept any data type.
This can't be done in C. I'm not even sure what you're talking about, but there's nothing similar in C. You could do templates in C++.
VARIANT V;
V.vt = VAR_INT;
It gives error as VAR_INT is not declared and vt is of non type void *.
Okay, you're hosed. This is not a feature of the language. -s _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/kennymillar%40mac.com This email sent to kennymillar@mac.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com