www.pudn.com > mailserver-muiter.zip > InetServer.cpp


// InetServer.cpp : Defines the class behaviors for the application. 
// 
 
#include "stdafx.h" 
#include "InetServer.h" 
#include "InetServerDlg.h" 
#include "wrap2cmc.h"           //- MAPI use 
#include "tools.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
 
Wrap2CMC       CMCObject ;      //- MAPI use 
 
///////////////////////////////////////////////////////////////////////////// 
// CInetServerApp 
 
BEGIN_MESSAGE_MAP(CInetServerApp, CWinApp) 
	//{{AFX_MSG_MAP(CInetServerApp) 
		// NOTE - the ClassWizard will add and remove mapping macros here. 
		//    DO NOT EDIT what you see in these blocks of generated code! 
	//}}AFX_MSG 
	ON_COMMAND(ID_HELP, CWinApp::OnHelp) 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CInetServerApp construction 
 
CInetServerApp::CInetServerApp() 
{ 
 
	char tempstr1[255]; 
	sprintf(tempstr1,"%s",GetReg("Software\\InetServ","MapiEnabled")); 
	if (strcmpi(tempstr1,"TRUE")== 0) 
	{ 
	MAPILoadSuccess = true; 
    if ( CMCObject.CMCInit() == FALSE )  //- MAPI initialisation 
	{ 
		 
		MAPILoadSuccess = false; 
 
	} 
	} 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// The one and only CInetServerApp object 
 
CInetServerApp theApp; 
 
///////////////////////////////////////////////////////////////////////////// 
// CInetServerApp initialization 
 
BOOL CInetServerApp::InitInstance() 
{ 
	if (!AfxSocketInit()) 
	{ 
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED); 
		return FALSE; 
	} 
 
	// Standard initialization 
	// If you are not using these features and wish to reduce the size 
	//  of your final executable, you should remove from the following 
	//  the specific initialization routines you do not need. 
 
#ifdef _AFXDLL 
	Enable3dControls();			// Call this when using MFC in a shared DLL 
#else 
	Enable3dControlsStatic();	// Call this when linking to MFC statically 
#endif 
 
	CInetServerDlg dlg; 
	m_pMainWnd = &dlg; 
 
 
	dlg.MAPILoadSuccess = MAPILoadSuccess; 
	int nResponse = dlg.DoModal(); 
	if (nResponse == IDOK) 
	{ 
		// TODO: Place code here to handle when the dialog is 
		//  dismissed with OK 
	} 
	else if (nResponse == IDCANCEL) 
	{ 
		// TODO: Place code here to handle when the dialog is 
		//  dismissed with Cancel 
	} 
 
	// Since the dialog has been closed, return FALSE so that we exit the 
	//  application, rather than start the application's message pump. 
	return FALSE; 
}