views:

204

answers:

1

Hello.

I'd like to embed some files (text files, maybe graphics) in a C++/CLI project -- preferably the same way I can do in C# project. This might be however impossible, as I found in this post: http://bytes.com/topic/net/answers/571530-loading-markup-xamlreader-load-resource-file#post2240705. This was written three years ago, so maybe now there is some way to do this (in VS2k8)?

+2  A: 

Under C++/Cli project go to “Properties…”, then look under “Linker”, and then “Input”, you’ll see the list of embedded files under “Embed Managed Resource File”.

Hamish Grubijan
If you add a file here called test.dat, then you can access it like this:Stream^ stm = Assembly::GetExecutingAssembly()->GetManifestResourceStream ("test.dat");
Tarydon
Also, check for nullptr just in case.
Hamish Grubijan