[Pharo-users] uFFI ExternalAddress challenges

Tomaž Turk tomaz.turk at ef.uni-lj.si
Tue Sep 17 09:54:08 EDT 2019


 > I don’t know if there is support for that (I don’t have the time to 
check it in detail now).
 > But, as a workaround, you may try
  > - return a void*
  >  myFunction
  >    ^self ffiCall: #(void* myFunction ( void ) )
 >   - and then do the transformation yourself using 

I checked, Win32WideString class>>#asExternalTypeOn: is defined, and it 
creates FFIExternalObjectType(Win32WideString) nicely with

^self ffiCall: #(Win32WideString myFunction ( void ) )

I also tried the other approach:

^self ffiCall: #(void* myFunction ( void ) )

and the transformation Win32WideString>>#fromHandle

Interestingly, in both cases I get

however I cannot pinpoint the reason for this.

 > What you are discovering here would be very useful as a 
section/chapter in
 > the uFFI booklet.

Thanks for the invitation, yes, it would be nice to participate, I'll 
try to prepare something when I get to the bottom of the challenge :-)

Thanks and best wishes,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190917/92e3cdfb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vwdbg421.png
Type: image/png
Size: 44505 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190917/92e3cdfb/attachment-0001.png>

More information about the Pharo-users mailing list