Re: Is it possible to include a dll in the exe

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Daniel Moth (dmoth74_at_hotmail.com)
Date: 12/08/04


Date: Wed, 8 Dec 2004 23:49:27 -0000

That is fine on the desktop and for the benefit of the archives the code
snippet needs to close the stream before using types from the assembly (and
should check if the file already exists before creating it).

On the CF it seems the dependencies are checked before any user code gets a
chance to execute, so I cannot get it working. If you have a working CF
example please send it to me (I am interested in it from a POC point of view
:-).

Cheers
Daniel

-- 
http://www.danielmoth.com/Blog/
"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message 
news:OcEJk9V3EHA.2572@TK2MSFTNGP11.phx.gbl...
> You can add DLL to the project, mark it as embedded resource, then, upon 
> loading your application, check for the dll existence in the file system 
> and if it's not there, simply copy it there from the resource stream.
>
> Stream strDLL = 
> Assembly.GetExecutingAssembly().GetManifestResourceStream("MyNameSpace.MyDll.dll"); 
> //Case sensitive
> string path = 
> Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName);
> FileStream fs = File.Create(path + "\\MyDLL.dll");
> int nRead = -1;
> byte[] buffer = new byte[4096];
> while(nRead != 0)
> {
>    nRead = strDLL.Read(buffer, 0, buffer.Length);
>    if ( nRead > 0 )
>        fs.Write(buffer, 0, nRead);
> }
>
> -- 
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "ORC" <orc@sol.dk> wrote in message 
> news:uZX04ES3EHA.2312@TK2MSFTNGP15.phx.gbl...
>> HI,
>>
>> It is possible to include a custom control dll in the exe file so that 
>> the
>> dll isn't a standalone file that will have to be copied to the PDA along
>> with the exe file?
>>
>> Thanks,
>> Ole
>>
>>
>
> 


Relevant Pages

  • mplayer (from CVS) && win32/wmvadvd.dll
    ... I'm trying to play a stream with mplayer from ... The stream needs the newer video codecs Windows Media Video 9 Advanced ... which comes from the DLL wmvadvd.dll. ...
    (freebsd-questions)
  • Re: Updating bookmarks in word after stream
    ... Why make it an EXE? ... > bookmarks, and save the file. ... I also have a dll that will stream the ... stream this temp file to the end user. ...
    (microsoft.public.vb.general.discussion)
  • Re: pipe-out from dll library
    ... You can redirect process output to the StreamReader and then get the data ... Another solution is that you will set the output stream manually for the ... Vadym Stetsyak aka Vadmyst ... > and a ftp client dll library using TCPclient, ...
    (microsoft.public.dotnet.languages.csharp)
  • ANN: ShareDll library
    ... Sharedll is a library to support dll. ... Host and dll can share single stream. ... dll without using bpl. ...
    (borland.public.delphi.thirdpartytools.general)