Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
New applications should not use this set of interfaces. These interfaces exist for backward compatibility with legacy applications. These interfaces will be unavailable in the future.
Note
In Windows Vista, Windows Contacts replaces Windows Address Book (WAB). For more information about this new mechanism for storing and retrieving contact information, see Windows Contacts.
Windows provides an address book for storing contact information. The WAB is an application and service that enables users to keep track of people. The WAB has a local database and user interface for finding and editing information about people, and it can query network directory servers using Lightweight Directory Access Protocol (LDAP). Other applications can use the WAB. For example, Microsoft Outlook uses the WAB as its e-mail address book.
The following topics are discussed in this document.
The Wab.exe program is included with Windows 98 and later. This address book application enables you to:
When you invoke Wab.exe, it creates and searches the file named Username.wab which is found in the Application Data directory. For specific information on using the Wab.exe program, see the Knowledge Base Article Q164531 and the Electronic Mail section of the Windows 98 Resource Kit.
The WAB provides an API that enables other applications to directly use its database and user interface services; therefore, you can write programs that include address books. The WAB API is based on MAPI, but the WAB does not use or require MAPI. The WAB interfaces support many of the methods used by MAPI, and because they inherit from IUnknown, they have the standard AddRef, Release, and QueryInterface methods. The WAB also has functions that provide access to the object interfaces.
If you want to use the WAB, you must register your application to use the Wab32.dll as a shared DLL. Registering Wab32.dll as a shared DLL prevents it from being inadvertently uninstalled while your application is running. To accomplish the registration, you must increment the reference count of the Wab32.dll in the SharedDLLs section of the registry.
HKLM\Software\Microsoft\Windows\CurrentVersion\SharedDLLs
The steps to increment the reference count are:
Look in the registry under:
HKLM\Software\Microsoft\WAB\DLLPath
The default value under this key gives the path of any WAB DLL installed on the computer.
This DLL path is defined in Wabapi.h as WAB_DLL_PATH_KEY.
If you include Wabapi.h in your application, use WAB_DLL_PATH_KEY as the name of the key to open.
Look in the registry under:
HKLM\Software\Microsoft\Windows\CurrentVersion\
SharedDLLs
Find the value <Full WAB32 Path>.
Increment the reference count by one and save the incremented value back to the registry.
With Microsoft Internet Explorer 4.0 or later, Wab32.dll is set in the registry at
HKLM\Software\Microsoft\WAB\DLLPath
Load the DLL at run time only if the key is not in the registry, if the path set in the key is invalid, or if you are using a version of Windows Internet Explorer earlier than Internet Explorer 4.0.
If you need to load the DLL, call LoadLibrary.
To use WAB in your application, you must create and initialize the first instance of IWABObject. The following code sample demonstrates how to do this.
LPWABOPEN lpfnWABOpen = NULL; // Defined in Wabapi.h.
HINSTANCE hinstWAB = NULL;
// Initialize <tla rid="tla_wab" /> and get an instance
// of IWABObject.
HRESULT InitWAB (LPWABOBJECT *lppWABObject, LPADRBOOK
*lppAdrBook)
{
HRESULT hr = E_FAIL;
hinstWAB = LoadLibrary_WABDll();
{
if (hinstWAB)
{
lpfnWABOpen = (LPWABOPEN) GetProcAddress
(hinstWAB, "WABOpen");
if (lpfnWABOpen)
hr = lpfnWABOpen (lppAdrBook, lppWABObject,
NULL, 0);
}
}
return hr;
}
Conceptual
Please sign in to use this experience.
Sign in