Click here to Skip to main content
16,012,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalfunction to set the combobox visible Pin
ask_you22-Jun-04 17:54
ask_you22-Jun-04 17:54 
GeneralRe: function to set the combobox visible Pin
bneacetp22-Jun-04 18:06
bneacetp22-Jun-04 18:06 
GeneralRe: function to set the combobox visible Pin
ask_you22-Jun-04 18:21
ask_you22-Jun-04 18:21 
GeneralRe: function to set the combobox visible Pin
bneacetp22-Jun-04 18:26
bneacetp22-Jun-04 18:26 
GeneralGray Bitmap Pin
Shuang. Wu22-Jun-04 16:45
Shuang. Wu22-Jun-04 16:45 
Questionalert when other computer (on our Local Area Networck) Explorering our computer ??? Pin
ngocdq22-Jun-04 16:42
ngocdq22-Jun-04 16:42 
Generalmail server Pin
gamitech22-Jun-04 13:48
gamitech22-Jun-04 13:48 
GeneralRe: mail server Pin
Muthukumar22-Jun-04 18:13
Muthukumar22-Jun-04 18:13 
If you are using MAPI try this. You should have a profile name supplied.

<br />
HRESULT GetServerName(LPSTR rszProfileName)<br />
{<br />
     HRESULT hRes = S_OK;   <br />
     LPPROFADMIN pAdminProfiles = NULL; <br />
     LPSERVICEADMIN pSvcAdmin = NULL;  <br />
     LPPROFSECT pGlobalProfSect = NULL;<br />
     LPSPropValue pProps = NULL; <br />
                                <br />
     // Get a Profile admin object<br />
     if ( FAILED ( hRes = MAPIAdminProfiles ( 0L, &pAdminProfiles ) ) )<br />
        return hRes ;<br />
<br />
     // Get a ServiceAdmin object<br />
     if ( FAILED ( hRes = pAdminProfiles -> AdminServices (<br />
                                           rszProfileName,<br />
                                           NULL,<br />
                                           0L,  // Your app's window handle<br />
                                           0L,<br />
                                           &pSvcAdmin ) ) )<br />
        return hRes ;<br />
<br />
      // Get the Global Profile Section by calling<br />
      // IServiceAdmin::OpenProfileSection use pbGlobalProfileSectionGuid<br />
      // defined in EDKMDB.H as the entry ID to request<br />
      // The default return is an IProfSect interface.<br />
      if ( FAILED ( hRes = pSvcAdmin -> OpenProfileSection (<br />
                                  (LPMAPIUID)pbGlobalProfileSectionGuid,<br />
                                  NULL,<br />
                                  0L,<br />
                                  &pGlobalProfSect ) ) )<br />
        return hRes ;<br />
<br />
<br />
      // Call HrGetOneProp to get PR_PROFILE_HOME_SERVER<br />
      if ( FAILED ( hRes = HrGetOneProp ( pGlobalProfSect,<br />
                                          PR_PROFILE_HOME_SERVER,<br />
                                          &pProps ) ) )<br />
        return hRes ;<br />
<br />
      CString m_strServerName = pProps -> Value.lpszA ;<br />
<br />
      if ( NULL != pAdminProfiles )<br />
         pAdminProfiles -> Release ();<br />
<br />
      if ( NULL != pSvcAdmin )<br />
         pSvcAdmin -> Release ( );<br />
<br />
      if ( NULL != pGlobalProfSect )<br />
         pGlobalProfSect -> Release ( );<br />
<br />
      if ( NULL != pProps )<br />
         MAPIFreeBuffer ( &pProps );<br />
<br />
      pSvcAdmin = NULL;<br />
      pGlobalProfSect = NULL;<br />
      pProps = NULL;<br />
      pAdminProfiles = NULL;<br />
<br />
      // Return the HRESULT to the calling function<br />
      return hRes;<br />
}<br />


The above code might have some variables not declared. Pls check it out before using.

Muthukumar.V
Home: WWW.CoderSource.Net
GeneralRe: mail server Pin
Anonymous22-Jun-04 19:23
Anonymous22-Jun-04 19:23 
GeneralRe: mail server Pin
Paul Ranson23-Jun-04 5:05
Paul Ranson23-Jun-04 5:05 
GeneralHyperlink Pin
x-trate22-Jun-04 13:18
x-trate22-Jun-04 13:18 
GeneralRe: Hyperlink Pin
Graham Bradshaw22-Jun-04 14:13
Graham Bradshaw22-Jun-04 14:13 
Generalproblems with ShowWindow() Pin
AmericanBacon22-Jun-04 12:26
AmericanBacon22-Jun-04 12:26 
GeneralRe: problems with ShowWindow() Pin
gamitech22-Jun-04 12:38
gamitech22-Jun-04 12:38 
GeneralRe: how to cast cstring into char*? Pin
James R. Twine22-Jun-04 11:05
James R. Twine22-Jun-04 11:05 
GeneralChange Icon in Dialog Titlebar Pin
YooVeeAy22-Jun-04 11:00
YooVeeAy22-Jun-04 11:00 
GeneralRe: Change Icon in Dialog Titlebar Pin
bneacetp22-Jun-04 13:49
bneacetp22-Jun-04 13:49 
GeneralCPropertySheet::OnInitDialog() exception Pin
Richard John22-Jun-04 10:57
Richard John22-Jun-04 10:57 
GeneralRe: CPropertySheet::OnInitDialog() exception Pin
bangiev5-May-11 5:20
bangiev5-May-11 5:20 
GeneralBringing desktop window to the top without taking focus Pin
casid22-Jun-04 9:47
casid22-Jun-04 9:47 
GeneralRe: Bringing desktop window to the top without taking focus Pin
casid22-Jun-04 9:49
casid22-Jun-04 9:49 
Generalconcatenation Pin
RabiaRabia22-Jun-04 9:24
RabiaRabia22-Jun-04 9:24 
GeneralRe: concatenation Pin
ov22-Jun-04 9:30
ov22-Jun-04 9:30 
GeneralRe: concatenation Pin
gamitech22-Jun-04 12:44
gamitech22-Jun-04 12:44 
QuestionHow to remove this error Pin
RabiaRabia22-Jun-04 9:21
RabiaRabia22-Jun-04 9:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.