Results 1 to 5 of 5

Thread: Just Need A Simple Explanation

  1. #1

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

    Question Just Need A Simple Explanation

    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
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    CHAR is a CHAR but a CHAR* is a pointer to a CHAR that can be a CHAR array pointer that is poiting to the first member of the array.
    this can sound confusing....but it isn't lol
    \m/\m/

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406
    So, if a CHAR is just a sinlge byte char, then how could it be used as way of passing/pointing to an address?

    More importantly, if I'm trying to re-write this in VB, how would it be done?

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    char* would be a pointer, but obviously its char here
    otherways you could have an array of bytes
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406
    So how does that help me?

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