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++ a weird problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mr.moon
Newbie cheater
Reputation: 0

Joined: 27 Aug 2016
Posts: 12

PostPosted: Sun Aug 28, 2016 6:36 pm    Post subject: c++ a weird problem Reply with quote

hello the problem is if copy the project after build to other place it don't work if it in normal path it work that mean Debug & Release where it build it work other path it don't
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Aug 28, 2016 10:33 pm    Post subject: Reply with quote

Does your project use specific paths or files that are not being adjusted / moved when you copy the project to another folder?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
mr.moon
Newbie cheater
Reputation: 0

Joined: 27 Aug 2016
Posts: 12

PostPosted: Sun Aug 28, 2016 10:38 pm    Post subject: Reply with quote

atom0s wrote:
Does your project use specific paths or files that are not being adjusted / moved when you copy the project to another folder?

no
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Aug 28, 2016 10:58 pm    Post subject: Reply with quote

Outside of that, unless you post code there is not much anyone can do to help you as we have no idea what your project is doing etc.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
mr.moon
Newbie cheater
Reputation: 0

Joined: 27 Aug 2016
Posts: 12

PostPosted: Mon Aug 29, 2016 5:25 pm    Post subject: Reply with quote

atom0s wrote:
Outside of that, unless you post code there is not much anyone can do to help you as we have no idea what your project is doing etc.

because the source is huge can't anyway fixed it was a windows problem maybe
Back to top
View user's profile Send private message
kuntz
Cheater
Reputation: 0

Joined: 29 Aug 2016
Posts: 44
Location: Canada

PostPosted: Tue Aug 30, 2016 4:47 pm    Post subject: Reply with quote

It sounds like somewhere in the program it is using the current 'Working Directory' for something. Can you tell us what the program is supposed to do?

There are a few simple tricks you can do to make the program "location agnostic", which means the program will run the same irregardless of where it is run from.

Code:
void set_working_directory(void)
{
    // Set the current directory to where the EXE is located
    char buf1[512], buf2[512], *p;
    GetModuleFileName(0, buf1, 512);
    GetFullPathName(buf1, 512, buf2, &p);
    *p = 0;
    SetCurrentDirectory(buf2);
}


This code will set the Working Directory to the same directory the EXE is located in. Windows does not always set the Working Directory to the EXE location, there are instances where it is set to some other location. This can be helpful for DLL injection where the location of the EXE loader and DLL file may not be the same directory as the running target (game). So the DLL is loaded into a process that has a different directory than where the DLL is located, so if the DLL tries to load some support/setting files, it wont find them.

microsoft-com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
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