Error On External Call 
Author Message
 Error On External Call

I created Win32Structure subclass: #TIMEZONEINFORMATION and added
class method:

defineFields
        "Define the fields of the Win32 TIME_ZONE_INFORMATION structure"

        self defineField: #bias type: DWORDField new;
                defineField: #standardName type: (StringField length: 32)
beReadOnly;
                defineField: #standardDate type: (StructureField type:
SYSTEMTIME) beReadOnly;
                defineField: #standardBias type: DWORDField new;
                defineField: #daylightName type: (StringField length: 32)
beReadOnly;
                defineField: #daylightDate type: (StructureField type:
SYSTEMTIME) beReadOnly;
                defineField: #daylightBias type: DWORDField new

"typedef struct _TIME_ZONE_INFORMATION
{
    LONG       Bias;
    WCHAR      StandardName[ 32 ];
    SYSTEMTIME StandardDate;
    LONG       StandardBias;
    WCHAR      DaylightName[ 32 ];
    SYSTEMTIME DaylightDate;
    LONG       DaylightBias;

Quote:
} TIME_ZONE_INFORMATION;

"

I suspect I didn't get the fields defined correctly because it blew up
Dolphin when I then evaluated "Locale default timeZoneInformation"
after adding Locale method:

timeZoneInformation
        | timeZoneInfo rc |
        timeZoneInfo := TIMEZONEINFORMATION new.
        rc := KernelLibrary default getTimeZoneInformation: timeZoneInfo.
        rc ifFalse: [KernelLibrary default systemError].
        ^Array with: rc with: timeZoneInfo "leftString: nameSize
asInteger"

and adding KernelLibrary method:

getTimeZoneInformation: lpTimeZoneInformation
        "Set the fields of lpTimeZoneInformation with th current
time-zone parameters.  If successful it answers the which fields apply
or unknown, else an error indicator.
        These parameters control the translations between Coordinated
Universal Time (UTC) and local time.

        DWORD GetTimeZoneInformation(
          LPTIME_ZONE_INFORMATION lpTimeZoneInformation // time zone
        );"

        <stdcall: dword GetTimeZoneInformation TIMEZONEINFORMATION* >
        ^self invalidCall

I checked the TIME_ZONE_INFORMATION strucure size in C++, but I may
have the call parms or return wrong.  Anyone spot anything obvious?

First time I ran it I think it got through the call.  Reloaded and
tried stepping through it, and got program performed illegal etc.  I
saw "Bad Oop" as I scanned the dump.

Thanks Bill and Blair for the "External ..." page on the Dolphin wiki.
That helped get me started after the Dev. Guide.

--
Richard A. Harmon          "The only good zombie is a dead zombie"



Sun, 02 Nov 2003 05:53:50 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Error On External Call

2. Unresolved External Error when trying to use WINAPI call

3. Calling an external prog - timeout and error-handling in Expect

4. NT errors on shutdown when Tcl/Tk script calls an external .exe

5. External link errors when using external Catalyst SocketTools Library Edition 2.15 dll

6. SHGetFolderPath external call

7. External calls and UI responsiveness

8. External Call with variable parameter list

9. Calling an non-DLL external function

10. External calls without DLL/C

11. Calling C++ external functions

12. Calling an external program

 

 
Powered by phpBB® Forum Software