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 


dll and forms with Delphi 7
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Fri Dec 13, 2013 5:30 pm    Post subject: Reply with quote

when a process has been closed windows will free all the memory it has allocated(Unless your dll does something really horrible like loading a kernelmode driver which allocates a gigabyte or more of nonpaged memory)
_________________
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
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 78

PostPosted: Fri Dec 13, 2013 5:58 pm    Post subject: Reply with quote

So that means form1.free is very seldom required in ANY application? Just placing cafree in the onclose would do?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Fri Dec 13, 2013 6:08 pm    Post subject: Reply with quote

Just exiting the thread when application.run returns is enough

Also, freeing an already freed form is a really bad idea.
I also don't recommend putting caFree as close action on the main form(or any form that's part of the main application), firstly, it's not needed, and most importantly is that it doesn‘t nil the variables that point to the form. If it‘s not nil then when application.run terminates calls functions on it (e.g. form.hide) and since it's freed that will cause unpredicted behaviour

_________________
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
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 78

PostPosted: Fri Dec 13, 2013 6:35 pm    Post subject: Reply with quote

Thanks for all your help Smile
Back to top
View user's profile Send private message
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 78

PostPosted: Sat Dec 14, 2013 4:24 am    Post subject: Reply with quote

From what I can see this error only happens on XP. After XP, the error does not show up. OSs after XP obviously dealt with missing handles better.
Back to top
View user's profile Send private message
dlpb
Advanced Cheater
Reputation: 0

Joined: 11 Dec 2013
Posts: 78

PostPosted: Sun Dec 15, 2013 2:01 pm    Post subject: Reply with quote

OK, this problem was solved over at another forum. As follows:


Code:
form1:=Tform1.Create(nil);
form1.visible:=true; (so it doesn't override the shownoactivate)

repeat
Application.HandleMessage;
until form1cancloseflag;

Form1.Close;


Then, in the oncreate of form1:

Code:
ShowWindow(Handle, SW_SHOWNOACTIVATE);


This has no error message on game close (from what I can see the error only happens with XP anyway), and it solves all other issues.
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
Goto page Previous  1, 2
Page 2 of 2

 
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