473,405 Members | 2,444 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.

Dynamic Library loading..

VJ
I will have the path of a DLL i.e C:\Test\Test.dll and a Method name in the
DLL say ExecuteMe(string arg1, int arg2). I want to be able to load the DLL
at run-time and execute this method. I also want to be able to capture the
return value of the Method.

Vijay
Nov 17 '05 #1
4 4946
Vijay,

Is this an unmanaged DLL that exports a C type function, or is it a
managed DLL? The ways you would do this are very, very different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"VJ" <vi********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I will have the path of a DLL i.e C:\Test\Test.dll and a Method name in the
DLL say ExecuteMe(string arg1, int arg2). I want to be able to load the DLL
at run-time and execute this method. I also want to be able to capture the
return value of the Method.

Vijay

Nov 17 '05 #2
VJ
Nicholas, it can be both, for now I would like to know only for managed
DLL's

Vijay

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eg**************@TK2MSFTNGP14.phx.gbl...
Vijay,

Is this an unmanaged DLL that exports a C type function, or is it a
managed DLL? The ways you would do this are very, very different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"VJ" <vi********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I will have the path of a DLL i.e C:\Test\Test.dll and a Method name in
the DLL say ExecuteMe(string arg1, int arg2). I want to be able to load
the DLL at run-time and execute this method. I also want to be able to
capture the return value of the Method.

Vijay


Nov 17 '05 #3
VJ,

For managed DLL's, you would use reflection (assuming that the types you
are loading don't implement a common interface which you have access to).
You would get the Type instance, and from there, you can get method/property
information, from which you can get the value or invoke the method.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"VJ" <vi********@yahoo.com> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Nicholas, it can be both, for now I would like to know only for managed
DLL's

Vijay

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:eg**************@TK2MSFTNGP14.phx.gbl...
Vijay,

Is this an unmanaged DLL that exports a C type function, or is it a
managed DLL? The ways you would do this are very, very different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"VJ" <vi********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I will have the path of a DLL i.e C:\Test\Test.dll and a Method name in
the DLL say ExecuteMe(string arg1, int arg2). I want to be able to load
the DLL at run-time and execute this method. I also want to be able to
capture the return value of the Method.

Vijay



Nov 17 '05 #4
Vijay,

First of all you should load the assembly and get a reference to it, take a
look at:

http://msdn.microsoft.com/library/de...sLoadTopic.asp

Regards - Octavio

"VJ" <vi********@yahoo.com> escribió en el mensaje
news:en**************@tk2msftngp13.phx.gbl...
Nicholas, it can be both, for now I would like to know only for managed
DLL's

Vijay

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:eg**************@TK2MSFTNGP14.phx.gbl...
Vijay,

Is this an unmanaged DLL that exports a C type function, or is it a
managed DLL? The ways you would do this are very, very different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"VJ" <vi********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I will have the path of a DLL i.e C:\Test\Test.dll and a Method name in
the DLL say ExecuteMe(string arg1, int arg2). I want to be able to load
the DLL at run-time and execute this method. I also want to be able to
capture the return value of the Method.

Vijay



Nov 17 '05 #5

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

Similar topics

0
by: Michael Own | last post by:
Hi. I've upgraded my RH 8.0 with some packages from rawhide : httpd-2.0.47-4.i386.rpm httpd-devel-2.0.47-4.i386.rpm php-4.3.2-7.i386.rpm php-devel-4.3.2-7.i386.rpm It works fine, but i...
19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
0
by: Parag Joshi | last post by:
hi, I am facing a wierd problem with dyanamic class loading. I have a namespace called ETS.DAO which contains my Data Access Object classes. All these classes implement a common interface which...
5
by: meendar | last post by:
can anyone tell me what the static and dynamic library? thnkx in advance.
1
by: dfj225 | last post by:
While my question doesn't pertain specifically to python programming, it is a result of developing a python module, so I'm hoping someone here might have experience with this issue. So, first a...
2
by: marikanti | last post by:
Hi, I wonder how can we override the dynamic library loaded by ld on start up.(dynamic linked application). so that linker uses the new library to find symbols. Is it possible to do.
4
by: sealo | last post by:
Hello, I have a test in VS2005 that static library A.lib use the dynamic library C.dll. Then a application App use the A.lib. App-->A.lib-->C.dll It works. But if I remove the C.dll, the app...
4
by: kukuta | last post by:
Hi I have static library that is created from VC++.Net, however, I would like to use it in Borland C++ and I do any ways but it is not successful. So I want to ask: by the way can I use static...
6
by: Even | last post by:
Hi all, As far as I know, relative address will be assigned by program at link time.Right? Ok, here we go. So if we use a static library, it will give the program an relative address(i mean...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
0
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,...
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.