Programmer Reference : VAST Virtual Machine API : Sample callback for Microsoft Windows
Sample callback for Microsoft Windows
The following example is the C code for the VA Smalltalk window procedure for Microsoft Windows. This example demonstrates how to call back into Smalltalk. Similar code will also work under UNIX platforms.
VA Smalltalk supports external language entry points that can be used instead of hand-written code. See Entry points.
Important points about the C code are:
The call-in is not performed from a user primitive, so the EsDefineUserPrimitiveEnvironment macro must be used before any VA Smalltalk API calls are made.
The calls to EsSaveObject are necessary because the EsU32ToInteger, EsI64ToInteger, EsU64ToInteger and EsUPtrToInteger calls can result in a garbage collection.
The object result from EsSendMessage is a Smalltalk object, so it must be converted back to C format before being returned.
Last modified date: 08/10/2017