Skip to main content
Visual C++ Samples 
MantaWeb Sample: Online Personal Information Management 

Download sample

Demonstrates how to use ATL Server to build a personal information management Web site that includes e-mail, scheduling and task lists, and a file store.

The MantaWeb sample includes the following features:

  • Use of attributed and nonattributed programming for easy comparison

  • Use of persistent and session cookies

  • Heavy use of stenciled pages to separate dynamic and static content

  • Use of ATL Server validation and exchange support

  • Use of SMTP classes for e-mail support

  • Mail XML Web service with native client for stand-alone e-mail access


Because JET components are not supported on the 64-bit versions of Microsoft Windows, this sample only works with the 32-bit versions.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.


  • IIS


    On Windows Server 2003, your machine must be configured as an Application Server.

Building and Running the Sample

To build the sample and set up the Web site

  1. Create the following folders on your machine.


    Note that if you do not use the suggested paths, you will have to change the hardcoded strings in \Common\MWS_Common.h and \FileStore\FilesHandler.h.

  2. Set permission for the IUSR_machinename user for C:\MantaWebSample\Database and C:\MantaWebSample\FileStore to allow read and write operations.

    To do this, right-click the MantaWebSample folder and click Properties. The Properties dialog box appears. Click the Security tab, and then click Add. In the Select Users, Computers, or Groups dialog box, ensure that Object Types includes Users, click Locations and select the local machine, and then enter IUSR_machinename in Enter the object names to select box. Click Check Names. An entry for Internet Guest Account will appear in the Properties dialog box; in the lower pane, select Read and Write. Click OK. This sets the permissions to allow read and write access for the folder and both subfolders.

  3. Copy manta\MantaWeb\MantaWeb.mdb to the C:\MantaWebSample\Database directory. Ensure that the database file is not read-only.

  4. Open the solution file, MantaWeb.sln, in the Visual Studio integrated development environment.

  5. Build the solution. This will also deploy the solution to the local Web server.

  6. Use the Internet Information Services Manager to add login.srf as a default document for the MantaWeb virtual directory. Right-click My Computer. On the shortcut menu, click Manage. In the Computer Management dialog box, open Internet Information Services, then Web Sites, and then Default Web Site.

  7. Use Internet Explorer to view http://localhost/mantaweb/.

    If you change the virtual directory that the MantaWeb solution deploys to, you will need to take the following steps to update the MFC mail client:

    1. Open the mailservice.h file in the MailClientMFC project.

    2. On line 75, change the string passed to the TClient base constructor to reflect the changes made to the path on the Web server.

    3. Build the MailClientMFC project.

To use the Web site

  1. Use a Web browser to view http://localhost/mantaweb/login.srf.

  2. Sign up for an account. Provide values for all requested information.

  3. Log in to the site.

  4. Use the site to send mail and manage your personal information.


By default, the MantaWeb sample will not send mail through the localhost SMTP server unless the following preprocessor defines are set: SEND_CONFIRMATION_MAIL, SEND_FORGOTPASS_MAIL, and SEND_OUTGOING_MAIL. You can uncomment the preprocessor #defines in \Common\MWS_Common.h.

This sample was written so that developers can learn about ATL Server without having to have SQL Server installed. It is strongly recommended that you use SQL Server for your Web-based applications because of its enhanced security features. It is also strongly recommended that you use SQL Server stored procedures wherever possible for your database logic.

Project Layout

The project layout of MantaWeb is as follows:

Folder Description


Nonattributed ATL Server application DLL project that provides a task list and basic calendar and scheduling support.


Folder holding header files used by all application DLL projects.


Nonattributed ATL Server application DLL project that provides an online file management system.


Attributed ATL Server application DLL project that provides for user signup and login.


Attributed ATL Server application DLL project that provides the mailbox functionality to the Web site.


XML Web service MFC client that uses the MantaWeb's XML Web service to check e-mail.


Attributed ATL Server application DLL project that provides the mail XML Web service and discovery of the XML Web service.


Attributed ATL Server application DLL project that provides session checking and profile management.


Nonattributed ATL Server ISAPI DLL project.


Folder holding all images used on the Web site.


BEGIN_HANDLER_MAP | BEGIN_REPLACEMENT_METHOD_MAP | CAccessorRowset::Close | CAtlFile::Create | CAtlFile::Read | CCookie::AddValue | CCookie::SetDiscard | CCookie::SetExpires | CCookie::SetName | CCookie::SetPath | CCryptHash::AddData | CCryptHash::GetSize | CCryptHash::GetValue | CCryptProv::GenRandom | CCryptProv::Initialize | CDataConnection | CHttpRequest::Cookies | CHttpRequest::GetFirstFile | CHttpRequest::GetFirstFormVar | CHttpRequest::GetFormVars | CHttpRequest::GetNextFile | CHttpRequest::GetNextFormVar | CHttpRequest::GetQueryParams | CHttpRequest::GetServerContext | CHttpRequestParams::Lookup | CHttpResponse::AppendCookie | CHttpResponse::AppendHeader | CHttpResponse::ClearResponse | CHttpResponse::Flush | CHttpResponse::Redirect | CHttpResponse::SendHeadersInternal | CHttpResponse::SetContentType | CIsapiExtension::GetExtensionVersion | CIsapiExtension::TerminateExtension | CIsapiWorker::GetWorkerData | CMimeHeader::AddRecipient | CMimeHeader::SetSender | CMimeHeader::SetSenderName | CMimeHeader::SetSubject | CMimeMessage::AddText | COleDateTime::GetCurrentTime | COleDateTime::GetDay | COleDateTime::GetDayOfWeek | COleDateTime::GetHour | COleDateTime::GetMinute | COleDateTime::GetMonth | COleDateTime::GetStatus | COleDateTime::GetYear | COleDateTime::ParseDateTime | COleDateTime::SetDate | COleDateTime::SetStatus | COleDateTimeSpan | CRequestHandlerT | CRequestHandlerT::m_HttpRequest | CRequestHandlerT::m_HttpResponse | CRequestHandlerT::ValidateAndExchange | CSMTPConnection::Connect | CSMTPConnection::SendMessage | CStringT::Format | CValidateObject::Exchange | CValidateObject::Validate | CWriteStreamHelper::operator << | db_column | db_command | db_param | EscapeToCString | export | GetDataSource | HANDLER_ENTRY | HTTP_CODE | IHttpServerContext::WriteClient | IRequestHandlerImpl::m_spServiceProvider | REPLACEMENT_METHOD_ENTRY | REPLACEMENT_METHOD_ENTRY_EX | request_handler | soap_handler | soap_method | tag_name

See Also