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 


Delphi Thread DLL creating error inject process

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

Joined: 14 Apr 2009
Posts: 31

PostPosted: Tue Aug 02, 2011 1:18 pm    Post subject: Delphi Thread DLL creating error inject process Reply with quote

Hello, I have a problem with the day, and I've been researching much more I can not find anything, and the next I'm good with a serious problem for the continuation of my project, let's go

the problem and the following dll and inject ..

I am using the following code:

Code:
  CreateThread (nil, 0, @ FormShow, nil, 0, ThreadId)


is working perfectly .. inject form, but when I create a form in new thread to use a function of the access violation

thread creation code error form:

Code:
METhread function (P: Pointer): LongInt;
begin
function
end;

using:
Code:

var
   hThreadID: THandle;
   ThreadID: DWord;
begin
   {Creates the thread, where @ is the MinhaThread created Function Pointer}
   hThreadID: = CreateThread (nil, 0, @ METhread, nil, 0, ThreadID);


and this problem when I create a new thread to use a function without the access violation crashes someone knows how to solve?

thanks
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25859
Location: The netherlands

PostPosted: Tue Aug 02, 2011 2:43 pm    Post subject: Reply with quote

Try that code in a normal application first and make sure you do not have the debugger attached.

Anyhow, one tip: Keep all gui access in one thread, the gui components are not thread safe and if you create a second form in another thread you might be accidentally overwriting some global variables that designate the main thread ID

Because you have injected your dll syncronize will not work, so implement this using postmessage and a procedure that watches that event in the main form, or just don't use another thread

and of course, use showmodal or application.run, just using show will cause the thread to exit

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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