RE: How to use VARIANT Structure of C on MAC OSX and XCODE2.2...............
RE: How to use VARIANT Structure of C on MAC OSX and XCODE2.2...............
- Subject: RE: How to use VARIANT Structure of C on MAC OSX and XCODE2.2...............
- From: "Kenny Millar" <email@hidden>
- Date: Mon, 8 May 2006 10:05:44 +0100
- Organization: Kenny Millar
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=email@hidden
[mailto:darwin-dev-bounces+kennymillar=email@hidden] On Behalf Of
Peter Seebach
Sent: 08 May 2006 09:59
To: email@hidden
Subject: Re: How to use VARIANT Structure of C on MAC OSX and
XCODE2.2...............
In message <email@hidden>, "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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden