473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with WriteFile and ReadFile

Hi,

I need to send and receive data through RS-232 port in a synchronous way.
The problem is that the data packet I need to send and receive is huge so I
need to send and receive it in two or more segments.

But I need to do that with two functions one to read and one to send in such
a way that those functions wait until all data has been received/sent.

Can anybody help me with this?

Thanks,

Robe.

Sep 28 '07 #1
3 1120

"Robe" <Ro**@discussions.microsoft.comwrote in message
news:A8**********************************@microsof t.com...
Hi,

I need to send and receive data through RS-232 port in a synchronous way.
The problem is that the data packet I need to send and receive is huge so
I
need to send and receive it in two or more segments.

But I need to do that with two functions one to read and one to send in
such
a way that those functions wait until all data has been received/sent.

Can anybody help me with this?
Which library are you using? .NET? MFC? Win32 API? something else?
>
Thanks,

Robe.

Oct 15 '07 #2
I'm using Win32 API.
"Ben Voigt [C++ MVP]" wrote:
Which library are you using? .NET? MFC? Win32 API? something else?

Oct 15 '07 #3

"Robe" <Ro**@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
I'm using Win32 API.
Ok, microsoft.public.vc.language or microsoft.public.win32.programmer.*
newsgroups would be better. This one is specific to using C++ in .NET
programs.

Anyway, can you create one or two new threads to do the serial data transfer
and then use WaitForSingleObject / WaitForMultipleObjects to wait for the
transfer to finish?
Oct 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hi, I am extending an existing MFC app to use Unicode (for a Japanese version of the interface elements). The app's purpose is to control a peripheral device through the serial port, and the...
2
by: monkeydragon | last post by:
Which is better, using ReadFile/WriteFile or use fstream?
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
2
by: yodadbl07 | last post by:
Hey i made this program that uses classes and files, and im having trouble with the readfile constructor... here is the code #include <iostream.h> #include <iomanip.h> #include <fstream.h>...
11
by: blunt | last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.