To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 10927
10926  |  10928
Subject: 
Re: Spirit.ocx in VC++
Newsgroups: 
lugnet.robotics
Date: 
Sun, 5 Mar 2000 01:19:22 GMT
Original-From: 
Stephen Collins <BLIVETS@stopspamGIS.NET>
Viewed: 
810 times
  
Antonio,

Actually, the datatype is VARIANT, which is a typedef around a struct that's
used to support a slew of datatypes in a single type. The struct contains a
member "vt" that describes the datatype of the data that's stored in the
variant.  Based on the value of "vt", the actual data will have a name
corresponding to the type.  For example, if vt is VT_BYREF | VT_BSTR, the data
is a BSTR stored via a pointer as pbstrVal (eg. BSTR * pbstrVal).  A float would
be of type VT_R4 stored as fltVal, etc.

Bottom line is you need the Microsoft Platform SDK doc on OLE automation to
really get the idea.  As for what UploadDatalog returns, you have to kind of
piece things together.  The spirit.ocx Tech Reference states that it returns
TRUE if it works, FALSE if it fails. This implies a VARIANT type of VT_BOOL
which means that the returned variant's value is boolVal, of type VARIANT_BOOL
which MSBorg documents as being set to either VARIANT_TRUE or VARIANT_FALSE.

So, a possible chunk of code for checking the return from UploadDatalog might
look like this:

        VARIANT retVariant = UploadDatalog(From, Size);
        if (retVariant.boolVal == VARIANT_TRUE)
        {
            // it worked!
        }
        else
        {
            // it failed!
        }

Anyway, I hope this helps.

Steve



--
MIME ATTACHMENTS DISCARDED:

1.  Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Content-Length: 2614



Message has 1 Reply:
  Re: Spirit.ocx in VC++
 
Hi Steve, (...) That's right. In the case of the datalog the type of the "vt" is (VT_ARRAY | VT_I2), that is an array of 2-byte integers. (...) Thank you very much, Steve. Your message was helpful for me to understand I'm in the right way to the (...) (25 years ago, 5-Mar-00, to lugnet.robotics)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR