TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jay Collins
from: Mike Stella
date: 1995-03-05 18:10:40
subject: The draw

A creature called Jay Collins screamed at All:

 JC>  Anyone know a way to dispay Thedraw ANsi's to the screen
 JC> under Os/2 using the VIO stuff?

#define INCL_NOPM
#define INCL_DOS
#define INCL_DOSFILEMGR
#define INCL_VIO
#include 
#include 

HFILE infile;
void main(int argc, char *argv[])
{
   int i;
   ULONG l;
   char *stuff;
   ULONG openflag,openmode,action;
   FILESTATUS3 infobuf;
   
   if(argc==1)
      DosExit(1,0);
   
   openflag = OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS;
   openmode = OPEN_SHARE_DENYWRITE|OPEN_ACCESS_READONLY|
            OPEN_FLAGS_FAIL_ON_ERROR;

   if(DosOpen(argv[1], &infile,&action,0L,0L,openflag,openmode,NULL))
   {
      printf("Attempted open of %s failed!\nExiting...",argv[1]);
      DosExit(1,1);
   }
   DosQueryFileInfo(infile,1,&infobuf,sizeof(infobuf));
   printf("%lu",infobuf.cbFile);
   stuff=(char *)malloc(infobuf.cbFile*sizeof(char));

   DosRead(infile,stuff,sizeof(stuff),&l);
   VioWrtTTY(stuff,sizeof(stuff),0);
   free(stuff);
}

   Its an odd way to do it, but yes, it does work.  I don't know if this is
what you want though...

   .\\ike Stella

--- ShadowMail/2 1.00
* Origin: Shadowland/2 - USR DS V.34 - 203.456.1103 (1:327/138)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 955
SEEN-BY: 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 327/138 469 451 324/288 3615/50 105/103 42 712/515 711/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™.