Re: Why can't open other com port
- From: "Boki" <bokiteam@xxxxxxxxxxxxxx>
- Date: 2 Jun 2006 01:50:11 -0700
Bruno van Dooren 寫道:
I want to open a com port that is from PCI board.
I can control that port ( com 13 ) by VB with MSCOMM control, work
well.
Now, it can't work in VC, could you please advice?
If you try to run your VC code, the VB program is closed, right?
COM ports can be opened by only 1 process at a time.
void InitialiseWindows(char *arg)
{
DCB
config;
COMMTIMEOUTS
timeouts;
// Open the com port required
com_handle = CreateFile
(
arg,
GENERIC_READ | GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
What is the text in arg?
--
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@xxxxxxxxxxx
Remove only "_nos_pam"
Hi,
Sure, VB already close.
um..
Here is my call method:
int main(int argc, char* argv[])
{
argv[1] = "com2";
InitialiseWindows(argv[1]);
return 0;
}
.
- Follow-Ups:
- Re: Why can't open other com port
- From: Scott McPhillips [MVP]
- Re: Why can't open other com port
- References:
- Why can't open other com port
- From: Boki
- Re: Why can't open other com port
- From: Bruno van Dooren
- Why can't open other com port
- Prev by Date: Re: Why can't open other com port
- Next by Date: Re: is auto_ptr part of STL?
- Previous by thread: Re: Why can't open other com port
- Next by thread: Re: Why can't open other com port
- Index(es):
Relevant Pages
|