Results 1 to 3 of 3

Thread: API constant masks

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    API constant masks

    Suppose you have a DWORD type value that could be API_CONST1 or API_CONST2, or both.

    Through VB, how do you handle the situation where its both, so "If value = API_CONST1 Then" would fail even though the value is API_CONST1 masked with the other constant?

    Thanks.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  2. #2
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    If I understand your question I think this is the answer.

    lValue contains the sum of APIConst1 and APIConst2.

    Code:
    If (lValue And APIConst1) = APIConst1 Then
    
    End if
    Greg
    Free VB Add-In - The Reference Librarian
    Click Here for screen shot and download link.

  3. #3

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I think that it's -- I was trying to do the same, but on the wrong side of the equal sign

    Thank you.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

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