Page 1 of 1

using *.xrc in VC2003

Posted: Mon Mar 20, 2006 11:15 am
by saint
Hi everybody.

Could anyone help me to solve this problem: how can I use xrc file, generated by wxFormBuilder, in my Visual Studio 2003 C++ solution?

Thanks in advance.

Posted: Mon Mar 20, 2006 12:45 pm
by benedicte
You don't really use it, in the sense that XRC files are not part of the Visual Studio projects.

You can add it to the list of files, but there is nothing special do to with it.

What are you expecting to do with XRC files in Visual Studio?

Posted: Mon Mar 20, 2006 1:21 pm
by saint
I want to have a small tutorial of loading xrc files to my app and working with xrc's controls.

Posted: Mon Mar 20, 2006 2:20 pm
by benedicte
Then, you should have a look at the "xrc" sample (in the samples folder).

Posted: Mon Mar 20, 2006 4:28 pm
by saint
how can I embed resource files in my *.exe file to not be obliged to copy *.xrc files in the same directory as *.exe file to be able to load them.

when I built xrc example with VC2003 and tried to start xrcdemo.exe - it failed because it couldn't load *.xrc files. And xrcdemo.exe started successfully only when I copied \rc folder in the it's working folder. How can I solve this problem.

Thanks in advance.

Posted: Tue Mar 21, 2006 1:11 pm
by benedicte
the xrc files not found in the samples in a"bug"... in nearly all the samples that load files, because the source code is not written knowing that executables are written in sub-folders (debug/release, ...)

Nothing forces you to embed the XRC files in your app.
For my apps, I install the XRC and icon files (.png) in a ZIP file, near the .exe file, and it works well.

Posted: Tue Mar 21, 2006 1:32 pm
by micros
You can use wxrc utility (found in wxWidgets/utils) to "compile" xrc into cpp file, which you then add to your project. You'll have to play a bit with dependecies and custom build steps to force the IDE recompile it when the xrc is chaged.