Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
I have an MFC app with html help, and automatically Visual Studio generates a file named HTMLDefines.h

I added my own identifiers to this file, but it keeps getting overwritten whenever I change the resources in the environment.

My question is: Is there any way I can get my identifiers (or ones that I specify, like just IDD_*) from resource.h automatically written into the HTMLDefines.h file?
Posted
Updated 23-Feb-11 22:24pm
v2
Comments
Hans Dietrich 24-Feb-11 4:22am    
In case you're wondering, the C++ purists in this forum are probably annoyed at seeing an MFC question, and so downvoted your question. Next time, post MFC questions in the C++/MFC forum. :)

1 solution

I have a utility that creates a .cpp and a .h file using a .rc file as input. For example, the .h file contains
#define HIDD_RENAME_DIALOG                                  100000
#define HIDC_RICHEDIT                                       100001
#define HIDC_STATUSBAR                                      100002
#define HIDC_MIN_RECT                                       100003
...
and the .cpp file contains
// IDD_RENAME_DIALOG
IDD_RENAME_DIALOG,                                  HIDD_RENAME_DIALOG,
IDC_RICHEDIT,                                       HIDC_RICHEDIT,
IDC_STATUSBAR,                                      HIDC_STATUSBAR,
IDC_MIN_RECT,                                       HIDC_MIN_RECT,
...
If you think you will be able to use this, I will upload it to Codeproject. If you do not want to run an unknown exe, email me your .rc file and I will email you back the .h and .cpp files.

hdietrich at gmail dot com
 
Share this answer
 
v3
Comments
Espen Harlinn 25-Feb-11 3:32am    
Nice reply, good attitude - my 5 :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900