Reputation: 2660
I'm in trouble with localize my COM classes. I don't known how to localize IErrorInfo
and other text in standard way. I have searched but found nothing. My COM classes is IUnknown
interface, not dual interfaces.
Thanks for advance.
Upvotes: 0
Views: 73
Reputation: 33998
There is no "COM-standard" mechanism to provide a localization locale to a COM object.
COM is arguably too "low-level" for that. Automation conceptually sits a layer above COM and so IDispatch
's Invoke
does provide an LCID argument; but even with [dual]
interfaces, the standard implementation of IDispatch
(CreateStdDispatch
et al) doesn't pass the LCID down to the called method.
(However, will the standard implementation provide the LCID if a method has an [lcid]
-marked parameter? I don't know first hand, but it's implied so here).
You will need to provide your own mechanism. I don't know what would be the most appropriate mechanism for your object. Some ideas:
SetLanguage()
method that sets an object-wide language stored in the instance and which controls the language used by your messages.Upvotes: 1