Running programs inside the IDE (CTRL+F5)

  • Thread starter Thread starter Janos Makadi
  • Start date Start date
J

Janos Makadi

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
 
Janos Makadi said:
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
 
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.
 
Janos Makadi said:
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
 
Back
Top