Example Application - World Time - Timex M851 Design Manual

Wristapp gui plug-in
Hide thumbs Also See for M851:
Table of Contents

Advertisement

M851 WristApp GUI Plug-in Design Guide
}
extern "C" BOOL FAR PASCAL EXPORT ProcessData(LPCTSTR lpszDataPath, LPVOID pData)
{
//Need to use this macro whenever we access resources from MFC DLL
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CString sINIFile = lpszDataPath;
sINIFile += "TestApp.ini";
theApp.CreateDatabase(sINIFile);
return TRUE;
}
Please note that the CreateDatabase routine defined above is a generic function that could be called to
create the actual WristApp database.
After adding these two functions, you must then add the function names to the DEFinition file. Open
TEST.DEF and add the two functions as shown:
3.2.4
Example application – World Time
The World Time WristApp that comes with the Timex Data Link USB has a user interface that allows you
to configure the different time zones within the WristApp.
As described above, the Show and ProcessData functions are called by the PIM to launch the GUI Plug-
in. In the World Time WristApp Plug-in, created using Microsoft's Visual C++ with MFC libraries, there is a
dialog class that handles such messages as WM_INITDIALOG, BN_CLICKED for the OK and Cancel
buttons, as well as WM_DESTROY. In addition to the dialog class, there is an app class based on the
CWinApp base class which has routines for saving the World Time database.
The pseudo-code below shows how the World Time GUI Plug-in works. Please refer to the included
source code for the actual functionality:
Show
{
Instantiate the app class
Initialize the character mapping for the watch
Initialize the World Time dialog
{
Load the World Time cities from the INI file
Fill the list view with the city data
Enter message loop (exit on OK, Canel, or Close events)
Timex Corporation
Rev 1.0
6

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents