home *** CD-ROM | disk | FTP | other *** search
- #include "IterateUsers.h"
- #include "MDUserImports.h"
- #include <iostream>
- using namespace std;
-
- int main(int argc, char** argv)
- {
-
- // Before calling any of the MDaemon functions you must first load the DLL
-
- int iLoadResult = 0;
- if (!LoadMDUserDll(iLoadResult, // buffer to store error result code
- NULL, // Optional path to the dll
- false)) // TRUE if you want the accounts loaded into memory after the dll has been initialized
- {
- cout << "Could not load the MDUserDll, error:" << iLoadResult << "\n";
- return -1;
- }
-
-
-
- MD_HANDLE hUser;
- MD_FINDHANDLE hFind = MD_FindFirst(&hUser);
- if (hFind != MD_BADFINDHANDLE)
- {
- do {
- MD_UserInfo UserInfo;
- MD_GetUserInfo(hUser, &UserInfo);
- cout << "Found user: " << UserInfo.Email << "\n";
- } while (MD_FindNext(hFind, &hUser));
-
- MD_FindClose(hFind);
- }
- else
- {
- // There was an error finding the first user
- cout << "Error finding the first MDaemon user\n";
- }
-
-
- // Release the MDUserDLL
- FreeMDUserDll();
-
- return 0;
- }