hi.
i have one question.
i want to change control panel(power).
so i define one vaulue in MYPROJECT.BAT file. the define value is
"PLATCFG_BATTERY=1".
of course set to MYPROJECT.CMN file.
after i checked this value in "\CLPMAIN\power.cpp" result is define
TRUE.
but i checked this value in cplmain.rc file. result is define FALSE.
how to control .rc file?

under code is my test code.

- MYPROJECT.BAT
SET PLATCFG_BACKUPBATTERY=1

- power.cpp
#ifdef PLATCFG_BACKUPBATTERY
RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is define
\n"))); // enter here
#else
RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is not define
\n")));
#endif // PLATCFG_BACKUPBATTERY

- cplmain.rc
IDD_BATTERY DIALOG DISCARDABLE 0, 0, 132, 140
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
BEGIN
#ifdef PLATCFG_BACKUPBATTERY
LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,4,40,122,8
CONTROL "Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",
PBS_SMOOTH | WS_BORDER,12,59,102,9
LTEXT "0",IDC_STATIC,5,59,10,8
LTEXT "100",IDC_STATIC,116,59,13,8
LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,98,122,8
CONTROL "Progress2",IDC_PROGRESS_BACK,"msctls_progress32",
PBS_SMOOTH | WS_BORDER,12,117,102,9
LTEXT "0",IDC_STATIC,5,117,10,8
LTEXT "100",IDC_STATIC,116,117,13,8
GROUPBOX "Main Battery",IDC_STATIC,0,24,131,51
GROUPBOX "Backup Battery",IDC_STATIC,0,81,131,51
#else
LTEXT "Main battery",IDC_STATIC_MAIN,5,43,43,8
LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,6,52,122,8
LTEXT "Backup battery",IDC_STATIC_BACK,5,53,49,8,NOT
WS_VISIBLE
GROUPBOX "",-1,25,42,105,6
GROUPBOX "",-1,53,53,74,6,NOT WS_VISIBLE
CONTROL
"Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",PBS_SMOOTH |
WS_BORDER,12,63,102,9
LTEXT "0",-1,5,63,10,8
LTEXT "100",-1,116,63,13,8
LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,64,122,8,NOT
WS_VISIBLE
CONTROL
"Progress2",IDC_PROGRESS_BACK,"msctls_progress32",PBS_SMOOTH | NOT
WS_VISIBLE | WS_BORDER,12,75,102,9
LTEXT "0",-1,5,75,10,8,NOT WS_VISIBLE
LTEXT "100",-1,116,75,13,8,NOT WS_VISIBLE
#endif

no entered "#ifdef PLATCFG_BACKUPBATTERY" construction.

what kind of need another control?

plz...advice to me.

aaplks@hotmail.com

Re: about .rc file control by Paul

Paul
Thu Jun 07 11:33:22 CDT 2007

What tool are you using to build?

There are seperate predefines for RC files than the ones used for C/CPP
files if you are using eVC or Visual Studio.

In visual studio 2005 when you look at the project properties there is a
node in the settings tree called "Resources" If you expand Resources
under that there is a setting for "Preprocessor Definitions"

There is a similar setting for eVC.

If you are building some other way you many need to add the definitions
to RCDEFINES in addition to CDEFINES.

Paul Monson
Intrinsyc


aplkswin wrote:
> hi.
> i have one question.
> i want to change control panel(power).
> so i define one vaulue in MYPROJECT.BAT file. the define value is
> "PLATCFG_BATTERY=1".
> of course set to MYPROJECT.CMN file.
> after i checked this value in "\CLPMAIN\power.cpp" result is define
> TRUE.
> but i checked this value in cplmain.rc file. result is define FALSE.
> how to control .rc file?
>
> under code is my test code.
>
> - MYPROJECT.BAT
> SET PLATCFG_BACKUPBATTERY=1
>
> - power.cpp
> #ifdef PLATCFG_BACKUPBATTERY
> RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is define
> \n"))); // enter here
> #else
> RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is not define
> \n")));
> #endif // PLATCFG_BACKUPBATTERY
>
> - cplmain.rc
> IDD_BATTERY DIALOG DISCARDABLE 0, 0, 132, 140
> STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
> BEGIN
> #ifdef PLATCFG_BACKUPBATTERY
> LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,4,40,122,8
> CONTROL "Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",
> PBS_SMOOTH | WS_BORDER,12,59,102,9
> LTEXT "0",IDC_STATIC,5,59,10,8
> LTEXT "100",IDC_STATIC,116,59,13,8
> LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,98,122,8
> CONTROL "Progress2",IDC_PROGRESS_BACK,"msctls_progress32",
> PBS_SMOOTH | WS_BORDER,12,117,102,9
> LTEXT "0",IDC_STATIC,5,117,10,8
> LTEXT "100",IDC_STATIC,116,117,13,8
> GROUPBOX "Main Battery",IDC_STATIC,0,24,131,51
> GROUPBOX "Backup Battery",IDC_STATIC,0,81,131,51
> #else
> LTEXT "Main battery",IDC_STATIC_MAIN,5,43,43,8
> LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,6,52,122,8
> LTEXT "Backup battery",IDC_STATIC_BACK,5,53,49,8,NOT
> WS_VISIBLE
> GROUPBOX "",-1,25,42,105,6
> GROUPBOX "",-1,53,53,74,6,NOT WS_VISIBLE
> CONTROL
> "Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",PBS_SMOOTH |
> WS_BORDER,12,63,102,9
> LTEXT "0",-1,5,63,10,8
> LTEXT "100",-1,116,63,13,8
> LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,64,122,8,NOT
> WS_VISIBLE
> CONTROL
> "Progress2",IDC_PROGRESS_BACK,"msctls_progress32",PBS_SMOOTH | NOT
> WS_VISIBLE | WS_BORDER,12,75,102,9
> LTEXT "0",-1,5,75,10,8,NOT WS_VISIBLE
> LTEXT "100",-1,116,75,13,8,NOT WS_VISIBLE
> #endif
>
> no entered "#ifdef PLATCFG_BACKUPBATTERY" construction.
>
> what kind of need another control?
>
> plz...advice to me.
>
> aaplks@hotmail.com
>

Re: about .rc file control by Paul

Paul
Thu Jun 07 16:46:10 CDT 2007

If you are trying to add this to a module that is built with a sources
file you will need something like this in your sources file

!IF "$(PLATCFG_BACKUPBATTERY)"=="1"
REDEFINES=$(REDEFINES) -DPLATCFG_BACKUPBATTERY
!ENDIF


Paul Monson
Intrinsyc


Paul Monson wrote:
> What tool are you using to build?
>
> There are seperate predefines for RC files than the ones used for C/CPP
> files if you are using eVC or Visual Studio.
>
> In visual studio 2005 when you look at the project properties there is a
> node in the settings tree called "Resources" If you expand Resources
> under that there is a setting for "Preprocessor Definitions"
>
> There is a similar setting for eVC.
>
> If you are building some other way you many need to add the definitions
> to RCDEFINES in addition to CDEFINES.
>
> Paul Monson
> Intrinsyc
>
>
> aplkswin wrote:
>> hi.
>> i have one question.
>> i want to change control panel(power).
>> so i define one vaulue in MYPROJECT.BAT file. the define value is
>> "PLATCFG_BATTERY=1".
>> of course set to MYPROJECT.CMN file.
>> after i checked this value in "\CLPMAIN\power.cpp" result is define
>> TRUE.
>> but i checked this value in cplmain.rc file. result is define FALSE.
>> how to control .rc file?
>>
>> under code is my test code.
>>
>> - MYPROJECT.BAT
>> SET PLATCFG_BACKUPBATTERY=1
>>
>> - power.cpp
>> #ifdef PLATCFG_BACKUPBATTERY
>> RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is define
>> \n"))); // enter here
>> #else
>> RETAILMSG(1,(_T(" [PM:(power.cpp)] PLATCFG_BACKUPBATTERY is not define
>> \n")));
>> #endif // PLATCFG_BACKUPBATTERY
>>
>> - cplmain.rc
>> IDD_BATTERY DIALOG DISCARDABLE 0, 0, 132, 140
>> STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
>> BEGIN
>> #ifdef PLATCFG_BACKUPBATTERY
>> LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,4,40,122,8
>> CONTROL "Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",
>> PBS_SMOOTH | WS_BORDER,12,59,102,9
>> LTEXT "0",IDC_STATIC,5,59,10,8
>> LTEXT "100",IDC_STATIC,116,59,13,8
>> LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,98,122,8
>> CONTROL "Progress2",IDC_PROGRESS_BACK,"msctls_progress32",
>> PBS_SMOOTH | WS_BORDER,12,117,102,9
>> LTEXT "0",IDC_STATIC,5,117,10,8
>> LTEXT "100",IDC_STATIC,116,117,13,8
>> GROUPBOX "Main Battery",IDC_STATIC,0,24,131,51
>> GROUPBOX "Backup Battery",IDC_STATIC,0,81,131,51
>> #else
>> LTEXT "Main battery",IDC_STATIC_MAIN,5,43,43,8
>> LTEXT "Charging",IDC_STATIC_CHARGE_MAIN,6,52,122,8
>> LTEXT "Backup battery",IDC_STATIC_BACK,5,53,49,8,NOT
>> WS_VISIBLE
>> GROUPBOX "",-1,25,42,105,6
>> GROUPBOX "",-1,53,53,74,6,NOT WS_VISIBLE
>> CONTROL
>> "Progress2",IDC_PROGRESS_MAIN,"msctls_progress32",PBS_SMOOTH |
>> WS_BORDER,12,63,102,9
>> LTEXT "0",-1,5,63,10,8
>> LTEXT "100",-1,116,63,13,8
>> LTEXT "Charging",IDC_STATIC_CHARGE_BACK,5,64,122,8,NOT
>> WS_VISIBLE
>> CONTROL
>> "Progress2",IDC_PROGRESS_BACK,"msctls_progress32",PBS_SMOOTH | NOT
>> WS_VISIBLE | WS_BORDER,12,75,102,9
>> LTEXT "0",-1,5,75,10,8,NOT WS_VISIBLE
>> LTEXT "100",-1,116,75,13,8,NOT WS_VISIBLE
>> #endif
>>
>> no entered "#ifdef PLATCFG_BACKUPBATTERY" construction.
>>
>> what kind of need another control?
>>
>> plz...advice to me.
>>
>> aaplks@hotmail.com
>>