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 in vb.net

Copy memory function in vb.net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpperformancetutorial
6 Posts 4 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

    Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef hpDest As any, ByVal hpSource As any, ByVal nBytes As integer) I am converted the vb code into vb.net in this the copy memory function does not work it seems. I am calling the function in the form Call CopyMemory(arrBarCodeInformation(0), ptrBarCodeInfo, size_Renamed) but is showing some error .How to use the copy memory in vb,net here arrBarCodeInformation(0) is an structure value.slove the above problem and also give me the code for the same. pls help me to slove the problem.. :confused::(( :((

    T 1 Reply Last reply
    0
    • S sundar_mca

      Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef hpDest As any, ByVal hpSource As any, ByVal nBytes As integer) I am converted the vb code into vb.net in this the copy memory function does not work it seems. I am calling the function in the form Call CopyMemory(arrBarCodeInformation(0), ptrBarCodeInfo, size_Renamed) but is showing some error .How to use the copy memory in vb,net here arrBarCodeInformation(0) is an structure value.slove the above problem and also give me the code for the same. pls help me to slove the problem.. :confused::(( :((

      T Offline
      T Offline
      The ANZAC
      wrote on last edited by
      #2

      http://www.codeproject.com/vb/net/CopyMemory_in_Net.asp Try this article right here on Code Project

      Posted by The ANZAC

      S 1 Reply Last reply
      0
      • T The ANZAC

        http://www.codeproject.com/vb/net/CopyMemory_in_Net.asp Try this article right here on Code Project

        Posted by The ANZAC

        S Offline
        S Offline
        sundar_mca
        wrote on last edited by
        #3

        I have tryied but i need to copy the integer value into the structure variable .how can i do that.pls give me the code .its very difficult for me to convert.pls help me its very urgent.... :((:((:((

        C 1 Reply Last reply
        0
        • S sundar_mca

          I have tryied but i need to copy the integer value into the structure variable .how can i do that.pls give me the code .its very difficult for me to convert.pls help me its very urgent.... :((:((:((

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          I love how many people post 'it's very urgent' but don't give anything resembling the info that people need to help.

          sundar_mca wrote:

          i need to copy the integer value into the structure variable

          Assuming that you have a block of memory that represents the struct, you can presumably use marshalling to copy the block of memory across. Or, you can cast that memory location to BE the struct, and copy them manually.

          sundar_mca wrote:

          .pls give me the code

          That you would even ask this, based on the info you've provided ( nearly none ), tells me that you're in over your head. Try posting the information that describes the problem, then perhaps we can help.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          S 1 Reply Last reply
          0
          • C Christian Graus

            I love how many people post 'it's very urgent' but don't give anything resembling the info that people need to help.

            sundar_mca wrote:

            i need to copy the integer value into the structure variable

            Assuming that you have a block of memory that represents the struct, you can presumably use marshalling to copy the block of memory across. Or, you can cast that memory location to BE the struct, and copy them manually.

            sundar_mca wrote:

            .pls give me the code

            That you would even ask this, based on the info you've provided ( nearly none ), tells me that you're in over your head. Try posting the information that describes the problem, then perhaps we can help.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            S Offline
            S Offline
            sundar_mca
            wrote on last edited by
            #5

            sorry for sending such messages.i hav etryied the marshaling function muct i want to copy the integer value to structure how can i do it using marshal function

            D 1 Reply Last reply
            0
            • S sundar_mca

              sorry for sending such messages.i hav etryied the marshaling function muct i want to copy the integer value to structure how can i do it using marshal function

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

              If all you're doing is marshalling a structure back and forth to unmanaged code, you DO NOT NEED the CopyMemory function. Post more of this code that your trying to translate so we can help. If you don't, there's nothing we can do to help!

              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