#ifdef in resource file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • None

    #1

    #ifdef in resource file

    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.
  • Bruno van Dooren

    #2
    Re: #ifdef in resource file

    > I have an application that will run on WinCE and XP. In order to have the[color=blue]
    > 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?[/color]

    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
    bruno_nos_pam_v an_dooren@hotma il.com
    Remove only "_nos_pam"


    Comment

    • Mihajlo Cvetanoviæ

      #3
      Re: #ifdef in resource file

      None wrote:[color=blue]
      > 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?[/color]

      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.

      Comment

      • Pavel A.

        #4
        RE: #ifdef in resource file

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

        --PA


        "None" wrote:[color=blue]
        > 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.
        >[/color]

        Comment

        • None

          #5
          Re: #ifdef in resource file

          "Bruno van Dooren" <bruno_nos_pam_ van_dooren@hotm ail.com> wrote in news:
          #q11GcqjGHA.160 0@TK2MSFTNGP04. phx.gbl:
          [color=blue]
          > 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.
          >[/color]

          Thanks, Bruno. It worked. :)

          Comment

          • None

            #6
            RE: #ifdef in resource file

            =?Utf-8?B?UGF2ZWwgQS4 =?= <pavel_a@NOwrit emeNO.com> wrote in
            news:C442A4F5-12B8-4499-BED7-9B5E319D45DD@mi crosoft.com:
            [color=blue]
            > Resource files are NOT compiled with C compiler!
            > please check in project options that _WINCE is defined
            > and passed to the Resource compiler.
            >
            > --PA
            >[/color]


            Thanks, PA. This worked very well.

            Comment

            Working...