Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / July 2004

Tip: Looking for answers? Try searching our database.

serial port usage

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gopher - 28 Jun 2004 03:19 GMT
Using C++ in VS .NET, I can't find how to open serial ports for reading/writing.

More specifically, I am writing a VC++ .NET application (a "Windows Forms
Application"), and need to access a Serial Port (COM1, COM2, etc),
preferably by using standard file I/O ("stream" type access would be great).
The example in the response below was interesting, but it was for VB, not
VC++. I'd like to do this with a "Windows Forms Application" program, NOT
Win32 program, if at all possible.

For example, when I attempt to use the following code with a "Windows Forms
Application", I get run-time errors:

     FileStream        *fs   =   new   FileStream(S"COM1", FileMode::OpenOrCreate);
     StreamWriter   *sw  =   new   StreamWriter(fs);

The run time errors look like:
    System.ArgumentException: FileStream will not open Win32 devices
          such as disk partitions and tape drives. Don't use "\\.\" in your path.

    at System.IO.FileStream..ctor(String path, FileMode mode,
                                                 FileAccess access, FileShare share,  
                                                 Int32 bufferSize, Boolean useAsync,
                                                 String msgPath, Boolean bFromProxy)

    (etc., etc., etc.)

How do o
Ed Kaim [MSFT] - 04 Jul 2004 01:39 GMT
Try
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default.aspx.

> Using C++ in VS .NET, I can't find how to open serial ports for
> reading/writing.
[quoted text clipped - 31 lines]
>
> How do o

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.