Click here to Skip to main content
16,006,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Is it Possible to create more than one file in the COM Port at same time? Please tell me . how to solve this problem.?
Thanks in Advance..
Regards,
Lakshmi Narayanan.S
Posted
Updated 3-Aug-11 1:28am
v3

1 solution

If you mean: "Can I open the same serial port, via CreateFile more than once at time?" the answer is no.
The serial port is not a shared device and the documentation clearly states ("Communications Resources" at MSDN[^]):

When the process uses CreateFile to open a communications resource, it must specify certain values for the following parameters:
  • The fdwShareMode parameter must be zero, opening the resource for exclusive access.
  • The fdwCreate parameter must specify the OPEN_EXISTING flag.
  • The hTemplateFile parameter must be NULL.
 
Share this answer
 
v2
Comments
naraayanan 3-Aug-11 8:34am    
Hi ,
Thanks for your quick reply.
Sergey Alexandrovich Kryukov 3-Aug-11 18:35pm    
A sound answer, deserves 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900