• exit on api call

    From T@21:1/5 to All on Tue Nov 29 02:16:43 2022
    Hi All,

    When I make an API all and my program just exists
    without an error or any complaint, is there some
    log somewhere that will tell me what went wrong?

    Many thanks,
    -T

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Wed Nov 30 06:54:33 2022
    On Tue, 29 Nov 2022 02:16:43 -0800, T wrote:
    Hi All,

    When I make an API all and my program just exists
    without an error or any complaint, is there some
    log somewhere that will tell me what went wrong?

    Many thanks,
    -T

    Did you check `GetLastError()`?

    Also, some APIs have their own error handling and reporting outside of the standard Win32 API. So check the API documentation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to All on Tue Nov 29 18:23:18 2022
    On 11/29/22 15:54, JJ wrote:
    On Tue, 29 Nov 2022 02:16:43 -0800, T wrote:
    Hi All,

    When I make an API all and my program just exists
    without an error or any complaint, is there some
    log somewhere that will tell me what went wrong?

    Many thanks,
    -T

    Did you check `GetLastError()`?

    Also, some APIs have their own error handling and reporting outside of the standard Win32 API. So check the API documentation.


    I traced it down to Raku's NativeCall. It
    happens when you forget to declare a variable
    that is [out] and/or [in/out] as "is rw".

    Or use a variable the is a mystery to
    NativeCall.

    I have written a pm6 for error reporting from
    the API calls. There is nothing there.

    Makes it pretty difficult to troubleshoot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Wed Nov 30 12:43:43 2022
    On Tue, 29 Nov 2022 18:23:18 -0800, T wrote:

    I traced it down to Raku's NativeCall. It
    happens when you forget to declare a variable
    that is [out] and/or [in/out] as "is rw".

    Or use a variable the is a mystery to
    NativeCall.

    I have written a pm6 for error reporting from
    the API calls. There is nothing there.

    Makes it pretty difficult to troubleshoot.

    Doesn't Raku have its own reporting to tell whether the result of that "NativeCall" itself has succeeded or not? Such as failure due to mismatched number of arguments supplied to the API; or if the API is called by DLL/function name, an error for DLL file is not found or function name is
    not found.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to All on Tue Nov 29 23:47:20 2022
    On 11/29/22 21:43, JJ wrote:
    On Tue, 29 Nov 2022 18:23:18 -0800, T wrote:

    I traced it down to Raku's NativeCall. It
    happens when you forget to declare a variable
    that is [out] and/or [in/out] as "is rw".

    Or use a variable the is a mystery to
    NativeCall.

    I have written a pm6 for error reporting from
    the API calls. There is nothing there.

    Makes it pretty difficult to troubleshoot.

    Doesn't Raku have its own reporting to tell whether the result of that "NativeCall" itself has succeeded or not? Such as failure due to mismatched number of arguments supplied to the API; or if the API is called by DLL/function name, an error for DLL file is not found or function name is
    not found.


    I does, but it is also not very mature. Consider
    it alpha code. It misses things still.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Thu Dec 1 04:58:19 2022
    On Tue, 29 Nov 2022 23:47:20 -0800, T wrote:

    I does, but it is also not very mature. Consider
    it alpha code. It misses things still.

    If that's the case, then I don't see any other way than to manually check
    the result of the API. e.g. if it creates a window handle, then check
    whether the returned window handle value is valid or not. Initialize the
    Raku variable which receive the window handle with zero before the API call.

    Considering the immature implementation of API call support, calling `GetLastError()` API may not be reliable since Raku may not preserve the system's last error code after an API has been called. The "NativeCall" post housekeeping code may actually overwrite the system's last error code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)