FFI Win32 api calls with LPTSTR args?

Bert Freudenberg bert at impara.de
Wed Jan 26 23:35:27 UTC 2005


Am 26.01.2005 um 22:29 schrieb Cees de Groot:

> On Tue, 25 Jan 2005 18:39:08 -0800, Ned Konz <ned at squeakland.org> 
> wrote:
>
>> GetTempPathA(DWORD nBufferLength, LPCTSTR lpBuffer );
>>
> Which would mean
>
> apiGetTempPathBufferSize: aNumber inTo: aString
> 	<apicall: long 'GetTempPathA' (long char *) module: 'kernel32.dll'>
> 	^self externalCallFailed
>
> Should be sort of ok, not?

Hmm, I'm not sure if you can use a String as buffer here - if I am not 
mistaken you can only pass in ByteArrays and ExternalAddresses where a 
pointer is required.

> I get the error message 'Only ExternalFunctions can be called' when I 
> try this - does this means that my arguments are messed up or that 
> this <apicall: > thingie is not correct?

Not sure about that ...

- Bert -




More information about the Squeak-dev mailing list