473,385 Members | 1,707 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,385 software developers and data experts.

Reading dll-Functions and execute them

Hi everybody

I am trying to load an assembly (dll) an this works fine for me with:

Dim SampleAssembly As [Assembly]

SampleAssembly = [Assembly].LoadFrom("c:\clsHali.dll")
But now I like to read all public functions I have created and can't make
this work I have to public functions in it called hali1 and hali2... I have
tried it with getmethods, gettypes and whatever but never get the results I
needed...

How can I read all public functions of this assembly?

The second question is:
How can I execute the function or whatever if I found the function (hali1 or
hali2) I needed?

Thanks alot for every help!

Nijazi Halimaji
Jan 16 '06 #1
2 1893
You first need to get the types ussing Assembly.GetExportedTypes (assuming
that your functions are in public types) and once you have a type you use:

objType.GetMethods or some variant.

Once you have a MethodInfo, to execute it you use:

objMethodInfo.Invoke(objectInstance, ....)

If you still have problems, post the minimal code to reproduce it in order
to us to take a look.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Halimaji Nijazi" <te**@hotmail.com> escribió en el mensaje
news:OY**************@TK2MSFTNGP15.phx.gbl...
Hi everybody

I am trying to load an assembly (dll) an this works fine for me with:

Dim SampleAssembly As [Assembly]

SampleAssembly = [Assembly].LoadFrom("c:\clsHali.dll")
But now I like to read all public functions I have created and can't make
this work I have to public functions in it called hali1 and hali2... I
have tried it with getmethods, gettypes and whatever but never get the
results I needed...

How can I read all public functions of this assembly?

The second question is:
How can I execute the function or whatever if I found the function (hali1
or hali2) I needed?

Thanks alot for every help!

Nijazi Halimaji

Jan 16 '06 #2
Thanks for the tips... I did it!

regards
Nijazi Halimaji
"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> schrieb im
Newsbeitrag news:%2****************@TK2MSFTNGP12.phx.gbl...
You first need to get the types ussing Assembly.GetExportedTypes (assuming
that your functions are in public types) and once you have a type you use:

objType.GetMethods or some variant.

Once you have a MethodInfo, to execute it you use:

objMethodInfo.Invoke(objectInstance, ....)

If you still have problems, post the minimal code to reproduce it in order
to us to take a look.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Halimaji Nijazi" <te**@hotmail.com> escribió en el mensaje
news:OY**************@TK2MSFTNGP15.phx.gbl...
Hi everybody

I am trying to load an assembly (dll) an this works fine for me with:

Dim SampleAssembly As [Assembly]

SampleAssembly = [Assembly].LoadFrom("c:\clsHali.dll")
But now I like to read all public functions I have created and can't make
this work I have to public functions in it called hali1 and hali2... I
have tried it with getmethods, gettypes and whatever but never get the
results I needed...

How can I read all public functions of this assembly?

The second question is:
How can I execute the function or whatever if I found the function (hali1
or hali2) I needed?

Thanks alot for every help!

Nijazi Halimaji


Jan 16 '06 #3

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

Similar topics

4
by: MLH | last post by:
It has been mentioned that a ghosted machine or a machine linked by cable modem and USB may result in my reading a MAC address other than one burned onto a NIC in the machine. That being the case,...
0
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems...
2
by: Ramesh | last post by:
Hello everybody, I have exe (a.exe) file that runs on COM+ environement the executable loads a dll(b.dll) which has a reference to a XML file which the dll uses to parse. The problem is that...
3
by: JRB | last post by:
I need to read from and write to USB and RS-232 ports in a new project I'm working on. I was thinking about using C#, but I'm not sure if there's a way to do this in that language. If not, any...
1
by: Visually Seen # | last post by:
Hey everybody, I feel like reading the DLL files of something like: System.Windows.Forms.DLL How do I open the files and understand the code? I know quite a bit of C# Visually Seen #
3
by: Arne Beruldsen | last post by:
How do you read the serial number to a hard drive? Thanks...Arne
2
by: bhreddy | last post by:
Hi All, Can someone help me out how can I resolve the error "0xC0000005: Access violation reading location 0x513112f4"? Steps I followed... 1. I ran the application at DOS prompt 2. After...
5
by: Kevin S Gallagher | last post by:
I have been attempting to read a value from the starting executable while in a DLL. So far have tried the following were "Test" is a defined value in the EXE. What is returned is a blank/empty...
3
by: raghunadhs | last post by:
Hi all, i have developed a ".dll" in vc++, regarding to find out CRC32. and in my V.B 6.0 application i am calling that .dll. If i run my v.b application it is working means.. i am able to find...
1
by: k.nagendra.prasad | last post by:
Hi , I have a few 3rd party DLLs whcih my application requires. These are all registered in GAC. When I run my application it throws an weired exception. Exception comes from those dlls. When i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.