"John Small" <
[hidden email]> wrote in message
news:
[hidden email]...
> Hi,
>
> I'm trying to add a loose method to the kernal library for [CreatePipe]
!KernelLibrary methodsFor!
createPipe: hReadPipe hWritePipe: hWritePipe lpPipeAttributes:
lpPipeAttributes nSize: nSize
<stdcall: bool CreatePipe handle* handle* lpvoid dword>
^self invalidCall
"
hRead := ExternalHandle new.
hWrite := ExternalHandle new.
KernelLibrary default
createPipe: hRead
hWritePipe: hWrite
lpPipeAttributes: nil
nSize: 0
"! !
!KernelLibrary categoriesFor:
#createPipe:hWritePipe:lpPipeAttributes:nSize:!public!win32 functions-pipe!
!
>
> But I'm confused about what to do about PHANDLE.
>
> The createPipe function needs to write handles into the hReadPipe and
> hWritePipe
> address locations.
>
> How can this be done?
The VM will automatically coerce the object passed depending on the argument
type, in the case of pointer arguments this usually means passing the
address of the bytes of the object (assuming it is a byte object). For
further information see:
http://www.object-arts.com/Lib/EducationCentre4/htm/externalinterfacing.htmand specifically:
http://www.object-arts.com/Lib/EducationCentre4/htm/parametertypes.validationandconversion.htm
Regards
Blair