tag:blogger.com,1999:blog-905735152719562127.post7377638389793739464..comments2024-03-11T05:58:23.741-07:00Comments on Technical Blog for Jim Beveridge: Convert a Locale Name to LCID in C++Jim Beveridgehttp://www.blogger.com/profile/07446539325869013304noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-905735152719562127.post-89231639542732276442013-08-29T05:18:02.339-07:002013-08-29T05:18:02.339-07:00CString lang;
CoInitialize(NULL);
HRESULT hr = C... CString lang;<br /> CoInitialize(NULL);<br /> HRESULT hr = CoCreateInstance(CLSID_CMultiLanguage, 0, CLSCTX_INPROC_SERVER, IID_IMultiLanguage, (void**)&mlang);<br /> if (SUCCEEDED(hr))<br /> {<br /> BSTR st;// = str.AllocSysString();<br /> mlang->GetRfc1766FromLcid(l/*lcid*/,&st );<br /> lang = st;<br /> SysFreeString(st);<br /><br /> }<br /> CoUninitialize();Ahmed Safanhttps://www.blogger.com/profile/12639408763210044591noreply@blogger.comtag:blogger.com,1999:blog-905735152719562127.post-53974108058103531242012-06-30T11:19:04.027-07:002012-06-30T11:19:04.027-07:00Hi Jakob,
Thanks for taking the time to comment, ...Hi Jakob,<br /><br />Thanks for taking the time to comment, but the line is correct as I wrote it. Static variables are always initialized to zero by the compiler. This goes all the way back to the K&R C standard - see K&R1 (Appendix A, §6.8).<br /><br />More details:<br />http://stackoverflow.com/questions/3373108/why-are-static-variables-auto-initialized-to-zeroJim Beveridgehttps://www.blogger.com/profile/07446539325869013304noreply@blogger.comtag:blogger.com,1999:blog-905735152719562127.post-59990654322188385542012-06-29T01:57:10.186-07:002012-06-29T01:57:10.186-07:00Hello,
thanks for posting this Code, it is great ...Hello,<br /><br />thanks for posting this Code, it is great but it has a bug in it, the line <br /><br />static bool bDone; <br /><br />results in an undefined variable, the correct version of the line is:<br /><br />static bool bDone = false;<br /><br />Regards<br />JakobAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-905735152719562127.post-80269418339761005332012-06-29T01:56:11.637-07:002012-06-29T01:56:11.637-07:00Hello,
thanks for posting this Code, it is great ...Hello,<br /><br />thanks for posting this Code, it is great but it has a bug in it, the line <br /><br />static bool bDone; <br /><br />results in an undefined variable, the correct version of the line is:<br /><br />static bool bDone = false;<br /><br />Regards<br />JakobAnonymousnoreply@blogger.com