Jump to content

Question about Dll

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
CriticalError

CriticalError

    Newbie

  • Members
  • PipPipPip
  • 42 posts
Hey guys

Got a quick question I have Visual Studio Professional and was wondering when making a class libary (.dll) can you add any files you want? I want to add around 100 audio files in a dll . It's for my other program

(also if yes which audio files just wav or MP3)

Thanks

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
Yes you can. We usually call it resource dll if the dll containing only embedded files and no actual codes. There is no limitation of what kind of files can be embedded into a dll. However we usually use RC_DATA type for types not specifically defined by MS. I believe there is special type of WAV resource. I just don't remember the constant names.

#3
CriticalError

CriticalError

    Newbie

  • Members
  • PipPipPip
  • 42 posts
Well yeah I did try to embed to Mp3 audio files there are around 114 of them an it totals up to around 1.60GB, however it gave me an error and it did not work. I will get that error back up.

#4
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
OMG! Don't get me wrong, but that's a very wrong way to use resource dll. Only embed tiny resources and not in large number. Using separate files is much better that your current approach. For example, it would take longer time to search your files also take longer time to load a file since when loading it must seek the through 1.60GB content.

If you want to store large number of files of considerable size into a single file, maybe you should consider using a database that can store data into one file. This approach is better since the db file is designed for easy searching and loading. SQLite and Firebird (embedded) to name some db that support storing to single file.