TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Craig Reynolds
from: Greg Newton
date: 1995-10-15 22:43:30
subject: Making a PM Window

G'day Craig,

Replying to a message of Craig Reynolds to All:

 CR> Hello All!

 CR> I am unsuccessfully trying to make a simple 'Hello World' style window
 CR> in PM using emx.  So far, all my efforts have been for nought, as I
 CR> cant get emx to compile it.


 CR> #include 

The 'window manager' functions you're trying to use are for text mode
windows, not PM.

 CR> main()
 CR> {
 CR>     int x0,y0,x1,y1,border,battr,wattr;
 CR>     char *wh;

wh needs to be a "wm_handle", not a "char*"

 CR>     x0 = 100;
 CR>     x1 = 500;
 CR>     y0 = 50;
 CR>     y1 = 300;

x0,x1,y0,y1 are going to have to be a lot smaller than that to fit on an 80
x 50 (or whatever) text mode screen.

 CR>     border = 1;
 CR>     battr = 1;
 CR>     wattr = 1;

 CR>     wm_init(1);

 CR>     wh = wm_create (x0, y0, x1,  y1,  border,  battr, wattr);

 CR>     wm_open(wh);

 CR> }

It may be worth your while doing a getchar();wm_close(wh);wm_exit(); as well.

 CR> Well thats the code, the exact errors  emx spits out are:

 CR> hellopm.c: In function `main':
 CR> hellopm.c:19: warning: assignment from incompatible pointer type
 CR> hellopm.c:21: warning: passing arg 1 of `wm_open' from incompatible
 CR> pointer type .\ccc00110: Undefined symbol _wm_init referenced from
 CR> text segment .\ccc00110: Undefined symbol _wm_create referenced from
 CR> text segment .\ccc00110: Undefined symbol _wm_open referenced from
 CR> text segment

The undefined symbols come from not specifying the 'video' library on the
compile line.

"gcc hellopm.c -lvideo"

 CR> To me, a novice at C programming, this dosent mean very much.
 CR> It took me ten minutes to get a HW window in Windows, so far around 3
 CR> hrs in Warp.

Was that ten minutes with a free compiler?

Take the time to look in \emx\samples for (surprise) wm_hello.c and the
files to make pm1.exe

Cheers,
Greg |;^)

--- FleetStreet 1.04 #429
* Origin: Permaculture 1 BBS * Northcote_Aust * +61-3-9482-2942 (3:639/666)
SEEN-BY: 620/243 632/103 341 348 998 633/371 634/384 635/301 502 503 638/102
SEEN-BY: 639/100 666 640/820 690/660 711/409 410 413 430 807 808 809 934 949
SEEN-BY: 711/955 712/515 713/888 800/1 7877/2809
@PATH: 639/666 100 635/503 632/348 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™.