VB2005 Allocating memory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Evolution445
    New Member
    • Jul 2007
    • 63

    VB2005 Allocating memory

    Hi,


    I have a function that reads 17 bytes starting from &H7C2B84. Each time it's about to read it throws an AccessViolation Exception, which, if I read posts around the net correctly means that I'm reading from protected or unsafe memory, and the solution is to allocate memory. I've been searching for examples on allocating memory, but all of these were for either C++ or C#.

    I tried something like:
    Marshal.AllocHG lobal(17)

    but it doesnt work.
    Also I've read something about a garbage collector, but I dont know how this works.

    How can I allocate the memory so I can read those 17 bytes and put the result in a textbox ?


    Thanks in advance,
    Evolution445
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    This should be moved to the VB.Net section.

    I do not have an answer for you, you might try taking a C# example and converting it in an online converter: vb.net c# convert online - Google Search

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      question moved to .NET section.

      Comment

      Working...