Results 1 to 2 of 2

Thread: VarPtr equivalent?

  1. #1

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

    VarPtr equivalent?

    The structure PRINTER_NOTIFY_OPTIONS_TYPE has a pointer to a variable length array of 16 bit integer flags as it's last member. In VB-Classic I filled this by using the VarPtr keyword....how do I go about doing this in VB.Net?

    i.e.
    VB Code:
    1. Private Structure PRINTER_NOTIFY_OPTIONS_TYPE
    2.      Dim wType As Int16
    3.      Dim wReserved0 As Int16
    4.      Dim dwReserved1 As Int32
    5.      Dim dwReserved2 As Int32
    6.      Dim Count As Int32 '\\Number of elements in the array
    7.      Dim pFields As Int32 '\\Pointer to the array
    8. End Type

    which is populated....

    VB Code:
    1. Dim arTypes(0) As Int16
    2. arTypes(0) = Job_Notify_Indexes.JOB_NOTIFY_FIELD_STATUS
    3.  
    4. With pTypeJob
    5.     .wType = Printer_Notification_Types.JOB_NOTIFY_TYPE
    6.     .Count = 1
    7.     '.pFields = ???? (was VarPtr(arTypes(0))
    8. End With

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

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    VarPtr, ObjPtr, StrPtr, VarPtrArray, and VarPtrStringArray functions
    The VarPtr, ObjPtr, StrPtr, VarPtrArray, and VarPtrStringArray functions in Visual Basic 6.0 were undocumented and unsupported functions that could be used to return a pointer to a memory address. Although unsupported, these functions were sometimes used when working with Windows API calls that would have otherwise been inaccessible from Visual Basic.

    These functions are not supported in Visual Studio .NET; however, most of the scenarios where they were used can be addressed through new functionality in the .NET Framework. Many of the Windows API calls that were necessary in Visual Basic 6.0 are now encapsulated in the framework; pointer references are no longer necessary.

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