IBM Support

OLE Event handler parameters passed by reference as OSUint8

Technote (FAQ)


How are OLE event handler parameters extracted from OSUint8's?


Some event handlers receive parameters that are instances of OSUint8. How can these parameters be manipulated?

OSUint8 instances are used to handle parameters that are passed by reference. The selectors in OSPtr can be used to extract the address or data pointed to by the passed pointer.

For example, to extract the 32-bit integer referenced by an OSUInt8 instance:

osUInt8Value := (theIntParm int32At: 0).

To change the integer stored in an OSUint8 instance:

theIntParm int32At: 0 put: 12.

" To dereference a pointer to a pointer to an automation object, use code like that below "

automationObject :=

OleAutomationObject forDispatch: (OSIDispatch address: (data uint32At: 0)).

Document information

More support for: VisualAge Smalltalk

Software version: all

Operating system(s): Windows

Reference #: 1000965

Modified date: 21 December 2007