using *.xrc in VC2003

Questions about wxWidgets running on MS.NET, mono or Portable.NET ? Ask it here !
Post Reply
saint
Earned a small fee
Earned a small fee
Posts: 17
Joined: Mon Mar 20, 2006 11:09 am
Location: Ukraine, Dnipropetrovsk

using *.xrc in VC2003

Post 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.
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post 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?
saint
Earned a small fee
Earned a small fee
Posts: 17
Joined: Mon Mar 20, 2006 11:09 am
Location: Ukraine, Dnipropetrovsk

Post by saint »

I want to have a small tutorial of loading xrc files to my app and working with xrc's controls.
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Then, you should have a look at the "xrc" sample (in the samples folder).
saint
Earned a small fee
Earned a small fee
Posts: 17
Joined: Mon Mar 20, 2006 11:09 am
Location: Ukraine, Dnipropetrovsk

Post 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.
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post 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.
micros
Super wx Problem Solver
Super wx Problem Solver
Posts: 317
Joined: Sat Mar 18, 2006 10:41 am
Location: Ustek, Bohemia

Post 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.
Post Reply