用VC,不出现“另存为。。”对话框。
解决方案 »
- SHGetFolderPath 函数的问题
- bmp转jpg
- 怎样才能将MFC学扎实!
- 关于坐标的问题!!!
- 请问高手在哪里??openGL中如何从屏幕坐标得到场景坐标?
- 如何让一CControlBar在Resize的时候,不是立刻将大小变化,而是先让一条虚线表示Border将移动到那里.以此解决窗口不断Repaint的问题.
- 关于CString的问题.高手请进!!!
- vc6.0编写的windows服务程序如何处理消息
- 高分在线:多文档转单文档问题!!!
- 有那位兄弟写过menubar的。给偶一个。
- 数据库中对于日期的查询(ODBC+VC6)
- 关于CColorDialog的问题。请各路朋友进来看看!
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")
#import <cdosys.dll> no_namespace rename("EOF", "EndOfFile")//代码
void CAssetReportDlg::OnButtonSave()
{
GetDlgItem(IDC_BUTTON_SAVE)->EnableWindow(FALSE);
CFileDialog fdlg(FALSE,
"mht",
m_FileNameCN,
OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
"Web档案,单一文件(*.mht)|*.mht||");
if(IDOK == fdlg.DoModal())
{
CString strPathFile = fdlg.GetPathName();
IMessagePtr iMsg(__uuidof(Message));
IConfigurationPtr iConf(__uuidof(Configuration));
iMsg->Configuration = iConf;
_bstr_t url;
try
{
m_FileName.Insert(0,"file://");//注意这里!
url = (LPSTR)(LPCSTR)m_FileName;iMsg->CreateMHTMLBody(
url,
cdoSuppressNone,
"domain\\username",
"password");
}
catch(_com_error err)
{
// handle exception
}
_StreamPtr pStream=iMsg->GetStream();
url = (LPSTR)(LPCSTR)strPathFile;pStream->SaveToFile(url,adSaveCreateOverWrite);
::MessageBox(0,"保存结束","信息",MB_OK|MB_ICONASTERISK);
}
GetDlgItem(IDC_BUTTON_SAVE)->EnableWindow(TRUE);
谢谢!