Microsoft KB Archive/126658

= PC MAPI: Sample C Code for MAPIAddress Function Call =

Article ID: 126658

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Mail for PC Networks 3.0
 * Microsoft Mail for PC Networks 3.2

-



This article was previously published under Q126658



SUMMARY
The simple messaging application program interface (MAPI) for Microsoft Mail for PC Networks includes a function that allows developers to access the address list user interface.

The following C code illustrates a successful call to this function. This example allows address browsing only. The code was compiled, linked, and ran successfully using Microsoft Visual C++, version 1.5.



MORE INFORMATION
/* start code for MAPIAddress call */ #include   #include    #include 

lpMapiRecipDesc lppNewRecips;

int main(void) {    LHANDLE lhSession; ULONG rc, lpnNewRecips = 0;

rc = MAPILogon(0L, "", "", MAPI_LOGON_UI, 0L, &lhSession);

rc = MAPIAddress(lhSession, 0L, NULL, 0L, NULL, 0L, NULL, 0L, 0L, \     &lpnNewRecips, &lppNewRecips);

if( rc != SUCCESS_SUCCESS ) printf("MAPIAddress failed with %d", rc);

rc=MAPIFreeBuffer(lppNewRecips);/* free the memory used by MAPIAddress */

rc = MAPILogoff(lhSession, 0L, 0L, 0L);

return (0);

}  /* end code */ For more information, please see the Microsoft Mail "Technical Reference," pages 96-98.

Additional query words: 3.00 3.20 MAPI address function

Keywords: KB126658

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.