Click here to Skip to main content
15,915,336 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionScrolling won't work when zooming in CScrollView [modified] Pin
ccaprani6-Aug-08 12:49
ccaprani6-Aug-08 12:49 
Questionvc++ 6 mfc, dialog with child, messed up Pin
rolfhorror6-Aug-08 7:59
rolfhorror6-Aug-08 7:59 
QuestionRe: vc++ 6 mfc, dialog with child, messed up Pin
Mark Salsbery6-Aug-08 9:18
Mark Salsbery6-Aug-08 9:18 
AnswerRe: vc++ 6 mfc, dialog with child, messed up [modified] Pin
rolfhorror6-Aug-08 10:04
rolfhorror6-Aug-08 10:04 
GeneralRe: vc++ 6 mfc, dialog with child, messed up Pin
Mark Salsbery7-Aug-08 4:45
Mark Salsbery7-Aug-08 4:45 
GeneralRe: vc++ 6 mfc, dialog with child, messed up Pin
rolfhorror7-Aug-08 8:18
rolfhorror7-Aug-08 8:18 
QuestionRe: vc++ 6 mfc, dialog with child, messed up Pin
David Crow7-Aug-08 3:38
David Crow7-Aug-08 3:38 
Question2005 C++ Resource editor replaces #defs with strings Pin
anand91966-Aug-08 7:24
anand91966-Aug-08 7:24 
Hi All,

We are trying to internationalize our software. To do this, we created resource bundles for various languages. However, after doing this we realized that all the .rc files needs to be updated when a new dialog is added to the project. To over come this problem, we moved all the strings to a header file and used to #defined in the .rc files. Now, we had to only update the header files for each of these languages and add the new dialog only in one .rc. The same rc file was linked all the resource bundle projects. Example as shown below.

As created by the resource editor:

IDD_DIALOG1 DIALOGEX 0, 0, 186, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
LTEXT "Sample text",IDC_STATIC,25,21,39,8
END

After replacing all the strings with constants:

ResourceBundle_en-US.h:
#define TEST_DIALOG “Test Dialog”
#define OK “OK”
#define CANCEL “Cancle”
#define SAMPLE_TEXT “Sample Text”


IDD_DIALOG1 DIALOGEX 0, 0, 186, 90
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION TEST_DIALOG
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON OK,IDOK,129,7,50,14
PUSHBUTTON CANCEL,IDCANCEL,129,24,50,14
LTEXT SAMPLE_TEXT,IDC_STATIC,25,21,39,8
END


The above code just works fine when you compile and run. The problem is when you try to add new dialogs or other resources from the resource editor. The resource editor replaces all the #defines with the actual strings and creates a new resource.h file. Is it possible to instruct resource editor not to replace the #define with the actual strings? or are there any other way to accomplish the same result -- Have a header file to specify all the strings used in the project and not in a resource file or define resources like dialog only once? We are currently using Visual Studio 2005.

Thanks,
Anand
AnswerRe: 2005 C++ Resource editor replaces #defs with strings Pin
Joe Woodbury6-Aug-08 10:43
professionalJoe Woodbury6-Aug-08 10:43 
QuestionOpenGL and HW acceleration [modified] Pin
Dave Calkins6-Aug-08 3:45
Dave Calkins6-Aug-08 3:45 
QuestionError message observed while using Standard User Analyzer Pin
V K 26-Aug-08 2:18
V K 26-Aug-08 2:18 
Questionnewbie C question Pin
johnny alpaca6-Aug-08 2:12
johnny alpaca6-Aug-08 2:12 
AnswerRe: newbie C question Pin
toxcct6-Aug-08 2:32
toxcct6-Aug-08 2:32 
GeneralRe: newbie C question Pin
_AnsHUMAN_ 6-Aug-08 2:36
_AnsHUMAN_ 6-Aug-08 2:36 
GeneralRe: newbie C question Pin
toxcct6-Aug-08 2:38
toxcct6-Aug-08 2:38 
GeneralRe: newbie C question Pin
johnny alpaca6-Aug-08 2:39
johnny alpaca6-Aug-08 2:39 
GeneralRe: newbie C question Pin
Kwanalouie6-Aug-08 2:55
Kwanalouie6-Aug-08 2:55 
GeneralRe: newbie C question Pin
Maximilien6-Aug-08 2:58
Maximilien6-Aug-08 2:58 
GeneralRe: newbie C question Pin
David Crow6-Aug-08 3:00
David Crow6-Aug-08 3:00 
Questionenteries in add remove program Pin
VCProgrammer6-Aug-08 1:56
VCProgrammer6-Aug-08 1:56 
AnswerRe: enteries in add remove program Pin
nisha000006-Aug-08 2:24
nisha000006-Aug-08 2:24 
GeneralRe: enteries in add remove program Pin
toxcct6-Aug-08 2:35
toxcct6-Aug-08 2:35 
AnswerRe: enteries in add remove program Pin
_AnsHUMAN_ 6-Aug-08 2:46
_AnsHUMAN_ 6-Aug-08 2:46 
GeneralRe: enteries in add remove program Pin
nisha000006-Aug-08 2:57
nisha000006-Aug-08 2:57 
QuestionXP Styles in Visual Studio 2003 Pin
__DanC__6-Aug-08 1:04
__DanC__6-Aug-08 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.