Everyone who has worked with ObjectStudio over the last years, knows how difficult it is to connect to an external DLL. Especially function calls using structs or pointer to structs are very complicated and difficult to handle.
Sometimes you had to know more about C and memory alignment, than Smalltalk to get it to work.

In ObjectStudio8 we now have access to DLLCC. This makes it much easier to deal with external function calls.
Something like

Array new: 2)
 at: 1 put: (VString passedBy: #reference fixedSize: self userNameLength);
 at: 2 put: (VDWord passedBy: #reference).
 self newProcedureNamed: (self funcNameFor: #GetUserName)
 paramVars: params callingConvention: #C returns: (VDWord new).

can be converted into something like

<C: BOOL GetUserNameA (LPTSTR lpBuffer, LPDWORD lpnSize)>

which is basically a copy of the definition on MSDN or a header file. Of course the data types have to be declared first, but that works pretty much the same way too.

DLLCC even enables us to use blocks as callbacks to C function calls, so that we can call functions like EnumWindows() without writing a single line of C.

Now we’re in the middle of improving the performance and capabilities of DLLCC together with the VM team. If we get the performance we desire, you’ll see more and more primitives rewritten in Smalltalk.
And that’s what we want, isn’t it?

Andreas
———————————————
Quis Custodiet Ipsos Custodes?