The API Text Viewer

Team-Fly    

 
eMbedded Visual Basic: Windows CE and Pocket PC Mobile Applications
By Chris Tacke, Timothy Bassett
Table of Contents
Chapter 9.  Harnessing the Windows CE API


Determining the contents of an API is made significantly easier with the use of the API Text Viewer, which is automatically installed with eMbedded Visual Tools in the \Windows CE Tools\BIN folder of your installation drive as APILOAD.EXE. The API Text Viewer can be used to open, browse, and seek through an API declaration file, which is simply a formatted text file that lists all an API's functions, constants, and structures (UDTs).

In Windows CE, most of the core Windows functionality is contained in the file Coredll.dll, and eVB comes with a API declaration file that covers most of Coredll.dll. The file is WINCEAPI.TXT and the default installation places it also in the \Windows CE Tools\BIN folder of your installation drive.

Running APILOAD.EXE presents you with the simple interface shown in Figure 9.1.

Figure 9.1. The API Viewer application.

graphics/09fig01.gif

Choosing Open from the File menu displays the Windows Open File dialog, which you can then use to navigate to and open WINCEAPI.TXT. Opening the API declaration file will immediately populate the Available Items list box in the middle of the form. This is the list of all functions, or declares, listed in the opened file. By changing the API Type combo box, you can also list all the defined constants.

Note

The combo box has Types as an option as well, but selecting Types gives you nothing in the Available Items list. This is because eVB doesn't natively support Types, which are simply UDTs or structures. We'll look at getting past this inconvenience later in the chapter. For now, just get used to using the API viewer to get function and constant declarations into an eVB project.


If you choose Declares and select a function to copy by either double-clicking its name or highlighting the name and clicking Add, you will see that the API declaration will be added to the Selected Items text box at the bottom of the form. The same can be done for Constants (see Figure 9.2).

Figure 9.2. The API Viewer after selecting the CharLower API declare and the ERROR_ACCESS_DENIED and ERROR_ADAP_HDW_ERR constants.

graphics/09fig02.gif

You can select any number and any combination of declares or constants, and when you've selected all the APIs you need, press Ctrl+C or click Copy to move the contents of the Selected Items to your Clipboard.

From there, simply paste the declarations into the top of your code module by choosing Paste from the Edit menu in the eVB IDE.


Team-Fly    
Top
 


eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net