Results 1 to 4 of 4

Thread: Convert C++ struct to VB type...

  1. #1

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    Convert C++ struct to VB type...

    Hi,

    There's this C++ struct that I want to make into a VB type, but it has a syntax that I haven't seen before:
    Code:
    struct {      DWORD BaseMid  :8;
    What does :8 mean?

    Thanks in advance,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    It is a bitfield. Means there are 8 bits (seems a bit odd, if someone wanted 8 bits, they should have used a char).

    Z.

  3. #3
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    It's a way to skip over to useful bits. Merrion left off part of the statement.

    What I find weird is the 'DWORD' part. Maybe it wasn't skipping over. The problem with DWORD is the sign bit. I would have thought ULONG was more appropriate.

    Merrion - you can't do bit fields in VB, you have to OR individual groups of bits, messing with RtlMoveMemory.

  4. #4
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by jim mcnamara
    It's a way to skip over to useful bits. Merrion left off part of the statement.

    What I find weird is the 'DWORD' part. Maybe it wasn't skipping over. The problem with DWORD is the sign bit. I would have thought ULONG was more appropriate.
    Could you explain a bit more on this? I think I have used bitfields all of once =).

    Z.

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