Question:
Getting and event from a dll in vb.net?
anonymous
1970-01-01 00:00:00 UTC
Getting and event from a dll in vb.net?
Three answers:
cabby
2007-11-13 11:21:20 UTC
try this site



www.dreamincode.net
nirvana r
2007-11-13 09:32:17 UTC
you can login for free at www.dreamincode.net , read the forum rules, then post your programming questions there. There are a lot great hardcore programmers there around the world.



My screenname is 'nirvanarupali'
Pfo
2007-11-13 12:07:44 UTC
What do you mean by "get an event from a dll"? Do you want the delegate signature? Do you want an object containing the event stub? Or is it a method handling an event?



I'll assume you aren't referencing this dll in your project, otherwise I doubt you'd be asking this (I would hope!).



You can programatically load an assembly like this:



dim assembly as Assembly = Assembly.LoadFrom(filePath)



From there, you can load all the types in the assembly into a list like this and process them:



dim types as Type() = assembly.GetExportedTypes()

for each t as Type in types



if t is delegate then

' do stuff

end if



if t.ImplementsInterface("IMyInterface") then

' do stuff

end if



next



The above assumes the dll was compiled in any managed language, it won't work on native dlls. If you are using a native dll, then you need to use the P/Invoke technique which I won't go into here.



If you email me more details, I might have an answer for you, but they are lacking here and I can't guess what you are looking for.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...