[Vm-beginners] Re: Interfacing with a C dll on Windows

David T. Lewis lewis at mail.msen.com
Sun Oct 28 11:15:30 UTC 2012


On Sat, Oct 27, 2012 at 09:51:52PM -0700, Sean P. DeNigris wrote:
> David T. Lewis wrote
> > Are you referring to some actual commercial... proprietary application
> > that you want to have interacting with your image?
> 
> Yes
> 
> 
> David T. Lewis wrote
> > Is the SDK something that exists and that you are trying to use
> 
> Yes. Specifically it's the SDK for the TradeStation trading platform
> (https://developer.tradestation.com/documents/EasyLanguage_Extension_SDK.pdf)
> 
> I was hoping for a way to use my custom dll as a magical link between the
> running platform and my image, without having to resort to IPC...

Is this the scenario?

 - You want to write your own application in Squeak/Pharo
 - Your application will make API calls to TradeStation EasyLanguage
   procedures in order to obtain information or perform functions
 - TradeStation will provide event notification, and your DLL will
   accept these events and turn them into something that your application
   understands (e.g. signal a semaphore for a waiting process in Squeak).

If this is more or less the architecture you have in mind, then I'd
say that it could in principle be done with a plugin or maybe FFI,
but this would be a complex thing to implement and I am quite sure
that you would not want to undertake it without a good working
knowledge of C and Windows programming.

In addition, I would guess that TradeStation is a runtime environment
unto itself, and that if you link a Squeak VM directly to that environment
you are likely to run into conflicts between them. I can't say specifically
what the problems would be, but basically you would be trying to take
two software enviroments that both expect to "own" the environments
that they live in, and conflicts (usually undocumented) are likely
to arise.

Having said that, it looks to me like getting the two environments
(Squeak and TradeStation) to communicate bidirectionally would be a
natural fit for a higher level IPC scheme such as SOAP or a custom
socket based protocol. This kind of architecture is likely to be more
robust in terms of maintainability and ease of debugging, and it will
provide some degree of future-proofing for your application as changes
occur in Squeak VM, TradeStation, and Windows.

I see references to COM in the document link you gave, so I suspect
that some kind of interface like this may be available. So my advice
is to find some higher level IPC, SOAP, XML or whatever that may be
supported by TradeStation, and then look for a way to talk to that
from Squeak/Pharo.

Dave



More information about the VM-beginners mailing list