Warning MIDL2346 in Visual C++ 6 source: The specified lcid is different from previous specification

StackOverflow https://stackoverflow.com/questions/13326724

Question

I have a strange warning in some code I'm trying to maintain. I'm currently testing it out in its current environment (Visual C++ 6.0, yes, I know, ancient) before moving it up to a more modern VC++ version. I don't understand this warning, and what effect it might be having on the EXE target I'm compiling. During compilation I get this output in the build tab:

Processing C:\OSDK\Libraries\PSDll\OSDKDefs.idl
OSDKDefs.idl
.\Server\Interfaces\InterfaceDef.idl(109) : warning MIDL2346 : the specified lcid is different from previous specification 
Compiling...

The above IDL file is a slightly hacked up version of an IDL file provided by a vendor which no longer provides any support for the above libraries. I believe that this comment in the IDL file was added by a former maintainer of this project, who has hacked this IDL file. My question is, I can make the warning go away by changing the lcid back to the value in the comment, possibly reintroducing some unwanted problem that the original modifier of this idl file wanted to avoid. What is an lcid and what would the difference between the behaviour with lcid(0x409) and lcid(0x09) be? A single bit with value 0x400 hex is being toggled, but what does that bit do?

The line that is causing the warning is marked and commented below, formerly lcid(0x409) changed to lcid(0x09) for "compatibility" with some kind of test tool that this vendor provides for their DCOM/COM code, the tool is mentioned in the comments below.

//
// Component and type library descriptions
//
[
    uuid(bbf92ab1-5031-40c2-864d-1c301f51d0ce),
    //  mvs04042000 - Changed back the lcid from 0x409 to 0x09. Else we have problems
    //  connecting from the PowerTool.
    lcid(0x09),    /// <<----- WARNING HERE
    version(7.16),
    helpfile("OsdkTlb.hlp"),
    helpstring("OPC Server 7.16 Library"),
    helpcontext(0x00000010)
]
library ED3Drv
{
    importlib("stdole32.tlb");

    [
        uuid(b66ac2ca-d99e-4319-8fc0-08c0b65e65df),
        appobject
    ]                          
    coclass ED3Server
    {
        [default]   interface IED3Driver;
                    interface IDriver;
                    interface IDriverMessage;
                    interface IDataScopeConnect;
                    interface IDispatch;
        [source]    interface IDataScopeSink;
    };
};

The IDL above is part of a toolkit that was designed to help people write C++ DCOM clients and servers that match a specification called OPC (OLE for Process Controls).

Was it helpful?

Solution

lcid is LocaleID. 0x409 equals to 1033, which is English (United States). 0x09 is not a valid locale id value.

See http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx for a complete list of valid values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top