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

(1.0.0.43) ASC version full

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52673 954022d7-b5bf-4e40-9824-e11837661b57
parent 8fea30be
// AVSOfficePDFFile.cpp : Implementation of DLL Exports.
// ASCOfficePDFFile.cpp : Implementation of DLL Exports.
#include "stdafx.h"
......@@ -7,10 +7,10 @@
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{1171181D-F894-4E61-A03E-08019B4E3F26}",
name = "AVSOfficePDFFile",
helpstring = "AVSOfficePDFFile 1.0 Type Library",
resource_name = "IDR_AVSOFFICEPDFFILE") ]
class CAVSOfficePDFFileModule
name = "ASCOfficePDFFile",
helpstring = "ASCOfficePDFFile 1.0 Type Library",
resource_name = "IDR_ASCOFFICEPDFFILE") ]
class CASCOfficePDFFileModule
{
public:
// Override CAtlDllModuleT members
......
......@@ -2,7 +2,7 @@
//
#include "resource.h"
#define COMPONENT_NAME "OfficePDFFile"
#include "../../../../Common/FileInfo.h"
#include "../Common/FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
......@@ -86,10 +86,10 @@ END
STRINGTABLE
BEGIN
IDS_PROJNAME "AVSOfficePDFFile"
IDS_PROJNAME "ASCOfficePDFFile"
END
IDR_AVSOFFICEPDFFILE REGISTRY "AVSOfficePDFFile.rgs"
IDR_ASCOFFICEPDFFILE REGISTRY "ASCOfficePDFFile.rgs"
////////////////////////////////////////////////////////////////////////////
......
......@@ -2,8 +2,8 @@ HKCR
{
NoRemove AppID
{
'%APPID%' = s 'AVSOfficePDFFile'
'AVSOfficePDFFile.DLL'
'%APPID%' = s 'ASCOfficePDFFile'
'ASCOfficePDFFile.DLL'
{
val AppID = s '%APPID%'
}
......
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AVSOfficePDFFile", "AVSOfficePDFFile_vs2005.vcproj", "{2F190D18-4F2B-4F10-BE6E-8AC355726483}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficePDFFile", "ASCOfficePDFFile_vs2005.vcproj", "{2F190D18-4F2B-4F10-BE6E-8AC355726483}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="AVSOfficePDFFile"
Version="8,00"
Name="ASCOfficePDFFile"
ProjectGUID="{2F190D18-4F2B-4F10-BE6E-8AC355726483}"
Keyword="AtlProj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
......@@ -42,11 +41,11 @@
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficePDFFile.tlb"
HeaderFileName="AVSOfficePDFFile.h"
TypeLibraryName="$(IntDir)/ASCOfficePDFFile.tlb"
HeaderFileName="ASCOfficePDFFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficePDFFile_i.c"
ProxyFileName="AVSOfficePDFFile_p.c"
InterfaceIdentifierFileName="ASCOfficePDFFile_i.c"
ProxyFileName="ASCOfficePDFFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
......@@ -76,12 +75,12 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="$(OutDir)/AVSOfficePDFFile.dll"
OutputFile="$(OutDir)/ASCOfficePDFFile.dll"
LinkIncremental="2"
MergedIDLBaseFileName="_AVSOfficePDFFile.idl"
MergedIDLBaseFileName="_ASCOfficePDFFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)/AVSOfficePDFFile.lib"
ImportLibrary="$(OutDir)/ASCOfficePDFFile.lib"
TargetMachine="1"
/>
<Tool
......@@ -102,6 +101,9 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
......@@ -119,7 +121,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="X:\AVS\Redist\VersionControl.exe &quot;$(SolutionDir)\version.h&quot;"
CommandLine="..\Redist\VersionControl.exe &quot;$(SolutionDir)\version.h&quot;"
/>
<Tool
Name="VCCustomBuildTool"
......@@ -136,11 +138,11 @@
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficePDFFile.tlb"
HeaderFileName="AVSOfficePDFFile.h"
TypeLibraryName="$(IntDir)/ASCOfficePDFFile.tlb"
HeaderFileName="ASCOfficePDFFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficePDFFile_i.c"
ProxyFileName="AVSOfficePDFFile_p.c"
InterfaceIdentifierFileName="ASCOfficePDFFile_i.c"
ProxyFileName="ASCOfficePDFFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
......@@ -166,15 +168,15 @@
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="../Redist/AVSOfficePDFFile.dll"
OutputFile="../Redist/ASCOfficePDFFile.dll"
LinkIncremental="1"
MergedIDLBaseFileName="_AVSOfficePDFFile.idl"
MergedIDLBaseFileName="_ASCOfficePDFFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/AVSOfficePDFFile.lib"
ImportLibrary="$(OutDir)/ASCOfficePDFFile.lib"
TargetMachine="1"
/>
<Tool
......@@ -195,6 +197,9 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
......@@ -211,7 +216,7 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\AVSOfficePDFFile.cpp"
RelativePath=".\ASCOfficePDFFile.cpp"
>
</File>
<File
......@@ -237,6 +242,14 @@
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseASC|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
......@@ -267,11 +280,11 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\AVSOfficePDFFile.rc"
RelativePath=".\ASCOfficePDFFile.rc"
>
</File>
<File
RelativePath=".\AVSOfficePDFFile.rgs"
RelativePath=".\ASCOfficePDFFile.rgs"
>
</File>
</Filter>
......@@ -286,10 +299,6 @@
RelativePath="..\Common\OfficeFileTemplate.h"
>
</File>
<File
RelativePath="..\..\..\..\Common\xmlutils.h"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
......

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AVSOfficePDFFile", "AVSOfficePDFFile.vcproj", "{2F190D18-4F2B-4F10-BE6E-8AC355726483}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2F190D18-4F2B-4F10-BE6E-8AC355726483}.Debug|Win32.ActiveCfg = Debug|Win32
{2F190D18-4F2B-4F10-BE6E-8AC355726483}.Debug|Win32.Build.0 = Debug|Win32
{2F190D18-4F2B-4F10-BE6E-8AC355726483}.Release|Win32.ActiveCfg = Release|Win32
{2F190D18-4F2B-4F10-BE6E-8AC355726483}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="AVSOfficePDFFile"
ProjectGUID="{2F190D18-4F2B-4F10-BE6E-8AC355726483}"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficePDFFile.tlb"
HeaderFileName="AVSOfficePDFFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficePDFFile_i.c"
ProxyFileName="AVSOfficePDFFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="$(OutDir)/AVSOfficePDFFile.dll"
LinkIncremental="2"
MergedIDLBaseFileName="_AVSOfficePDFFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)/AVSOfficePDFFile.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe &quot;$(SolutionDir)\version.h&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficePDFFile.tlb"
HeaderFileName="AVSOfficePDFFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficePDFFile_i.c"
ProxyFileName="AVSOfficePDFFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="../../../Redist/AVSOfficeStudio/AVSOfficePDFFile.dll"
LinkIncremental="1"
MergedIDLBaseFileName="_AVSOfficePDFFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/AVSOfficePDFFile.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="ReleaseASC|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="X:\AVS\Redist\VersionControl.exe &quot;$(SolutionDir)\version.h&quot;"
ExcludedFromBuild="true"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/AVSOfficePDFFile.tlb"
HeaderFileName="AVSOfficePDFFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="AVSOfficePDFFile_i.c"
ProxyFileName="AVSOfficePDFFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;ASCBUILD"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="../../../..\ASC\Redist/ASCOfficeStudio/ASCOfficePDFFile.dll"
LinkIncremental="1"
MergedIDLBaseFileName="_AVSOfficePDFFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/AVSOfficePDFFile.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\AVSOfficePDFFile.cpp"
>
</File>
<File
RelativePath=".\PDFFile.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseASC|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\PDFFile.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\version.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\AVSOfficePDFFile.rc"
>
</File>
<File
RelativePath=".\AVSOfficePDFFile.rgs"
>
</File>
</Filter>
<Filter
Name="Common"
>
<File
RelativePath="..\Common\OfficeFileErrorDescription.h"
>
</File>
<File
RelativePath="..\Common\OfficeFileTemplate.h"
>
</File>
<File
RelativePath="..\..\..\..\Common\xmlutils.h"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
......@@ -5,9 +5,8 @@
#include "..\Common\OfficeFileTemplate.h"
#include "..\Common\OfficeFileErrorDescription.h"
#include "..\Common\RSA\XMLEncoder.h"
#include "OfficeRendererTemplate.h"
#include "XmlUtils.h"
#include "TemporaryCS.h"
#include "..\Common\XmlUtils.h"
#include "..\Common\TemporaryCS.h"
#define MAX_PERCENT 1000000
......@@ -20,8 +19,8 @@
//#define AVSGraphics AVSOfficeEditor
//#define _IAVSDocumentPainterEvents _IAVSOfficeViewerEvents
//#define IAVSDocumentPainter IAVSOfficeViewer
//#define IAVSDocumentRenderer IAVSCommandsRenderer
//#define _IAVSDocumentRendererEvents _IAVSCommandsRendererEvents
//#define IASCDocumentRenderer IAVSCommandsRenderer
//#define _IASCDocumentRendererEvents _IAVSCommandsRendererEvents
//#define CAVSDocumentPainter CAVSOfficeViewer
......@@ -68,182 +67,10 @@ public:
protected:
class COfficeViewerEvents : public AVSGraphics::_IAVSDocumentPainterEvents
{
public:
COfficeViewerEvents(CPDFFile *pOwner)
{
m_pOwner = pOwner;
m_cnt = 0;
m_dwAdvise = 0;
};
virtual ~COfficeViewerEvents(void)
{ }
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(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HRESULT hr = S_OK;
VARIANTARG varg0;
VARIANTARG varg1;
switch(dispIdMember)
{
case 0:
VariantInit(&varg0);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
OnError( varg0.lVal );
break;
case 1:
OnStop();
break;
case 5:
VariantInit(&varg0);
hr = DispGetParam(pDispParams,0,VT_I4,&varg0,puArgErr);
OnProgress( varg0.lVal );
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 );
break;
case 11:
OnCompletePage();
break;
default:
return E_NOTIMPL;
}
return S_OK;
}
STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppv)
{
if ((iid == __uuidof(AVSGraphics::_IAVSDocumentRendererEvents)) || (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 *pVirtualPrinter)
{
if (NULL == pVirtualPrinter)
return FALSE;
IConnectionPointContainer *pContainer; pContainer = NULL;
IConnectionPoint *pCP; pCP = NULL;
HRESULT hr = pVirtualPrinter->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
if (NULL != pContainer)
{
hr = pContainer->FindConnectionPoint(__uuidof(AVSGraphics::_IAVSDocumentPainterEvents), &pCP);
if (NULL != pCP)
{
pCP->Advise(this, &m_dwAdvise);
RELEASEINTERFACE(pCP);
}
RELEASEINTERFACE(pContainer);
}
return TRUE;
}
BOOL UnAdvise(IUnknown *pVirtualPrinter)
{
if ( ( NULL == pVirtualPrinter ) || ( 0 == m_dwAdvise ) )
return FALSE;
IConnectionPointContainer *pContainer; pContainer = NULL;
IConnectionPoint *pCP; pCP = NULL;
HRESULT hr = pVirtualPrinter->QueryInterface(IID_IConnectionPointContainer, (void**)&pContainer);
if (NULL != pContainer)
{
hr = pContainer->FindConnectionPoint(__uuidof(AVSGraphics::_IAVSDocumentPainterEvents), &pCP);
if (NULL != pCP)
{
hr = pCP->Unadvise(m_dwAdvise);
RELEASEINTERFACE(pCP);
}
RELEASEINTERFACE(pContainer);
}
m_dwAdvise = 0;
return TRUE;
}
protected:
HRESULT OnError(LONG lError)//[id(0)]
{
m_pOwner->OnErrorViewer( lError );
return S_OK;
}
HRESULT OnStop()//[id(1)]
{
m_pOwner->OnStopViewer();
return S_OK;
}
HRESULT OnProgress(LONG lProgressPage)//[id(5)]
{
m_pOwner->OnProgressViewer( lProgressPage );
return S_OK;
}
HRESULT OnProgressParce(LONG lType, LONG lProgress)//[id(6)]
{
return S_OK;
}
HRESULT OnNewPage(double dWidthMm, double dHeightMm)//[id(10)]
{
m_pOwner->OnNewPageViewer(dWidthMm, dHeightMm);
return S_OK;
}
HRESULT OnCompletePage() //[id(11)]
{
m_pOwner->OnCompletePageViewer();
return S_OK;
}
protected:
CPDFFile *m_pOwner;
LONG m_cnt;
DWORD m_dwAdvise;
};
private:
AVSGraphics::IAVSEffectPainter *m_piEffectPainter;
AVSGraphics::IAVSDocumentPainter *m_piOfficeViewer;
AVSOfficePDFWriter::IPDFRenderer *m_piPdfRenderer;
AVSGraphics::IAVSDocumentRenderer *m_piDocumentRenderer;
AVSGraphics::IASCDocumentRenderer *m_piDocumentRenderer;
AVSOfficePDFReader::IPDFReader *m_piReader;
......@@ -346,23 +173,18 @@ private:
}
void OnNewPageViewer(double dWidthMm, double dHeightMm)
{
m_piOfficeViewer->Resume();
}
void OnCompletePageViewer()
{
m_piOfficeViewer->Resume();
}
public:
CPDFFile():m_piOfficeViewer(NULL), m_piPdfRenderer(NULL), m_piDocumentRenderer(NULL), m_piReader(NULL)
CPDFFile(): m_piPdfRenderer(NULL), m_piDocumentRenderer(NULL), m_piReader(NULL)
{
CoCreateInstance( __uuidof( AVSGraphics::CAVSDocumentPainter ), NULL ,CLSCTX_INPROC_SERVER, __uuidof(AVSGraphics::IAVSDocumentPainter), (void **)(&m_piOfficeViewer) );
CoCreateInstance( __uuidof( AVSOfficePDFWriter::CPDFWriter ), NULL ,CLSCTX_INPROC_SERVER, __uuidof(AVSOfficePDFWriter::IPDFRenderer), (void **)(&m_piPdfRenderer) );
m_hViewerStop = CreateEvent( NULL, FALSE, FALSE, NULL);
m_piEffectPainter = NULL;
}
......@@ -386,10 +208,8 @@ public:
SysFreeString( m_bsEmpty );
RELEASEHANDLE( m_hViewerStop );
RELEASEINTERFACE( m_piPdfRenderer );
RELEASEINTERFACE( m_piOfficeViewer );
RELEASEINTERFACE( m_piDocumentRenderer );
RELEASEINTERFACE( m_piReader );
RELEASEINTERFACE( m_piEffectPainter );
}
protected:
......@@ -730,16 +550,6 @@ public:
return hRes;
}
// ( watermark)
if ( m_piEffectPainter )
{
if ( FAILED( hRes = m_piEffectPainter->Draw( m_piPdfRenderer ) ) )
{
RELEASEINTERFACE( piPdfWriter );
return hRes;
}
}
//
SHORT shCancel = 0;
OnProgressEx( 0 , ( float( nIndex + 1 ) / ( nPagesCount + 1 ) ) * MAX_PERCENT, &shCancel );
......@@ -942,24 +752,18 @@ public:
(*ppRenderer) = NULL;
if( NULL == m_piDocumentRenderer )
return S_OK;
return m_piDocumentRenderer->QueryInterface(__uuidof(AVSGraphics::IAVSDocumentRenderer), (void**)&ppRenderer);
return m_piDocumentRenderer->QueryInterface(__uuidof(AVSGraphics::IASCDocumentRenderer), (void**)&ppRenderer);
}
STDMETHOD(put_CommandRenderer)(IUnknown* pRenderer)
{
RELEASEINTERFACE( m_piDocumentRenderer );
if( NULL != pRenderer )
pRenderer->QueryInterface(__uuidof( AVSGraphics::IAVSDocumentRenderer), (void**)&m_piDocumentRenderer);
pRenderer->QueryInterface(__uuidof( AVSGraphics::IASCDocumentRenderer), (void**)&m_piDocumentRenderer);
return S_OK;
}
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
{
CString sParamName = ParamName;
if ( _T("EffectPainter") == sParamName && VT_UNKNOWN == ParamValue.vt )
{
RELEASEINTERFACE( m_piEffectPainter );
ParamValue.punkVal->QueryInterface( __uuidof( AVSGraphics::IAVSEffectPainter ), (void**)&m_piEffectPainter );
}
return S_OK;
}
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT * ParamValue)
......
......@@ -4,7 +4,7 @@
//
#define IDS_PROJNAME 100
#define IDR_AVSOFFICEPDFFILE 101
#define IDR_ASCOFFICEPDFFILE 101
// Next default values for new objects
//
......
......@@ -42,15 +42,12 @@
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atldefine.h>
#include "../Common/atldefine.h"
using namespace ATL;
#import "..\..\..\Redist\AVSMediaCore3.dll" named_guids rename_namespace("MediaCore"), exclude("tagRECT")
#import "..\..\..\Redist\AVSOfficeStudio\AVSOfficePDFWriter.dll" rename_namespace("AVSOfficePDFWriter") raw_interfaces_only
#import "..\..\..\Redist\AVSOfficeStudio\AVSOfficePDFReader.dll" rename_namespace("AVSOfficePDFReader") raw_interfaces_only
#import "..\..\..\Redist\AVSOfficeStudio\AVSOfficeEditor.dll" rename_namespace("AVSOfficeEditor") raw_interfaces_only
#import "..\..\..\Redist\AVSOfficeStudio\AVSOfficeFOFile.dll" rename_namespace("AVSOfficeFOFile") raw_interfaces_only
#import "..\..\..\Redist\AVSGraphics.dll" rename_namespace("AVSGraphics")
#import "../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT")
#import "../Redist/ASCOfficePDFWriter.dll" rename_namespace("AVSOfficePDFWriter") raw_interfaces_only
#import "../Redist/ASCOfficePDFReader.dll" rename_namespace("AVSOfficePDFReader") raw_interfaces_only
#import "../Redist/ASCGraphics.dll" rename_namespace("AVSGraphics")
......@@ -2,6 +2,6 @@
//1
//0
//0
//42
#define INTVER 1,0,0,42
#define STRVER "1,0,0,42\0"
//43
#define INTVER 1,0,0,43
#define STRVER "1,0,0,43\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