Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Win32 API

Win32 API

Scheduled Pinned Locked Moved Visual Basic
jsonhelpquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Kanev
    wrote on last edited by
    #1

    When I declare a WIN32 API like this Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer I receive an error message by the compiler - "User-defined type not defined" Do you know what it means? P.S. This is VB6

    N M D T 4 Replies Last reply
    0
    • D Daniel Kanev

      When I declare a WIN32 API like this Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer I receive an error message by the compiler - "User-defined type not defined" Do you know what it means? P.S. This is VB6

      N Offline
      N Offline
      nitin3
      wrote on last edited by
      #2

      i think there is no primitive datatype named IntPtr invb6. u can use long instead of IntPtr in this function.

      1 Reply Last reply
      0
      • D Daniel Kanev

        When I declare a WIN32 API like this Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer I receive an error message by the compiler - "User-defined type not defined" Do you know what it means? P.S. This is VB6

        M Offline
        M Offline
        MohammadAmiry
        wrote on last edited by
        #3

        You may use (Byref hWnd As Long) instead.

        1 Reply Last reply
        0
        • D Daniel Kanev

          When I declare a WIN32 API like this Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer I receive an error message by the compiler - "User-defined type not defined" Do you know what it means? P.S. This is VB6

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          This Declare is for VB.NET, not VB6. The VB6 equivilent would be:

          Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As Long, ByVal nBar As Long) As Long
          

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          • D Daniel Kanev

            When I declare a WIN32 API like this Private Declare Function GetScrollPos Lib "user32" (ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer I receive an error message by the compiler - "User-defined type not defined" Do you know what it means? P.S. This is VB6

            T Offline
            T Offline
            Thomas Stockwell
            wrote on last edited by
            #5

            Consider using API Viewer or API Guide for determining API calls from whatever the language.

            Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups