Results 1 to 2 of 2

Thread: Type Mismatch using API

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Jefferson State
    Posts
    3

    Type Mismatch using API

    I really don't understand this error. I get a Type Mismatch when trying to call GetWindowLong(). It's declared as Long and the value I'm assigning it too is Long. I don't see how it could be returning something larger than a Long. Any help would be greatly appreciated.

  2. #2
    jim mcnamara
    Guest
    The declaration for GetWindowLong is like this:

    long = GetWindowLong(ByVal long, ByVal Long)

    It is pushing 32bits on to the stack for each parameter.
    The first parameter is a handle for a window, the second is a constant value like GWL_STYLE. Check your const statement
    it should look like
    Code:
     const ES_WHATEVER = &HF01&
    with the ampersands. VB 6.0 IDE makes it &HF01, which is ok.
    You can force it to long like
    Code:
    const ES_SOMETHING As Long = (-16)

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