Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Thursday, November 12, 2015

Decryption of DLGINIT .rc file entry

Visual Studio saves ComboBox item list in DLGINIT entries of .rc files as ASCIIZ strings, in WORD format:

IDD_DIALOG1 DLGINIT
BEGIN
    IDC_STR1, 0x403, 16, 0
0x7241, 0x2063, 0x6c63, 0x636f, 0x776b, 0x7369, 0x0065,

    IDC_STR2, 0x403, 18, 0
0x6c41, 0x6177, 0x7379, 0x6120, 0x2074, 0x6874, 0x2065, 0x6964, 0x0065,
    0
END

Using simple type conversion we can reveal, what do these strings contain.

Monday, August 11, 2014

Fitting multilungual resources in Visual Studio C++ project in user-friendly manner

Going to I18n with our MFC Visual Studio C++ projects, we were considering several methods for organizing resources, (read here for details):
  1. Language-dependent binary 
  2. One resource DLL for all languages 
  3. One resource DLL per target language 

I bet #2 is the best one, and here is how to organize .rc files and VS projects in the way good both: for machine and for humanity. Good for machine, because:
Good for humanity because:
  • resources for all languages will be capable of manual editing with Visual Studio (thus you can keep resources synchronized among different languages), 
  • It would be possible to edit TEXTINCLUDE from VS GUI.
Plenty of time spent for investigation, reading docs, exploring existing projects and collegial disputes made it possible to get desired structure of VS C++ project and .rc files. This structure might be used as a template for other projects, and even might be an Ariadne's thread in localization labyrinth.

Friday, September 27, 2013

Embedding C++ code analysis into Visual Studio

Once needed to perform C++ code analysis in order to find multibyte-unfriendly code. Perl with regular expressions helped me a much. Then I've realized that asking everybody in my team to work from DOS console would be inconvenient, thus I've started thinking how to embed this stuff into my lovely IDE (*)

I even asked the community a question: How do I modify View.FindResults1 contents in Visual Studio? 
and got am advice to my own version of the "Find Results" window by creating a Visual Studio extension myself. We can start by having a look at Extending Visual Studio > Tool Windows


Probably writing VisualStudio extensions is a deal of my future self-development. For now I've stopped on calling the script from Post-Build process:
perl $(SolutionDir)\Localization\test_resource_funs.pl  $(InputDir)
thus having its output in Compile Output window. No additional efforts are needed. I can even use "Errors List" to sort and observe all of script warnings.

"Output" window:

"Error List" window:


* - I bet Visual Studio is the best one IDE.

PS see: Formatting the Output of a Custom Build Step or Build Event