home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 March
/
Chip_1999-03_cd.bin
/
zkuste
/
delphi
/
INFO
/
DI9802TS.ZIP
/
MyObj.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-07-23
|
727b
|
32 lines
{ This is the implementation of a custom COM Automation Object that we
will be exposing to the scripting engine }
unit MyObj;
interface
uses
ComObj, Demo_TLB, Dialogs, SysUtils;
type
TMyObj = class(TAutoObject, IMyObj)
protected
procedure ShowCelcius(DegreesF: Integer); safecall;
end;
implementation
uses ComServ;
procedure TMyObj.ShowCelcius(DegreesF: Integer);
var
DegreesC : Integer;
begin
DegreesC := (DegreesF - 32) * 5 div 9;
MessageDLG( Format( '%d degrees Fahrenheit is equal to %d degrees Celcius.',
[DegreesF, DegreesC]) , mtInformation, [mbOK], 0 );
end;
Initialization
TAutoObjectFactory.Create(ComServer, TMyObj, Class_MyObj, ciMultiInstance);
end.