#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
#import <cdosys.dll> no_namespace rename("EOF", "EndOfFile")
............
void CSavemhtDlg::OnOK()
{
// save url as a single file, in fact I don't know if it is mht file, but it can be opened by IE, can someone tell me?
CoInitialize(NULL);
{
IMessagePtr iMsg(__uuidof(Message));
IConfigurationPtr iConf(__uuidof(Configuration));
iMsg->Configuration = iConf;
try
{
iMsg->CreateMHTMLBody(
"http://example.microsoft.com",
cdoSuppressNone,
"domain\\username",
"password");
}
catch(_com_error err)
{
// handle exception
}
_StreamPtr pStream=iMsg->GetStream();
pStream->SaveToFile("test.mht",adSaveCreateOverWrite);
}
CoUninitialize();
}