Skip to content

LCID for ProxyObject is hardcoded and inconsistent #659

Closed
@matthiasblaesing

Description

@matthiasblaesing

@dhakehurst while working with excel I noted, that I'd need to change th used LCID for the COM invocations. Excel formulas are interpreted locale dependent and here unifying to the english locale helps development. I already overrid the LCID manually and got the expected locale (I'm on german locale, and could now send english formulas).

While looking through the ProxyObject code, I noticed, that you decided to use different default LCIDs:

GetIDsOfNames is using LOCALE_USER_DEFAULT
Invoke is called with LOCALE_SYSTEM_DEFAULT

From my perspective this looks inconsistent. Is there a reason for this?

I'd like to make the locale configurable, my idea:

  • add a "getLCID" method to the factory (by default reporting what is today reported as LOCALE_USER_DEFAULT)
  • add a "setLCID" method to the factory to be able to override the method
  • make ProxyObject use getLCID to determine the LCID to use

The big question: would this be enough and workable or are more complex methods needed? Instead of a fixed LCID I could imaging an LCIDMapper, that takes a target object and java.lang.reflect.Method and returns the LCID to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions