Article View: borland.public.cppbuilder.nativeapi
Article #12753Re: WriteFile(to COM1)
From: Nicholas Gessler
Date: Thu, 20 Nov 2003 03:09
Date: Thu, 20 Nov 2003 03:09
17 lines
1547 bytes
1547 bytes
"Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> wrote:
> WriteFile(hComm, "w\x0\x1", 3, &dwWritten, NULL);
Super! This all works great!
Am I correct in assuming that WriteFile cannot pass an INT?
Where "phase" and "motor" are INTS and "coil" is a CHAR,
This code works:
// Coil Off
WriteFile(hComm, "w", 1, &dwWritten, NULL);
coil = ((phase[motor] + 2) % 4) + (motor * 4);
WriteFile(hComm, &coil, 1, &dwWritten, NULL);
WriteFile(hComm, "\xo", 1, &dwWritten, NULL);
Is this the best way to handle it?
Technical Details
Message-ID:
<3fbc3e97$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fbc160d$1@newsgroups.borland.com> <3fbc1f3c@newsgroups.borland.com> <3fbc2c5f$1@newsgroups.borland.com> <3fbc2e31$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,bcf3c83168a0fa3a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-19 20:39:36 PST From: "Nicholas Gessler" <gessler@ucla.edu> Sender: "Nicholas Gessler" <gessler@ucla.edu> Reply-To: "Nicholas Gessler" <gessler@ucla.edu> Subject: Re: WriteFile(to COM1) Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 4.60.102.178 References: <3fbc160d$1@newsgroups.borland.com> <3fbc1f3c@newsgroups.borland.com> <3fbc2c5f$1@newsgroups.borland.com> <3fbc2e31$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <3fbc3e97$1@newsgroups.borland.com> Date: 19 Nov 2003 20:09:59 -0700 X-Trace: newsgroups.borland.com 1069301399 207.105.83.66 (19 Nov 2003 20:09:59 -0700) Lines: 17 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail