Visual Basic

The Windows CE Desktop Emulator

The Windows CE Desktop Emulator is a program supplied with the Windows CE Platform Software Development Kit (and also supplied with the Windows CE toolkit). The emulator is a program that runs the Windows CE operating system on your desktop. You can start the emulator by running the program manually, or it is started automatically when you run a Windows CE application from Visual Basic after having selected the target device as Emulator. You can write, test, and run your applications wholly within the emulator without having a physical HPC device at all. The Start menu of the emulator is really a dummy menu-you cannot use it to access any of the programs loaded in the emulator. To browse and copy files within the emulator's environment, you need to run the My Handheld PC program from the desktop. Even from here not all the programs will run in the emulator, though your Visual Basic programs will. The emulator's file system is stored in the object store (essentially an OBS file), meaning that you cannot copy or move files between your PC and the emulator using standard methods like drag-and-drop. To do this you need to use the program EMPFILE.EXE, which you can find in the \wce\emul\hpc\Windows folder in the Windows CE Platform SDK folder. The location of the Windows CE Platform SDK folder obviously depends on your installation options. The following listing shows the Help information that the program displays when run from an MS-DOS window:

  C:\Program Files\Windows CE Platform SDK\wce\emul\hpc\windows>empfile
  USAGE:  EMPFILE [options]...
  options:
   -c SOURCE DEST  ('put' or 'get' a file from object store)
   -d FILE         (delete a file on object store)
   -e FILE         (check to see if a file exists on object store)
   -s              (synchronize object store with wce\emul\PLATFORM\ tree)
   -r MYAPP ARGS   (run myapp.exe in the object store with arguments ARGS)
  examples:
     EMPFILE -s
             (Synchronize wce\emul\PLATFORM\ tree with object store)
     EMPFILE -c c:\test.exe wce:windows\test.exe
             (Copy c:\test.exe to object store's Windows\ directory)
     EMPFILE -c wce:test.exe c:\test.exe
             (Copy test.exe from object store to c:\)
     EMPFILE -e windows\text.exe
             (verify that test.exe Exists in object store's
             Windows\ directory)
     EMPFILE -d test.txt
             (Delete test.txt from object store root directory)
     EMPFILE -r test.exe -10
             (Run test.exe from object store with parameter "-10")

You can use EMPFILE to copy files to and from the emulator and also to synchronize databases between the emulator and your PC. If you write any programs that require external files (such as bitmaps), you need to use EMPFILE to copy those files to the emulator so that these files are available when you run your program under the emulator.