C language > Pocket PC and Smartphone questions

how get the current directory

(1/3) > >>

joerg:
My problem is to find a function, that give me the current directory on PocketPC.

The C-function getcwd() is not defined for WINCE, and by using the API-Function GetCurrentDirectory I get a linker error "unresolved external GetCurrentDirectoryW"  :?
And the Commandline of WinMain is empty.

I want to read a INI-File that is stored in the EXE-Dir. But a call for wfopen without a path give me a NULL Handle.

Does anybody know, what else can I do

Thanks
  Joerg

Stefan Pendl:
You may check GetModuleFileName at http://msdn2.microsoft.com/en-us/library/ms908441.aspx

Pelle:
As Microsoft puts it: "Windows CE does not use the current directory concept. Instead, all of the references to an object are given in the full path".

joerg:
Yes I read it yesterday night , that CE don't have a current directory.


I have an EXE and I want to put it in any directory. In the same dirictory is the coresporending ini-file.
Now I want to read this Ini-File, but I found no way to get the directory, from which my EXE started.
In normaly C I can read this info from argv[0].

One solution  is, to store the Path in the registry.  :( But other programms, I have installed, can read there INI's, without using the registry  :|

Stefan Pendl:

--- Quote from: "joerg" ---I have an EXE and I want to put it in any directory. In the same dirictory is the coresporending ini-file.
Now I want to read this Ini-File, but I found no way to get the directory, from which my EXE started.
--- End quote ---

Use GetModuleFileName to get the full path to the EXE.
Set the handle to NULL and this function will return the full path to your EXE.

Navigation

[0] Message Index

[#] Next page

Go to full version