[Pharo-users] uFFI ExternalAddress challenges

Tomaž Turk tomaz.turk at ef.uni-lj.si
Tue Sep 10 13:53:29 EDT 2019


Dear all,

I'm struggling with passing an ExternalAddress to a c function call with 
uFFI. Firstly, I get the ExternalAddress from this method:

myFFI>>create: aString
     ^ self
         ffiCall: #(void * CreateObject (String aString) )

[in c:
void* CreateObject(char* szProgId)]

The method that uses the resulting ExternalAddress is defined as:

myFFI>>ask: anExternalAddress
     ^ self
         ffiCall: #(void CallMethod (void * anExternalAddress) )

[in c:
void CallMethod(void* myObj)]

In playground I have

| w |
w := myFFI create: 'Word.Application'.
myFFI ask: w .

w gets a "nice", properly looking external address, however the last 
line crushes Pharo, its window gets closed.

I went through the uFFI book, however I cannot find the answer.

I'm on Windows 10 x64, Pharo 7.0.4 32-bit.

Best wishes,
Tomaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190910/d50e65b2/attachment.html>


More information about the Pharo-users mailing list