Results 1 to 4 of 4

Thread: Just Need A Simple Answer

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406

    Question Just Need A Simple Answer

    I'm converting some C++ code to VB.

    I don't understand how part of this declaration works:
    #ifndef IGBOOL
    #ifdef __WIN32
    typedef int IGBOOL;
    #else
    typedef long IGBOOL;
    #endif
    #endif

    struct NotifyCallbackRecord{
    IGBOOL Message; /* The message ID for the notification */
    IGBOOL DataStatus; /* The status of the data attached to the notification */
    char Data; /* The address of the data attached to the notification */
    };

    The type IGBOOL is defined as an INT.

    I understand that an INT in C++ equals a LONG in VB.

    But how can a CHAR be an address?
    Isn't a CHAR a single byte?

    I need to convert this to VB.

    Anyone? Anyone?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Never mind about the #if things. On 32 bit systems they don't matter.

    char Data;
    This however looks like a typo. Actually it should probably be
    char *Data;
    which is a pointer. The corresponding VB datatype is again Long, but you can't use pointers in VB unless you use the API.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406
    Thanks, but I don't think it's a typo.

    There are at least 5 other declarations, none of which have the "*".

    Of course, I can't guarantee that the Sample code I copied this from works either, but I believe it will.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Then it could be some sort of index. You would have to look up its usage.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width