Title: TipsTricks and Other Useful Tools
1(No Transcript)
2Tips/Tricks and Other Useful Tools
3- Dennis Corpman
- Senior Software Engineer
- Systems Solutions Software
- Intermec Technologies Corporation
4Agenda
- Kiosk Mode/Lockdown Application Development
- Creating Custom Soft Input Panels (SIPs)
- Code Reuse Tips and Tricks
5Agenda
- Kiosk Mode/Lockdown Application Development
- Creating Custom Soft Input Panels (SIPs)
- Code Reuse Tips and Tricks
6What is Kiosk Mode?
- Its a state where the users interaction, with
the computer, is restricted in some manner.
7Why Implement Kiosk Mode?
- Security To protect the computers settings
and/or data. - Productivity Access granted for intended use
only.
8How do you implement Kiosk Mode?
- Build a Kiosk Mode WinCE Operating System (OS)
image. - Build a Kiosk Mode Application, aka Lockdown
Application.
9What is a Kiosk Mode WinCE OS?
- No Games.
- No Office Applications.
- Your application running from the shell.
10Why not use a Kiosk Mode WinCE OS Image?
- You have two options to obtain that image
- Have someone build it for your, like the Original
Equipment Manufacturer (OEM). - Build it yourself!
11Why not a use a Kiosk Mode Wince OS Image? (cont.)
- If you build it yourself, beware of the
following - Youll need special software (Platform Builder)
and knowledge on how to use it. - Youll need support from the hardware
manufacturer. - Its complex. (See http//msdn.com/mikehall/archiv
e/2005/08.aspx for Mike Halls attempt to build a
kiosk mode OS with Wince 5.0)
12How about a Kiosk Mode Application instead?
- An application is said to run in Kiosk Mode if it
performs the following - Runs in full screen mode to prevent switching to
other applications. - The hardware keys are disabled to prevent
switching to other applications. - The application is automatically restarted after
a soft-reset.
13Example 1 Attempt at creating a full screen
application
- SDFS1 Uses MFC and SHFullScreen on a Windows
Mobile 2003 device. - Example created using information published by
Microsoft, How to Create Full-Screen
Applications for the Pocket PC, at
http//support.microsoft.com/default.aspx
?scidkb5Bln5D266244.
14Example 2 Attempt at creating a full screen
application
- SDFS2 Full screen application using C .NET and
SHFullScreen on a Windows Mobile 2003 device.
15Kiosk Mode Applications (cont.)
- SDFS1 SDFS2 made use of SHFullScreen.
- The code for each Form or Dialog had to be
modified. - Theyre not compete as they still have issues
switching between Forms and Dialogs. - SHFullScreen is only available for Windows Mobile
Pocket PC builds. Youll need another solution if
your application targets some other device. - Every application you build will have the
overhead of making it full screen. - We still havent handled the hardware keys or
restarting the application on a soft-reset.
16Tip Try Kiosk Mode Third Party Solutions
- Spb Kiosk Explorer A Pocket Internet Explorer
running in Kiosk Mode. - Intermecs iBrowse Internet Explorer-compatible
web browser that doesnt allow the user to exit
the browser or access a non-work related website. - Intermecs iLaunch Configurable locked-down
menu program that prevents end-users from
accessing the start menu and other non-authorized
applications. - Etc. (google the web)
17iLaunch Demo
- Controlled through an Ini file.
- Installed with a cab file.
- Example Ini
- Caption
- Button1Notes
- Button2Calculator
- Button3Internet Explorer
- exe
- Button1\windows\notes.exe
- Button2\windows\calc.exe
- Button3\windows\iexplorer.exe
- PassWord
- pwd
- Bitmaps
- TopLogo\windows\launcher\intermecblue.bmp
18Agenda
- Kiosk Mode/Lockdown Application Development
- Creating Custom Soft Input Panels (SIPs)
- Code Reuse Tips and Tricks
19Soft Input Panel (SIP) Basics
- The Wince OS implements an Input Panel that gets
its input through various Input Methods. - The Input Panel and Input Methods are COM,
Component Object Model, objects they implement
the IIMCallBack and IInputMethod interfaces. - Wince provides a default Input Panel and default
Input Methods. - The Input Methods receive the user input and
passes the information to the Input Panel, which
in turn passes it to GWES and then the
application.
20Soft Input Panel (SIP) Basics Cont.
21Custom Soft Input Panels (SIPs)
- Input Methods are COM objects. You can create
your own and install them on a WinCE device. - Microsoft provides a sample custom SIP project,
with Embedded Visual C 4.0, called DvorakSip.
22Custom Soft Input Panels (SIPs)
- Intermec is launching a new product to make
customization easier. Its called SIP Designer. - SIP Designer creates custom Kbd files that are
used by a companion Input Method on the device. - Initially being released with next release of
TE2000.
23SIP Designer Demo
24Agenda
- Kiosk Mode/Lockdown Application Development
- Creating Custom Soft Input Panels (SIPs)
- Code Reuse Tips and Tricks
25Code Reuse Tips and Tricks
- Tip Separate your User Interface code from your
Business Process code. - Tip Separate your User Interface Layout code for
each screen orientation type (i.e., square vs.
portrait screen layouts).
26Code Reuse Tips and Tricks (cont.)
- Tip Move your Business Process into dynamic-link
libraries (DLLs) if you can. - Managed DLLs can be referenced from any .NET
language like C and VB .NET. - Native DLLs can be referenced from any .NET
language using the Platform Invoke mechanism.
27Code Reuse Tips and Tricks (cont.).
- Tip If your Business Process already exists in
C/C code, dont rewrite it in managed code like
C or VB .NET. Wrap it in a native DLL. - Code is already tested.
- Code is secure from prying eyes, no need to
obfuscate it. - C/C code is faster than managed code.
28Code Reuse Tips and Tricks (cont.)
- Tip Expose your native code interfaces without
name mangling (C-style). - Much easier to call FUNCONE vs. ?UNCONE_at__at_3HA.
- Tip Limit the number of p/invoke calls you make
from your managed code. - At just-in-time (JIT) compile time, the common
language runtime extracts the module name, entry
point name, and calling convention from the
metadata. It then loads the DLL into memory and
retrieves the address of the function. - At run time, the common language runtime marshals
the parameters from managed format to unmanaged
format.
29Code Reuse Tips and Tricks (cont.)
- Tip P/Invoking native DLLs doesnt circumvent
the virtual memory problem inherent with WinCE.
30Windows CE Memory Architecture Overview
- When WinCE starts, it creates a single 4-gigabyte
virtual address space with 33 process slots. - When a process initializes, the OS maps the
following - Some execute-in-place (XIP) DLLs
- Some read/write sections of other XIP DLLs
- All the non-XIP DLLs
- The stack
- The heap
- The data section for each process in the slot
assigned to the process - DLLs and ROM DLL read/write sections are loaded
at the top of the slot. DLLs are controlled by
the loader, which loads all the DLLs at the same
address for each process.
31Code Reuse Tips and Tricks (cont.)
- Tip Just like native code, you can manage the
native DLLs that are active in a managed
application. - You can test to see if a native DLL is loaded.
- You can preload all your native DLLs before
theyre used to test how your application
behaves. - You can unload a native DLL when youre finished
with it.
32Example Virtual Memory Management
- CDLL Native, C, DLL with two methods
exported. - fn42Cdll exported function that returns value
42. - fn99Cdll exported function that returns value
99. - DynamicLibraryTest Managed Compact Framework C
application that utilizes the two CDLL functions. - AnotherDllTest Managed Compact Framework C
applications that utilizes the same two CDLL
functions. - Windows CE Remote Process Viewer
33Tips/Tricks and Other Useful Tools
34Tips/Tricks and Other Useful Tools