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. Copy memory function

Copy memory function

Scheduled Pinned Locked Moved Visual Basic
csharpperformance
2 Posts 2 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.
  • S Offline
    S Offline
    sundar_mca
    wrote on last edited by
    #1

    Hai i have migrated the vb code into vb.net.When i was migrating i found that copy memory function cant able to work it seems. i am using the function Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef hpDest As any, ByVal hpSource As any, ByVal nBytes As Integer) and call the function inside form1.show Call CopyMemory(arrBarCodeInformation(0), ptrBarCodeInfo, size_Renamed) i have declared Public arrBarCodeInformation() As BarCodeInformation Public Structure BarCodeInformation Dim tRegionRect As rect Dim dwBarType As Integer Dim fOrientation As Single Dim lDecodeStatus As Integer Dim lNoOfCharacters As Integer Dim lpbDecodByteArray As Integer Dim lReserved As Integer Dim hReserved As Integer End Structure using this i want to copy the memory value from integer value into the structure variable.how can it been done.tell me the syntax are any function to copy memory :((

    D 1 Reply Last reply
    0
    • S sundar_mca

      Hai i have migrated the vb code into vb.net.When i was migrating i found that copy memory function cant able to work it seems. i am using the function Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef hpDest As any, ByVal hpSource As any, ByVal nBytes As Integer) and call the function inside form1.show Call CopyMemory(arrBarCodeInformation(0), ptrBarCodeInfo, size_Renamed) i have declared Public arrBarCodeInformation() As BarCodeInformation Public Structure BarCodeInformation Dim tRegionRect As rect Dim dwBarType As Integer Dim fOrientation As Single Dim lDecodeStatus As Integer Dim lNoOfCharacters As Integer Dim lpbDecodByteArray As Integer Dim lReserved As Integer Dim hReserved As Integer End Structure using this i want to copy the memory value from integer value into the structure variable.how can it been done.tell me the syntax are any function to copy memory :((

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

      You're not listening. You do NOT need CopyMemory to do this. You need to marshal this structure to your function properly. This is not done the same way it was under VB6. If you created and instance of this structure in your code and just want to assign a value to one of it's members, then all you have to do is something like this:

      arrBarCodeInformation(0).dwBarType = 42
      

      Other than that, you haven't described what your doing with this stuff, nor have you posted any of the code you're trying to convert to show us what you want it to do.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      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