Click here to Skip to main content
16,004,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Microsoft Installer Pin
Ravi Bhavnani6-Jan-02 4:46
professionalRavi Bhavnani6-Jan-02 4:46 
Generalheap problems... Pin
drummer5-Jan-02 18:35
drummer5-Jan-02 18:35 
GeneralRe: heap problems... Pin
Michael Dunn5-Jan-02 18:41
sitebuilderMichael Dunn5-Jan-02 18:41 
GeneralRe: heap problems... Pin
drummer6-Jan-02 12:32
drummer6-Jan-02 12:32 
QuestionWhat would cause strtok to fail? Pin
Stephen Caldwell5-Jan-02 8:23
Stephen Caldwell5-Jan-02 8:23 
AnswerRe: What would cause strtok to fail? Pin
Ravi Bhavnani5-Jan-02 8:36
professionalRavi Bhavnani5-Jan-02 8:36 
GeneralRe: What would cause strtok to fail? Pin
Stephen Caldwell5-Jan-02 8:47
Stephen Caldwell5-Jan-02 8:47 
QuestionProper MSComm usage? Pin
5-Jan-02 6:51
suss5-Jan-02 6:51 
I'm relativly new to MFC and would like to write some test code using the MSComm control. I've added one to my dialog and attached a variable to it. I just cannot seem to get the SetOutput() to actually output any bytes. Also, I ran across some "supposidly" working MFC code, but it will not work for me. Could someone please provide a simple example of sending a byte, say 0x90? Here is the "non-working" code that I found:

m_objMSComm.SetRThreshold(1);
m_objMSComm.SetRTSEnable(TRUE);
m_objMSComm.SetSettings("9600,n,8,1");
m_objMSComm.SetSThreshold(1);
m_objMSComm.SetPortOpen(TRUE);

COleSafeArray objOutputBuffer;

int iLoopVar=0;
long iArraySizeInc=0;

BYTE bOutput;

// First Byte to be send

bOutput='A';

objOutputBuffer.PutElement(&iArraySizeInc,(void *) &bOutput);
objOutputBuffer.ResizeOneDim(iArraySizeInc+2);
iArraySizeInc++;

// Secondt Byte to be send


bOutput='B';

objOutputBuffer.PutElement(&iArraySizeInc,(void *) &bOutput);
objOutputBuffer.ResizeOneDim(iArraySizeInc+2);
iArraySizeInc++;


// Third Byte to be send


bOutput='C';
objOutputBuffer.PutElement(&iArraySizeInc,(void *) &bOutput);
objOutputBuffer.ResizeOneDim(iArraySizeInc+2);
iArraySizeInc++;

//sending "ABC" through comm port #1

m_objMSComm.SetOutput((VARIANT)objOutputBuffer);


Thanks in advance!
GeneralFine a file Pin
Jon Newman5-Jan-02 6:30
Jon Newman5-Jan-02 6:30 
GeneralRe: Fine a file Pin
Michael Dunn5-Jan-02 6:49
sitebuilderMichael Dunn5-Jan-02 6:49 
GeneralRemoving *Unchanged* Output File (ofstream) :: C++ Pin
valikac5-Jan-02 6:00
valikac5-Jan-02 6:00 
GeneralRe: Removing *Unchanged* Output File (ofstream) :: C++ Pin
Daniel Turini6-Jan-02 22:58
Daniel Turini6-Jan-02 22:58 
GeneralRe: Removing *Unchanged* Output File (ofstream) :: C++ Pin
valikac7-Jan-02 8:28
valikac7-Jan-02 8:28 
Questionextern? Pin
Stan the man5-Jan-02 3:56
Stan the man5-Jan-02 3:56 
AnswerRe: extern? Pin
Chris Losinger5-Jan-02 4:14
professionalChris Losinger5-Jan-02 4:14 
GeneralRe: extern? Pin
Stan the man5-Jan-02 4:19
Stan the man5-Jan-02 4:19 
GeneralRe: extern? Pin
Chris Losinger5-Jan-02 4:24
professionalChris Losinger5-Jan-02 4:24 
AnswerRe: extern? Pin
Rick York5-Jan-02 6:48
mveRick York5-Jan-02 6:48 
AnswerRe: extern? Pin
Christian Graus5-Jan-02 9:32
protectorChristian Graus5-Jan-02 9:32 
GeneralRe: extern? Pin
Tim Smith5-Jan-02 11:01
Tim Smith5-Jan-02 11:01 
GeneralRe: extern? Pin
Christian Graus5-Jan-02 11:08
protectorChristian Graus5-Jan-02 11:08 
AnswerRe: extern? Pin
David Chamberlain7-Jan-02 7:56
David Chamberlain7-Jan-02 7:56 
GeneralTabbed multiple views Pin
Nnamdi Onyeyiri5-Jan-02 3:26
Nnamdi Onyeyiri5-Jan-02 3:26 
QuestionHow to write a service by VC Pin
Vistac5-Jan-02 3:10
Vistac5-Jan-02 3:10 
AnswerRe: How to write a service by VC Pin
Chris Losinger5-Jan-02 3:25
professionalChris Losinger5-Jan-02 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.