#ifdef in resource file

  • Thread starter Thread starter None
  • Start date Start date
N

None

Hello

I have an application that will run on WinCE and XP. In order to have the
WinCE virtual keyboard pop up when the cursor enters an edit field, the
following has to be inserted at the end of each dialog after all the edit
fields have been created:

CONTROL "",IDC_STATIC,"SIPPREF",NOT WS_VISIBLE,-10,-10,5,5


Unfortunately in the XP version of the app, this causes the Dialog->DoModal
to fail. So I thought putting the #ifdef _WINCE statement around this line
can remedy the problem. However it seems that VC++ does not complie the
above line when this line is present even for the WinCE version.

So my question is do #ifdef statements around control statements have any
meaning in resource files? If not, can anyone recomment a workaround?

Thanks very much in advance.
 
I have an application that will run on WinCE and XP. In order to have the
WinCE virtual keyboard pop up when the cursor enters an edit field, the
following has to be inserted at the end of each dialog after all the edit
fields have been created:

CONTROL "",IDC_STATIC,"SIPPREF",NOT WS_VISIBLE,-10,-10,5,5


Unfortunately in the XP version of the app, this causes the
Dialog->DoModal
to fail. So I thought putting the #ifdef _WINCE statement around this line
can remedy the problem. However it seems that VC++ does not complie the
above line when this line is present even for the WinCE version.

So my question is do #ifdef statements around control statements have any
meaning in resource files? If not, can anyone recomment a workaround?

If you right-click your resource file, you can include files and specify
compile time directives.
or you can open it as code and edit it directly.

--

Kind regards,
Bruno van Dooren
(e-mail address removed)
Remove only "_nos_pam"
 
None said:
I have an application that will run on WinCE and XP.
...

So my question is do #ifdef statements around control statements have any
meaning in resource files? If not, can anyone recomment a workaround?

In my view the GUI's for these two OS'es are so different that you're
probably better of with two separate configurations, or even two
separate projects. Do you have those #ifdef's in the code as well? If
you do then you might reconsider rearranging the code so that all code
that is different belongs to different projects, including the dialogs.
 
Resource files are NOT compiled with C compiler!
please check in project options that _WINCE is defined
and passed to the Resource compiler.

--PA
 
If you right-click your resource file, you can include files and specify
compile time directives.
or you can open it as code and edit it directly.

Thanks, Bruno. It worked. :)
 
Resource files are NOT compiled with C compiler!
please check in project options that _WINCE is defined
and passed to the Resource compiler.

--PA


Thanks, PA. This worked very well.
 
Back
Top