Commit bd83a389 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

work windows version

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63771 954022d7-b5bf-4e40-9824-e11837661b57
parent b898a069
......@@ -36,12 +36,19 @@ int CHtmlFile::Convert(const std::wstring& sXml, const std::wstring& sPathIntern
ZeroMemory(&sturtupinfo,sizeof(STARTUPINFO));
sturtupinfo.cb = sizeof(STARTUPINFO);
std::wstring sTempFileForParams = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"XML");
NSFile::CFileBinary oFile;
oFile.CreateFile(sTempFileForParams);
oFile.WriteStringUTF8(sXml, true);
oFile.CloseFile();
std::wstring sApp = L"HtmlFileInternal <html>" + sTempFileForParams;
wchar_t* pCommandLine = NULL;
if (!sXml.empty())
{
pCommandLine = new wchar_t[sXml.length() + 1];
memcpy(pCommandLine, sXml.c_str(), sXml.length() * sizeof(wchar_t));
pCommandLine[sXml.length()] = (wchar_t)'\0';
pCommandLine = new wchar_t[sApp.length() + 1];
memcpy(pCommandLine, sApp.c_str(), sApp.length() * sizeof(wchar_t));
pCommandLine[sApp.length()] = (wchar_t)'\0';
}
PROCESS_INFORMATION processinfo;
......@@ -62,6 +69,8 @@ int CHtmlFile::Convert(const std::wstring& sXml, const std::wstring& sPathIntern
CloseHandle(processinfo.hProcess);
CloseHandle(processinfo.hThread);
NSFile::CFileBinary::Remove(sTempFileForParams);
#endif
#ifdef LINUX
......
......@@ -19,6 +19,19 @@ public:
CHtmlFile();
~CHtmlFile();
///
/// \brief Convert
/// \param sXml -
/// <html>
/// <sdk>file:///D:/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb/Word/sdk-all.js</sdk>
/// <file>file:///C:/Users/oleg.korshul/Desktop/original_message%20(5).html</file>
/// <file>file://192.168.3.208/allusers/Files/HTML/AllHTML/cars.html</file>
/// <destination>D:/test/Document/</destination> (end /!!!)
/// </html>\
/// \param sPathInternal - path (subprocesspath = path + HtmlFileInternal.exe) ("" -> GetProcessDirectory()/HtmlFileInternal/HtmlFileInternal.exe)
/// \return 1 error, 0 - success
///
int Convert(const std::wstring& sXml, const std::wstring& sPathInternal = L"");
};
......
......@@ -7,7 +7,17 @@ int main(int argc, char *argv[])
CHtmlFile oFile;
int nResult = oFile.Convert(L"xml", sPath);
std::wstring sXml = L"\
<html>\
<sdk>file:///D:/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb/Word/sdk-all.js</sdk>\
<file>file:///C:/Users/oleg.korshul/Desktop/original_message%20(5).html</file>\
<file>file://192.168.3.208/allusers/Files/HTML/AllHTML/cars.html</file>\
<destination>D:/test/Document/</destination>\
</html>\
";
int nResult = oFile.Convert(sXml, sPath);
nResult;
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment