Menu

WinCE Experience

2007-04-11
2013-04-08
  • Edward Sitarski

    Edward Sitarski - 2007-04-11

    I have been using SmartWin to create a Windows CE PocketPC application using Visual C++ 2005.
    I have read some comments questioning the value of SmartWin, however, SmartWin could be the ideal solution for WinCE where is a great need for a small run-time footprint and "sane" development environment.
    This could really be a "sweet spot" and a key selling point of the tool.

    In the end, I was able to develop a working app, but it still looks a bit crude.
    I ran into a number of annoyances/problems:

    1)  The stock SmartWin++ 2.0 install will not compile for WinCE (the SmartWinDevices Solution) and gives the error:

    2>c:\smartwin\include\smartwin\widgets\../MessageMap.h(323) : error C2065: 'extPtr' : undeclared identifier
    2>        c:\smartwin\include\smartwin\widgets\../MessageMap.h(294) : while compiling class template member function 'LRESULT SmartWin::MessageMap<EventHandlerClass,MessageMapPolicy>::mainWndRouteChild(HWND,UINT,WPARAM,LPARAM)'
    2>        with
    2>        [
    2>            EventHandlerClass=ABCentralWidget,
    2>            MessageMapPolicy=SmartWin::MessageMapPolicyNormalWidget
    2>        ]

    This is pretty easy to fix with an #ifdef WINCE/#endif at lines 323 and 330, but it leads one to question whether it has been compiled in a while?

    2)  The Calculator example will not run in WinCE and returns the error:

        Unable to start program '%CSIDL_PROGRAM_FILES%\Calculator\Calculator.exe'

    Is there something simple that I am missing?

    3)  The code for handling program icons in WinCE seems to be ifdef'ed out.  Is there any way to get a program icon to show on a WinCE program?

    4)  WidgetLoadFile:  showDialog() should have a parameter to pass in a program-suggested file name (default, none).  Entering a file name on the PocketPC is too painful, but the enhancement is easy to do.

    5)  Can one of the Canvas classes be used for printing?  Canvas is a nice wrapper, but even the iolib examples use the "raw" WIN32 API.  Am I missing something, or would it be easy to make a PrinterCanvas subclass of Canvas?

    6)  Specific support for CommandBands and other WinCE features.  This would further differentiate the SmartWin toolkit.  Is anyone else interested in this?

    7)  WinCE devices come in many different screen resolutions, and it is cumbersome/impractical to define resource files for widget layout on them all (translations are always a pain too).  SmartWin does have widget layout functionality, but it is separate (normally in a layout() function) from the widget creation (normally in initAndCreate() ).
    For reasons of clarity and ease of maintenance, widget creation and layout would be done together.
    Although Qt suffers from some other key problems (MOC preprocessor, etc.), it does have useful and seemingly lightweight layout containers such as HBoxLayout, VBoxLayout and GridLayout.  Are there any plans to add layout containers to SmartWin so that layout can be done at Widget creation?
    Is anyone interested in this?

    8) The single-include file approach is SmartWin is convenient, but it causes long compile times.  Has anyone been able to configure VC++ to use precompiled headers with SmartWin?  I have not had any luck.

    Sorry for all the things in one posting, but if anyone can help, I would really appreciate it.

     
    • andrew7

      andrew7 - 2007-04-11

      Thanks for your post.  All are good issues.  I can't address them all now in depth, but here is a short reponse for each.

      1. Fixed in CVS today.  I don't have a WinCE build myself. Most likely I will get one by summer.  Our WinCe people have been recently quiet.  If you want to be a developer so you can fix CE issues just say so, and I'll set you up. 

      2. I don't know.

      3. I don't know.

      4. Sounds sensible.

      5. You are probably right, I have not investigated this area enough.

      6. Not my area.

      7. We did add anchors.h pretty recently.

      8. I tried pre-compiled headers once but failed.  I'll try again.

      best regards, Andrew

       
    • andrew7

      andrew7 - 2007-04-11

      8. Precompiled headers

      How to make MSVC++ go faster when compiling SmartWin++ projects.

      First, create a precompiled header for the project in question:

      Project:    C/C++ | Precompiled Headers
      Create/use Precompiled Header        Create Precompiled header (/yu)
      Create/use PCH Through File        SmartWin.h

      Second, Build the project.
      Third, Change the option to say use the precompiled header.

      Project:    C/C++ | Precompiled Headers
      Create/use Precompiled Header        Use Precompiled header (/yu)
      Create/use PCH Through File        SmartWin.h

      This does not work on SmartWin project to build the library though.   Note I tested this with VS 2005.

       
    • andrew7

      andrew7 - 2007-06-09

      2) >> The Calculator example will not run in WinCE and returns the error:

      I had to add: /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE
      to properties | linker | command line
      to avoid this error:

      CVTRES : fatal error CVT1109: target machine 'THUMB' requires '/WINDOWSCE'
      LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

      4)  I added a showDialog method with a defaultFilePath.

       

Log in to post a comment.