Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Re: Sharing COM Port access between Processes

Reply
 
Old 07-06-2009   #1 (permalink)
Dick Grier


 
 

Re: Sharing COM Port access between Processes

Hi,

You will have to write a wrapper class for the serial port access to allow
this sharing. In the wrapper, you publish the methods that you want to
share (and events), then handle the shared access using standard Threading
sharing constructs -- though threading isn't actually being used explicitly.

I have example code for this (a VB6 ActiveX EXE) in my book, see below.
However, .NET code would make it even cleaner.

Of course, your wrapper class (dll) becomes a new object, and is no longer
an instance of SerialPort -- you can, however, inherit SerialPort, and
overload the methods that you want to share to add the additional "stuff"
that I mention above.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Hyper-V -sharing modem for sbs server - How do you connect a com port to a named pipe Virtual Server
net.tcp port sharing service - any disadvantages? .NET General
sharing global variable between two processes PowerShell
telnet to port 19226 doesn't open, no password protected sharing o Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46