| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Get The Message ? |
MK>
> sprintf(runme,"CMD.EXE /C HELP.CMD SYS%04u",rc);
MK>
You know, you could probably code a proper call to DosGetMessage in
almost the same amount of code. It wouldn't have all of the hidden
pitfalls of your current method (such as relying on PATH to be set up
correctly), and it wouldn't be so s-l-o-w.
MK>
> runme[strlen(runme) + 1] = 0;
MK>
I think that you need to take a second look at this line. (-:
Here, have an implementation that doesn't need two extra processes
just to print text from a help file and that is only three lines
longer than yours :
void
ShowHelp (APIRET rc)
{
static const char FileName[] = "OSO001H.MSG" ;
ULONG MsgLength = 0 ;
char *IvTable[] = { 0 } ;
char buf[DECIDE_YOUR_MAXIMUM_BUFFER_SIZE] ;
if (0 == DosGetMessage(IvTable, 0, buf, sizeof(buf), rc,
(char *)FileName, &MsgLength)) {
cout.write(buf, MsgLength) ;
} else
cout << "No help is available for error SYS"
<< rc << endl ;
}
> JdeBP <
___
X MegaMail 2.10 #0:
--- Maximus/2 2.02
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)SEEN-BY: 12/2442 620/243 624/50 632/348 640/820 690/660 711/409 410 413 430 SEEN-BY: 711/807 808 809 934 942 949 712/353 515 713/888 800/1 7877/2809 @PATH: 440/4 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 808 809 934 |
|
| 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™.