Using MSComm32.ocx with .NET

P

Paul Clark

Hello,

I wonder if anyone can help me.

We have moved over to VS.NET 2003 from evb and I am
climbing a very steep learning curve as quick as
possible, (the migration path has not been made easy !),
anyway I have embedded vb projects running on various
mobile platforms using mscomm controls and wish to add
the control to VS.net so that I can use it in a new
project. Anybody know how to ?

If I do an 'Add Reference' in the project it complains
that I can only add dll's and not ocx components.

I presume I have to include an instance of the mscomm
class somehow but having searched MSDN for hours, (all I
found was the C++ example VcTerm which is double dutch to
me), I am still no further forwards.

Thanks in advance to anyone who can show me the light.
 
D

DS

Hello,

I am trying to find out what support .NET has for the
MSCOMM control I used in VB6. Is there a new one for .NET
or do you have to use the MSCOMM control from VB6? Does
the control upgrade to a .NET app?

Thanks
 
D

Dick Grier

Hi,

If you have Visual Studio 6, you can use MSComm32.ocx. Simply Browse to the
file, select it, and this will add it to your toolbox. If you do not have
VS 6 installed, the simplest solution is to download NETComm.ocx (free) from
my homepage. It is fully licensed for use with .NET, and does not need
Visual Studio 6. You still browse to the control, and add it manually (Click
on the COM Components tab in the Customize Toolbox dialog, then click Browse
to select).

I include an example with NETComm (and there is another that you can
download from my site). I have lots of other examples in my book. See
below.

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.
 
D

Dick Grier

Hi,

See my other reply. You can download NETcomm.ocx from my homepage (free).
There are native .NET classes available on the web, and I provide one in my
book (see below). These use Platform Invoke to call the native Windows
32-bit serial communications APIs, behind the scenes. As of today, the .NET
framework does not have any built-in serial communications support.

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.
 

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

Top