[Pharo-users] uFFI ExternalAddress challenges

Tomaž Turk tomaz.turk at ef.uni-lj.si
Fri Sep 13 09:22:26 EDT 2019


OK, I'm proceeding with the library that I mentioned 
(http://disphelper.sourceforge.net/) and I got nice results. Pablo's 
package goes directly into the core of OLE/COM automation and it would 
be too hard to for me to study it and continue with it at this stage.

An example below loads Word for Windows, makes it visible, creates a new 
document and writes some text:

| w |
COMEngineAlpha initializeCOM .
w := COMEngineAlpha createObjectByName: 'Word.Application'.
COMEngineAlpha callObject: w setProperty: '.Visible = %b' withInteger: 
1.
COMEngineAlpha callObject: w method: '.Documents.Add'.
COMEngineAlpha callObject: w method: '.Selection.TypeText(%S)' 
withString: 'This is a message to appear in Word document.'.
COMEngineAlpha safeReleaseObject: w.
COMEngineAlpha uninitializeCOM.

However, I'd like to marshall a WideString through uFFI so that I won't 
loose UTF-8 support, of course the plain (String aString) signature 
doesn't work ("Cannot coerce arguments"). Is there anything I can do 
myself (i.e. without poking into Pharo virtual machine complexity) to 
solve this challenge?

Best wishes,
Tomaz

------ Original Message ------
From: "Torsten Bergmann" <astares at gmx.de>
To: tomaz.turk at ef.uni-lj.si; pharo-users at lists.pharo.org
Cc: "Any question about pharo is welcome" <pharo-users at lists.pharo.org>
Sent: 12. 09. 2019 12:07:34
Subject: Aw: Re: [Pharo-users] uFFI ExternalAddress challenges

>From your snippets it looks like you want to do COM Automation on 
>Windows.
>
>Maybe you should have a look at: https://github.com/tesonep/pharo-com
>
>Bye
>T.
>
>Gesendet: Donnerstag, 12. September 2019 um 11:08 Uhr
>Von: "Tomaž Turk" <tomaz.turk at ef.uni-lj.si>
>An: "Any question about pharo is welcome" <pharo-users at lists.pharo.org>
>Betreff: Re: [Pharo-users] uFFI ExternalAddress challenges
> > We are interested in it
>:)
> > If I recall well Pablo got one version somewhere.
>
>Me too
>:-)
>  Unfortunately, I only have time for 'weekend' projects, and any help 
>is appreciated
>:-)
>
>Regarding the uFFI calls, is it possible to pass Win32WideString in a 
>similar fashion as a String - or where to look to implement that?
>
>Best wishes,
>Tomaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190913/27b0df39/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emoticon_smiley
Type: image/png
Size: 786 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190913/27b0df39/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emoticon_smiley
Type: image/png
Size: 786 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190913/27b0df39/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: emoticon_smiley
Type: image/png
Size: 786 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20190913/27b0df39/attachment-0002.png>


More information about the Pharo-users mailing list