#ifdef in resource file

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.
 
B

Bruno van Dooren

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"
 
?

=?windows-1250?Q?Mihajlo_Cvetanovi=E6?=

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.
 
G

Guest

Resource files are NOT compiled with C compiler!
please check in project options that _WINCE is defined
and passed to the Resource compiler.

--PA
 
N

None

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. :)
 
N

None

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top