Chapter 9. Harnessing the Windows CE API

Team-Fly    

  
eMbedded Visual Basic: Windows CE and Pocket PC Mobile Applications
By Chris Tacke, Timothy Bassett
Table of Contents


IN THIS CHAPTER

  • The Application Programming Interface

  • The API Text Viewer

  • Non-UDT API Examples

  • User-Defined Data Type Workaround

  • UDT API Examples

  • Transferring Data to and from a PC

This chapter isn't meant to be the definitive source for API programming in Windows CE. In fact, it covers only a small part of the available Win32 API functions. Although you will get a good understanding of how to call just about any API from any library, trying to cover even a majority of what the APIs can be used for is beyond the scope of a single book, let alone this chapter.

If you want more information and practice on what can be done with the API set, from graphics to menus to window behavior modifications, you can find plenty of information online as well as at bookstores. API calls in eVB are almost identical to API calls in Visual Basic 6, so any VB API source will be of use. To really get into the depths of the API, I recommend Dan Appleman's definitive Visual Basic Programmer's Guide to the Win32 API ( Sams Publishing, ISBN 0-672-31590-4).

If you've gone through every chapter of the book so far, you should have a strong understanding of how to write most any type of application for the PocketPC. However, undoubtedly sometimes eVB just doesn't expose the function or ability to do what you want. This chapter looks at how to go beyond the native eVB functions and call some of the C++ functions in the Windows CE Application Programming Interface (API). We'll look at how you declare API calls, where you can get the declaration prototypes , and how you can use them from within your eVB application. Because many API calls require User-Defined Data types (UDTs) and eVB doesn't support them, we'll also look at a workaround that will allow you to still use them.

In this chapter you'll see

  • What API calls are and how to declare them in eVB

  • How to use the API Text Viewer tool that comes with eVB

  • Some of the non-UDT requiring API calls

  • What UDTs are at memory level and how to work around eVB's lack of support for them

  • Some of the UDTs requiring API calls

In this chapter you won't be writing a sample application, but instead looking at many of the utility functions that you can use in other projects. By no means will we cover all the API calls, but this chapter should give you the know-how to look up and use most functions defined in the Windows CE API set.

Note

Unless otherwise noted, all code samples in this chapter can be found in the file modUtil.bas, which you can download from www.samspublishing.com (enter this book's ISBN in the Search field).



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