NO

Author Topic: how get the current directory  (Read 40378 times)

joerg

  • Guest
how get the current directory
« on: February 12, 2007, 10:40:14 PM »
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

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
how get the current directory
« Reply #1 on: February 12, 2007, 11:32:06 PM »
---
Stefan

Proud member of the UltraDefrag Development Team

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
how get the current directory
« Reply #2 on: February 13, 2007, 10:52:46 AM »
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".
/Pelle

joerg

  • Guest
how get the current directory
« Reply #3 on: February 13, 2007, 11:26:56 AM »
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  :|

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
how get the current directory
« Reply #4 on: February 13, 2007, 11:45:48 AM »
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.

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.
---
Stefan

Proud member of the UltraDefrag Development Team

joerg

  • Guest
how get the current directory
« Reply #5 on: February 13, 2007, 12:05:30 PM »
@Stefan

thanks, I will try it  :D

joerg

  • Guest
how get the current directory
« Reply #6 on: February 13, 2007, 12:14:33 PM »
@Stefan

 =D> Thank you ... it works  :)

The Api-Doc tells about DLL only, but it seems, that the doc is wrong at this point.

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
how get the current directory
« Reply #7 on: February 13, 2007, 11:26:25 PM »
Quote from: "joerg"
The Api-Doc tells about DLL only, but it seems, that the doc is wrong at this point.

I think the doc is just missing that an EXE is an executable too.

I checked the "Server 2003 SDK" and it says executable file.
I had to check MSDN to be sure it was supported on WinCE and it is since v2.0.
---
Stefan

Proud member of the UltraDefrag Development Team

Jacqueline

  • Guest
Re: how get the current directory
« Reply #8 on: January 01, 2015, 06:20:52 AM »
thanks a lot i think this is the thin i couldn t find!!
i will spend my time with it and hope me to check it ;)

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: how get the current directory
« Reply #9 on: January 03, 2015, 04:10:33 AM »
thanks a lot i think this is the thin i couldn t find!!
i will spend my time with it and hope me to check it ;)
ICU! ;)

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: how get the current directory
« Reply #10 on: January 03, 2015, 10:35:42 AM »
Ralf,

Any idea what these bots want? There used to be a species that embedded links to shops in their posts for raising google hits, but the last two just repeat earlier posts without such links. What do they gain by posting here??

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: how get the current directory
« Reply #11 on: January 03, 2015, 02:57:49 PM »
Ralf,

Any idea what these bots want? There used to be a species that embedded links to shops in their posts for raising google hits, but the last two just repeat earlier posts without such links. What do they gain by posting here??
At least a couple.
They check how the forum control is effective, and what's the traffic.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: how get the current directory
« Reply #12 on: January 05, 2015, 04:23:18 AM »
Ralf,

Any idea what these bots want?
Gaining a foothold...
Quote
There used to be a species that embedded links to shops in their posts for raising google hits, but the last two just repeat earlier posts without such links. What do they gain by posting here??
Most of these have a kind of dummy signature, without a actual link when they sign up. Then they post what seems an harmless post into an existing thread, with a more or less matching contents. This is to get past the initial forum moderation that is in some forums in place, where the first (few) post(s) of a new signup needs to have moderator approval. They rely here on the fact that in a lot of forum software this moderator approval page does not show the whole thread, so a harmless reply, somehow on topic to the subject line might get them past this point.
And once they have a foothold, they change the signature to link to spam sites and/or start to spew whole messages with spam.

Just doesn't work here  ;)

And those aren't bots, those are real-live "string puppets", therefor bypassing all those more or less fancy "gotchas" that are aimed at preventing real bots to sign up and post...

Ralf