2 Replies - 625 Views - Last Post: 06 March 2013 - 07:41 AM Rate Topic: -----

#1 DarkTyranno  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-February 13

Embed DLL's in project using code (no software to merge)

Posted 06 March 2013 - 02:54 AM

I'm having trouble for a long time, to be able to use dll files in my project.
I want to add them as embedded resource to my project, so I only have to send .exe files.
I'm using Visual Studio 2010 and 2 dlls (1 managed and 1 unmanaged) for my project.
They're needed to get the BASS modplayer working in my application.

NOTE: As I have many different designs of my program and want to update it easily, I don't want to use those software solutions to merge the dll files with the final exe. Then I have to do this constantly, but embedding the dll's will work as automatisation for exporting future updates and different designs without merging the dll's each time afterwards!

However I didn't find a lot online, a few examples of code that could fit my needs, but they all fail.
I get the usual errors like 'type/namespace 'xxx' could not be found, missing reference?' and if it seems to work and I run it, then it can't find my embedded dll's...

I've put my attention to this topic, which would handle the actions I need (if I could get this to work).
I also asked a question there, but it's waiting for the author to come online and if he's willing to help me out...

If anyone knows a solution for my problem or knows how to use that code, I would be grateful if you can help me out with it.

Is This A Good Question/Topic? 0
  • +

Replies To: Embed DLL's in project using code (no software to merge)

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3551
  • View blog
  • Posts: 10,999
  • Joined: 05-May 12

Re: Embed DLL's in project using code (no software to merge)

Posted 06 March 2013 - 07:31 AM

As far as I know, the BASS modplayer is purely unmanaged. It is not mixed mode like the SQLite example in that CodeProject example. So what you need to do with that file is stream the data out from your embedded resource and save it as a real file with the correct file name that matches any DllImport attributes that you used to P/Invoke into the BASS modplayer.

An alternative in to rebuild BASS modplayer and make it into a mixed mode assembly like the SQLite mixed mode assembly.

Or have you considered using ClickOnce for distribution, rather than shipping a single executable? You seem to be thinking ahead about future updates and ClickOnce has built in solutions for handling automatically doing updates.

I also see that there is a BASSMod.Net ( http://us.un4seen.co...MOD20.Net20.zip ) I suspect that code is either purely managed, or at least mixed mode.

This post has been edited by Skydiver: 06 March 2013 - 07:31 AM

Was This Post Helpful? 0
  • +
  • -

#3 DarkTyranno  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 27-February 13

Re: Embed DLL's in project using code (no software to merge)

Posted 06 March 2013 - 07:41 AM

View PostSkydiver, on 06 March 2013 - 07:27 AM, said:

Or have you considered using ClickOnce for distribution, rather than shipping a single executable? You seem to be thinking ahead about future updates and ClickOnce has built in solutions for handling automatically doing updates.


I have to look what ClickOnce does, the way I want to share my 'application' and update it is like this:
I create subtitles (srt files) and my application shows the nfo file which is merged in application.
So I have 1 exe file and 1 srt file in a rar.
The updates I can have are changes in my application (skin, music, text of nfo updated),
the dll files will remain the same or can be replaced as well if I need any other ones.
At this time I already have the BASS.NET dll. I use both the bass.dll and Bass.Net.dll,
otherwise my application won't run. It would be handy for me to merge the dll files in my application once,
so I can update and export any new changes without adding the dll's and music each time.

That code from codeproject is exactly what I need, the same error and just the way to find all embedded dll's.
I just can't get it to work completely. As I mentioned in the question there, the example and the code in the article differ and I get confused. It should be easy, but I don't really get what I do wrong...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1