Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] ReadProcessMemory /unsafe problem...[SOLVED]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Tue Feb 10, 2009 2:45 pm    Post subject: [C#] ReadProcessMemory /unsafe problem...[SOLVED] Reply with quote

error CS0227: Unsafe code may only appear if compiling with /unsafe


[DllImport("kernel32.dll", SetLastError = true)]
static unsafe extern bool ReadProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
void* lpBuffer,
int dwSize,
out IntPtr lpNumberOfBytesRead
);

Shocked Shocked Shocked


Last edited by Wiw3K on Tue Feb 10, 2009 3:29 pm; edited 3 times in total
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Tue Feb 10, 2009 3:13 pm    Post subject: Reply with quote

IT TELLS YOU EXACLY WHAT IT IS!!! Neutral
You don't have Form1_Load method in your code...
Back to top
View user's profile Send private message MSN Messenger
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Tue Feb 10, 2009 3:16 pm    Post subject: Reply with quote

@up
OMGGG i am blind xD
thank you

check #1 ReadProcessMemory error Shocked
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Feb 10, 2009 3:23 pm    Post subject: Reply with quote

Wiw3K wrote:
@up
OMGGG i am blind xD
thank you

check #1 ReadProcessMemory error Shocked


compile with unsafe LIKE IT SAYS TO DO, or just use IntPtr as lpBuffer's type (which is what you should do)
Back to top
View user's profile Send private message
Wiw3K
Grandmaster Cheater
Reputation: 0

Joined: 09 Jul 2006
Posts: 762
Location: Poland.

PostPosted: Tue Feb 10, 2009 3:28 pm    Post subject: Reply with quote

slovach wrote:
Wiw3K wrote:
@up
OMGGG i am blind xD
thank you

check #1 ReadProcessMemory error Shocked


compile with unsafe LIKE IT SAYS TO DO, or just use IntPtr as lpBuffer's type (which is what you should do)

i changed void* to IntPtr and deleted unsafe.

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

ty for help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites