delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/09/14:10:28

From: EricJ <ericj AT netvigator DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: MSComm
Date: Fri, 10 Dec 1999 02:41:26 +0800
Organization: IMS Netvigator
Lines: 19
Message-ID: <384FF7D6.6159EAE2@netvigator.com>
NNTP-Posting-Host: bbig001089.netvigator.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have to develope a program to access RS232 using
Visual C++ 6.0, MFC MSComm. But I face the questions :
I have assign a CMSComm object m_MSComm.
I can setup the port using the following statements :
    m_MSComm.SetCommPort(1);
    m_MSComm.SetSettings("9600,N,8,1");
    m_MSComm.SetOutBufferSize(10);
    m_MSComm.SetPortOpen(TRUE);

But I can't use the following statement :
    m_MSComm.SetOutput("ABC");
The compiler compain that "cannot convert from 'char [4]' to 'const
struct tagVARIANT'". How to correct it?

And also I don't know how to receive data from RS232.
Any body can me or send me simple example?



- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019