Newbie Q about C# and DLLs

  • Thread starter Thread starter Peter Krikelis
  • Start date Start date
P

Peter Krikelis

Hi,

We recently upgraded to C# from VB 6.0 and all our front
ends imported fine. I was wondering how to convert over
all our DLL code to C#. Does C# support the notion of
creating DLLs or do I have to create a Class Library
instead or whether a VB DLL could be called by a C# front-
end.

Thanks in advance,

Pete.
 
Peter Krikelis said:
Hi,

We recently upgraded to C# from VB 6.0 and all our front
ends imported fine. I was wondering how to convert over
all our DLL code to C#. Does C# support the notion of
creating DLLs or do I have to create a Class Library
instead or whether a VB DLL could be called by a C# front-
end.

A class library will compile to a DLL, which you can then reference from
your front end .exe project like any other library. You can actually compile
any .NET project into a DLL, providing you set the correct output type in
the compiler settings! An alternative approach, as you suggest, is to look
at adding the VB COM DLL to your project (under references), and VS will
generate the necessary interop elements to allow your c# code to talk to it
(intellisense and all!). It's really just a 3-click process!

HTH

Tobin
 
Simply go to the class view, right click on the project
and click on Add Reference. Here you'll have a list of
available registered objects. Click browse and nav to
your VB DLL's. If they're COM compliant you should be
able to access them as they are from .Net (language
doesn't matter)

Dan.
 
Back
Top