{Three Myths, figure 1.  Copyright © 1992, Jon Shemitz}

library SimplDLL; {Sample export shells for an object oriented DLL}

uses	SimplObj; {Exports objects from the SimplObj unit}

function Simple_Setup( Code: word; VMT: word; var Self): pointer; export;
type	Cast = function (Code: word; VMT: word; var Self): pointer;
const	MethodPtr: pointer = @ Simple.Setup;
begin
  	Simple_Setup := Cast(MethodPtr)(Code, VMT, Self);
end;

exports Simple_Setup index 1;

procedure Simple_Teardown(VMT: word; var Self); export;
type	Cast = procedure (VMT: word; var Self);
const	MethodPtr: pointer = @ Simple.Teardown;
begin
	Cast(MethodPtr)(VMT, Self);
end;

exports Simple_Teardown index 2;

procedure Simple_Method(var Data; var Self); export;
type	Cast = procedure (var Data; var Self);
const	MethodPtr: pointer = @ Simple.DoSomething;
begin
	Cast(MethodPtr)(Data, Self);
end;

exports Simple_Method index 3;

begin
end.

This article originally appeared in PC Techniques

Copyright © 1992, Jon Shemitz - jon@midnightbeach.com - html markup 9-3-94