473,545 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12886
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************* *@exisconsultin g.com

"maghana" <gw*****@hotmai l.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************* *@exisconsultin g.com

"maghana" <gw*****@hotmai l.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.swissonl ine.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*****@hotmai l.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.Diagnost ics;
using System.Reflecti ons;
class thisclasstest
{
public static class void loadDll()
{
Assembly EmbeddedDll = Assembley.GetAs sembly(
typeof( <Your other dll's name no
extention>));
//now you type in the method or function out want to
//call IE from book. NetModuleTestSe rver.Bar()
// were NetModuleTestSe rver 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.c s
of course be in the directory of the CS file and the path to csc
you'll have to find, Mine is
C:\windows\micr osoft.net\frame work\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
1403
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 example, i want to use the 're' module. 2.build a exe(usedll.exe) which uses that dll. 3.use py2exe to eliminate the dependence of the python...
26
10774
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 postgres.org website seems to be catering for people with all sorts of requirements and platforms.
0
1667
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 in IE using the <object> tag. My question is this. When the browser visits the pages and requests the object from the server, it appears to be...
7
19220
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 outputing all Resources names to a simple textfile. Here nothing is output. Here my code (a little messy after about 3 hours of debugging): // Use the...
3
2587
by: Rogerio Jun | last post by:
Can I copy a embedded resource icon from a DLL to ohter DLL ? Rogerio
4
5873
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 generating a very simple installer app that embeds referenced .dll files inside it, which are extracted and referenced when the installer app is...
0
1497
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 that change Moreover if the way of using java native interface is the same My aim is to create a java application that works on pda on jeode jvm. In...
0
2185
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 multiple web forms. When you compile the application, it creates a DLL. If you view this DLL using ILDASM (the manifest), it shows info about the...
2
4703
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 resource in the dll from the dll (which is an icon) i can though figure out how to get an embedded resource from inside the exe file... what am i...
2
1805
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 processor. The board (development kit from www.arcom.co.uk called the Viper) works fine and i can write programs using VS2005 in C++, C# no...
0
7453
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4940
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1865
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
692
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.