PDA

Click to See Complete Forum and Search --> : anyone tried to embedd an image or an audio clip in a *.dll file ??


addola
Dec 10th, 2002, 04:05 PM
I am trying to make an application but i want to hide the files like Images and stuff, say I want to make a card game but i want to hide the image files in a dll file....

Is it possible ??

DevGrp
Dec 10th, 2002, 09:24 PM
Yeah its possible. Read up on resources. I've never worked with audio file, but I'm sure it can be done. Here is an example I did with images.

Both projects are included.

Link (http://www.pierrewalker.com/Files/vsproject.zip)

addola
Dec 11th, 2002, 04:24 AM
oh thank u , yours worked fine ....

I will see how can i do it in mine...


by the way I have a little question, would it be the same thing with a Microsoft Access database file *.mdb ?? Can I also embedd a database in a DLL ?? is it feasible ?? or should I make the *.mdb an external password protected file ??

PT Exorcist
Dec 11th, 2002, 07:38 AM
i dont think that for a game a db would be a good idea

Scott Penner
Dec 11th, 2002, 12:40 PM
oh,
by the way
What are you hoping to accomplish by hiding the images in the dll? You know that any .NET resource editor should be able to pull the images out, right?

Storing a database in a dll makes no sense. If you don't want to ship the mdb file, then you will need to write the code to create it on the fly, or just use XML for that matter. (Both alternatives are pretty easy with .NET.)

addola
Dec 11th, 2002, 11:05 PM
No I won't use a db for my game :)

Creating a DB on the fly using my code ?? Okay I create The Tables and load the values whenever the Program is excuted, but then where should i save the changes of inserted records ?

Second, I think that once u build a DLL file u can't see what's inside it unless u use a code like Assembly.Load(CardImages) to access it.

DevGrp
Dec 12th, 2002, 06:50 AM
You can find what is in the dll using reflection. You can even call the methods too. Reflection is very powerfull.

HumanCompiler
Dec 13th, 2002, 01:44 PM
yes, Reflection kicks a$$ :D

I would go with Scott Penner's idea if I were you. In fact, you don't even have to directly use XML if you don't want to. The ADO.NET DataSet allows you to directly save your data directly to an XML file (the DataSet, but in a serialized way ;)) and then load it from that file :)