: : : : : It is an Win32 console application in VC++. Is there a solution for the problem?
: : : :
: : : :
: : : : what version of that compiler? I know all VC++ 6.0 and newer compilers support long filenames. VC++ 1.52C is a 16-bit compiler and does not. It was the last 16-bit compiler Microsoft produced.
: : : :
: : :
: : : Its VC++ 6.0. The file with a long name is not being read. Also the one with a space in the name.
: : :
: : There shouldn't be any problem reading the file. Post the code, please.
: :
: :
: : Greets,
: : Eric Goldstein
: :
http://www.gvh-maatwerk.nl
: :
: :
: :
: Here's the relevant code:
:
: ifstream ifile;
:
: setpath(argv[1]);//change the working dir
:
: if(get_cdr_structure(format,values))//read the file structure
: {
: printlabel();
:
: //open the cdr
: ifile.open(argv[2]);
: if (ifile)
: {
: //my code
: }
:
: }
:
: The code works well if argv[2] contains a short path and a short name
: Thanks in advance
Aha. Since the file is passed through an argument nd contains spaces, the runtime splits the filename in two or more arguments.
You can verify that by inspecting argv[3]. You'll see that it contains the rest of the filename.
Try passing the filename within double quotes.
Greets,
Eric Goldstein
http://www.gvh-maatwerk.nl