DVH> Can anybody help me??
DVH> I am trying to transfer information across my modem to a remote user so
DVH> I can make a door for my BBS. I am using Borland C++ for OS/2 v2.0..
DVH> Thank you in advance..
I use the following program with EMX under OS/2:
//
// quicky to report to the user something...
//
#define INCL_DOS
#define INCL_DOSDEVIOCTL
#include
#include
#include
#define NO_ERROR 0
const int DCD_ON_BIT = (1<<7);
struct EXTENDEDBITRATE
{
ULONG ulBitRate;
BYTE bFraction;
// just to make my life THAT much easier...
EXTENDEDBITRATE() : ulBitRate(0UL), bFraction(0) {}
EXTENDEDBITRATE(ULONG ul, BYTE b = 0) : ulBitRate(ul), bFraction(b) {}
};
struct QUERYEXTENDEDBITRATE
{
EXTENDEDBITRATE ebrCurrent;
EXTENDEDBITRATE ebrMinimum;
EXTENDEDBITRATE ebrMaximum;
};
int main(int argc, char** argv)
{
if (argc < 5)
{
cerr << "Not enough args" << endl;
return 1;
}
// arg 1 is the filehandle.
int fh = strtol(argv[1],NULL,10);
// first see if the user is still there.
BYTE bModemStatus;
APIRET ulrc = DosDevIOCtl(fh,
1, // SIO is always 1
0x67, // query modem status byte
NULL, // no parameters
0, // parameter len
NULL, // pointer to return length
&bModemStatus,
sizeof(bModemStatus),
NULL);
if (ulrc != 0)
{
cerr << "Can't get the stuff from DosDevIOCtl" << endl;
return 2;
}
if (!(bModemStatus & DCD_ON_BIT))
{
cerr << "Hung up." << endl;
return 3;
}
ofstream osCom(fh);
osCom << "\x1b[2J\b\b\b\bTanktalus' Settings Monitor\n" << endl;
osCom << "Getting BBS ready for:" << endl;
osCom << "Node : " << argv[2] << endl;
osCom << "Speed : " << argv[3] << "bps" << endl;
osCom << "Extended Info: " << argv[4] << endl;
osCom << "\n"
"(Note: May include current system-use information in the future)" <<
endl;
osCom << "\n";
osCom << "Tracing call, please wait..." << endl;
osCom << "\"I'm going insane, and I'm taking you with me\"" << endl;
return 0;
}
Note that this program doesn't actually do the call trace... Nor does it do
any input from the user.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|