News:

How did you even find this place?

Main Menu

C# CopyMemory

Started by abc, April 20, 2007, 04:57:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

abc

In C#, How would I go about using the CopyMemory API, I have the CopyMemory API in Visual Basic 6.

Any links?

Sidoh

CopyMemory is a Windows API call... just learn how to call API functions in C#.

abc

Er, I googled tons, I never found a decent tutorial. All I've got is

[DllImport("kernel32")]

heh.

Sidoh

http://www.csharphelp.com/archives/archive79.html

First result in the list of results for "C# Windows API."

Warrior

What are you using CopyMemory for? Please don't tell me it's for any kind of Packet Buffer. It's completely unnecessary.

Directly porting things from non .NET to .NET should be done with care to avoid doing more work than you should.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

abc

You're right Warrior, Thanks, I think I remember some thread on vL about not using CopyMemory now.

warz

You shouldn't need to use CopyMemory even without C#, most of the time.
http://www.chyea.org/ - web based markup debugger

MyndFyre

Since the people who have replied haven't posted the alternative to using CopyMemory, I will.  You want to use the BitConverter class.
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.

abc


Warrior

Making him do a little homework. So what? :(
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

MyndFyre

Quote from: Warriorx86] link=topic=9135.msg116082#msg116082 date=1177171540]
Making him do a little homework. So what? :(
Neither you nor Sidoh provided even a hint as to how to do this appropriately.  I know you specifically knew the right answer.

Referencing the BitConverter class still makes him do homework.
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.