CreateFile API or MSComm 
Author Message
 CreateFile API or MSComm

Dick,

Thanks for the info and advice,  I understand there are limitations using
the API in VB, however in this particular case, those limitations don't
affect me or the functionallity of the program.  The added cost of $399.00
to the project is something I will have a hard time justifying to the
customer since it's been working fine up to this point.  All that has
happened is the addtion of some serial ports.  The added ports cost the
customer enough that it required Capital Appropriations Request.  I'm
hesistant to go back to them and tell them I need another purchase component
to effect this upgrade.

Any third party control I could possibly buy is going to be little more than
a wrapper for these very API calls, so If I knew how they were able to
address the additional ports I could adapt my present API function calls to
address them as well, and voila' my job is done.  Coincidentally, this isn't
exclusively a VB problem. There is a sample application in VC that uses the
calls,  Modifying the code to allow me to address over 8 ports results in
the same error when I attempt to open COM9 or greater.  This appears to be a
problem with the API Call itself.

Any information on a workaround for this apparent limitation to the
CreateFile function would be appreciated.


Quote:
> Hi,

> I'd use a control.  There are serious limitations using the API under VB
(I
> do have code example in my book, but you already seem to have a handle on
> that).  I'd suggest that you take a look at Sax Comm Objects
> (www.saxsoft.com).  Your code for parsing will be a trivial port.

> --
> Richard Grier (Microsoft Visual Basic MVP)
> Hard & Software
> 12962 West Louisiana Avenue
> Lakewood, CO  80228
> 303-986-2179 (voice)
> 303-986-3143 (fax)
> Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
> Edition ISBN 1-890422-25-8 (355 pages).
> For information look on my homepage at http://www.*-*-*.com/ .
> Use the Books link to order.  For faster service contact the publisher at
> http://www.*-*-*.com/ .



Sun, 02 Mar 2003 03:00:00 GMT  
 CreateFile API or MSComm
I am writing an application that monitors Serial Data from multiple ports
simultaneously.  I originally wrote the program using the MSComm control and
it works wonderfully.  However, I have a Digi EPC/X Controller with 2 16
Port Concentrators on it and much to my dismay learned that MSComm will only
address 16 Serial Ports.  Anything above Com16 you are out of luck.

so I resorted to the old API method and found some excellent references.  I
have written a sample app that does the same thing my previous app did using
API calls; specifically CreateFile, ReadFile, and WriteFile API's.  These
work great up to COM8 and from COM9 on I get a big ugly error,  if I step
through the program, the problem is with the CreateFile function.  It can't
open the file (PORT).  Thus it returns an invalid handle and my operation is
dead in it's tracks.

I cannot find any reference to Port Name limitations on MSDN in reference to
the CreateFile call,  Any help would be appreciated.

P.S.  All ports are defined and operational in the system.  Hyperterminal
can open and use all of the defined ports all the way through COM36.  MSComm
can open and use the ports all the way through COM16.

I would consider using API calls or a control, but I am going to lean
towards API calls since I already have the code written to handle all of the
data parsing from the serial ports.



Sun, 02 Mar 2003 21:33:23 GMT  
 CreateFile API or MSComm
Hi,

I'd use a control.  There are serious limitations using the API under VB (I
do have code example in my book, but you already seem to have a handle on
that).  I'd suggest that you take a look at Sax Comm Objects
(www.saxsoft.com).  Your code for parsing will be a trivial port.

--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com.



Sun, 02 Mar 2003 23:45:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CreateFile API or MSComm

2. Open existing file with API CreateFile()

3. CreateFile - API, Am I a Pudding?

4. CreateFile API

5. hFile = CreateFile(...) -- need HELP with API

6. Open existing file with API CreateFile()

7. CreateFile API call with VB4(32) on Win95 OS

8. Createfile API problem with COM ports

9. Using API function CreateFile(),ReadFile() and WriteFile()

10. CreateFile API

11. Createfile API

12. CreateFile API Return INVALID_HANDLE_VALUE

 

 
Powered by phpBB® Forum Software