Article View: comp.lang.modula2
Article #915Re: Windows and JPI V2.0
From: Troy Zerr
Date: Wed, 11 Jul 1990 04:59
Date: Wed, 11 Jul 1990 04:59
105 lines
4459 bytes
4459 bytes
I downloaded this from the JPI/JPAM board in California. Hope it helps
Microsoft Windows Programming Support
Dear TopSpeed Modula-2 customer,
The Microsoft Windows support currently supplied in the TopSpeed Modula-2
Extended Edition package currently supports Microsoft Windows 2.x. Windows
3.0 Support is under development and should be available in a future revision
of the compiler.
The current package requires the use of some tools and libraries from the
Microsoft Windows Software Development Kit (SDK) when developing programs for
Microsoft Windows. These components are:
IMPLIB.EXE - Generates Import Libraries for the main program.
WIN87EM.LIB - Windows 80x87 and Emulator support import library.
RC.EXE - Resource Compiler.
DIALOG.EXE - Dialog Box Editor.
ICONEDIT.EXE - Icon Editor.
There are a few errors in the files supplied on the Extended Edition Disk. In
order to program for windows the following changes must be made.
To eliminate a problem with the windows core library for Modula-2. First copy
the file R_SYSTEM.A to W_SYSTEM.A. Then comment out the section of code near
line 16 to look like:
$init:
(* Removed for Windows compatibility
extrn __getheapbase
extrn SYSTEM@HeapBase
(*%T sameCS*)
call __getheapbase
(*%E*)
(*%F sameCS*)
call far __getheapbase
(*%E*)
mov ax, _DATA
mov es, ax
mov es:[SYSTEM@HeapBase], dx
(*%F sameDS *)
extrn SYSTEM$initprocess
call far SYSTEM$initprocess
(*%E *)
END of removed code *)
Once this is accomplished the project files must be updated and the libraries
remade.
1) To update the project files change the references to r_system in
RS_WM2A and RM_WM2A to w_system.
2) To remake the libraries, from the DOS command line type:
> TSC /M RS_WM2A RM_WM2A RS_MWLIB RM_MWLIB
The file WINDOWS.DEF has some omissions and inconsistencies that should be
changed so that your programs act in a manner consistent with other Windows
programs. Two identifiers were omitted from the list of window style con-
stants (WS_), near line 545. They are:
WS_MINIMIZEBOX = 00020000H;
WS_MAXIMIZEBOX = 00010000H;
and the reference to WS_TILEDWINDOW on line 560 needs to be changed from
00CC0000H to 00CF0000H. The section around line 790 defining the procedures
RGB, GetRValue, GetGValue, and GetBValue should be changed to:
(* GDI rgb values packed into a dword *)
TYPE H4 = ARRAY[0..3] OF BYTE;
H2 = ARRAY[0..1] OF BYTE;
(*# save, call(reg_param => (ax,bx,dx), reg_saved => (cx,si,di,ds,es,st0,st1,
st2,st3,st4,st5,st6), inline => on)*)
INLINE PROCEDURE RGB(r,g,b:SHORTCARD):DWORD = H4(088H,0DCH,030H,0F6H);
(*# call(reg_saved=>(bx,cx,dx,si,di,ds,es,st0,st1,st2,st3,st4,st5,st6))*)
INLINE PROCEDURE GetRValue(d:DWORD):SHORTCARD = H4(088H,0D8H,030H,0E4H);
INLINE PROCEDURE GetGValue(d:DWORD):SHORTCARD = H4(088H,0F8H,030H,0E4H);
INLINE PROCEDURE GetBValue(d:DWORD):SHORTCARD = H2(030H,0E4H);
(*# restore *)
In the demonstration program MWDEMO there are a few errors that should be
corrected. On line 102 of the file WMAIN.MOD the line should be changed to:
MessageLength:=Windows.LoadString(hInstance,IDSTITLE,
Windows.LPSTR(FarADR(szMessage)), 25);
In the file MWDEMO.RC the reference to "mwdemo.ico" on line 24 should be
changed to DEMOICON.
We are always striving to improve our product and provide you with the best
development tools available. If you have any information about inconsisten-
cies or problems that you feel should be addressed in the documentation or
this errata sheet please contact JPI Technical Support at (415) 967-3200.
Thank you for your Interest in our TopSpeed Compilers.
- Troy Zerr
zerr@math.wisc.edu
Technical Details
Message-ID:
<4975@daffy.cs.wisc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!rutgers!uwvax!daffy!cat22.cs.wisc.edu!zerrReferences:
<1317.26985A4E@puddle.fidonet.org>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!rutgers!uwvax!daffy!cat22.cs.wisc.edu!zerr From: zerr@cat22.cs.wisc.edu (Troy Zerr) Newsgroups: comp.lang.modula2 Subject: Re: Windows and JPI V2.0 Summary: Here's what JPI says Message-ID: <4975@daffy.cs.wisc.edu> Date: 11 Jul 90 04:59:12 GMT References: <1317.26985A4E@puddle.fidonet.org> Sender: news@daffy.cs.wisc.edu Organization: U of Wisconsin Math Dept Lines: 105