Commit a621c993 authored by Sergey.Kirillov's avatar Sergey.Kirillov Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52220 954022d7-b5bf-4e40-9824-e11837661b57
parent e9c1cfc2
......@@ -15,7 +15,7 @@ ASCOfficeFB2File/AVSOfficeFB2FileTest/AVSOfficeFB2FileTest/bin/Release/AVSOffice
ASCOfficeFB2File/AVSOfficeFB2FileTest/AVSOfficeFB2FileTest/bin/Release/AVSOfficeFB2FileTest.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficeFB2File/AVSOfficeFB2FileTest/AVSOfficeFB2FileTest/bin/Release/AVSOfficeFB2FileTest.vshost.exe svn_mime_002dtype=application%2Foctet-stream
ASCOfficeFB2File/AVSOfficeFB2FileTest/AVSOfficeFB2FileTest/bin/Release/Interop.AVSOfficeFB2File.dll svn_mime_002dtype=application%2Foctet-stream
AVSOfficeFile/Watermark.h svn_mime_002dtype=application%2Foctet-stream
ASCOfficeFile/Watermark.h svn_mime_002dtype=application%2Foctet-stream
AVSOfficeHtmlFile/HTMLReaderLib/docs/HTML[!!-~]Reader[!!-~]C++[!!-~]Class[!!-~]Library[!!-~]-[!!-~]CodeProject_files/AddTo_Delicious.png svn_mime_002dtype=application%2Foctet-stream
AVSOfficeHtmlFile/HTMLReaderLib/docs/HTML[!!-~]Reader[!!-~]C++[!!-~]Class[!!-~]Library[!!-~]-[!!-~]CodeProject_files/AddTo_Digg.png svn_mime_002dtype=application%2Foctet-stream
AVSOfficeHtmlFile/HTMLReaderLib/docs/HTML[!!-~]Reader[!!-~]C++[!!-~]Class[!!-~]Library[!!-~]-[!!-~]CodeProject_files/AddTo_Facebook.png svn_mime_002dtype=application%2Foctet-stream
......
// AVSOfficeFile.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "OfficeFile.h"
#include "AVSOfficeFormatChecker.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{74cbf220-bf08-11de-8a39-0800200c9a66}",
name = "AVSOfficeFile",
helpstring = "AVSOfficeFile 1.0 Type Library",
resource_name = "IDR_AVSOFFICEFILE") ]
class CAVSOfficeFileModule
{
public:
// Override CAtlDllModuleT members
};
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
#define COMPONENT_NAME "OfficeFile"
#include "../../../../Common/FileInfo.h"
#include "version.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE 25, 1
#pragma code_page(1251)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION INTVER
PRODUCTVERSION INTVER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "LegalTrademarks", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "AVSOfficeFile"
END
IDR_AVSOFFICEFILE REGISTRY "AVSOfficeFile.rgs"
////////////////////////////////////////////////////////////////////////////
#endif
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'AVSOfficeFile'
'AVSOfficeFile.DLL'
{
val AppID = s '%APPID%'
}
}
}

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AVSOfficeFile", "AVSOfficeFile.vcproj", "{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
ReleaseASC|Win32 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.Debug|Win32.ActiveCfg = Debug|Win32
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.Debug|Win32.Build.0 = Debug|Win32
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.Release|Win32.ActiveCfg = Release|Win32
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.Release|Win32.Build.0 = Release|Win32
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
{CF852DB8-5A50-4C30-B683-5503D8DAF7B3}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
#pragma once
#include "resource.h"
#include "..\Common\OfficeFileFormats.h"
#include "TemporaryCS.h"
[
object,
uuid("498741e0-b8a1-11de-8a39-0800200c9a66"),
dual, helpstring("IAVSDocumentConverter Interface"),
pointer_default(unique)
]
__interface IAVSOfficeFormatChecker : IDispatch
{
[id(10), helpstring("method copy")] HRESULT GetFileFormat([in] BSTR bstrFilename, [out,retval] LONG* pnFormat);
[id(30), helpstring("method copy")] HRESULT CanConvert([in] LONG nSource, [in] LONG nDestination ,[out,retval] VARIANT_BOOL* pbResult);
[id(40), helpstring("method copy")] HRESULT CanView([in] LONG nFileFormat, [out,retval] VARIANT_BOOL* pbResult);
};
[
coclass,
default(IAVSOfficeFormatChecker),
event_receiver(native),
threading(apartment),
vi_progid("AVSOfficeUniversalConverter.AVSDocume"),
progid("AVSOfficeUniversalConverter.AVSDocu.1"),
version(1.0),
uuid("58bf6fc0-b8a1-11de-8a39-0800200c9a66"),
helpstring("AVSOfficeFormatChecker Class")
]
class ATL_NO_VTABLE CAVSOfficeFormatChecker : public IAVSOfficeFormatChecker
{
private:CRITICAL_SECTION m_csThread;
public:
CAVSOfficeFormatChecker()
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
InitializeCriticalSection(&m_csThread);
return S_OK;
}
void FinalRelease()
{
DeleteCriticalSection(&m_csThread);
}
public:
STDMETHOD(GetFileFormat)( BSTR bstrFilename, LONG* pnFormat)
{
AVSOfficeFormatChecker avsOfficeFormatChecker;
CTemporaryCS oCS(&m_csThread);
if( NULL == pnFormat )
return S_FALSE;
(*pnFormat) =avsOfficeFormatChecker.GetFileFormat( CString(bstrFilename) );
return S_OK;
}
STDMETHOD(CanConvert)( LONG nSource, LONG nDestination , VARIANT_BOOL* bResult)
{
CTemporaryCS oCS(&m_csThread);
AVSOfficeFormatChecker avsOfficeFormatChecker;
if( NULL == bResult )
return S_FALSE;
if( false == avsOfficeFormatChecker.CanConvert( nSource, nDestination ) )
(*bResult) = VARIANT_FALSE;
else
(*bResult) = VARIANT_TRUE;
return S_OK;
}
STDMETHOD(CanView)( LONG nFileFormat , VARIANT_BOOL* bResult)
{
AVSOfficeFormatChecker avsOfficeFormatChecker;
CTemporaryCS oCS(&m_csThread);
if( NULL == bResult )
return S_FALSE;
if( false == avsOfficeFormatChecker.CanView( nFileFormat ) )
(*bResult) = VARIANT_FALSE;
else
(*bResult) = VARIANT_TRUE;
return S_OK;
}
};
\ No newline at end of file
This diff is collapsed.
#pragma once
#include "TemporaryCS.h"
//class CVideoFile3;
template <class T, class Reciever>
class COfficeEventTemplate : public T
{
protected: CRITICAL_SECTION m_csThread;
public:
COfficeEventTemplate(Reciever *pReciever)
: m_pReciever(pReciever)
{
InitializeCriticalSection(&m_csThread);
m_cnt = 0;
m_dwAdvise = 0;
};
virtual ~COfficeEventTemplate(void)
{
DeleteCriticalSection(&m_csThread);
}
STDMETHOD(GetTypeInfoCount)(UINT*) { return E_NOTIMPL; }
STDMETHOD(GetTypeInfo)(UINT, LCID, ITypeInfo**) { return E_NOTIMPL; }
STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return E_NOTIMPL; }
STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppv) {
if ((iid == __uuidof(T)) ||
(iid == __uuidof(IDispatch)) ||
(iid == __uuidof(IUnknown)))
*ppv = this;
else {
*ppv = 0;
return E_NOINTERFACE;
}
AddRef();
return S_OK;
}
STDMETHOD_(ULONG,AddRef)() {
return InterlockedIncrement(&m_cnt);
}
STDMETHOD_(ULONG,Release)() {
InterlockedDecrement(&m_cnt);
if (m_cnt!=0) return m_cnt;
delete this;
return 0;
}
BOOL Advise(IUnknown *pFile)
{
CTemporaryCS oCS(&m_csThread);
if (NULL==pFile)
return FALSE;
IConnectionPointContainer* pContainer;
IConnectionPoint* pCP;
HRESULT hr = pFile->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
if (NULL!=pContainer)
{
pContainer->FindConnectionPoint(__uuidof(T), &pCP);
if (NULL!=pCP)
{
pCP->Advise(this, &m_dwAdvise);
pCP->Release();
pCP = NULL;
}
pContainer->Release();
pContainer = NULL;
}
return TRUE;
}
BOOL UnAdvise(IUnknown *pFile)
{
CTemporaryCS oCS(&m_csThread);
if ((NULL==pFile)||(0==m_dwAdvise))
return FALSE;
IConnectionPointContainer* pContainer;
IConnectionPoint* pCP;
HRESULT hr = pFile->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
if (NULL!=pContainer)
{
hr = pContainer->FindConnectionPoint(__uuidof(T), &pCP);
if (NULL!=pCP)
{
hr = pCP->Unadvise(m_dwAdvise);
pCP->Release();
pCP = NULL;
}
pContainer->Release();
pContainer = NULL;
}
return TRUE;
}
public:
Reciever* m_pReciever;
protected:
LONG m_cnt;
DWORD m_dwAdvise;
};
This diff is collapsed.
This diff is collapsed.
#pragma once
#include "OfficeEventsTemplate.h"
template <class T, class Reciever>
class COfficeEventDocuments : public COfficeEventTemplate<T,Reciever>
{
public:
COfficeEventDocuments(Reciever *pReciever):COfficeEventTemplate(pReciever)
{
m_cnt = 0;
m_dwAdvise = 0;
};
HRESULT OnProgress( LONG nID, LONG nPercent)
{
m_pReciever->OnProgressDocument( nID, nPercent );
return S_OK;
}
HRESULT OnProgressEx( LONG nID, LONG nPercent, SHORT* Cancel)
{
m_pReciever->OnProgressDocumentEx( nID, nPercent, Cancel );
return S_OK;
}
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
//CTemporaryCS oCS(&m_csThread);
HRESULT hr;
VARIANTARG varg0;
VARIANTARG varg1;
VARIANTARG varg2;
switch(dispIdMember) {
case 1:
VariantInit(&varg0);
VariantInit(&varg1);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_I4,&varg1,puArgErr);
OnProgress( varg0.lVal, varg1.lVal );
return(S_OK);
break;
case 2:
VariantInit(&varg0);
VariantInit(&varg1);
VariantInit(&varg2);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_I4,&varg1,puArgErr);
hr = DispGetParam(pDispParams,2,VT_I2,&varg2,puArgErr);
OnProgressEx( varg0.lVal, varg1.lVal, &varg2.iVal );
if (pDispParams->rgvarg[0].vt & VT_BYREF) // implemented now for last VT_I2 arg only
{
SHORT* p = (SHORT*)pDispParams->rgvarg[0].byref;
if (p) *p = varg2.iVal;
}
return(S_OK);
break;
default:
return(E_NOTIMPL);
}
}
};
template <class T, class Reciever>
class COfficeEventViewer : public COfficeEventTemplate<T,Reciever>
{
public:
COfficeEventViewer(Reciever *pReciever):COfficeEventTemplate(pReciever)
{
m_cnt = 0;
m_dwAdvise = 0;
};
HRESULT OnError(LONG lError)//[id(0)]
{
m_pReciever->OnErrorViewer( lError );
return S_OK;
}
HRESULT OnStop()//[id(1)]
{
m_pReciever->OnStopViewer();
return S_OK;
}
HRESULT OnProgress(LONG lProgressPage)//[id(5)]
{
m_pReciever->OnProgressViewer( lProgressPage );
return S_OK;
}
HRESULT OnProgressParce(LONG lType, LONG lProgress)//[id(6)]
{
m_pReciever->OnProgressParse( lType, lProgress );
return S_OK;
}
HRESULT OnNewPage(double dWidthMm, double dHeightMm)//[id(10)]
{
m_pReciever->OnNewPageViewer(dWidthMm, dHeightMm);
return S_OK;
}
HRESULT OnCompletePage() //[id(11)]
{
m_pReciever->OnCompletePageViewer();
return S_OK;
}
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
//CTemporaryCS oCS(&m_csThread);
HRESULT hr;
VARIANTARG varg0;
VARIANTARG varg1;
switch(dispIdMember) {
case 0:
VariantInit(&varg0);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
OnError( varg0.lVal);
return(S_OK);
break;
case 1:
OnStop( );
return(S_OK);
break;
case 5:
VariantInit(&varg0);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
OnProgress( varg0.lVal );
return(S_OK);
break;
case 6:
VariantInit(&varg0);
VariantInit(&varg1);
hr = DispGetParam(pDispParams,0,VT_R8,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_R8,&varg1,puArgErr);
OnProgressParce( varg0.lVal, varg1.lVal );
return(S_OK);
break;
case 10:
VariantInit(&varg0);
VariantInit(&varg1);
hr = DispGetParam(pDispParams,0,VT_R8,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_R8,&varg1,puArgErr);
OnNewPage( varg0.dblVal, varg1.dblVal );
return(S_OK);
break;
case 11:
OnCompletePage();
return(S_OK);
break;
default:
return(E_NOTIMPL);
}
}
};
template <class T, class Reciever>
class COfficeFileConvEvents : public COfficeEventTemplate<T,Reciever>
{
public:
COfficeFileConvEvents(Reciever *pReciever):COfficeEventTemplate(pReciever)
{
m_cnt = 0;
m_dwAdvise = 0;
};
HRESULT OnProgressEx( LONG nID, LONG nPercent, SHORT* Cancel)
{
m_pReciever->OnProgressDocumentEx( nID, nPercent, Cancel );
return S_OK;
}
HRESULT OnProgress( LONG nID, LONG nPercent)
{
m_pReciever->OnProgressDocument( nID, nPercent );
return S_OK;
}
HRESULT OnCompletePage()
{
m_pReciever->OnCompletePageDocument();
return S_OK;
}
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
//CTemporaryCS oCS(&m_csThread);
HRESULT hr;
VARIANTARG varg0;
VARIANTARG varg1;
VARIANTARG varg2;
switch(dispIdMember) {
case 1:
VariantInit(&varg0);
VariantInit(&varg1);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_I4,&varg1,puArgErr);
OnProgress( varg0.lVal, varg1.lVal );
return(S_OK);
break;
case 2:
VariantInit(&varg0);
VariantInit(&varg1);
VariantInit(&varg2);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
hr = DispGetParam(pDispParams,1,VT_I4,&varg1,puArgErr);
hr = DispGetParam(pDispParams,2,VT_I2,&varg2,puArgErr);
OnProgressEx( varg0.lVal, varg1.lVal, &varg2.iVal );
if (pDispParams->rgvarg[0].vt & VT_BYREF) // implemented now for last VT_I2 arg only
{
SHORT* p = (SHORT*)pDispParams->rgvarg[0].byref;
if (p) *p = varg2.iVal;
}
return(S_OK);
break;
case 10:
OnCompletePage();
return(S_OK);
break;
default:
return(E_NOTIMPL);
}
}
};
template <class T, class Reciever>
class CCommandRendererEvents : public COfficeEventTemplate<T,Reciever>
{
public:
CCommandRendererEvents(Reciever *pReciever):COfficeEventTemplate(pReciever)
{
m_cnt = 0;
m_dwAdvise = 0;
};
HRESULT OnCompletePageDocument()
{
m_pReciever->OnCompletePageDocument();
return S_OK;
}
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
//CTemporaryCS oCS(&m_csThread);
switch(dispIdMember) {
case 100:
return(S_OK);
break;
case 101:
OnCompletePageDocument();
return(S_OK);
break;
default:
return(E_NOTIMPL);
}
}
};
\ No newline at end of file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by AVSOfficeFile.rc
//
#define IDS_PROJNAME 100
#define IDR_AVSOFFICEFILE 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif
#pragma once
#include "stdafx.h"
#include "../Common/OfficeFileTemplate.h"
class StorageConverters
{
//----------------------------- Public Members --------------------------------
//----------------------------- Public Methods --------------------------------
public: BOOL GetConverter( int nFormat , IAVSOfficeFileTemplate** ppiOutConverter)
{
if( AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC == nFormat )
return GetInterface( __uuidof(AVSOfficeDocFile::COfficeDocFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX == nFormat )
return GetInterface( __uuidof(AVSOfficeDocxFile::COfficeDocxFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML == nFormat || AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT == nFormat )
return GetInterface( __uuidof(AVSOfficeHtmlFile::CHtmlFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT == nFormat )
return GetInterface( __uuidof(AVSOfficeOdtFile::COdtFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF == nFormat )
return GetInterface( __uuidof(AVSOfficeRtfFile::CRtfFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT == nFormat )
return GetInterface( __uuidof(AVSOfficeTxtFile::CTxtFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_IMAGE & nFormat )
return GetInterface( __uuidof(AVSOfficeImageFile::COfficeImageFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormat )
return GetInterface( __uuidof(AVSOfficePDFFile::CPDFFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormat )
return GetInterface( __uuidof(AVSOfficeXlsFile::CXlsFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormat )
return GetInterface( __uuidof(AVSOfficeDocxFile::COfficeDocxFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormat )
return GetInterface( __uuidof(AVSOfficePPTFile::CAVSOfficePPTFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormat )
return GetInterface( __uuidof(AVSOfficePPTXFile::CAVSOfficePPTXFile),ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormat )
return GetInterface( __uuidof(AVSOfficeOdpFile::CAVSOfficeODPFile ), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB == nFormat )
return GetInterface( __uuidof(OfficeEpub::COfficeEpubFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_SWF == nFormat )
return GetInterface( __uuidof(FlashStudio::CSWFOfficeFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2 == nFormat )
return GetInterface( __uuidof(OfficeFB2::CFB2File), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU == nFormat )
return GetInterface( __uuidof(OfficeDjVu::CDjVuFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS == nFormat )
return GetInterface( __uuidof(OfficeXPS::CXPSFile), ppiOutConverter );
else if( AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI == nFormat )
return GetInterface( __uuidof(EBOOKWriter::COfficeMobiFile), ppiOutConverter );
return FALSE;
}
public: BOOL GetConverter( CString sFilename , IAVSOfficeFileTemplate** ppiOutConverter)
{
AVSOfficeFormatChecker avsOfficeFormatChecker;
int nType = avsOfficeFormatChecker.GetFileFormat( sFilename );
return GetConverter( nType, ppiOutConverter );
}
//----------------------------- Private Methods --------------------------------
private: BOOL GetInterface(REFCLSID rclsid, IAVSOfficeFileTemplate** ppiOutConverter)
{
if( NULL == *ppiOutConverter )
{
bool bRews = SUCCEEDED (CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, __uuidof(IAVSOfficeFileTemplate), (void **)(ppiOutConverter) ) );
if( false == bRews )
return FALSE;
}
return TRUE;
}
};
\ No newline at end of file
Binary files a/AVSOfficeFile/Watermark.h and /dev/null differ
// stdafx.cpp : source file that includes just the standard includes
// AVSOfficeFile.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#pragma once
#ifndef STRICT
#define STRICT
#endif
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define _CRT_SECURE_NO_DEPRECATE
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define USE_ATL_CSTRING
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#pragma warning(disable: 4244 4267 4683)
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include "atldefine.h"
using namespace ATL;
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW
#endif
#import "../../../Redist/AVSOfficeStudio/AVSOfficeDocFile.dll" rename_namespace("AVSOfficeDocFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeDocxFile.dll" rename_namespace("AVSOfficeDocxFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeHtmlFile.dll" rename_namespace("AVSOfficeHtmlFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeOdtFile.dll" rename_namespace("AVSOfficeOdtFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeRtfFile.dll" rename_namespace("AVSOfficeRtfFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeTxtFile.dll" rename_namespace("AVSOfficeTxtFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeImageFile.dll" rename_namespace("AVSOfficeImageFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficePDFFile.dll" rename_namespace("AVSOfficePDFFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeXlsFile.dll" rename_namespace("AVSOfficeXlsFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeEpubFile.dll" rename_namespace("OfficeEpub"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeDjVuFile.dll" rename_namespace("OfficeDjVu"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeFB2File.dll" rename_namespace("OfficeFB2"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSSWFRenderer.dll" rename_namespace("FlashStudio"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeWSHtmlFile.dll" rename_namespace("WSHtmlFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeDocxRenderer.dll" rename_namespace("DocxRenderer"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSHTMLRenderer.dll" rename_namespace("HTMLRenderer"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeXPSFile.dll" rename_namespace("OfficeXPS"), raw_interfaces_only
#import "../../../Redist/AVSGraphics.dll" rename_namespace("AVSGraphics"), raw_interfaces_only
//#import "../../../Redist/AVSOfficeStudio/AVSOfficeEditor.dll" rename_namespace("AVSOfficeEditor"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficePPTXFile.dll" rename_namespace("AVSOfficePPTXFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficePDFWriter.dll" rename_namespace("AVSOfficePDFWriter"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeFOFile.dll" rename_namespace("AVSOfficeFOFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficePPTFile.dll" rename_namespace("AVSOfficePPTFile"), raw_interfaces_only
#import "../../../Redist/AVSOfficeStudio/AVSOfficeOdpFile.dll" rename_namespace("AVSOfficeOdpFile"), raw_interfaces_only
#import "../../../Redist/AVSMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT")
#import "../../../Redist/AVSMediaFormatSettings3.dll" named_guids rename_namespace("MediaFormat"), exclude("tagRECT")
#import "../../../Redist/AVSImageStudio3.dll" rename_namespace("ImageStudio")
#import "../../../Redist/AVSOfficeStudio/AVSEBOOKWriter.dll" rename_namespace("EBOOKWriter"), raw_interfaces_only
#define _USE_MATH_DEFINES
#pragma once
//1
//0
//0
//110
#define INTVER 1,0,0,110
#define STRVER "1,0,0,110\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