// CWinAddrBook // // Created on: 12/22/2002 // Written by Sam C // // Contributors Source code I found on the web don't know where, but I have included the full source in the ZIP and if // anyone knows the author please let me know, Hirosh from CodeProject and his article entitled "Extracting Email ID's from an address book using Memory mapped file" // // License: I grant anyone the right to use or distribute this source code for personal or commercial purposes. The only restriction // is that you must keep the comments at top (the comment file you are reading now) intact, and no changes made to them whatsoever // // Copyright 2002 Stuffsoft // http://www.stuffsoft.com info@stuffsoft.com // #pragma once #include #include #include //Typedef the function pointer to WABOpen typedef HRESULT (WINAPI *fWABOpen)( LPADRBOOK* , LPWABOBJECT* , LPWAB_PARAM , DWORD ); typedef struct __EMAILS { string DisplayName; //char DisplayName[200]; string NickName; //char NickName[200]; string EmailAddr; //char EmailAddr[200]; } EMAILS, *LPEMAILS; class CWinAddrBook { public: CWinAddrBook(void); ~CWinAddrBook(void); // Module to library that is opened char PathToWAB[255]; //LPCWSTR PathToWAB; //If hModule is NULL then the library is not loaded yet HMODULE hModule; // Initialize the address book and load the values into memory (I hope) Return 0 if successful, anything else failed int InitAddrBook(void); vector AddrMemBook; private: // Pointer to the IAddressBook interface LPADRBOOK lpAddrBook; //Pointer to the WAB object itself that we are using LPWABOBJECT lpWABObject; // Pointer to the function inside of the wab32.dll for the open procedure fWABOpen ssWABOpen; // Load email addresses into the vector int LoadEmails(void); public: // Test mostly for debug purposes so you can step through and ensure that all the information is present for the address book vector //void TestAddrBook(void); // Tells if the class has already been initialized or it has not been initialized bool IsInit; };