read serially

Ambitious contributor
4Mar2010,12:25   #1
answerme's Avatar
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
Contributor
9Mar2010,19:04   #2
Gene Poole's Avatar
You'll need to post more than just that. There's no way to diagnose your error without knowing more about the problem.
Ambitious contributor
19Mar2010,12:35   #3
answerme's Avatar
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
Contributor
19Mar2010,20:37   #4
Gene Poole's Avatar
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?