Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC++
hello,
 
I implemented an vc++ application in vs2010, where i am retrieving the data from .xml files for stock maintenance.
 
1) So when i run my application in Debug/Release mode i can retrieve data from .xml files, where as when i run my application through a web browser it is unable to retrieve data from .xml files and the application is not responding and struck.
 
2) If i run the same application in other computer it asks for these .xml files, so i added these .xml files in the folder where the application.exe is there. Then it is running fine.
 
What is the problem and where i am doing wrong i am bit confusion.
 
1) is there any way, where i can include these .xml files in to the solution directly. So that it wont create any problem if i execute the .exe from web browser or from other computer.
 
can anyone guide me on this.
 
Thank u in advance.
Posted 28-Dec-12 19:18pm
Kumar 091.2K
Comments
Richard MacCutchan at 29-Dec-12 5:41am
   
Are you using the full path to the files' locations?
Kumar 09 at 30-Dec-12 20:18pm
   
not the full path but the folder where these files are exists like xmldata()folder in this xml files, the path is xmldata\\file1.xml, xmldata\\file2.xml, xmldata\\file3.xml, and so on like this five xml files are there.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Well since you cannot guarantee that your program will be started from the directory above xmldata you cannot be sure that the path is valid. You should always use absolute paths to refer to your program's data files. In most cases the files should be stored in one of the standard locations that you can access by the SHGetFolderPath function[^].
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100