Win32Shell

Andreas Raab andreas.raab at gmx.de
Fri Aug 22 20:51:15 UTC 2003


Hi,

> The implementation of externalCallFailed will
> query for the last error message.
> 
> Typically a windows API call returns a result (failed, success
> or error code). If it fails you can use GetLastError()
> to retrieve error information. 

Just to point this out as it may cause some confusion otherwise: There are
really "two kinds" of errors we are talking about. One is an error that
happens within the FFI (such as when a type coercion fails) and this kind of
error will reported by #externalCallFailed. If the function (API) call
itself fails #externalCallFailed will not report an error (as for the FFI
the call went out successful). Those errors (typically indicated by return
codes or similar) have to be handled according to what the documentation for
the API says (in this case calling GetLastError() would be the right thing
to do).

> Note that ShellOpen is not the best way to call an external
> executable - it's used for open documents.
> To start an executable the CreateProcess() API is better suited.

Yes, even though I think that in this case shellOpen: was called with the
executable name (and not some document) which should work just fine, e.g.,
something like "Win32Shell new shellOpen:'notepad.exe'".

Cheers,
  - Andreas



More information about the Squeak-dev mailing list