Additional Porting Considerations

If you port a Windows-based application to the Microsoft® Windows NT® or Microsoft Windows® 95/98 operating system and do not need to maintain compatibility with Windows, you can change your DB-Library code to remove redundant or unnecessary Windows functions.

Redundant Windows-specific DB-Library Functions

The dbwinexit function is Windows-specific and unnecessary in DB-Library for the Microsoft Win32® API.

Error/Message Handler Registration

The following changes apply to the registration of error and message handlers for the Win32 API:

Preemptive Multitasking (Win32) vs. Cooperative Multitasking (Windows)

To support asynchronous processing in the cooperative multitasking environment in Windows, each application must behave well and yield to the CPU at regular intervals. Therefore, when you process Microsoft SQL Server™ queries in Windows, you need to use Windows timers or the PeekMessage function in combination with the DB-Library function calls for asynchronous processing (dbsqlsend, dbdataready, and dbsqlok).

Support for preemptive multitasking in the Win32 API simplifies the implementation of asynchronous query processing. The preemptive multitasking nature of the Windows NT and Windows 95/98 operating systems ensures that other processes always obtain CPU cycles regardless of any processing that another application is doing. Within a single process, asynchronous processing can be implemented using Win32 threads or by using the DB-Library functions that support asynchronous processing in conjunction with the PostMessage Windows function. For more information about asynchronous processing, see Taking Advantage of Win32 API Features in DB-Library Applications.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.