TIP: Click on subject to list as thread! ANSI
echo: maxdev
to: all
from: Frank McCormick
date: 1998-10-13 08:09:56
subject: Comm init problem

I'm forwarding this question from The Pascal echo in hopes someone will be
able to answer him. 


* Forwarded (from: PASCAL) by Frank McCormick using timEd 1.10.y2k.
* Originally from Stewart Honsberger (1:229/604) to All.
* Original dated: Fri Oct 09, 18:56

Hello all.. I'm having some trouble initializing the com port with my
door library. In fact, it's the only thing that's stopping me from
releasing a (beta) door with it.

When BinkleyTerm passes the com info to Maximus, it passes the comm
HANDLE, not the PORT, so Maximus puts the com HANDLE into the door.sys
file (IE: COM7: instead of COM2: which my (V)modem is on).

The code I use to initialize the com port is as follows;

Function ModemInit(P: Byte; var PHandle: HFile): Boolean;
var
  Com: string[6];
  Action: ulong;
  Error: apiret;
Begin
  Com := 'COM' + Char(P + 48) + #0;
  Error := DosOpen({at}Com[1], PHandle, Action, 0, $0000,
                   OPEN_ACTION_OPEN_IF_EXISTS, OPEN_ACCESS_READWRITE OR
                   OPEN_SHARE_DENYNONE, nil);
  if Error  NO_ERROR then PHandle := 0;
  FPort := PHandle;
  if PHandle = 0 then ModemInit := FALSE else ModemInit := TRUE;
End;

P: Byte; is the port number (obtained by parsing the drop file), and
PHandle is the port handle passed to me on the command-line.

I got (most of) this code from an existing OS/2 COMM library written for
VP/2 1.1, but it doesn't seem to work for me. :<

Anyone have any ideas?

                    Stewart Honsberger (AKA Blackdeath)
                   WWW - http://tinys.oix.com/blackdeath
                     E-Mail - blackdeath{at}tinys.oix.com
--- 
* Origin: McBBS - Since 1987 Mtl.Que. V32b V42bis (1:167/119)
SEEN-BY: 396/1 632/0 371 633/210 260 267 270 284 371 635/506 725 728 639/252
SEEN-BY: 670/218
@PATH: 167/119 320 166 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.