Results 1 to 2 of 2

Thread: C++/Structure/unions in Visual basic

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Sweden
    Posts
    8

    C++/Structure/unions in Visual basic

    How would you/anyone declare this union in a type/structure in VB??

    union {
    UINT uTimeout;
    UINT uVersion;
    } DUMMYUNIONNAME;


    goodnite!

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's simply UINT. All the member of a union start at the same memory location. In this case, having two UINTs is marginally pointless, and they'd normally be used for things like this:
    Code:
    union large_uint {
        struct {
            unsigned long low;
            unsigned long high;
        }
    
        unsigned long long quad;
    };
    This means that the 64-bit integer quad occupies the same space as the two 32-bit integers low and high. This allows you to easily interpret it as the two parts of the same number.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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