[comp.lang.modula2] Windows and JPI V2.0

Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org (Ernie Bokkelkamp) (07/08/90)

Has anybody tried to use JPI 2.0 (R1.04b) to write MS-Windows applications ?

I compiled the exampled MWDEMO and it compiles/links/executes with no problems under Windows 2.03 and Windows 3.0.

Then I made a very small change, in WMAIN I added the line "IMPORT Str". Now I get unresolved errors in the link for SYSTEM@HeapBase and __GetHeapBase. Somehow it seems that I can not use any of the JPI libraries when developing for windows and I can't find any help in the manuals. 

Any ideas ?

Thanks
Ernie



--  
uucp: uunet!m2xenix!puddle!5!491!1.22!Ernie.Bokkelkamp
Internet: Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org

zerr@cat22.cs.wisc.edu (Troy Zerr) (07/11/90)

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

Pat.Terry@p101.f4.n494.z5.fidonet.org (Pat Terry) (07/13/90)

zerr@cat22.cs.wisc.edu (Troy Zerr) writes in 
  Message-ID:<4975@daffy.cs.wisc.edu>

 > Newsgroups: comp.lang.modula2
 > 
 > I downloaded this from the JPI/JPAM board in California.  Hope it helps
 >                   Microsoft Windows Programming Support
...

etc


Thanks very much.  Provided it is kosher to do so, some of us far from JPAM
BBS would appreciate any more of the same sort of stuff you can copy across
   




--  
uucp: uunet!m2xenix!puddle!5!494!4.101!Pat.Terry
Internet: Pat.Terry@p101.f4.n494.z5.fidonet.org

Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org (Ernie Bokkelkamp) (07/14/90)

On 12 Jul 1990 05:29, Troy Zerr (1:105/42) wrote:

 TZ>I downloaded this from the JPI/JPAM board in California.  Hope 
 TZ>it helps
 TZ>
 TZ>                  Microsoft Windows Programming Support

Thanks Troy, you have just rescued my sanity. Last night (this morning) 02.00AM I gave up trying to find/fix the problem. Hopefully I can now get the Welcome4 example (Programming Windows by Charles Petzold) running.

BTW: Altough Windows 3.0 is not supported, the program will run under 3.0 when Windows is loaded in REAL mode (win /r)

Regards
Ernie



--  
uucp: uunet!m2xenix!puddle!5!491!1.22!Ernie.Bokkelkamp
Internet: Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org

aubrey@rpp386.cactus.org (Aubrey McIntosh) (07/19/90)

In article <1773.26A3274D@puddle.fidonet.org> Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org (Ernie Bokkelkamp) writes:
>BTW: Altough Windows 3.0 is not supported, the program will run under 3.0 when Windows is loaded in REAL mode (win /r)

Oh?  If I spend $50 for my upgrade on 3.0, can I run it on my XT (in real mode)


-- 
Aubrey McIntosh  	"Find hungry samurai." -- The Old Man        
1502 Devon Circle       comp.os.minix, comp.lang.modula2         
Austin, TX 78723 
1-(512)-452-1540  (v)

Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org (Ernie Bokkelkamp) (07/24/90)

On 21 Jul 1990 01:12, Aubrey McIntosh (1:105/42) wrote:

 AM>In article <1773.26A3274D@puddle.fidonet.org> 
 AM>Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org (Ernie Bokkelkamp) 
 AM>writes:
 AM>>BTW: Altough Windows 3.0 is not supported, the program will run 
 AM>under 3.0 when Windows is loaded in REAL mode (win /r)
 AM>
 AM>Oh?  If I spend $50 for my upgrade on 3.0, can I run it on my XT 
 AM>(in real mode)

I don't know. If have just upgraded my AT to 386SX and my XT to a diskless machine for my daughter. Unfortunately I can't try it out for you, but looking at the performance of Windows 3.0 on my office AT (12 Mhz, 1Mb) I would expect that an XT will turn it self over with all (rubber) feet pointing upwards towards the blue sky ;-). The performance is so bad that I have given up trying to run windows on this machine, another 1Mb brings a lot of extra performance but I needed the memory for my SX.

Cheers
Ernie


--  
uucp: uunet!m2xenix!puddle!5!491!1.22!Ernie.Bokkelkamp
Internet: Ernie.Bokkelkamp@p22.f1.n491.z5.fidonet.org