read serially

answerme's Avatar, Join Date: Dec 2007
Ambitious contributor
Hi all
I want to read number of bytes serially ,but i am getting an error that is

Code:
error C2664: 'CSerialCom::ReadByte' : cannot convert parameter 1 from 'DWORD [10]' to 'DWORD &'
where buffr is
DWORD buffr[10];
& iam reading buffr serially below here.

if((port.ReadByte(buffr)))


Iam able to write perfectly but reading iam facing problem
Gene Poole's Avatar, Join Date: Nov 2009
Contributor
You'll need to post more than just that. There's no way to diagnose your error without knowing more about the problem.
answerme's Avatar, Join Date: Dec 2007
Ambitious contributor
well actually I am sending(i.e. writing) CSTRING data through serial port. & reading it through Dword since CSerialcom readbyte has only one parameter i.e DWORD.
Well I am able to send(write) the full data 57 char (checked in hyper terminal also).
But when I am reading data I am getting only 46 char.. I don't know why. I tried to convert DWORD to CString but i couldnt get suceed

Code:
Sending /Writing Data Serially
CString data="dfdfsdfwewrrttnmnmbn12.343iuyiuyiuyiuyiyuyubnmb nbvbnbn"

Receiving Serially 
CSerialcom port;
DWORD buffer;
unsigned char frame;
int i;
if(port.ReadByte(buffer))>0)
frame[i++]=(unsigned char)buffer; 
In buffer i am receiving only 46 char
Gene Poole's Avatar, Join Date: Nov 2009
Contributor
1. What is CSerialcom? Not a standard class.

2. "frame" is a single byte. How did you even get "frame[i++]=..." to compile?

3. if you got this to compile, it probably ran the buffer over some critical part of your code at 46 bytes. Did it crash? Did you try to debug?