473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Embedded .dll's

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/).
Nov 15 '05 #1
5 12880
maghana,

I think that there is a third-party product out there that does this,
but I don't know offhand which it is. Generally speaking though, static
linking is not allowed in .NET. You would have to embed all of the code
into the one project and compile it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"maghana" <gw*****@hotmail.com> wrote in message
news:02****************************@phx.gbl...
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/).

Nov 15 '05 #2
maghana,

I think that there is a third-party product out there that does this,
but I don't know offhand which it is. Generally speaking though, static
linking is not allowed in .NET. You would have to embed all of the code
into the one project and compile it.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"maghana" <gw*****@hotmail.com> wrote in message
news:02****************************@phx.gbl...
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/).

Nov 15 '05 #3
You could take the assembly and add it to your project as an embedded
resource.
Then, create a stream from the resource at runtime.
You can then load the assembly from the resource stream using assembly.Load
A little reflection and you are there.

Oscar
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/).


Nov 15 '05 #4
Hmmm ... that sounds very interesting, but won't there be
a problem at compile time, if you already need to refer to
it then ? - is it possible to trick it to "pre-load" the
library, so you can use something like "using BASS;" ?
-----Original Message-----
Yes,

Actually, we go a step further and encrypt the contents of the assembly fileand rename it to another extension so as not to confuse Visual Studio. Itworks quite well since our software is designed around plugins and usesinterfaces extensively.
The encryption/renaming is done as a post-build so it is completelyautomated.

Oscar.

"Andreas Huber" <ah****@gmx.net> wrote in message
news:3f********@news.swissonline.ch...
Oscar Papel wrote:
> You could take the assembly and add it to your project as an embedded > resource.
> Then, create a stream from the resource at runtime.
> You can then load the assembly from the resource stream using > assembly.Load A little reflection and you are there.


Have you ever done this?

Regards,

Andreas

.

Nov 15 '05 #5
On Fri, 22 Aug 2003 01:41:54 -0700, "maghana" <gw*****@hotmail.com>
wrote:
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

Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: newbie | last post by:
Hi all, I got a problem using the embedded python. I'll be appreciated if some one can show me the way. What i want is, 1.build a dll(test.dll/test.lib) which uses the embedded python, for...
26
by: jini us | last post by:
Hi, I am starting a new project where I intend to use embedded database server in my win32 application. I intend to use VC++ microsoft studio 6.0 as my development environment. The...
0
by: Chris Schremser | last post by:
I have a question regarding embedded controls in IE. We are looking to replace a small VB ActiveX control with something written in C#. We have written the control and it instantiates correctly...
7
by: Christofer Dutz | last post by:
Hi, I am trying to read a XML-File which I marked as embedded resource from within the code of my DLL. Unfortunately it doesn't work. On my search for the error I inserted some code for...
3
by: Rogerio Jun | last post by:
Can I copy a embedded resource icon from a DLL to ohter DLL ? Rogerio
4
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm...
0
by: gueverson | last post by:
Hello! I am new in programming embedded visual c++ but I have done visual c++. I would like to know if the way of doing a dll in embedded is the same as the normal one or if not what are the aspects...
0
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
2
by: Brian Henry | last post by:
If you embedded an icon into a dll, how would you get access to it form inside the dll and return it to the calling app? I know how to return it, just I cant figure out how to access the embedded...
2
by: Fergal | last post by:
Hi, im recently new to embedded development. Im using an embedded system with Windows CE5 installed and trying to communicate with some hardware with a PC104 interface. The processor is an ARMV...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.