473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to use VARIANT??

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
8 33136
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
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

"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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matt Smith | last post by:
Hi, all. Just a quick question, when setting a COM process to read a value from a pre-defined register index, I think, I have to change the variable that the value will be returned to (as I have...
0
by: Matt Smith | last post by:
Hi, all. Just a quick question, when setting a COM process to read a value from a pre-defined register index, I think, I have to change the variable that the value will be returned to (as I have...
1
by: C. N. Sridhar | last post by:
Hi, I'm writing a wrapper to a win32 dll in C#. I need to call a method in DLL which has a Variant type reference parameter. How to marshal variant type from win32 (unmanaged code) to C#...
8
by: MLH | last post by:
A97 HELP shows the proper syntax for using Nz as Nz(variant) I'm wondering what to expect from potential past misuse I've made. For example, consider the following... Private Sub...
19
by: Jon Davis | last post by:
Hi guys! Just wanted to let you all know that I created a Variant structure, inspired by the old VB6 days. This is written in C#, but you can build a CLR/.NET class library assembly and reference...
0
by: .::alex::. | last post by:
Hello, Maybe you already guess the problem. I have a COM with a method in a Interface like that: HRESULT GetArray(VARIANT *pVal); so this method will return a VARIANT. This VARIANT contains...
2
by: Heike | last post by:
Hello everybody, I have a Problem with C Sharp. I have to use external functions in DLLs. This Functions are written in Visual C++ 6 like this: int (__stdcall *GetGlobalValue) (VARIANT Appl,...
1
by: morten | last post by:
When i compile this code in VC71 or VC80 i get the following errors: The code is copy/paste from the boost.org tutorial. Please help! error C2039: 'begin' : is not a member of...
1
by: captainc | last post by:
I have C++ code to import a .tlb and use a .dll that has functions that return VARIANT types and accepts BSTRs (bstrings). I have seen that python has modules that can manipulate VARIANTs and BSTRs...
4
by: jainchar | last post by:
hello I am creating a VARIANT that stores a integer value of variable but variable is not initialize.In my code the variable are "r" and"c" where r and c are the value of row and column of a table.I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.