将Word嵌入到ActiveX中并在IE中调用
如何得到编辑完成的文档数据并发送到服务端
如何得到编辑完成的文档数据并发送到服务端
解决方案 »
- 关于CRect下的left,right,top,bottom
- 使用AutoLoad创建位图按钮编译通过了但是运行不起来是怎么回事啊
- 头一回玩ActiveX控件,VS2005 MFC写的,请高手帮我调试源程序,感激不尽.....
- IOCP是否还存在Context Switch 消耗(讨论)
- 散分~随便询问有经验的前辈们 这样的一个项目报价多少是合理的(vc+DirectShow)~~感谢,顶就给分
- 对话框背景图丢失了,全部恢复灰色,来着有分
- Picaview的效果是怎么做的
- 如何虚拟键盘的组合键并寄送到指定控件?分另外开贴,本贴UP有分。
- 一个关于播放语音 的问题!
- (派分)COM/DCOM/MTS/COM+的区别?...
- 求b-spline或其它三次样条插值代码?
- 如何判斷一個CEdit對象中的內容是否被修改?
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// TODO: 在此添加调度处理程序代码
m_pWebOfficeFrame->m_pWebOfficeView->m_pSelection->DeactivateUI();
LPDISPATCH lpDisp;
lpDisp=m_pWebOfficeFrame->m_pWebOfficeView->m_pSelection->GetIDispatch();
TCHAR szTempPath[MAX_PATH],szTempFile[MAX_PATH];
DWORD dwResult=::GetTempPath(MAX_PATH,szTempPath);
GetTempFileName(szTempPath,_T("TelStar_"),0,szTempFile);
CString strTempDocPath;
strTempDocPath=szTempFile;
USES_CONVERSION;
WCHAR* wcPathName=T2W(szTempFile);
IStorage* pStorage=NULL;
BOOL bSuccess=FALSE;
if(SUCCEEDED(StgCreateDocfile(wcPathName,STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_CREATE,0,&pStorage)))
{
IPersistStorage* pPersistStorage=NULL;
if(SUCCEEDED(lpDisp->QueryInterface(IID_IPersistStorage,(void**)&pPersistStorage)))
{
if(SUCCEEDED(OleSave(pPersistStorage,pStorage,FALSE)))
{
pPersistStorage->SaveCompleted(NULL);
}
pPersistStorage->Release();
}
pStorage->Release();
}//保存到本地.
CInternetSession m_Session("DigitalTitan");
CHttpConnection* pServer=NULL;
CHttpFile* pFile=NULL;
CString strServerName=m_ServerName;
INTERNET_PORT nPort=(INTERNET_PORT)atoi(m_ServerPort);
CString strURL=m_DesignFile;
try
{
pServer=m_Session.GetHttpConnection(strServerName,nPort);
//AfxMessageBox(strServerName,MB_ICONINFORMATION);
pFile=pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,strURL,NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT);
//AfxMessageBox(strURL,MB_ICONINFORMATION);
CString strBoundary="-----------------------------7d33a816d302b6";//分界线视CGI程序做响应改动.
pFile->AddRequestHeaders("Content-Type: multipart/form-data, boundary="+strBoundary);
pFile->AddRequestHeaders("Accept: **");
//格式化你的数据到pBuf中吧
if(pFile->SendRequest(NULL,0,(LPVOID)pBuf,strlen(pBuf))==0)
{
AfxMessageBox("网络异常...",MB_ICONINFORMATION);
}
else
{
AfxMessageBox("完成设计...",MB_ICONINFORMATION);
}
pFile->Close();
pServer->Close();
}
catch(CInternetException* e)
{
char strErrorBuf[255];
e->GetErrorMessage(strErrorBuf,255,NULL);
AfxMessageBox(strErrorBuf,MB_ICONINFORMATION);
}
delete pFile;
delete pServer;
m_Session.Close();
}