Click here to Skip to main content
15,885,877 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
Comments
Richard MacCutchan 29-Dec-12 5:41am    
Are you using the full path to the files' locations?
Kumar 09 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

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[^].
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900