Hi, I need help on trying to display Chinese characters in a CListCtrl. I have _UNICODE flag in project settings, and I'm using the unicode conventions (i.e., _T() for string literals, _tcscpy in place of strcpy(), etc.). Still no luck, I've even tried to set the font: CFont *cFontPtr = m_CertListCntrl.GetFont(); LOGFONT lFontObj; int success = cFontPtr->GetLogFont(&lFontObj); lFontObj.lfCharSet = CHINESEBIG5_CHARSET; CFont cfObj; BOOL s = cfObj.CreateFontIndirect(&lFontObj); m_CertListCntrl.SetFont(&cfObj, TRUE); And still no luck. Note: I tried to test the code by hard coding chinese characters and filling in the list. Not sure if that has an effect on it. Thanks, Raymond
Raymond So
Posts
-
Need help displaying Chinese characters in a CListCtrl -
GetModuleFileName instance and registering appI'm trying to place a value in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run so that my app starts up when windows starts up, as a background app. I've implemented DLLRegisterServer so that it is invoked when the setup.exe runs (I've set the .exe to self-register under InstallShield). In DLLSelfRegister, I need the path to the .exe so that the value in the registry is set properly and the .exe runs from that path. I use GetModuleFileName to get the path of the app, but when regsvr32 myApp.exe is run, the app is not instantiated yet. I used MFC to create a dialog based app Here's a code snipet: CSysTrayDemoApp theApp; //MFC generated ... //Implement this funciton so that regsvr32 can invoke it to register exe. STDAPI DllRegisterServer() { char path[MAX_PATH]; DWORD pathLen = sizeof(fileName); __asm int 3; GetModuleFileName(theApp.m_hInstance, path, pathLen); ... theApp.m_hInstance is not instantiated and thus I can't get the path name. Does anyone have experience in registering an app/is there a better way of doing this? Thanks, Raymond