Programmer's Reference
The following example is the C code for the IBM Smalltalk window procedure
for OS/2 and Microsoft Windows. This example demonstrates how to call
back into Smalltalk. Similar code will also work under UNIX
platforms.
Note: | IBM 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 IBM
Smalltalk API calls are made.
- The calls to EsSaveObject are necessary because the
EsU32ToInteger call 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.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]