????? ??? ???? ??? ??????? ???????

?????? ????????? ?????? ?????????
???? ???????: 188482 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ??????? ?????? ???? ????? ??? ???? "??? ??????? ???????" ???????? ???? ??????? ???????? ?? ??? ??????. ????? ????? ????? ????? ?? ??????? ???????? ?? ???? ??? ??????? ???????. ????? ??? ?? ??? ???? ??? ??????? ???? ????? ??? pbGlobalProfileSectionGuid ?????? ??? ?????? ?????? ????? ??. ??? ?? ???? ??????? ?? ????? Edkmdb.h.

??????? ????

?? ???? ??????? ???????? ?? ????? ??? ??????? ???? ???? ?? "???? ??? ??????? ????????" ???? ????? ????? ????? ??????? ??????? (MAPI). ???? ???? ??? ????? ????? ?? ????? ????? ??????? ????? ???????? Microsoft Exchange. ??? ??????? ??? "????? ???????" ?????? ???????? ??????? ???????? ??? ??????? ??????? ???? ??? ???? ???? ???? ???????? ???? ???? ???? ????? ?????? ? ???? ???? ???? ??? ????? ???? ?????? ???? ??? ???????? ????? ??????.

???????? ???????? ??????? ???? ?? ????? ??? "???? ??? ??????? ????????" ???? ????? MAPI ?????? ??????? ??????? PR_PROFILE_HOME_SERVER:

??? ?????

   #include <objbase.h>
   #include <mapix.h>
   #include <mapidefs.h>
   #include <mapiguid.h>
   #include <edk.h>
   #include <edkmdb.h>


   HRESULT GetServerName()
   {
     HRESULT hRes = S_OK;   // HRESULT returned by this method
     LPPROFADMIN pAdminProfiles = NULL; // Pointer to IProfAdmin object
     LPSERVICEADMIN pSvcAdmin = NULL;  // Pointer to IServiceAdmin object
     LPPROFSECT pGlobalProfSect = NULL; // Pointer to IProfSect object
     LPSPropValue pProps = NULL; // Pointer to PropValue
                                // PR_PROFILE_HOME_SERVER
     char szServerName[256]; // String that will contain the server name
     // If your app doesn't already initialize the MAPI subsystem,
     // do it now.
     if ( FAILED ( hRes = MAPIInitialize ( NULL ) ) )
        return hRes;

     // Get a Profile admin object
     if ( FAILED ( hRes = MAPIAdminProfiles ( 0L, &pAdminProfiles ) ) )
        goto CleanUp;

     // Get a ServiceAdmin object
     if ( FAILED ( hRes = pAdminProfiles -> AdminServices (
                                           "<profile name>",
                                           NULL,
                                           0L,  // Your app's window handle
                                           0L,
                                           &pSvcAdmin ) ) )
       goto CleanUp;

      // Get the Global Profile Section by calling
      // IServiceAdmin::OpenProfileSection use pbGlobalProfileSectionGuid
      // defined in EDKMDB.H as the entry ID to request
      // The default return is an IProfSect interface.
      if ( FAILED ( hRes = pSvcAdmin -> OpenProfileSection (
                                  (LPMAPIUID)pbGlobalProfileSectionGuid,
                                  NULL,
                                  0L,
                                  &pGlobalProfSect ) ) )
         goto CleanUp;


      // Call HrGetOneProp to get PR_PROFILE_HOME_SERVER
      if ( FAILED ( hRes = HrGetOneProp ( pGlobalProfSect,
                                          PR_PROFILE_HOME_SERVER,
                                          &pProps ) ) )
         goto CleanUp;


      // Set Server name pointer to string equal to value returned from
      // HrGetOneProp
      strcpy ( szServerName, "PR_PROFILE_HOME_SERVER == " );
      strcat ( szServerName, pProps -> Value.lpszA );

      // Replace window handle param with your application's window handle
      MessageBox ( 0L, szServerName, "Exchange Server Name", MB_OK );

      CleanUp:

      // Free all memory allocated by any MAPI calls

      if ( NULL != pAdminProfiles )
         pAdminProfiles -> Release ();

      if ( NULL != pSvcAdmin )
         pSvcAdmin -> Release ( );

      if ( NULL != pGlobalProfSect )
         pGlobalProfSect -> Release ( );

      if ( NULL != pProps )
         MAPIFreeBuffer ( &pProps );

      pSvcAdmin = NULL;
      pGlobalProfSect = NULL;
      pProps = NULL;
      pAdminProfiles = NULL;

      // Return the HRESULT to the calling function
      return hRes;
      }
				
??????: ???? ?? ????? ???????? ??????? ?? ????? ????????:
Kernel32.lib, User32.lib ? Msvcrt.lib ? Mapi32.lib, Edkguid.lib ? ??? ??????? ???????? Edkdebug.lib Edkutils.lib Edkmapi.lib ?.
????? ????? ??? ????? ?????? ????? ?????? ????????? ?? ??????? ??????? ?????? ?? ????? ????????. ?????? ????? ???? ????????? ?? ??????? ??????? ???? ??? ????? ??????? ?????? ? ????? ???? ????? ??? ??? ?? ??? ?????? ???????.

?????? ?? ????? ??????? ?? ???? "??? ??????? ???????":
  • pr_profile_version
  • pr_profile_config_flags
  • pr_profile_home_server
  • pr_profile_home_server_dn
  • pr_profile_home_server_addrs
  • pr_profile_user
  • pr_profile_connect_flags
  • pr_profile_transport_flags
  • pr_profile_ui_state
  • pr_profile_unresolved_name
  • pr_profile_unresolved_server
  • pr_profile_binding_order
  • pr_profile_max_restrict
  • pr_profile_ab_files_path
  • pr_profile_offline_store_path
  • pr_profile_offline_info
  • pr_profile_addr_info
  • pr_profile_options_data
  • pr_profile_secure_mailbox
  • pr_disable_winsock
?????? ????? "????? ????? ????? ?????? ???????" ?????? ??? ???? ?? ????????? ??? ??? ?????? ????.

???????

???? ???????: 188482 - ????? ??? ??????: 13/???/1426 - ??????: 2.5
????? ???
  • Microsoft Office Outlook 2007
  • Microsoft Exchange Development Kit 5.5
  • Microsoft Exchange Development Kit 5.5
  • ????? ????? ??????? ??????? ?? Microsoft
????? ??????: 
kbmt kbapi kbhowto kbmsg KB188482 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????188482

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com