Hi,
I have a very interesting problem.
I wrote a little code which linked against an externel library. I have
the debug, and the release version of the ext. lib. One library function
opens a file which is in the same path as the executable. I copyed the
file into the Debug, and the Release directoryes too. Starting the
program directly from the folders (Debug, Release) causes no problem.
When I start it with CTRL+F5, in any configuration it failed to open the
file. When I used the debugger to see what's wrong, I found the lib's
fopen fails.
The code looks like this:
FILE* file = fopen("filename without the full path", "r");
If I use the full path the same thing happens.
I use Visual Studio .Net 2003.
Is there any difference running the program inside or outside the IDE?
What could be the problem?
THX
William DePalo [MVP VC++] - 15 May 2005 16:27 GMT
> Is there any difference running the program inside or outside the IDE?
> What could be the problem?
Probably the current directory. From the menu choose Project->Properties. In
the left pane under the "Configuration Properties" folder click the
"Debugging" item. In the right pane in the edit box labelled woking
directory set the directory to the debug or release folder as appropriate.
Regards,
Wil
Janos Makadi - 15 May 2005 16:36 GMT
William DePalo [MVP VC++] írta:
> Probably the current directory. From the menu choose Project->Properties. In
> the left pane under the "Configuration Properties" folder click the
> "Debugging" item. In the right pane in the edit box labelled woking
> directory set the directory to the debug or release folder as appropriate.
Oh, my god! How stupid I am.
Thaks a lot.
William DePalo [MVP VC++] - 15 May 2005 20:34 GMT
> Oh, my god! How stupid I am.
That's being too hard on yourself. The IDE has _so_ many configuration
options that even those of use who claim to know it well often get lost. :-)
> Thaks a lot.
You are welcome.
Regards,
Will