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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Dereferencing in VisualBasic

Dereferencing in VisualBasic

Scheduled Pinned Locked Moved Visual Basic
help
2 Posts 1 Posters 11 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, Please help me in derefernce a variable in VisualBasic or VBScript.

    L 1 Reply Last reply
    0
    • L Lost User

      Hi, Please help me in derefernce a variable in VisualBasic or VBScript.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      It's not directly possible to dereference a variable in Visual Basic, but you can do a workaround with the help of the api-function "rtlmovememory" (copymemory). This function makes it possible to copy the data of the variable when only having its adress (varptr-function in VB; some api-functions only return pointers to datastructs). Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long) This function copies the value of a variable into another variable of the same size (hpvDest). The second parameter takes the adress of the sourcevariable. The third parameter takes the size of the variable. I think there is an example of this technique in the Knowledge Base... "HOWTO: Call NetUserGetInfo API from Visual Basic" Article ID: Q151774

      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