Commit 4fdb174c authored by Oleg Korshul's avatar Oleg Korshul

com dll (activex) - сборка билдера

parent 38e24953
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by docbuilder.com.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCDOCBUILDER 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
// docbuilder.com.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "docbuilder.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{B43F4AFD-2278-4175-992C-D7AE390507D8}",
name = "ascdocbuilder",
helpstring = "ascdocbuilder 1.0 Type Library",
resource_name = "IDR_ASCDOCBUILDER") ];
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define COMPONENT_NAME "docbuilder.com"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.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", "Ascensio System SIA"
VALUE "FileDescription", "Ascensio System SIA docbuilder ActiveX DLL"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "docbuilder.com.dll"
VALUE "LegalCopyright", "Ascensio System SIA Copyright (c) 2011-2016. All rights reserved."
VALUE "OriginalFilename", "docbuilder.com.dll"
VALUE "ProductName", "docbuilder.com"
VALUE "ProductVersion", "1.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "docbuilder.com"
END
IDR_ASCDOCBUILDER REGISTRY "docbuilder.com.rgs"
////////////////////////////////////////////////////////////////////////////
#endif
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'docbuilder.com'
'docbuilder.com.DLL'
{
val AppID = s '%APPID%'
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
<Filter Include="Common">
<UniqueIdentifier>{530148cb-621e-4ac5-92fe-be9c13744f78}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="docbuilder.com.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="docbuilder.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="docbuilder.com.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="docbuilder.com.rgs">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
// docbuildercom.h : Declaration of the CDocbuilder
#pragma once
#include "resource.h" // main symbols
#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
using namespace ATL;
#ifdef CreateFile
#undef CreateFile
#endif
#ifdef _WIN64
#pragma comment(lib, "../../../build/lib/win_64/doctrenderer.lib")
#else
#pragma comment(lib, "../../../build/lib/win_32/doctrenderer.lib")
#endif
#include "../docbuilder.h"
#include "../../common/File.h"
// IASCDocBuilder
[object, uuid("B0C0E80B-2076-4C33-BC6D-3DB1B0FE9687"), dual, pointer_default(unique)]
__interface IASCDocBuilder : IDispatch
{
[id(1)] HRESULT CreateInstance([in] VARIANT_BOOL checkFonts);
[id(100)] HRESULT OpenFile([in] BSTR path, [in] BSTR params, [out, retval] VARIANT_BOOL* result);
[id(101)] HRESULT CreateFile([in] int type, [out, retval] VARIANT_BOOL* result);
[id(102)] HRESULT SetTmpFolder([in] BSTR folder);
[id(103)] HRESULT SaveFile([in] int type, [in] BSTR path, [out, retval] VARIANT_BOOL* result);
[id(104)] HRESULT CloseFile(void);
[id(105)] HRESULT ExecuteCommand([in] BSTR command, [out, retval] VARIANT_BOOL* result);
[id(106)] HRESULT Run([in] BSTR path, [out, retval] VARIANT_BOOL* result);
[id(107)] HRESULT RunText([in] BSTR commands, [out, retval] VARIANT_BOOL* result);
[id(108)] HRESULT SetProperty([in] BSTR sproperty);
[id(1001)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
[id(1002)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
};
// CASCDocBuilder
[coclass, uuid("227DE4AD-D992-4CCD-9704-0F041CE908F3"), threading(apartment), vi_progid("ASCDocBuilder.DocBuilder"), progid("ASCDocBuilder.DocBuilder.1"), version(1.0)]
class ATL_NO_VTABLE CASCDocBuilder : public IASCDocBuilder
{
protected:
NSDoctRenderer::CDocBuilder* m_pBuilder;
public:
CASCDocBuilder()
{
m_pBuilder = NULL;
}
~CASCDocBuilder()
{
if (NULL != m_pBuilder)
delete m_pBuilder;
}
STDMETHOD(CreateInstance)(VARIANT_BOOL checkFonts)
{
if (NULL != m_pBuilder)
delete m_pBuilder;
m_pBuilder = new NSDoctRenderer::CDocBuilder((VARIANT_TRUE == checkFonts) ? true : false);
return S_OK;
}
STDMETHOD(OpenFile)(BSTR path, BSTR params, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->OpenFile(path, params);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(CreateFile)(int type, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->CreateFile(type);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(SetTmpFolder)(BSTR folder)
{
if (NULL == m_pBuilder)
return S_FALSE;
m_pBuilder->SetTmpFolder(folder);
return S_OK;
}
STDMETHOD(SaveFile)(int type, BSTR path, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->SaveFile(type, path);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(CloseFile)()
{
if (NULL == m_pBuilder)
return S_FALSE;
m_pBuilder->CloseFile();
return S_OK;
}
STDMETHOD(ExecuteCommand)(BSTR command, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->ExecuteCommand(command);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(Run)(BSTR path, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->Run(path);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(RunText)(BSTR commands, VARIANT_BOOL* result)
{
if (NULL == m_pBuilder)
return S_FALSE;
bool bRet = m_pBuilder->Run(commands);
*result = bRet ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHOD(SetProperty)(BSTR sproperty)
{
if (NULL == m_pBuilder)
return S_FALSE;
std::wstring sData(sproperty);
std::string sDataA = U_TO_UTF8(sData);
m_pBuilder->SetProperty(sDataA.c_str());
return S_OK;
}
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
{
return S_OK;
}
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
{
return S_OK;
}
};
\ No newline at end of file
// stdafx.cpp : source file that includes just the standard includes
// docbuilder.com.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
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_NONSTDC_NO_DEPRECATE 1
#ifndef STRICT
#define STRICT
#endif
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atlcoll.h>
#include <atlfile.h>
#include <memory.h>
#include <math.h>
#include <string.h>
using namespace ATL;
#pragma once
//1
//0
//1
//0
#define INTVER 1,0,1,0
#define STRVER "1,0,1,0\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