MFC, my resource file *.rc corrupted after any change I do

167 Views Asked by At

I have a MFC dialog-based application. whenever I change anything in the resource file my_project_name.rc file, all the dialogs' captions got corrupted like the image below:

how captions look after any change

The change I did was changing order of two edit controls in a dialog to change the order of focus goes when pressing Tab button. Got the idea from this question.

I moved the two edit controls from the last of my dialog controls area in the resource file to the middle.

Edit 01

I modified the resource file using VSCode, I open it as a text file, do my changes and save it.

Even after I undo the changes no fix for this.

I have a backup for my resource file. when I replace it with the corrupted one everything goes normal.

But I still don't know why and how to avoid or fix the problem I'm in.

Any other idea to change the order of focus on elements when Tab pressed?

1

There are 1 best solutions below

1
Ibrahim T Eslim On

Thanks to commenters, it was encoding problem, because I was applying the changes using VSCode, and VSCode change the original encoding (ANSI) to UTF-8 so this was what causing the problem.

The solution was applying edits using Notepad++. that solved the problem.