<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Windows Address Book (WAB)]]></title><description><![CDATA[<p>Wie kann benutzen &quot;Windows Address Book&quot; in MS Visual C++?<br />
Mir interessiert Benutzung des Handy Nummers.<br />
Ich habe gefunden Benutzung des e-mails:</p>
<pre><code class="language-cpp">// Load email addresses into the vector
int CWinAddrBook::LoadEmails(void)
{
	HRESULT hr = E_FAIL;

	if (ssWABOpen==NULL) return 1; //ssWABOpen cannot be NULL
	{
		ULONG lpcbEntryID;
		ENTRYID* lpEntryID;

		hr = lpAddrBook-&gt;GetPAB(&amp;lpcbEntryID, &amp;lpEntryID);
		if (hr!=S_OK) return 10; //error opening the darn PAB

		//Declare variables for MAPI and specific access to the PAB
		ULONG ulFlags = MAPI_BEST_ACCESS,
			  ulObjType = NULL;
		LPUNKNOWN lpIUnknown = NULL;
		hr = lpAddrBook-&gt;OpenEntry(lpcbEntryID,
								   lpEntryID,
								   NULL,
								   ulFlags,
								   &amp;ulObjType,
								   &amp;lpIUnknown);

		ulFlags = NULL; //We are using it again :)

		if (ulObjType==MAPI_ABCONT) //See if an address book container was passed which we are looking for
		{
			IABContainer* lpABContainer = static_cast&lt;IABContainer*&gt;(lpIUnknown); //cast the IUnknown pointer returned from previous function to what we need
			LPMAPITABLE lpMAPItbl = NULL;
			hr = lpABContainer-&gt;GetContentsTable(ulFlags, &amp;lpMAPItbl);
			ASSERT(lpMAPItbl);

			ULONG ulRows; //Number of rows in the MAPI table (Addresses)
			hr = lpMAPItbl-&gt;GetRowCount(0, &amp;ulRows);
				if (hr!=S_OK) return 11; //Return 11 to tell them we where unable to get the row count

			SRowSet* lpRowSet;
			hr = lpMAPItbl-&gt;QueryRows(		//Return all the rows found in the address book
									ulRows,									
									0,
									&amp;lpRowSet);

			//Grow variable
			AddrMemBook.resize(lpRowSet-&gt;cRows);
			//char Match[200]; strset(Match, 0);

			for (ULONG x = 0; x &lt; lpRowSet-&gt;cRows; x++) 
			{
				//Loop through all the rows and add it to our address book
				//vector variable
				EMAILS thisAddr;											

				SRow* lpRow = &amp;lpRowSet-&gt;aRow[x]; //Get this specific row
				for (ULONG y = 0; y &lt; lpRow-&gt;lpProps; y++)
				{

				}
				for (ULONG y = 0; y &lt; lpRow-&gt;cValues; y++)
				{
					//Loop through the fields in the address book and assign
					//to our variable and put it in the address book variable					
    					SPropValue* lPropVal = &amp;lpRow-&gt;lpProps[y];
					switch (lPropVal-&gt;ulPropTag)
					{
					case PR_DISPLAY_NAME_A:		
						thisAddr.DisplayName = lPropVal-&gt;Value.lpszA;						
						//strcpy(thisAddr-&gt;DisplayName, lPropVal-&gt;Value.lpszA);
						break;

					case PR_EMAIL_ADDRESS_A:						
						thisAddr.EmailAddr = lPropVal-&gt;Value.lpszA;
						if (strchr(thisAddr.EmailAddr.c_str(), '@')==NULL) //replace with empty string
							thisAddr.EmailAddr='\0';
						//strcpy(thisAddr-&gt;EmailAddr, lPropVal-&gt;Value.lpszA);						
						break;

					case PR_NICKNAME_A:						
						thisAddr.NickName = lPropVal-&gt;Value.lpszA;
						//strcpy(thisAddr-&gt;NickName, lPropVal-&gt;Value.lpszA);
						break;

					default:
						break;
					}

				}//End of cycling through fields
				//Add the information to the vector variable				
				if (!thisAddr.EmailAddr.empty()) 
					AddrMemBook.push_back(thisAddr);				

				lpWABObject-&gt;FreeBuffer(lpRow);

			}//End of cycling through rows
			lpWABObject-&gt;FreeBuffer(lpRowSet);
		}
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/127067/windows-address-book-wab</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 15:04:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127067.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Nov 2005 09:34:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Windows Address Book (WAB) on Mon, 21 Nov 2005 09:34:16 GMT]]></title><description><![CDATA[<p>Wie kann benutzen &quot;Windows Address Book&quot; in MS Visual C++?<br />
Mir interessiert Benutzung des Handy Nummers.<br />
Ich habe gefunden Benutzung des e-mails:</p>
<pre><code class="language-cpp">// Load email addresses into the vector
int CWinAddrBook::LoadEmails(void)
{
	HRESULT hr = E_FAIL;

	if (ssWABOpen==NULL) return 1; //ssWABOpen cannot be NULL
	{
		ULONG lpcbEntryID;
		ENTRYID* lpEntryID;

		hr = lpAddrBook-&gt;GetPAB(&amp;lpcbEntryID, &amp;lpEntryID);
		if (hr!=S_OK) return 10; //error opening the darn PAB

		//Declare variables for MAPI and specific access to the PAB
		ULONG ulFlags = MAPI_BEST_ACCESS,
			  ulObjType = NULL;
		LPUNKNOWN lpIUnknown = NULL;
		hr = lpAddrBook-&gt;OpenEntry(lpcbEntryID,
								   lpEntryID,
								   NULL,
								   ulFlags,
								   &amp;ulObjType,
								   &amp;lpIUnknown);

		ulFlags = NULL; //We are using it again :)

		if (ulObjType==MAPI_ABCONT) //See if an address book container was passed which we are looking for
		{
			IABContainer* lpABContainer = static_cast&lt;IABContainer*&gt;(lpIUnknown); //cast the IUnknown pointer returned from previous function to what we need
			LPMAPITABLE lpMAPItbl = NULL;
			hr = lpABContainer-&gt;GetContentsTable(ulFlags, &amp;lpMAPItbl);
			ASSERT(lpMAPItbl);

			ULONG ulRows; //Number of rows in the MAPI table (Addresses)
			hr = lpMAPItbl-&gt;GetRowCount(0, &amp;ulRows);
				if (hr!=S_OK) return 11; //Return 11 to tell them we where unable to get the row count

			SRowSet* lpRowSet;
			hr = lpMAPItbl-&gt;QueryRows(		//Return all the rows found in the address book
									ulRows,									
									0,
									&amp;lpRowSet);

			//Grow variable
			AddrMemBook.resize(lpRowSet-&gt;cRows);
			//char Match[200]; strset(Match, 0);

			for (ULONG x = 0; x &lt; lpRowSet-&gt;cRows; x++) 
			{
				//Loop through all the rows and add it to our address book
				//vector variable
				EMAILS thisAddr;											

				SRow* lpRow = &amp;lpRowSet-&gt;aRow[x]; //Get this specific row
				for (ULONG y = 0; y &lt; lpRow-&gt;lpProps; y++)
				{

				}
				for (ULONG y = 0; y &lt; lpRow-&gt;cValues; y++)
				{
					//Loop through the fields in the address book and assign
					//to our variable and put it in the address book variable					
    					SPropValue* lPropVal = &amp;lpRow-&gt;lpProps[y];
					switch (lPropVal-&gt;ulPropTag)
					{
					case PR_DISPLAY_NAME_A:		
						thisAddr.DisplayName = lPropVal-&gt;Value.lpszA;						
						//strcpy(thisAddr-&gt;DisplayName, lPropVal-&gt;Value.lpszA);
						break;

					case PR_EMAIL_ADDRESS_A:						
						thisAddr.EmailAddr = lPropVal-&gt;Value.lpszA;
						if (strchr(thisAddr.EmailAddr.c_str(), '@')==NULL) //replace with empty string
							thisAddr.EmailAddr='\0';
						//strcpy(thisAddr-&gt;EmailAddr, lPropVal-&gt;Value.lpszA);						
						break;

					case PR_NICKNAME_A:						
						thisAddr.NickName = lPropVal-&gt;Value.lpszA;
						//strcpy(thisAddr-&gt;NickName, lPropVal-&gt;Value.lpszA);
						break;

					default:
						break;
					}

				}//End of cycling through fields
				//Add the information to the vector variable				
				if (!thisAddr.EmailAddr.empty()) 
					AddrMemBook.push_back(thisAddr);				

				lpWABObject-&gt;FreeBuffer(lpRow);

			}//End of cycling through rows
			lpWABObject-&gt;FreeBuffer(lpRowSet);
		}
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/923063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923063</guid><dc:creator><![CDATA[indrekm]]></dc:creator><pubDate>Mon, 21 Nov 2005 09:34:16 GMT</pubDate></item></channel></rss>