Using old DLL

  • Thread starter Thread starter Arda Han
  • Start date Start date
A

Arda Han

Hi friends,

I wrote a DLL with Delphi. Now I am migrating my applications to C#.Net. In
this way I have a few question.

1- How can I create a DLL in C#.Net
2-How can I load DLL's at runtime dynamically?
3-Can I use my old DLL in C#.Net? How can I do it?

Thanks

Arda Han
Software Engineer
 
Hi Arda

this is a short answer you quistions , i will be wiling to give more
explination if you post others once you get into somedetails.

1- How can I create a DLL in C#.Net
Answer: create a new project of type Class Library. That is, open new
project, select C#, then in the project type select Class Library.
2-How can I load DLL's at runtime dynamically?
Answer: to load a DLL, you use the DllImport attribute, then
define the function you are to use form the dll as external(you can read
more about that attribute on the MSDN online) However, if it is your dll,
why don't you just add reference to it (right click you project, select add
reference), you select it from the project tab, assuming you will have the
two project inside the same solution.
3-Can I use my old DLL in C#.Net? How can I do it?
Ansewer : yes you can , if it is com , you can make register it using
TlpExp ,if not , still you can alway use the DllImport

Thanks



Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top