Hi,
I have a .dll the I want to embed into the main (and
only) assembly, and use it from there ... how do I do
that, or is it even possible ? - please reply by eMail if
you reply to this fast ...
TIA
maghana.
NB : I use the BASS library to play .ogg files
(
http://www.un4seen.com/).
Here is my take. I personally hate writing DLL's in the traditional
fasion, but fortunatelly Microsoft has made it easy. okay here is the
example, it is derived from a book I got from one of my college
classes called "Inside C# 2nd edition"
Note: since you have one DLL already I'll continue on the one you want
to put it in.
just make a new .cs code file. and write a class
using System;
using System.Diagnostics;
using System.Reflections;
class thisclasstest
{
public static class void loadDll()
{
Assembly EmbeddedDll = Assembley.GetAssembly(
typeof( <Your other dll's name no
extention>));
//now you type in the method or function out want to
//call IE from book. NetModuleTestServer.Bar()
// were NetModuleTestServer is the dll and bar
// is the method
}
}
you will have to compile it in the command window to make it a dll
using this command csc /t:library thisclasstest.cs
of course be in the directory of the CS file and the path to csc
you'll have to find, Mine is
C:\windows\microsoft.net\framework\V1.0.3705\
I may be off on a couple of numbers. anyhow, use the similar code in
your main to call the dll with the embedded one in it and it should
work.
I know it's long and drawn out but it should work I make all my DLL's
this way, though I don't usually embed them. well hope it helps for
what it's worth.
Brian