use unknown dll

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hi, I wonder if it is possible to import and use an unknown dll in a C#
program? I.e. get to know what public variables, methods, properties
etc. the dll contains and get to know what parameters to call the
methods with, what the properties return etc. Does it have to be a .net
dll?

Thanks!
 
Eric,

Well, you can use reflection for .NET dlls, but this isn't the
recommended way to handle unknown dlls. Typically, you will want types in
dlls (in a known location) to implement an interface, then create instances
of those types and cast to the interface.

Hope this helps.
 
Hi,

Eric said:
Hi, I wonder if it is possible to import and use an unknown dll in a C#
program? I.e. get to know what public variables, methods, properties
etc. the dll contains and get to know what parameters to call the
methods with, what the properties return etc. Does it have to be a .net
dll?

It's a .net it's much easier , you can use reflection to know about all the
types the dll defines.

What are you trying to do?

Are you trying to implement plug ins ?
 
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message | Hi,
|
| | > Hi, I wonder if it is possible to import and use an unknown dll in a C#
| > program? I.e. get to know what public variables, methods, properties
| > etc. the dll contains and get to know what parameters to call the
| > methods with, what the properties return etc. Does it have to be a .net
| > dll?
|
| It's a .net it's much easier , you can use reflection to know about all
the
| types the dll defines.
|
| What are you trying to do?
|
| Are you trying to implement plug ins ?
|
|
| --
| Ignacio Machin,
| ignacio.machin AT dot.state.fl.us
| Florida Department Of Transportation
|
|

I'm affraid he's talking about non .NET DLL's, notice it's last sentence...
"Does it have to be a .net dll?"


Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top