views:

298

answers:

2

So I have a Visual Studio 2008 project which has a large amount of binary data that it is currently referencing. I would like to package the binary data much like you can do with C# by adding it as a "resource" and compiling it as a DLL.

Lets say all my data has an extension of ".data" and is currently being read from the visual studio project.

Is there a way that you can compile or link the data into the .dll which it is calling?

I've looked at some of the google link for this and so far I haven't come up with anything - the only possible solution I've come up with is to use something like ResGen to create a .resources file and then link it using AssemblyLinker with /Embed or /Link flags. I dont think it'd work properly though because I dont have text files to create the .resources files, but rather binary files themselves.

Any advice?

+1  A: 
Robert
How do you import binary data with this? It appears easy to do with "bitmap (.bmp), icon (.ico), cursor (.cur), Html file (.htm)" but how does one do it with importing "other" data?
CrimsonX
What if there is no resource script?
Jive Dadson
@CrimsonX When you import a file that Visual Studio doesn't understand or edit, it can still shove it into the PE file's data (executable or dll) even though it can't read it. "Resoucres" are just files in the data section of your exe or dll.http://msdn.microsoft.com/en-us/magazine/cc301805.aspx
Robert
@Robert - Thanks for the clarification and help Robert, I'll try this out. Its much appreciated.
CrimsonX
A: 

You can embed the binary data as a C language array - no resources involved at all. An old classic trick. see for example XD

renick