"Martin Rubi" <
[hidden email]> wrote in message
news:
[hidden email]...
> Hello.
> I have an ExternalStructure containing a function pointer:
>
> MyStruct class>>defineFields
>
> self
> defineField: #field1 type: (PointerField type: String);
> defineField: #field2 type: LPVOIDField new
>
> now I want to fill the second field with an ExternalCallback, how should I
> do it ?
>
> Thanks in advance
>
>
Add an instance variable to the structure - the iv is necessary to prevent
the callback object from being garbage collected while it is still
referenced from the structure. Then define an accessor such as:
callback: anExternalCallback
callback := anExternalCallback.
self field2: anExternalCallback asParameter yourAddress
Regards
Blair