LOCALE bug in AXDispatchImpAbstract>>Invoke:riid:lcid:wFlags:pdispparams:pvarResult:pexcepinfo:puArgErr:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LOCALE bug in AXDispatchImpAbstract>>Invoke:riid:lcid:wFlags:pdispparams:pvarResult:pexcepinfo:puArgErr:

Antony Blakey-4
In the process of a building a generic mechanism for automatically
exposing ST classes as IDispatch interfaces (i.e. pure dispinterface) I
have had cause to subclass AXDispatchImpAbstract. I think I've found a
bug in

AXDispatchImpAbstract>>Invoke:riid:lcid:wFlags:pdispparams:pvarResult:pexcepinfo:puArgErr:

It fails on my system (English - Australian) because of the following
code at the head of the method:

| hr errDesc selector |
   (lcid == 0 or: [lcid = LOCALE_USER_DEFAULT  or: [lcid =
LOCALE_SYSTEM_DEFAULT]])
     ifFalse: [^E_INVALIDARG].

the lcid that's coming through matches none of the three cases, but it
does match the value of:

   KernelLibrary default getSystemDefaultLCID

which is English - United States

Invoke is being sent by IScriptControl (I'm testing by scripting Dolphin
from JScript).

So, I think the above test needs to be extended to match

   0
   LOCALE_USER_DEFAULT
   LOCALE_SYSTEM_DEFAULT
   KernelLibrary default getSystemDefaultLCID
   KernelLibrary default getUserDefaultLCID

Theoretically you can't cache the last two because the use can change
locale at any time (maybe that only applies to the UserDefaultLCID).

This may be a bug in the Script Engine, or it may be that I'm not doing
something properly in my code, but I can't see anything.

-------------------------
Antony Blakey
mailto:[hidden email]
Linkuistics Pty Ltd
Adelaide, South Australia


Reply | Threaded
Open this post in threaded view
|

Re: LOCALE bug in AXDispatchImpAbstract>>Invoke:riid:lcid:wFlags:pdispparams:pvarResult:pexcepinfo:puArgErr:

Blair McGlashan
"Antony Blakey" <[hidden email]> wrote in message
news:[hidden email]...
> In the process of a building a generic mechanism for automatically
> exposing ST classes as IDispatch interfaces (i.e. pure dispinterface) I
> have had cause to subclass AXDispatchImpAbstract. I think I've found a
> bug in
>
>
AXDispatchImpAbstract>>Invoke:riid:lcid:wFlags:pdispparams:pvarResult:pexcep
info:puArgErr:
>....

Thanks Anthony, #850. The most sensible thing to do seems to be to remove
the test altogether - it is (according to MSDN) acceptable to ignore the
LCID argument if multiple languages are not supported.

Regards

Blair