Re: help with c++ program

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



marsze@xxxxxxxxx wrote:

now i want to put the configuration file in the current directory.
this works fine in debug, but gives an error when executing without
debugging (I checked the file is in the debug and release directories).

private: void ReadCfg(void) {
string fileline;
char* Adir;
const char *fname = "\\MipMenu.cfg";
// Get the current working directory:
if( (Adir = _getcwd( NULL, 0 )) == NULL )
perror( "_getcwd error" );
strcat(Adir, fname);
ifstream CfgFile (Adir); //C:\\demand\\MipMenu\\
getline(CfgFile, fileline);
processline(fileline, 1) ;
....

char * Adir = _getcwd( NULL, 0 );
string filename = Adir;
free( Adir );
filename += "\\MipMenu.cfg";
ifstream CfgFile( filename.c_str() );
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.



Relevant Pages

  • help with c++ program
    ... char* Adir; ... now i want to put the configuration file in the current directory. ... debugging. ...
    (microsoft.public.vc.language)
  • Re: xorg 7.4 keyboard localisation (xorg.conf vs hal)
    ... How would I detect that my configuration file needs changing? ... debug my problems in any way. ... Correct, if you using gnome, that will enable hal and dbus. ... Robert Noland ...
    (freebsd-stable)
  • Re: [opensuse] Perl question
    ... something and just forgot to comment out the debug line. ... configuration file. ... SUSE Linux Products GmbH GF: Markus Rex, ...
    (SuSE)
  • Re: xorg 7.4 keyboard localisation (xorg.conf vs hal)
    ... the keyboard and mouse input devices from xorg.conf, ... that it is disabling all input devices and never says anything else. ... How would I detect that my configuration file needs changing? ... debug my problems in any way. ...
    (freebsd-stable)
  • Re: VSTO Security - cannot run or debug any VSTO documents
    ... Unfortunately you cannot debug an assembly hosted by the Whidbey CLR from ... OR you can use a configuration file to lock Excel ... Please post questions to the newsgroup - everyone benefits. ...
    (microsoft.public.vsnet.vstools.office)