Commit d107959b authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander Trofimov

delete ASCOfficeDocxFile

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64283 954022d7-b5bf-4e40-9824-e11837661b57
parent 35dd3f13
// ASCDocxFile.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{CBCEF68A-61B4-49FA-A35F-3BFF46FD3BE8}",
name = "ASCDocxFile",
helpstring = "ASCDocxFile 1.0 Type Library",
resource_name = "IDR_ASCDOCXFILE") ]
class CAVSDocxFileModule
{
public:
// Override CAtlDllModuleT members
};
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define COMPONENT_NAME "OfficeDocxFile"
#include "../Common/FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// 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 "040904b0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_ASCDOCXFILE REGISTRY "ASCOfficeDocxFile.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "ASCOfficeDocxFile"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'ASCOfficeDocxFile'
'ASCOfficeDocxFile.DLL'
{
val AppID = s '%APPID%'
}
}
}

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile", "ASCOfficeDocxFile.vcproj", "{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Debug|Win32.ActiveCfg = Debug|Win32
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Debug|Win32.Build.0 = Debug|Win32
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.Release|Win32.ActiveCfg = Release|Win32
{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}.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="9,00"
Name="ASCOfficeDocxFile"
ProjectGUID="{C8FDF8E6-D8CB-4A9F-B2BF-9890D0E42A17}"
RootNamespace="ASCOfficeDocxFile"
Keyword="AtlProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="2"
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)/ASCOfficeDocxFile.tlb"
HeaderFileName="ASCOfficeDocxFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
ProxyFileName="ASCOfficeDocxFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Msimg32.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
IgnoreDefaultLibraryNames="LIBC.lib"
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="2"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeDocxFile.tlb"
HeaderFileName="ASCOfficeDocxFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxFile_i.c"
ProxyFileName="ASCOfficeDocxFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=".\..\Common\ASCDocxFormat\Source\Utility;.\..\Common\ASCDocxFormat\Source\XML;.\..\Common\ASCDocxFormat\Source\Common;.\..\Common\ASCDocxFormat\Source\DocxFormat"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Msimg32.lib"
OutputFile=".\..\Redist\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\ASCOfficeUtils\ZLIB\zlib123dll\static32"
IgnoreDefaultLibraryNames="LIBC.lib"
MergedIDLBaseFileName="_ASCOfficeDocxFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<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=".\ASCOfficeDocxFile.cpp"
>
</File>
<File
RelativePath=".\DocxFile.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>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\DocxFile.h"
>
</File>
<File
RelativePath=".\OfficeEventsTemplate.h"
>
</File>
<File
RelativePath="..\Common\OfficeFileTemplate.h"
>
</File>
<File
RelativePath=".\OfficeUtilsEvents.h"
>
</File>
<File
RelativePath=".\RelsReader.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\SimpleDocxFormat.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=".\ASCOfficeDocxFile.rc"
>
</File>
<File
RelativePath=".\ASCOfficeDocxFile.rgs"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile", "ASCOfficeDocxFile2005.vcproj", "{475B0C01-940F-4A7D-994A-969E5F9F412D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
ReleaseASC|Win32 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Debug|Win32.ActiveCfg = Debug|Win32
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Debug|Win32.Build.0 = Debug|Win32
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Release|Win32.ActiveCfg = Release|Win32
{475B0C01-940F-4A7D-994A-969E5F9F412D}.Release|Win32.Build.0 = Release|Win32
{475B0C01-940F-4A7D-994A-969E5F9F412D}.ReleaseASC|Win32.ActiveCfg = ReleaseASC|Win32
{475B0C01-940F-4A7D-994A-969E5F9F412D}.ReleaseASC|Win32.Build.0 = ReleaseASC|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
This diff is collapsed.
#include "stdafx.h"
#include "DocxFile.h"
#include "SimpleDocxFormat.h"
COfficeDocxFile::COfficeDocxFile()
{
}
HRESULT COfficeDocxFile::FinalConstruct()
{
m_pOfficeUtils = NULL;
return CoCreateInstance(__uuidof(COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(IOfficeUtils), (void **)&(this->m_pOfficeUtils));
}
void COfficeDocxFile::FinalRelease()
{
if (m_pOfficeUtils != NULL )
{
m_pOfficeUtils->Release();
m_pOfficeUtils = NULL;
}
}
STDMETHODIMP COfficeDocxFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
{
OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >* oEventUtils = new OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >(this);
oEventUtils->AddRef();
oEventUtils->Advise( m_pOfficeUtils );
const HRESULT extractResult = m_pOfficeUtils->ExtractToDirectory(sSrcFileName, sDstPath, NULL, 0);
oEventUtils->UnAdvise( m_pOfficeUtils );
oEventUtils->Release();
if ( extractResult != S_OK )
{
return extractResult;
}
XmlUtils::CXmlReader oXmlReader;
if( TRUE == oXmlReader.OpenFromXmlString( sXMLOptions ) )
if( TRUE == oXmlReader.ReadRootNode( _T("Options") ) )
if( TRUE == oXmlReader.ReadNode( _T("ExtractOption") ) )
if( TRUE == oXmlReader.ReadNode( _T("Images") ) )
{
CString sResultPath = oXmlReader.ReadNodeAttribute( _T("path") );
CString sSourcePath = sDstPath;
SimpleDocxFormat oSimpleDocxFormat;
oSimpleDocxFormat.ExtractImages( sSourcePath, sResultPath );
}
return S_OK;
}
STDMETHODIMP COfficeDocxFile::SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
{
OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >* oEventUtils = new OfficeUtilsEvents< _IAVSOfficeUtilsEvents, COfficeDocxFile >(this);
oEventUtils->AddRef();
oEventUtils->Advise( m_pOfficeUtils );
const HRESULT compressResult = m_pOfficeUtils->CompressFileOrDirectory(sSrcPath, sDstFileName, ZIP_DEFAULT_COMPRESSION);
oEventUtils->UnAdvise( m_pOfficeUtils );
oEventUtils->Release();
return compressResult;
}
STDMETHODIMP COfficeDocxFile::AddObjects(BSTR sSrcPath, BSTR sXMLOptions)
{
SimpleDocxFormat oSimpleDocxFormat;
return oSimpleDocxFormat.AddObject( sSrcPath, sXMLOptions );
}
\ No newline at end of file
#pragma once
#include "resource.h"
#include "../Common/OfficeFileTemplate.h"
#include "OfficeUtilsEvents.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif
#import "..\Redist\ASCOfficeUtils.dll" raw_interfaces_only
using namespace ASCOfficeUtils;
/*
Compression levels:
-1 - Default.
0 - No compression.
1 - Best speed.
...
9 - Best compression.
*/
#define ZIP_NO_COMPRESSION 0
#define ZIP_BEST_SPEED 1
#define ZIP_BEST_COMPRESSION 9
#define ZIP_DEFAULT_COMPRESSION (-1)
// IOfficeDocxFile
[
object,
uuid("0FE32AEF-E7C5-42BD-A752-AC7F809D5E20"),
dual, helpstring("IOfficeDocxFile Interface"),
pointer_default(unique)
]
__interface IOfficeDocxFile : IAVSOfficeFileTemplate
{
[id(20), helpstring("method AddObjects")] HRESULT AddObjects([in] BSTR sSrcPath, [in]BSTR sXMLOptions);
};
// CDocxFile
[
coclass,
default(IOfficeDocxFile, _IAVSOfficeFileTemplateEvents),
threading(apartment),
event_source(com),
vi_progid("AVSOfficeDocxFile.DocxFile"),
progid("AVSOfficeDocxFile.DocxFile.1"),
version(1.0),
uuid("CF346C1A-8384-4516-9DD4-11219FB23799"),
helpstring("OfficeDocxFile Class")
]
class ATL_NO_VTABLE COfficeDocxFile : public IOfficeDocxFile
{
public:
COfficeDocxFile();
__event __interface _IAVSOfficeFileTemplateEvents;
__event __interface _IAVSOfficeFileTemplateEvents2;
public:
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct();
void FinalRelease();
public:
STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions);
STDMETHOD(SaveToFile)(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions);
STDMETHOD(AddObjects)(BSTR sSrcPath, BSTR sXMLOptions);
private:
IOfficeUtils* m_pOfficeUtils;
};
\ No newline at end of file
#pragma once
#include "../Common/TemporaryCS.h"
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;
};
#pragma once
#include "OfficeEventsTemplate.h"
template <class T, class Reciever>
class OfficeUtilsEvents : public COfficeEventTemplate<T,Reciever>
{
public:
OfficeUtilsEvents(Reciever *pReciever):COfficeEventTemplate(pReciever)
{
m_cnt = 0;
m_dwAdvise = 0;
};
HRESULT OnProgress( LONG nID, LONG nPercent, SHORT* Cancel)
{
m_pReciever->OnProgress( nID, nPercent );
m_pReciever->OnProgressEx( nID, nPercent, Cancel );
return S_OK;
}
STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
HRESULT hr;
VARIANTARG varg0;
VARIANTARG varg1;
VARIANTARG varg2;
switch(dispIdMember) {
case 1:
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);
OnProgress( 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);
}
}
};
\ No newline at end of file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ASCOfficeDocxFile.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCDOCXFILE 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
This diff is collapsed.
// stdafx.cpp : source file that includes just the standard includes
// AVSDocxFile.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 _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define _CRT_SECURE_NO_DEPRECATE
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
using namespace ATL;
\ No newline at end of file
#pragma once
//1
//0
//0
//26
#define INTVER 1,0,0,26
#define STRVER "1,0,0,26\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