Link to home
Start Free TrialLog in
Avatar of ChiragDanech
ChiragDanech

asked on

Replacement of MoveMemory in VB.NET

Hello Folks,

I am converting VB.6 application to VB.NET 2005.During conversion I couldnt find the resplacement of API MoveMemory which is used in VB.6 application.

Is there anybody who has faced similar kind of problem or know how to solve it.

Thanking you
Avatar of Mikal613
Mikal613
Flag of United States of America image

You may not need MoveMemory.  What are you trying to accomplish in .NET 2005?   There might be an easier way without API calls.

Bob
Avatar of ChiragDanech
ChiragDanech

ASKER

Trying to copy Structure type to 2 dimensional array.

MoveMemory(VarPtrArray(2 dimensional Array), VarPtr(structureType), 4)

Its urgent . Can anybody reply me asap.
Ok, let's take a little wider view of your requirement.   What is the overall requirement?  How does this one little question fit into the grander scheme?  That is what I meant by it might be easier without API calls.  Maybe we could suggest a native .NET framework approach, if we knew what you were trying to convert.  It might be simpler than complex memory operations.

You can use the Marshal class to copy memory, but with the garbage collector, it gets a little messy, since you have to start think about handles and pinning memory.

Bob
I appriciate  your comments on it. But Its difficult to explain the whole thing. I have already converted 75 % of the VB application into VB.NET. I just stuck here on MoveMemory API. And as i have aleready mentioned my cleare intension what I need to do.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial