Device or Desktop

Discussion in 'Questions (Windows Mobile)' started by DaveW, Nov 7, 2008.

  1. DaveW

    DaveW Active Member Licensed User

    Is there a simple way to determine if the program is running on a Device or Desktop - one which will allow the compiler to use/omit code?

    For example, I have

    img1clk.New1(img1obj.value,"MouseClick")

    in my program but this has to be

    img1clk.New1(img1obj.value,"MouseDown")

    on the Device. I don't want to have to edit this (and remember what to edit) every time I transfer the program to the device or back again.

    In Delphi they have
    {$IFDEF VER130}
    do this
    {$ELSE}
    do that
    {$ENDIF}

    is there something similar in Basic4PPC?
     
  2. Mr_Gee

    Mr_Gee Active Member Licensed User

    try the "cPPC = true" constant :
    If cPPC = true Then
    ' running on the PPC
    Else
    'running on the Desktop
    End If
     
  3. agraham

    agraham Expert Licensed User

    This will work on the desktop as well. In general what works on a device will work on the desktop but not vice versa. The Compact Framework on the device is a higly compatible subset of the full Framework. This is why a lot of code, libraries and even compiled exes, intended for the device will actually run on the desktop.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice