This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Saving state in same directory as .EXE


Saving state in same directory as .EXE

Postby britcode » Jul 15, 2002 @ 10:04pm

I'd like to save the game in the same directory as the exe. I think this is probably a good idea in case the state gets quite large, so if they installed to Compact Flash it doesn't eat up RAM.

What do you think?

I'm also looking for ways to do this, because obviously there is not current directory. Is it possible to get the filename of the current process, perhaps with GetCurrentProcessID or something, or with GetCommandLine()? And then get the directory.

Anyone done this before and can advise The Right Way (tm)?
britcode
 


Finding the .exe's location

Postby Conan » Jul 15, 2002 @ 10:42pm

Taken from eVC help
The PocketPC function you need is:-

GetModuleFileName

This function gets a module file name.

WINAPI DWORD GetModuleFileName(
HMODULE hModule,
LPWSTR lpFilename,
DWORD nSize );
Parameters
hModule
[in] Handle to the module whose executable filename is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file used to create the calling process.
[/code]
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby britcode » Jul 15, 2002 @ 10:51pm

Thanks Conan, that was just what I was after!
britcode
 


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

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 post attachments in this forum