Control hardware with a dll

  • Thread starter Thread starter Eddy_w
  • Start date Start date
E

Eddy_w

Hello,

I am busy with a project now that have to do hardware controlling with
the com port. They gave me a dll file for that (with the functions to
control the hardware in it). But now how can I use this dll file from
my vb.net like I should use a com object. Or is this not possible and
how can I solve my problem then.

thnx
 
Hello,

I am busy with a project now that have to do hardware controlling with
the com port. They gave me a dll file for that (with the functions to
control the hardware in it). But now how can I use this dll file from
my vb.net like I should use a com object. Or is this not possible and
how can I solve my problem then.

Using VB you would choose Project, Add Reference from the menu. From
here you can browse to the DLL-file, and from there use the DLL's
functionality. Pressing F2 will give you an overview for references
active for the particular project.

/Snedker
 
Hi,

Eddy_w said:
Hello,

I am busy with a project now that have to do hardware controlling with
the com port. They gave me a dll file for that (with the functions to
control the hardware in it). But now how can I use this dll file from
my vb.net like I should use a com object. Or is this not possible and
how can I solve my problem then.

If the DLL is a C or C++ DLL, add the dll to the references of your project
and use Interop to call its functions. If it's a .NET assembly, then just
add the dll to the refernces of your project, add "using" followed by the
namespace used in the DLL at the begining of your VB source file and use the
DLL functions normally.
 
Hi,

This depends on what kind of DLL it is. Is it an ActiveX DLL (COM object),
a native DLL (probably written in C/C++), or a .NET assembly?

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
Back
Top