![]()  | 
 
Greek Strings in non unicode app | 
 
    Post Reply  
   | 
  
| Author | |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: Greek Strings in non unicode appPosted: 24 January 2020 at 4:40am  | 
 
| 
   
    I tried to localize my ribbon and tabs using as a guide an older answer from Oleg. You can add toolkit resources to same dll - add #include "XTToolkitPro.rc" and can define before #define _XTP_RESOURCE_LANGUAGE el to include Hebrew version instead English. and in code add XTPResourceManager()->SetResourceHandle(hYourDllHandle) But my application (non unicode) is partially shows greek strings. Take a look. What am I doing wrong? ![]()  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 26 January 2020 at 12:29pm | 
 
| 
   
    
   Its seems that using directly an LPCTSTR string in the AddTab method like below, it works perfectly instead of using nID from the string table. 
   
  CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(_T("ΕΛΛΗΝΙΚΑ")); I think that codejock team have to fix this.  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 29 January 2020 at 3:27am | 
 
| 
   
    
   Is it an UNICODE application? 
   
   | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 29 January 2020 at 3:41am | 
 
   
   
 No, no unicode app. 
    | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 29 January 2020 at 5:40am | 
 
| 
   
    Which encoding are you using for your .rc files? Perhaps that's the reason. What do you get when you call CString::LoadString()? Is the content ok or not? 
    | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 29 January 2020 at 5:41am | 
 
| 
   
    
   Ah, and don't forget to check the #pragma codepage in your rc files 
   
   | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 29 January 2020 at 9:30am | 
 
   
   
 My settings inside *.rc2 #define _XTP_RESOURCE_LANGUAGE el inside *.rc LANGUAGE LANG_GREEK, SUBLANG_DEFAULT #pragma code_page(1253) CString::LoadString() I get gibberish instead of Greeks but String Table is notated as [Greek] 
    | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 30 January 2020 at 3:43am | 
 
| 
   
    
   What happens if you try CStringW::LoadString instead of CString::LoadString (which indeed takes CStringA::LoadString())? 
   
   | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 01 February 2020 at 4:27am | 
 
   
   
 Testing with  CStringW strFormat; strFormat.LoadString(136); In this way it works just fine.   But what this exactly means? That my String Table is saved as a Unicode file and Compiler can not manage this? Regards,  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 01 February 2020 at 11:21am | 
 
| 
   
    In Visual Studio IDE you can choose the file encoding when you call "Save as...". Just press the down  arrow of the save button and select the correct encoding according your codepage 1253. You can use Notepad++ for example to test the current encoding of your file and you can change the encoding if it's wrong using the "Encoding" main menu item of the same editor. Hope this helps! 
    | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   mgampi  
   
   Senior Member  
   Joined: 14 July 2003 Status: Offline Points: 1210  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 01 February 2020 at 11:25am | 
 
| 
   
    ...and another hint: the correct order of statements in .rc2 file is #define _XTP_RESOURCE_LANGUAGE el #include "XTToolkitPro.rc" First define the required language and the include the .rc file  | 
 |
| 
   
     
     Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022  | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 02 February 2020 at 5:13am | 
 
   
   
 I already used this order in my projects. 
    | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 02 February 2020 at 5:39am | 
 
   
   
 This project is pretty old and I am using VS2008. For *.rc files the option "Save as" is disabled, but it works with all other files. So, I used Notepad++. I confirm that this is an ANSI file and I choose Greek 1253 as character encoding, before I save the file. Inside the *.rc file I can see without problems the Greek characters as well as inside the Visual Studio String Table.  No matter what, everytime I open once again the file under Notepad++, it reports ANSI but character encoding is turned back to default which is Greek ISO 8859-7.  I also changed the *.rc file to  #ifdef _WIN32 LANGUAGE LANG_GREEK, SUBLANG_GREEK_GREECE #pragma code_page(1253) #endif //_WIN32 I compiled and tested the code below. No difference at all. Using CStringW it works. To be honest, I am not sure what exactly is going on here but I assume that VS2008 ignores the Greek character encoding? CString strFormat; strFormat.LoadString(136); ![]()  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 05 March 2020 at 7:32am | 
 
| 
   
    
   Another paradox is when I use the debug executable I can see Greek characters in CXTPTaskDialog  but when I use release executable I get gibberish instead.
 
   
  The character set in the General Settings of the project are both set to "Not set". What seems to be the problem here? ![]()  | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
   
   sdancer75  
   
   Groupie  
   Joined: 08 July 2008 Location: Greece Status: Offline Points: 70  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 05 March 2020 at 8:47am | 
 
| 
   
    
   [Solved] 
   
  I don't know why this works and shows correctly the Greek characters, but the CXTPTaskDialog derived dialog should be called with TRUE in the 1st parameter to force use the ComCtl32.dll version of the task dialog. Unfortunately this concerns only for Vista and newer OSs For example CXTPTaskDialog	tDialog(this); tDialog.DoModal(TRUE); 
    | 
 |
| 
   
     
     Just me!
     
   
   | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |