By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

How to use VARIANT??

P: n/a
Hi all,

Im being supplied data from shared memory in the format of VARIANT's.

Ive been searching through MSDN and Google for quite a long time now
and i cannot find how these should be used in C++ (MS VisualStudio
V8.0).

Are there macros that are used to handle values, types, etc?
Also, how do i handle (and test for) NAN/QNAN values?

Thanks in advance.

Nov 6 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hi Mark!
Im being supplied data from shared memory in the format of VARIANT's.
Hm... you can't use VARIANT in shared memory... it sometimes contains
pointers to some memory from the process who allocated the VARIANT...

So it is a bad idea to use VARIANT in a shared-memory-situation.
Ive been searching through MSDN and Google for quite a long time now
and i cannot find how these should be used in C++ (MS VisualStudio
V8.0).
See: Variant Manipulation Functions
http://windowssdk.msdn.microsoft.com.../ms221673.aspx
Are there macros that are used to handle values, types, etc?
V_xx macros...
Also, how do i handle (and test for) NAN/QNAN values?
As always... in V_R4/R8

Greetings
Jochen
Nov 6 '06 #2

P: n/a
Ok, that cleared up a few things.
Also, how do i handle (and test for) NAN/QNAN values?
As always... in V_R4/R8
Ok, V_R8 returns the value "1.#QNAN00000000000" as shown in the VS
debugger.
How do i test for this? What would an if statement look like?

ie:
if (V_R8(&v) == ????) {blah}

Thanks again.

Nov 6 '06 #3

P: n/a

"Mark Williams" <mw****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Ok, that cleared up a few things.
Also, how do i handle (and test for) NAN/QNAN values?
As always... in V_R4/R8

Ok, V_R8 returns the value "1.#QNAN00000000000" as shown in the VS
debugger.
How do i test for this? What would an if statement look like?

ie:
if (V_R8(&v) == ????) {blah}
if (V_R8(&v) != V_R8(&v)) {blah}

is the C++ standard way to detect NAN, assuming that V_R8 returns a double.

Jeff Flinn
Nov 6 '06 #4

P: n/a
Hi Mark!
Ok, that cleared up a few things.
>>Also, how do i handle (and test for) NAN/QNAN values?
As always... in V_R4/R8

Ok, V_R8 returns the value "1.#QNAN00000000000" as shown in the VS
debugger.
How do i test for this? What would an if statement look like?

ie:
if (V_R8(&v) == ????) {blah}
_isnan
Greetings
Jochen
Nov 6 '06 #5

P: n/a
Mark Williams wrote:
Ok, V_R8 returns the value "1.#QNAN00000000000" as shown in the VS
debugger.
How do i test for this? What would an if statement look like?

ie:
if (V_R8(&v) == ????) {blah}
Someone has doubtless told you VARIANT is off-topic here.

"Off-topic" means we are only qualified to give the Standard C++ answer. So
if there were such an answer for a NAN, we might tell you a method
incompatible with Win32 and its VARIANT type.

Try either an OLE newsgroup, or news:microsoft.public.vc.language for the
best possible answer here.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 6 '06 #6

P: n/a
Mark Williams wrote:
Hi all,

Im being supplied data from shared memory in the format of VARIANT's.

Ive been searching through MSDN and Google for quite a long time now
and i cannot find how these should be used in C++ (MS VisualStudio
V8.0).

Are there macros that are used to handle values, types, etc?
Also, how do i handle (and test for) NAN/QNAN values?

Thanks in advance.
What is a VARIANT? Standard C++ doesn't define it.

You might want to try a newsgroup with "microsoft" or "windows" in its name.
Nov 6 '06 #7

P: n/a
red floyd wrote:
What is a VARIANT? Standard C++ doesn't define it.
C++ Programmers should generally know that pattern; don't play dumb. ;-)

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Nov 6 '06 #8

P: n/a
Phlip wrote:
red floyd wrote:
>What is a VARIANT? Standard C++ doesn't define it.

C++ Programmers should generally know that pattern; don't play dumb. ;-)
He's not asking about a pattern, he's asking about an MS-specific data
type. I told him it was OT and to try an MS newsgroup instead.
Nov 6 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.