TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gary Chambers
from: Gerard Gerritsen
date: 1996-03-07 11:43:06
subject: Visual Pascal COM routin

Hello Gary!

Sunday March 03 1996, Gary Chambers writes to Gerard Gerritsen:

 GC> Because of Pascal's strong type-checking, you won't be able to do this
 GC> (cast Rectl to Pointl) nearly as easily as it is done above.

That's right,

This is the 'converted' code

function GpiMove(PS: Hps; PptlPoint: PPointL): Bool;EXTERNAL;
function GpiBox(PS: Hps; Control: Long; PptlPoint: PPointL;
  HRound,VRound: Long): Long;EXTERNAL;

{ Had to redefine the PtlPoint variable, since the os2pmapi unit uses var
and so it will not accept a pointer } { this must be done in os2pmapi.pas }

Var
Rect:Rectl;
HandlePs:Hps;
Dummy:Ppointl;

begin
 ASM
  mov eax,DWORD PTR RECT
  mov dummy,eax
 end;
GpiMove(Handleps, dummy);
 Rect.Xright:=1;
 Rect.YTop:=2;
 asm
  add dummy,2
 end;
GpiBox(Handleps, Dro_Outline,dummy,0,0);
WinEndPaint(HandlePs);
exit;


 GC>   Obviously, this is only a code segment, but you should get the
 GC> idea.

I agree that C handles this more gracefully,

 GC> ... Topsham, ME 43 57.0'N 69 57.0'W

Ah, now I can test my secondhand ICBM ;^)

==> Gerard/2   - member of team os/2 -  1000521{at}ibk.fnt.hvu.nl

--- Fmail/2 1.02 Registered
* Origin: Yet another forgotten area! (2:283/203.18)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 283/203 2 512 280/801 270/101 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™.