<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<blockquote type="cite"
cite="mid:CAFMUeB_fWNJnbXNAxaJ=v7cbA15tkGtsJskfb2fOQqFh7Qfn-g@mail.gmail.com">
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I am expected to create and pass an instance of such class
<br>
ApiProxyWrapperReply in my calling program<br>
via a function<br>
void
SPAPI_RegisterApiProxyWrapperReply(ApiProxyWrapperReply* <br>
apiProxyWrapperReply);<br>
<br>
and the external library will then call the various
methods of <br>
ApiProxyWrapperReply as 'call-back' functions when
needed.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Considering that the class only has abstract
virtual methods and the destructor is non-virtual you *might*
be able to do this by declaring a raw interface ({$Interfaces
Corba}) and declaring all the virtual methods in the same
order (very important!) with suitable signatures and calling
convention (for i386 you should pick cppdecl otherwise the
system default should be alright), implementing that interface
in some Object Pascal class and then passing an instance of
that interface to the library.</div>
<div dir="auto"><br>
</div>
<div dir="auto">It could still go wrong due to some differences
in the ABI, but it might just as well work. 🤷♀️</div>
<div dir="auto"><br>
</div>
</div>
</blockquote>
<p>In C++, I was expected to pass the class instance to the external
library. So, In Pascal, do I pass the interface variable to the
external library?</p>
<p>Thanks a lot.</p>
<p>Dennis Poon<br>
</p>
</body>
</html>