Visual Studio 2005 和 Tinyxml - xml 文件位置
由于某种原因,我通过 Visual Studio 2005 (c++) 创建的 Tinyxml 文件保存在我的桌面上,而不是调试文件夹或程序的根文件夹中。
如果有人知道某种方法告诉 vs2005 将tinyxml 创建文件保存在其他地方?
我用 eclipse 尝试过,它将文件保存在程序的根文件夹中,这就是我想要做的。
谢谢。
编辑: 我正在做一个 BHO(浏览器帮助对象),这是一个附加的 Internet Explorer。因此,当我运行程序时,“exe”是来自 c:\program files\Intenet Explorer 的 iexplore.exe
For some reason my Tinyxml file which is created via visual studio 2005 (c++) is saved on my desktop instead of the debug folder or in the program's root folder.
if anyone knows about some way to tell vs2005 to save the tinyxml create file somewhere else?
I tried that with eclipse and it saved the file in the program's root folder, which is what I'm trying to do.
thanks.
EDIT:
I'm doing a BHO (Browser Helper Object), this is an add-on Internet Explorer. so when I run my program the 'exe' is iexplore.exe from c:\program files\Intenet Explorer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您通常不应该渴望将数据文件写入程序目录。您应该在调用 SaveFile 时通过传递整个路径来明确告诉 TinyXml 您希望在何处创建文件,而不是让输出目录碰巧发生。
You normally shouldn't aspire to write data files to your program directory. Rather than leaving the output directory to chance, you should explicitly tell TinyXml where you want the file created by passing in the whole path when you call SaveFile.
确保您已在“项目属性->调试”中将工作目录设置为 $(OutDir),
然后调用:
该文件应该与您的 exe 位于同一目录中。
编辑:如果它是 Internet Explorer 的附加组件,那么我不知道工作目录在哪里,但我确信 Internet Explorer 会提供一些环境变量或某些内容,可以为您提供临时目录或其他内容。
Make sure you have set the working directory to $(OutDir) in "Project Properties->Debugging"
and then just call:
That file should then be in the same directory as your exe.
Edit: If its an add on to internet explorer than I don't know where the working directory would be, but im sure there would be some environment variable or something provided by internet explorer that would give you a temp directory or something.