TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Miha Valencic
from: Peter Fitzsimmons
date: 1995-01-20 03:37:32
subject: Vio. functions

MV> How to use Vio* functions in Rexx or C Set/2? Rexx 
 MV> returns error, if I pull it from DLL and .c also 
 MV> returns error while linking .obj (func do not exist).

Rexx can't call vio functions directly.

Cset++ (are you really using the old c set/2?) should be able to call Vio
functions without any problem.  If you are having a linking problem,it is
probably because have not prototyped them correctly (are you compiling with
warnings enabled?  You shoud always compile with AT LEAST "icc
/Kb").

Here's a program that works:


 // compiled with ibm cset++ v2:
 // icc /W2 /Wall /O /Oi /Rn /Sse /G4  vio.c
 #define INCL_NOPMAPI
 #define INCL_VIO
 #include 
 #include 
 #include 

 int main(void)
 {
     int i;
     char msg[40];
     BYTE attr;

     VioScrollUp(0, 0, 0xffff, 0xffff, 0xffff, " \x7", 0);  // cls

     attr = 15;  // start off with bold on black background.
     for(i=0; i<22; i++){
         sprintf(msg, "Line %2d: Programming is fun!", i);
         VioWrtCharStrAtt(msg, strlen(msg), i, i, &attr, 0);

         attr += 16;     // change background colour.  Note: attributes
                         // are just like they are under dos when poking
                         // into video memory.
     }


     VioSetCurPos(23, 0, 0);      // so cursor is at bottom when program ends
     return 0;
 }


--- Maximus/2 2.02p1
* Origin: Sol 3/Toronto (905)858-8488 (1:259/414)
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: 259/414 400 99 250/99 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™.