代码改变世界

codepage IMLangCodePages

2013-12-02 14:47 by Clingingboy, ... 阅读, ... 评论, 收藏, 编辑

 

http://baike.baidu.com/link?url=78DSTGAri8dvHNLQ03rThSKieJqhFwFWL4sQMao6cfaRSOUWN88QVBwmSJPCZch0vfyChnSoRHC1iscdGiSHOK

使用COM对象查询

CoCreateInstance(CLISD_MLANG,NULL,CLSCTX_INPROC_SERVER,__uuidof(IMultiLanguage),(void**)&m_pLanguage);

CComQIPtr<IMLangCodePages> pPages = m_pLanguage;

DWORD* pdwCodePages=0;

pPages ->GetCharCodePages(wCh,pdwCodePages);

pPages->CodePagesToCodePage(*pdwCodePages,1252,pdwCodePage);
if (*pdwCodePage == 1252)
{
    return S_OK;
}
pPages->CodePagesToCodePage(*pdwCodePages,936,pdwCodePage);
if (*pdwCodePage == 936)
{
    return S_OK;
}