This commit is contained in:
Rich 2007-12-10 20:53:18 +00:00
parent d927deacd7
commit 8af7cd5ee1
34 changed files with 16710 additions and 0 deletions

View File

@ -0,0 +1,281 @@
/***************************************************************************
* DSOFRAMER.IDL - DSO Framer ActiveX Control Type Library
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
/***************************************************************************
*
* IMPORTANT: You should not attempt to modify this library unless you are
* sure you do not break binary compatibility, or you change all the GUIDs
* listed in version.h so as to build a completely new control.
*
***************************************************************************/
#include <olectl.h>
#include "..\version.h"
[
uuid(DSOFRAMERCTL_TLIB), helpstring(DSOFRAMERCTL_FULLNAME),
version(DSOFRAMERCTL_VERSION), lcid(0x0000), control
]
library DSOFramer
{
importlib("STDOLE2.TLB");
typedef enum dsoBorderStyle
{
dsoBorderNone = 0,
dsoBorderFlat,
dsoBorder3D,
dsoBorder3DThin
} dsoBorderStyle;
typedef enum dsoShowDialogType
{
dsoDialogNew = 0,
dsoDialogOpen,
dsoDialogSave,
dsoDialogSaveCopy,
dsoDialogPrint,
dsoDialogPageSetup,
dsoDialogProperties
} dsoShowDialogType;
typedef enum dsoFileCommandType
{
dsoFileNew = 0,
dsoFileOpen,
dsoFileClose,
dsoFileSave,
dsoFileSaveAs,
dsoFilePrint,
dsoFilePageSetup,
dsoFileProperties,
dsoFilePrintPreview
} dsoFileCommandType;
[
uuid(DSOFRAMERCTL_INTERFACE), hidden, version(DSOFRAMERCTL_VERSION),
dual, oleautomation, odl
]
interface _FramerControl : IDispatch
{
[id(0x00010001), helpstring("Activates the current document object.")]
HRESULT Activate();
[propget, id(0x00010002), helpstring("Returns the Automation interface of the document object.")]
HRESULT ActiveDocument([out,retval] IDispatch** ppdisp);
[id(0x00010003), helpstring("Creates a new document based on the ProgId or Template file provided.")]
HRESULT CreateNew([in] BSTR ProgIdOrTemplate);
[id(0x00010004), helpstring("Opens a document from a file, URL, or Automation object.")]
HRESULT Open([in] VARIANT Document, [in, optional] VARIANT ReadOnly, [in, optional] VARIANT ProgId, [in, optional] VARIANT WebUsername, [in, optional] VARIANT WebPassword);
[id(0x00010005), helpstring("Saves the document to specified location or its original location.")]
HRESULT Save([in, optional] VARIANT SaveAsDocument, [in, optional] VARIANT OverwriteExisting, [in, optional] VARIANT WebUsername, [in, optional] VARIANT WebPassword);
[id(0x00010008), hidden]
HRESULT _PrintOutOld([in, optional] VARIANT PromptToSelectPrinter);
[id(0x00010009), helpstring("Closes the currently open document.")]
HRESULT Close();
[propput, id(0x0001000A), helpstring("Returns/sets the titlebar caption.")]
HRESULT Caption([in] BSTR bstr);
[propget, id(0x0001000A)]
HRESULT Caption([out,retval] BSTR* pbstr);
[propput, id(0x0001000B), helpstring("Returns/sets whether the titlebar should be displayed.")]
HRESULT Titlebar([in] VARIANT_BOOL vbool);
[propget, id(0x0001000B)]
HRESULT Titlebar([out,retval] VARIANT_BOOL* pbool);
[propput, id(0x0001000C), helpstring("Returns/sets whether toolbars should be displayed.")]
HRESULT Toolbars([in] VARIANT_BOOL vbool);
[propget, id(0x0001000C)]
HRESULT Toolbars([out,retval] VARIANT_BOOL* pbool);
[propput, nonbrowsable, id(0x0001000D), helpstring("Returns/sets the controls modal state.")]
HRESULT ModalState([in] VARIANT_BOOL vbool);
[propget, nonbrowsable, id(0x0001000D)]
HRESULT ModalState([out,retval] VARIANT_BOOL* pbool);
[id(0x0001000E), helpstring("Displays a modal dialog of the given type for user action.")]
HRESULT ShowDialog([in] dsoShowDialogType DlgType);
[propput, id(0x0001000F), helpstring("Returns/sets whether a specific action item is enabled.")]
HRESULT EnableFileCommand([in] dsoFileCommandType Item, [in] VARIANT_BOOL vbool);
[propget, id(0x0001000F)]
HRESULT EnableFileCommand([in] dsoFileCommandType Item, [out,retval] VARIANT_BOOL* pbool);
[propput, id(DISPID_BORDERSTYLE), helpstring("Returns/sets the border style for the control.")]
HRESULT BorderStyle([in] dsoBorderStyle style);
[propget, id(DISPID_BORDERSTYLE)]
HRESULT BorderStyle([out, retval] dsoBorderStyle* pstyle);
[propput, id(DISPID_BORDERCOLOR), helpstring("Returns/sets the border color of the control.")]
HRESULT BorderColor([in] OLE_COLOR clr);
[propget, id(DISPID_BORDERCOLOR)]
HRESULT BorderColor([out,retval] OLE_COLOR* pclr);
[propput, id(DISPID_BACKCOLOR), helpstring("Returns/sets the background color of the control.")]
HRESULT BackColor([in] OLE_COLOR clr);
[propget, id(DISPID_BACKCOLOR)]
HRESULT BackColor([out,retval] OLE_COLOR* pclr);
[propput, id(DISPID_FORECOLOR), helpstring("Returns/sets the foreground color of the control.")]
HRESULT ForeColor([in]OLE_COLOR clr);
[propget, id(DISPID_FORECOLOR)]
HRESULT ForeColor([out,retval]OLE_COLOR* pclr);
[propput, id(0x00010010), helpstring("Returns/sets the color of the titlebar.")]
HRESULT TitlebarColor([in] OLE_COLOR clr);
[propget, id(0x00010010)]
HRESULT TitlebarColor([out,retval] OLE_COLOR* pclr);
[propput, id(0x00010011), helpstring("Returns/sets the color of text for the titlebar.")]
HRESULT TitlebarTextColor([in] OLE_COLOR clr);
[propget, id(0x00010011)]
HRESULT TitlebarTextColor([out,retval] OLE_COLOR* pclr);
[id(0x00010012), helpstring("Calls IOleCommandTarget::Exec on embedded object.")]
HRESULT ExecOleCommand([in] LONG OLECMDID, [in, optional] VARIANT Options, [in, optional] VARIANT* vInParam, [in, out, optional] VARIANT* vInOutParam);
[propput, id(0x00010013), helpstring("Returns/sets whether a menu bar should be displayed.")]
HRESULT Menubar([in] VARIANT_BOOL vbool);
[propget, id(0x00010013)]
HRESULT Menubar([out,retval] VARIANT_BOOL* pbool);
[propput, id(0x00010014), helpstring("Returns/sets host application name (used in embedding).")]
HRESULT HostName([in] BSTR bstr);
[propget, id(0x00010014)]
HRESULT HostName([out,retval] BSTR* pbstr);
[propget, id(0x00010015), helpstring("Returns full document path name for object.")]
HRESULT DocumentFullName([out,retval] BSTR* pbstr);
[id(0x00010016), helpstring("Prints current document to specific printer with settings.")]
HRESULT PrintOut([in, optional] VARIANT PromptUser, [in, optional] VARIANT PrinterName, [in, optional] VARIANT Copies,
[in, optional] VARIANT FromPage, [in, optional] VARIANT ToPage, [in, optional] VARIANT OutputFile);
[id(0x00010017), helpstring("Starts a print preview (if document supports it).")]
HRESULT PrintPreview();
[id(0x00010018), helpstring("Exits a current print preview.")]
HRESULT PrintPreviewExit();
[propget, id(0x00010019), helpstring("Returns True/False if file was open read-only, or has not been saved.")]
HRESULT IsReadOnly([out,retval] VARIANT_BOOL* pbool);
[propget, id(0x0001001A), helpstring("Returns True/False if file has been altered or needs save.")]
HRESULT IsDirty([out,retval] VARIANT_BOOL* pbool);
[propput, id(0x0001001B), helpstring("Sets lock on the current embed server to keep it running (document must be open first).")]
HRESULT LockServer([in] VARIANT_BOOL vbool);
[propget, id(0x0001001B)]
HRESULT LockServer([out,retval] VARIANT_BOOL* pvbool);
[id(0x0001001C), nonbrowsable, helpstring("Gets the content of the body of the document (excluding headers/footers).")]
HRESULT GetDataObjectContent([in] VARIANT ClipFormatNameOrNumber, [out,retval] VARIANT *pvResults);
[id(0x0001001D), nonbrowsable, helpstring("Sets the content of the body of the document.")]
HRESULT SetDataObjectContent([in] VARIANT ClipFormatNameOrNumber, [in] VARIANT DataByteArray);
[propput, id(0x0001001E), helpstring("Allows host to set policy on activation behavior.")]
HRESULT ActivationPolicy([in] enum dsoActivationPolicy lPolicy);
[propget, id(0x0001001E)]
HRESULT ActivationPolicy([out,retval] enum dsoActivationPolicy *plPolicy);
[propput, id(0x0001001F), helpstring("Allows host to set policy on use of the frame hook.")]
HRESULT FrameHookPolicy([in] enum dsoFrameHookPolicy lPolicy);
[propget, id(0x0001001F)]
HRESULT FrameHookPolicy([out,retval] enum dsoFrameHookPolicy *plPolicy);
[propput, id(0x00010020), helpstring("Gets/sets whether control should try to handle menu accelerators or pass to host window.")]
HRESULT MenuAccelerators([in] VARIANT_BOOL vbool);
[propget, id(0x00010020)]
HRESULT MenuAccelerators([out,retval] VARIANT_BOOL* pvbool);
[propput, nonbrowsable, id(0x00010021), helpstring("Gets/sets whether control events are raised.")]
HRESULT EventsEnabled([in] VARIANT_BOOL vbool);
[propget, nonbrowsable, id(0x00010021)]
HRESULT EventsEnabled([out,retval] VARIANT_BOOL* pvbool);
[propget, id(0x00010022), helpstring("Returns just the document name (excluding path).")]
HRESULT DocumentName([out,retval] BSTR* pbstr);
};
[
uuid(DSOFRAMERCTL_DISPEVTS), hidden
]
dispinterface _DFramerCtlEvents
{
properties:
methods:
[id(DSOF_DISPID_FILECMD), helpstring("Called when File menu item is selected by user (may be canceled).")]
HRESULT OnFileCommand([in] dsoFileCommandType Item, [in,out] VARIANT_BOOL* Cancel);
[id(DSOF_DISPID_DOCOPEN), helpstring("Called when document is opened or new document added.")]
HRESULT OnDocumentOpened([in] BSTR File, [in] IDispatch* Document);
[id(DSOF_DISPID_DOCCLOSE), helpstring("Called when document is closed.")]
HRESULT OnDocumentClosed();
[id(DSOF_DISPID_ACTIVATE), helpstring("Called when component gains/loses activation.")]
HRESULT OnActivationChange([in] VARIANT_BOOL fGoingActive);
[id(DSOF_DISPID_BDOCCLOSE), helpstring("Called before document is closed (may be canceled).")]
HRESULT BeforeDocumentClosed([in] IDispatch* Document, [in,out] VARIANT_BOOL* Cancel);
[id(DSOF_DISPID_BDOCSAVE), helpstring("Called before document is saved (may be canceled).")]
HRESULT BeforeDocumentSaved([in] IDispatch* Document, [in] BSTR Location, [in,out] VARIANT_BOOL* Cancel);
[id(DSOF_DISPID_ENDPREVIEW), helpstring("Called when print preview is closed.")]
HRESULT OnPrintPreviewExit();
[id(DSOF_DISPID_SAVECOMPLETE), helpstring("Called when save is successful.")]
HRESULT OnSaveCompleted([in] IDispatch* Document, [in] BSTR DocName, [in] BSTR FullFileLocation);
};
[
uuid(DSOFRAMERCTL_CLSID),
helpstring(DSOFRAMERCTL_SHORTNAME), control
]
coclass FramerControl
{
[default] interface _FramerControl;
[default, source] dispinterface _DFramerCtlEvents;
};
typedef enum dsoFrameHookPolicy
{
dsoNormalBehavior = 0,
dsoSetOnFirstOpen,
dsoResetNow,
dsoDisableHook = 0xFFFFFFFF
} dsoFrameHookPolicy;
typedef enum dsoActivationPolicy
{
dsoDefaultBehavior = 0,
dsoKeepUIActiveOnAppDeactive = 0x01,
dsoCompDeactivateOnLostFocus = 0x02,
dsoIPDeactivateOnCompDeactive = 0x04
} dsoActivationPolicy;
};

View File

@ -0,0 +1,93 @@
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 6.00.0361 */
/* at Mon Oct 22 07:55:11 2007
*/
/* Compiler settings for .\Lib\dsoframer.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#if !defined(_M_IA64) && !defined(_M_AMD64)
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#ifdef __cplusplus
extern "C"{
#endif
#include <rpc.h>
#include <rpcndr.h>
#ifdef _MIDL_USE_GUIDDEF_
#ifndef INITGUID
#define INITGUID
#include <guiddef.h>
#undef INITGUID
#else
#include <guiddef.h>
#endif
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
#else // !_MIDL_USE_GUIDDEF_
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, LIBID_DSOFramer,0x00460180,0x9E5E,0x11d5,0xB7,0xC8,0xB8,0x26,0x90,0x41,0xDD,0x57);
MIDL_DEFINE_GUID(IID, IID__FramerControl,0x00460181,0x9E5E,0x11d5,0xB7,0xC8,0xB8,0x26,0x90,0x41,0xDD,0x57);
MIDL_DEFINE_GUID(IID, DIID__DFramerCtlEvents,0x00460185,0x9E5E,0x11d5,0xB7,0xC8,0xB8,0x26,0x90,0x41,0xDD,0x57);
MIDL_DEFINE_GUID(CLSID, CLSID_FramerControl,0x00460182,0x9E5E,0x11d5,0xB7,0xC8,0xB8,0x26,0x90,0x41,0xDD,0x57);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
}
#endif
#endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@ -0,0 +1,154 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#include "..\version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.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 DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TYPELIB
//
#ifdef _DEBUG
IDR_TYPELIB TYPELIB DISCARDABLE "..\\Debug\\dsoframer.tlb"
#else
IDR_TYPELIB TYPELIB DISCARDABLE "..\\Release\\dsoframer.tlb"
#endif // _DEBUG
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION DSOFRAMERCTL_VERSION_MAJOR,DSOFRAMERCTL_VERSION_MINOR,DSOFRAMERCTL_VERSION_BUILD,0
PRODUCTVERSION DSOFRAMERCTL_VERSION_MAJOR,DSOFRAMERCTL_VERSION_MINOR,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "UNSUPPORTED BY MICROSOFT\0"
VALUE "CompanyName", "Your Company\0"
VALUE "FileDescription", "Your Company's Office Framer Control Sample\0"
VALUE "FileVersion", DSOFRAMERCTL_VERSIONSTRFULL "\0"
VALUE "OriginalFilename", "dsoframer.ocx\0"
VALUE "ProductName", "DSOFRAMER\0"
VALUE "ProductVersion", DSOFRAMERCTL_VERSIONSTR "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_TOOLBOX BITMAP DISCARDABLE "toolbox.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SMALLOFFDOC ICON DISCARDABLE "dso.ico"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
RES_DSO_E_UNKNOWN "An unknown problem has occurred."
RES_DSO_E_INVALIDPROGID "The ProgID/Template could not be found or is not associated with a COM server."
RES_DSO_E_INVALIDSERVER "The associated COM server does not support ActiveX Document embedding."
RES_DSO_E_COMMANDNOTSUPPORTED
"The command is not supported by the document server."
RES_DSO_E_DOCUMENTREADONLY
"Unable to perform action because document was opened in read-only mode."
RES_DSO_E_REQUIRESMSDAIPP
"The Microsoft Internet Publishing Provider is not installed, so the URL document cannot be open for write access."
RES_DSO_E_DOCUMENTNOTOPEN "No document is open to perform the operation requested."
RES_DSO_E_INMODALSTATE "Cannot access document when in modal condition."
RES_DSO_E_NOTBEENSAVED "Cannot Save file without a file path."
RES_DSO_E_FRAMEHOOKFAILED "Unable to set frame hook for the parent window."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,39 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by dsoframer.rc
//
#define IDR_TYPELIB 1
#define RES_DSO_E_UNKNOWN 1
#define RES_DSO_E_INVALIDPROGID 2
#define RES_DSO_E_INVALIDSERVER 3
#define RES_DSO_E_COMMANDNOTSUPPORTED 4
#define RES_DSO_E_DOCUMENTREADONLY 5
#define RES_DSO_E_REQUIRESMSDAIPP 6
#define RES_DSO_E_DOCUMENTNOTOPEN 7
#define RES_DSO_E_INMODALSTATE 8
#define RES_DSO_E_NOTBEENSAVED 9
#define RES_DSO_E_FRAMEHOOKFAILED 10
#define IDB_TOOLBOX 102
#define IDB_TOOLBAR 103
#define IDR_BINDMENU 104
#define IDI_SMALLOFFDOC 105
#define MNU_NEW 40001
#define MNU_OPEN 40002
#define MNU_CLOSE 40003
#define MNU_SAVE 40004
#define MNU_SAVEAS 40005
#define MNU_PGSETUP 40006
#define MNU_PRINT 40007
#define MNU_PROPS 40008
#define MNU_PRINTPV 40009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 107
#define _APS_NEXT_COMMAND_VALUE 40011
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="dsoframer">
</Property><Property Name="Solution File" Value="C:\DsoFramer13\Source2005\dsoframer.sln">
</Property><Property Name="User Options File" Value="C:\DsoFramer13\Source2005\dsoframer.suo">
</Property><Property Name="Date" Value="Monday, October 22, 2007">
</Property><Property Name="Time" Value="15:21 PM">
</Property></Properties><Event ErrorLevel="0" Project="" Source="dsoframer.sln" Description="File successfully backed up as C:\DsoFramer13\Source2005\dsoframer.sln.old">
</Event><Event ErrorLevel="0" Project="" Source="dsoframer.suo" Description="File successfully backed up as C:\DsoFramer13\Source2005\dsoframer.suo.old">
</Event><Event ErrorLevel="0" Project="dsoframer" Source="dsoframer.vcproj" Description="Visual C++ now provides improved safety in its C and C++ Libraries. This includes new and improved functions, additional checking and validation, and internal design changes. These libraries are turned on by default. You may see some warnings about unsafe functions or parameters when you build your project. The warnings will generally suggest an alternative safer coding style or function. It is advised that you correct these warnings, in order to make your code more safe. Full details can be found in the documentation by searching for 'Security Enhancements in the CRT' and for 'Checked Iterators'.">
</Event><Event ErrorLevel="0" Project="dsoframer" Source="dsoframer.vcproj" Description="The C/C++ compiler default settings have been modified to be more compliant with ISO Standard C++. Included in those changes are enforcing Standard C++ for loop scoping and supporting wchar_t as a native type. These changes may cause existing code to no longer compile without changes to the code or the compiler options with which it is built.">
</Event><Event ErrorLevel="0" Project="dsoframer" Source="dsoframer.vcproj" Description="The single-threaded run-time library switches (/MLd, /ML) have been removed from the C++ compiler. The project has been automatically converted to use the corresponding multi-threaded run-time library switches (/MTd, /MT).">
</Event><Event ErrorLevel="1" Project="dsoframer" Source="dsoframer.vcproj" Description="The C/C++ compiler switch /YX is lo longer supported. /YX has been removed from your project settings.">
</Event><Event ErrorLevel="1" Project="dsoframer" Source="dsoframer.vcproj" Description="Due to the requirement that Visual C++ projects produce an embedded (by default) Windows SxS manifest, manifest files in the project are automatically excluded from building with the Manifest Tool. It is recommended that the dependency information contained in any manifest files be converted to &quot;#pragma comment(linker,&quot;&lt;insert dependency here&gt;&quot;)&quot; in a header file that is included from your source code. If your project already embeds a manifest in the RT_MANIFEST resource section through a resource (.rc) file, the line will need to be commented out before the project will build correctly.">
</Event><Event ErrorLevel="1" Project="dsoframer" Source="dsoframer.vcproj" Description="Due to a conformance change in the C++ compiler, code change may be required before your project will build without errors. Previous versions of the C++ compiler allowed specification of member function pointers by member function name (e.g. MemberFunctionName). The C++ standard requires a fully qualified name with the use of the address-of operator (e.g. &amp;ClassName::MemberFunctionName). If your project contains forms or controls used in the Windows Forms Designer, you may have to change code in InitializeComponent because the designer generated code used the non-conformant syntax in delegate construction (used in event handlers).">
</Event><Event ErrorLevel="0" Project="dsoframer" Source="dsoframer.vcproj" Description="Project file successfully backed up as 'C:\DsoFramer13\Source2005\dsoframer.vcproj.7.10.old'.">
</Event><Event ErrorLevel="0" Project="dsoframer" Source="dsoframer.vcproj" Description="Project upgraded successfully.">
</Event><Event ErrorLevel="3" Project="dsoframer" Source="dsoframer.vcproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="dsoframer.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="dsoframer.sln" Description="Converted">
</Event></UpgradeLog>

View File

@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

View File

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl='urn:schemas-microsoft-com:xslt'>
<xsl:key name="ProjectKey" match="Event" use="@Project" />
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution">Solution: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)">Project: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
&#32;<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Filename</td>
<td nowrap="1" class="header" _locID="Status">Status</td>
<td nowrap="1" class="header" _locID="Errors">Errors</td>
<td nowrap="1" class="header" _locID="Warnings">Warnings</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" alt="expand/collapse section" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9" ><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A>&#32;<xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'">Converted</xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0">Converted
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Conversion Issues - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/> files
</xsl:if>
<xsl:if test="count(source)=1">
1 file
</xsl:if>
</td>
<td class="foot">
Converted: <xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR />
Not converted <xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css" />
<title>Conversion Report&#32;
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Conversion Report - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b>Time of Conversion:</b>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Date']/@Value"/>&#32;&#32;<xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b>Conversion Settings</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

View File

@ -0,0 +1,118 @@
/***************************************************************************
* CLASSFACTORY.CPP
*
* CDsoFramerClassFactory: The Class Factroy for the control.
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#include "dsoframer.h"
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory - IClassFactory Implementation
//
// This is a fairly simple CF. We don't provide support for licensing
// in this sample because it is just a sample. If licensing is important
// you should change the class to support IClassFactory2.
//
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory::QueryInterface
//
STDMETHODIMP CDsoFramerClassFactory::QueryInterface(REFIID riid, void** ppv)
{
ODS("CDsoFramerClassFactory::QueryInterface\n");
CHECK_NULL_RETURN(ppv, E_POINTER);
if ((IID_IUnknown == riid) || (IID_IClassFactory == riid))
{
SAFE_SET_INTERFACE(*ppv, (IClassFactory*)this);
return S_OK;
}
*ppv = NULL;
return E_NOINTERFACE;
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory::AddRef
//
STDMETHODIMP_(ULONG) CDsoFramerClassFactory::AddRef(void)
{
TRACE1("CDsoFramerClassFactory::AddRef - %d\n", m_cRef+1);
return ++m_cRef;
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory::Release
//
STDMETHODIMP_(ULONG) CDsoFramerClassFactory::Release(void)
{
TRACE1("CDsoFramerClassFactory::Release - %d\n", m_cRef-1);
if (0 != --m_cRef) return m_cRef;
ODS("CDsoFramerClassFactory delete\n");
InterlockedDecrement((LPLONG)&v_cLocks);
delete this;
return 0;
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory::CreateInstance
//
// Creates an instance of our control.
//
STDMETHODIMP CDsoFramerClassFactory::CreateInstance(LPUNKNOWN punk, REFIID riid, void** ppv)
{
HRESULT hr;
CDsoFramerControl* pocx;
IUnknown* pnkInternal;
ODS("CDsoFramerClassFactory::CreateInstance\n");
CHECK_NULL_RETURN(ppv, E_POINTER); *ppv = NULL;
// Aggregation requires you ask for (internal) IUnknown
if ((punk) && (riid != IID_IUnknown))
return E_INVALIDARG;
// Create a new instance of the control...
pocx = new CDsoFramerControl(punk);
CHECK_NULL_RETURN(pocx, E_OUTOFMEMORY);
// Grab the internal IUnknown to use for the QI (you don't agg in CF:CreateInstance)...
pnkInternal = (IUnknown*)&(pocx->m_xInternalUnknown);
// Initialize the control (windows, etc.) and QI for requested interface...
if (SUCCEEDED(hr = pocx->InitializeNewInstance()) &&
SUCCEEDED(hr = pnkInternal->QueryInterface(riid, ppv)))
{
InterlockedIncrement((LPLONG)&v_cLocks); // on success, bump up the lock count...
}
else {delete pocx; *ppv = NULL;} // else cleanup the object
return hr;
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerClassFactory::LockServer
//
// Keeps the server loaded in memory.
//
STDMETHODIMP CDsoFramerClassFactory::LockServer(BOOL fLock)
{
TRACE1("CDsoFramerClassFactory::LockServer - %d\n", fLock);
if (fLock) InterlockedIncrement((LPLONG)&v_cLocks);
else InterlockedDecrement((LPLONG)&v_cLocks);
return S_OK;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,350 @@
/***************************************************************************
* DSOFDOCOBJ.H
*
* DSOFramer: OLE DocObject Site component (used by the control)
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#ifndef DS_DSOFDOCOBJ_H
#define DS_DSOFDOCOBJ_H
////////////////////////////////////////////////////////////////////
// Declarations for Interfaces used in DocObject Containment
//
#include <docobj.h> // Standard DocObjects (common to all AxDocs)
#include "ipprevw.h" // PrintPreview (for select Office apps)
#include "rbbinder.h" // Internet Publishing (for Web Folder write access)
////////////////////////////////////////////////////////////////////////
// Microsoft Office 97-2003 Document Object GUIDs
//
DEFINE_GUID(CLSID_WORD_DOCUMENT_DOC, 0x00020906, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_EXCEL_WORKBOOK_XLS, 0x00020820, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_EXCEL_CHART_XLS, 0x00020821, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_PPT_PRESENTATION_PPT, 0x64818D10, 0x4F9B, 0x11CF, 0x86, 0xEA, 0x00, 0xAA, 0x00, 0xB9, 0x29, 0xE8);
DEFINE_GUID(CLSID_VISIO_DRAWING_VSD, 0x00021A13, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_PROJECT_DOCUMENT_MPP, 0x74B78F3A, 0xC8C8, 0x11D1, 0xBE, 0x11, 0x00, 0xC0, 0x4F, 0xB6, 0xFA, 0xF1);
DEFINE_GUID(CLSID_MSHTML_DOCUMENT, 0x25336920, 0x03F9, 0x11CF, 0x8F, 0xD0, 0x00, 0xAA, 0x00, 0x68, 0x6F, 0x13);
////////////////////////////////////////////////////////////////////////
// Microsoft Office 2007 Document GUIDs
//
DEFINE_GUID(CLSID_WORD_DOCUMENT_DOCX, 0xF4754C9B, 0x64F5, 0x4B40, 0x8A, 0xF4, 0x67, 0x97, 0x32, 0xAC, 0x06, 0x07);
DEFINE_GUID(CLSID_WORD_DOCUMENT_DOCM, 0x18A06B6B, 0x2F3F, 0x4E2B, 0xA6, 0x11, 0x52, 0xBE, 0x63, 0x1B, 0x2D, 0x22);
DEFINE_GUID(CLSID_EXCEL_WORKBOOK_XLSX, 0x00020830, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_EXCEL_WORKBOOK_XLSM, 0x00020832, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_EXCEL_WORKBOOK_XLSB, 0x00020833, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
DEFINE_GUID(CLSID_PPT_PRESENTATION_PPTX, 0xCF4F55F4, 0x8F87, 0x4D47, 0x80, 0xBB, 0x58, 0x08, 0x16, 0x4B, 0xB3, 0xF8);
DEFINE_GUID(CLSID_PPT_PRESENTATION_PPTM, 0xDC020317, 0xE6E2, 0x4A62, 0xB9, 0xFA, 0xB3, 0xEF, 0xE1, 0x66, 0x26, 0xF4);
////////////////////////////////////////////////////////////////////
// IDsoDocObjectSite -- {444CA1F7-B405-4002-95C3-A455BC9F4F55}
//
// Implemented by control host for callbacks. Required interface.
//
interface IDsoDocObjectSite : public IServiceProvider
{
STDMETHOD(GetWindow)(HWND* phWnd) PURE;
STDMETHOD(GetBorder)(LPRECT prcBorder) PURE;
STDMETHOD(SetStatusText)(LPCOLESTR pszText) PURE;
STDMETHOD(GetHostName)(LPWSTR *ppwszHostName) PURE;
STDMETHOD(SysMenuCommand)(UINT uiCharCode) PURE;
};
DEFINE_GUID(IID_IDsoDocObjectSite, 0x444CA1F7, 0xB405, 0x4002, 0x95, 0xC3, 0xA4, 0x55, 0xBC, 0x9F, 0x4F, 0x55);
////////////////////////////////////////////////////////////////////
// CDsoDocObject -- ActiveDocument Container Site Object
//
// The CDsoDocObject object handles all the DocObject embedding for the
// control and os fairly self-contained. Like the control it has its
// own window, but it merely acts as a parent for the embedded object
// window(s) which it activates.
//
// CDsoDocObject works by taking a file (or automation object) and
// copying out the OLE storage used for its persistent data. It then
// creates a new embedding based on the data. If a storage is not
// avaiable, it will attempt to oad the file directly, but the results
// are less predictable using this manner since DocObjects are embeddings
// and not links and this component has limited support for links. As a
// result, we will attempt to keep our own storage copy in most cases.
//
// You should note that this approach is different than one taken by the
// web browser control, which is basically a link container which will
// try to embed (ip activate) if allowed, but if not it opens the file
// externally and keeps the link. If CDsoDocObject cannot embed the object,
// it returns an error. It will not open the object external.
//
// Like the control, this object also uses nested classes for the OLE
// interfaces used in the embedding. They are easier to track and easier
// to debug if a specific interface is over/under released. Again this was
// a design decision to make the sample easier to break apart, but not required.
//
// Because the object is not tied to the top-level window, it constructs
// the OLE merged menu as a set of popup menus which the control then displays
// in whatever form it wants. You would need to customize this if you used
// the control in a host and wanted the menus to merge with the actual host
// menu bar (on the top-level window or form).
//
class CDsoDocObject : public IUnknown
{
public:
CDsoDocObject();
~CDsoDocObject();
// Static Create Method (Host Provides Site Interface)
static STDMETHODIMP_(CDsoDocObject*) CreateInstance(IDsoDocObjectSite* phost);
// IUnknown Implementation
STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
// IOleClientSite Implementation
BEGIN_INTERFACE_PART(OleClientSite, IOleClientSite)
STDMETHODIMP SaveObject(void);
STDMETHODIMP GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker** ppmk);
STDMETHODIMP GetContainer(IOleContainer** ppContainer);
STDMETHODIMP ShowObject(void);
STDMETHODIMP OnShowWindow(BOOL fShow);
STDMETHODIMP RequestNewObjectLayout(void);
END_INTERFACE_PART(OleClientSite)
// IOleInPlaceSite Implementation
BEGIN_INTERFACE_PART(OleInPlaceSite, IOleInPlaceSite)
STDMETHODIMP GetWindow(HWND* phwnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP CanInPlaceActivate(void);
STDMETHODIMP OnInPlaceActivate(void);
STDMETHODIMP OnUIActivate(void);
STDMETHODIMP GetWindowContext(IOleInPlaceFrame** ppFrame, IOleInPlaceUIWindow** ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo);
STDMETHODIMP Scroll(SIZE sz);
STDMETHODIMP OnUIDeactivate(BOOL fUndoable);
STDMETHODIMP OnInPlaceDeactivate(void);
STDMETHODIMP DiscardUndoState(void);
STDMETHODIMP DeactivateAndUndo(void);
STDMETHODIMP OnPosRectChange(LPCRECT lprcPosRect);
END_INTERFACE_PART(OleInPlaceSite)
// IOleDocumentSite Implementation
BEGIN_INTERFACE_PART(OleDocumentSite, IOleDocumentSite)
STDMETHODIMP ActivateMe(IOleDocumentView* pView);
END_INTERFACE_PART(OleDocumentSite)
// IOleInPlaceFrame Implementation
BEGIN_INTERFACE_PART(OleInPlaceFrame, IOleInPlaceFrame)
STDMETHODIMP GetWindow(HWND* phWnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP GetBorder(LPRECT prcBorder);
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS pBW);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS pBW);
STDMETHODIMP SetActiveObject(LPOLEINPLACEACTIVEOBJECT pIIPActiveObj, LPCOLESTR pszObj);
STDMETHODIMP InsertMenus(HMENU hMenu, LPOLEMENUGROUPWIDTHS pMGW);
STDMETHODIMP SetMenu(HMENU hMenu, HOLEMENU hOLEMenu, HWND hWndObj);
STDMETHODIMP RemoveMenus(HMENU hMenu);
STDMETHODIMP SetStatusText(LPCOLESTR pszText);
STDMETHODIMP EnableModeless(BOOL fEnable);
STDMETHODIMP TranslateAccelerator(LPMSG pMSG, WORD wID);
END_INTERFACE_PART(OleInPlaceFrame)
// IOleCommandTarget Implementation
BEGIN_INTERFACE_PART(OleCommandTarget , IOleCommandTarget)
STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvaIn, VARIANTARG *pvaOut);
END_INTERFACE_PART(OleCommandTarget)
// IServiceProvider Implementation
BEGIN_INTERFACE_PART(ServiceProvider , IServiceProvider)
STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv);
END_INTERFACE_PART(ServiceProvider)
// IAuthenticate Implementation
BEGIN_INTERFACE_PART(Authenticate , IAuthenticate)
STDMETHODIMP Authenticate(HWND *phwnd, LPWSTR *pszUsername, LPWSTR *pszPassword);
END_INTERFACE_PART(Authenticate)
// IContinueCallback Implementation
BEGIN_INTERFACE_PART(ContinueCallback , IContinueCallback)
STDMETHODIMP FContinue(void);
STDMETHODIMP FContinuePrinting(LONG cPagesPrinted, LONG nCurrentPage, LPOLESTR pwszPrintStatus);
END_INTERFACE_PART(ContinueCallback)
// IOlePreviewCallback Implementation
BEGIN_INTERFACE_PART(PreviewCallback , IOlePreviewCallback)
STDMETHODIMP Notify(DWORD wStatus, LONG nLastPage, LPOLESTR pwszPreviewStatus);
END_INTERFACE_PART(PreviewCallback)
// DocObject Class Methods IDsoDocObjectSite
STDMETHODIMP InitializeNewInstance(IDsoDocObjectSite* phost);
STDMETHODIMP CreateDocObject(REFCLSID rclsid);
STDMETHODIMP CreateDocObject(IStorage *pstg);
STDMETHODIMP CreateFromFile(LPWSTR pwszFile, REFCLSID rclsid, LPBIND_OPTS pbndopts);
STDMETHODIMP CreateFromURL(LPWSTR pwszUrlFile, REFCLSID rclsid, LPBIND_OPTS pbndopts, LPWSTR pwszUserName, LPWSTR pwszPassword);
STDMETHODIMP CreateFromRunningObject(LPUNKNOWN punkObj, LPWSTR pwszObjectName, LPBIND_OPTS pbndopts);
STDMETHODIMP IPActivateView();
STDMETHODIMP IPDeactivateView();
STDMETHODIMP UIActivateView();
STDMETHODIMP UIDeactivateView();
STDMETHODIMP_(BOOL) IsDirty();
STDMETHODIMP Save();
STDMETHODIMP SaveToFile(LPWSTR pwszFile, BOOL fOverwriteFile);
STDMETHODIMP SaveToURL(LPWSTR pwszURL, BOOL fOverwriteFile, LPWSTR pwszUserName, LPWSTR pwszPassword);
STDMETHODIMP PrintDocument(LPCWSTR pwszPrinter, LPCWSTR pwszOutput, UINT cCopies, UINT nFrom, UINT nTo, BOOL fPromptUser);
STDMETHODIMP StartPrintPreview();
STDMETHODIMP ExitPrintPreview(BOOL fForceExit);
STDMETHODIMP DoOleCommand(DWORD dwOleCmdId, DWORD dwOptions, VARIANT* vInParam, VARIANT* vInOutParam);
STDMETHODIMP Close();
// Control should notify us on these conditions (so we can pass to IP object)...
STDMETHODIMP_(void) OnNotifySizeChange(LPRECT prc);
STDMETHODIMP_(void) OnNotifyAppActivate(BOOL fActive, DWORD dwThreadID);
STDMETHODIMP_(void) OnNotifyPaletteChanged(HWND hwndPalChg);
STDMETHODIMP_(void) OnNotifyChangeToolState(BOOL fShowTools);
STDMETHODIMP_(void) OnNotifyControlFocus(BOOL fGotFocus);
STDMETHODIMP HrGetDataFromObject(VARIANT *pvtType, VARIANT *pvtOutput);
STDMETHODIMP HrSetDataInObject(VARIANT *pvtType, VARIANT *pvtInput, BOOL fMbcsString);
STDMETHODIMP_(BOOL) GetDocumentTypeAndFileExtension(WCHAR** ppwszFileType, WCHAR** ppwszFileExt);
// Inline accessors for control to get IP object info...
inline IOleInPlaceActiveObject* GetActiveObject(){return m_pipactive;}
inline IOleObject* GetOleObject(){return m_pole;}
inline HWND GetDocWindow(){return m_hwnd;}
inline HWND GetActiveWindow(){return m_hwndUIActiveObj;}
inline BOOL IsReadOnly(){return m_fOpenReadOnly;}
inline BOOL InPrintPreview(){return ((m_pprtprv != NULL) || (m_fInPptSlideShow));}
inline HWND GetMenuHWND(){return m_hwndMenuObj;}
inline HMENU GetActiveMenu(){return m_hMenuActive;}
inline HMENU GetMergedMenu(){return m_hMenuMerged;}
inline void SetMergedMenu(HMENU h){m_hMenuMerged = h;}
inline LPCWSTR GetSourceName(){return ((m_pwszWebResource) ? m_pwszWebResource : m_pwszSourceFile);}
inline LPCWSTR GetSourceDocName(){return ((m_pwszSourceFile) ? &m_pwszSourceFile[m_idxSourceName] : NULL);}
inline CLSID* GetServerCLSID(){return &m_clsidObject;}
inline BOOL IsIPActive(){return (m_pipobj != NULL);}
BOOL IsWordObject()
{return ((m_clsidObject == CLSID_WORD_DOCUMENT_DOC) ||
(m_clsidObject == CLSID_WORD_DOCUMENT_DOCX) ||
(m_clsidObject == CLSID_WORD_DOCUMENT_DOCM));
}
BOOL IsExcelObject()
{return ((m_clsidObject == CLSID_EXCEL_WORKBOOK_XLS) ||
(m_clsidObject == CLSID_EXCEL_WORKBOOK_XLSX) ||
(m_clsidObject == CLSID_EXCEL_WORKBOOK_XLSM) ||
(m_clsidObject == CLSID_EXCEL_WORKBOOK_XLSB) ||
(m_clsidObject == CLSID_EXCEL_CHART_XLS));
}
BOOL IsPPTObject()
{return ((m_clsidObject == CLSID_PPT_PRESENTATION_PPT) ||
(m_clsidObject == CLSID_PPT_PRESENTATION_PPTX) ||
(m_clsidObject == CLSID_PPT_PRESENTATION_PPTM));
}
BOOL IsVisioObject()
{return (m_clsidObject == CLSID_VISIO_DRAWING_VSD);}
STDMETHODIMP SetRunningServerLock(BOOL fLock);
protected:
// Internal helper methods...
STDMETHODIMP InstantiateDocObjectServer(REFCLSID rclsid, IOleObject **ppole);
STDMETHODIMP CreateObjectStorage(REFCLSID rclsid);
STDMETHODIMP SaveObjectStorage();
STDMETHODIMP SaveDocToMoniker(IMoniker *pmk, IBindCtx *pbc, BOOL fKeepLock);
STDMETHODIMP SaveDocToFile(LPWSTR pwszFullName, BOOL fKeepLock);
STDMETHODIMP ValidateDocObjectServer(REFCLSID rclsid);
STDMETHODIMP_(BOOL) ValidateFileExtension(WCHAR* pwszFile, WCHAR** ppwszOut);
STDMETHODIMP_(void) OnDraw(DWORD dvAspect, HDC hdcDraw, LPRECT prcBounds, LPRECT prcWBounds, HDC hicTargetDev, BOOL fOptimize);
STDMETHODIMP EnsureOleServerRunning(BOOL fLockRunning);
STDMETHODIMP_(void) FreeRunningLock();
STDMETHODIMP_(void) TurnOffWebToolbar(BOOL fTurnedOff);
STDMETHODIMP_(void) ClearMergedMenu();
STDMETHODIMP_(DWORD) CalcDocNameIndex(LPCWSTR pwszPath);
STDMETHODIMP_(void) CheckForPPTPreviewChange();
// These functions allow the component to access files in a Web Folder for
// write access using the Microsoft Provider for Internet Publishing (MSDAIPP),
// which is installed by Office and comes standard in Windows 2000/ME/XP/2003. The
// provider is not required to use the component, only if you wish to save to
// an FPSE or DAV Web Folder (URL).
STDMETHODIMP_(IUnknown*) CreateIPPBindResource();
STDMETHODIMP IPPDownloadWebResource(LPWSTR pwszURL, LPWSTR pwszFile, IStream** ppstmKeepForSave);
STDMETHODIMP IPPUploadWebResource(LPWSTR pwszFile, IStream** ppstmSave, LPWSTR pwszURLSaveTo, BOOL fOverwriteFile);
static STDMETHODIMP_(LRESULT) FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// The private class variables...
private:
ULONG m_cRef; // Reference count
HWND m_hwnd; // our window
HWND m_hwndCtl; // The control's window
RECT m_rcViewRect; // Viewable area (set by host)
IDsoDocObjectSite *m_psiteCtl; // The control's site interface
IOleCommandTarget *m_pcmdCtl; // IOCT of host (for frame msgs)
LPWSTR m_pwszHostName; // Ole Host Name for container
LPWSTR m_pwszSourceFile; // Path to Source File (on Open)
IMoniker *m_pmkSourceFile; // Moniker to original source file
IBindCtx *m_pbctxSourceFile; // Bind context used to original source file
IStorage *m_pstgSourceFile; // Original File Storage (if open/save file)
DWORD m_idxSourceName; // Index to doc name in m_pwszSourceFile
CLSID m_clsidObject; // CLSID of the embedded object
IStorage *m_pstgroot; // Root temp storage
IStorage *m_pstgfile; // In-memory file storage
IStream *m_pstmview; // In-memory view info stream
LPWSTR m_pwszWebResource; // The full URL to the web resource
IStream *m_pstmWebResource; // Original Download Stream (if open/save URL)
IUnknown *m_punkIPPResource; // MSDAIPP provider resource (for URL authoring)
LPWSTR m_pwszUsername; // Username and password used by MSDAIPP
LPWSTR m_pwszPassword; // for Authentication (see IAuthenticate)
IOleObject *m_pole; // Embedded OLE Object (OLE)
IOleInPlaceObject *m_pipobj; // The IP object methods (OLE)
IOleInPlaceActiveObject *m_pipactive; // The UI Active object methods (OLE)
IOleDocumentView *m_pdocv; // MSO Document View (DocObj)
IOleCommandTarget *m_pcmdt; // MSO Command Target (DocObj)
IOleInplacePrintPreview *m_pprtprv; // MSO Print Preview (DocObj)
HMENU m_hMenuActive; // The menu supplied by embedded object
HMENU m_hMenuMerged; // The merged menu (set by control host)
HOLEMENU m_holeMenu; // The OLE Menu Descriptor
HWND m_hwndMenuObj; // The window for menu commands
HWND m_hwndIPObject; // IP active object window
HWND m_hwndUIActiveObj; // UI Active object window
DWORD m_dwObjectThreadID; // Thread Id of UI server
BORDERWIDTHS m_bwToolSpace; // Toolspace...
// Bitflags (state info)...
unsigned int m_fDisplayTools:1;
unsigned int m_fDisconnectOnQuit:1;
unsigned int m_fAppWindowActive:1;
unsigned int m_fOpenReadOnly:1;
unsigned int m_fObjectInModalCondition:1;
unsigned int m_fObjectIPActive:1;
unsigned int m_fObjectUIActive:1;
unsigned int m_fObjectActivateComplete:1;
unsigned int m_fLockedServerRunning:1;
unsigned int m_fLoadedFromAuto:1;
unsigned int m_fInClose:1;
unsigned int m_fAttemptPptPreview:1;
unsigned int m_fInPptSlideShow:1;
};
#endif //DS_DSOFDOCOBJ_H

View File

@ -0,0 +1,419 @@
/***************************************************************************
* DSOFPRINT.CPP
*
* CDsoDocObject: Print Code for CDsoDocObject object
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#include "dsoframer.h"
////////////////////////////////////////////////////////////////////////
// CDsoFramerControl::_PrintOutOld
//
// Prints the current object by calling IOleCommandTarget for Print.
//
STDMETHODIMP CDsoFramerControl::_PrintOutOld(VARIANT PromptToSelectPrinter)
{
DWORD dwOption = BOOL_FROM_VARIANT(PromptToSelectPrinter, FALSE)
? OLECMDEXECOPT_PROMPTUSER : OLECMDEXECOPT_DODEFAULT;
TRACE1("CDsoFramerControl::_PrintOutOld(%d)\n", dwOption);
CHECK_NULL_RETURN(m_pDocObjFrame, ProvideErrorInfo(DSO_E_DOCUMENTNOTOPEN));
// Cannot access object if in modal condition...
if ((m_fModalState) || (m_pDocObjFrame->InPrintPreview()))
return ProvideErrorInfo(DSO_E_INMODALSTATE);
return m_pDocObjFrame->DoOleCommand(OLECMDID_PRINT, dwOption, NULL, NULL);
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerControl::PrintOut
//
// Prints document using either IPrint or IOleCommandTarget, depending
// on parameters passed. This offers a bit more control over printing if
// the doc object server supports IPrint interface.
//
STDMETHODIMP CDsoFramerControl::PrintOut(VARIANT PromptUser, VARIANT PrinterName,
VARIANT Copies, VARIANT FromPage, VARIANT ToPage, VARIANT OutputFile)
{
HRESULT hr;
BOOL fPromptUser = BOOL_FROM_VARIANT(PromptUser, FALSE);
LPWSTR pwszPrinter = LPWSTR_FROM_VARIANT(PrinterName);
LPWSTR pwszOutput = LPWSTR_FROM_VARIANT(OutputFile);
LONG lCopies = LONG_FROM_VARIANT(Copies, 1);
LONG lFrom = LONG_FROM_VARIANT(FromPage, 0);
LONG lTo = LONG_FROM_VARIANT(ToPage, 0);
TRACE3("CDsoFramerControl::PrintOut(%d, %S, %d)\n", fPromptUser, pwszPrinter, lCopies);
CHECK_NULL_RETURN(m_pDocObjFrame, ProvideErrorInfo(DSO_E_DOCUMENTNOTOPEN));
// First we do validation of all parameters passed to the function...
if ((pwszPrinter) && (*pwszPrinter == L'\0'))
return E_INVALIDARG;
if ((pwszOutput) && (*pwszOutput == L'\0'))
return E_INVALIDARG;
if ((lCopies < 1) || (lCopies > 200))
return E_INVALIDARG;
if (((lFrom != 0) || (lTo != 0)) && ((lFrom < 1) || (lTo < lFrom)))
return E_INVALIDARG;
// Cannot access object if in modal condition...
if ((m_fModalState) || (m_pDocObjFrame->InPrintPreview()))
return ProvideErrorInfo(DSO_E_INMODALSTATE);
// If no printer name was provided, we can print to the default device
// using IOleCommandTarget with OLECMDID_PRINT...
if (pwszPrinter == NULL)
return _PrintOutOld(PromptUser);
// Ask the embedded document to print itself to specific printer...
hr = m_pDocObjFrame->PrintDocument(pwszPrinter, pwszOutput, (UINT)lCopies,
(UINT)lFrom, (UINT)lTo, fPromptUser);
// If call failed because interface doesn't exist, change error
// to let caller know it is because DocObj doesn't support this command...
if (FAILED(hr) && (hr == E_NOINTERFACE))
hr = DSO_E_COMMANDNOTSUPPORTED;
return ProvideErrorInfo(hr);
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerControl::PrintPreview
//
// Asks embedded object to attempt a print preview (only Office docs do this).
//
STDMETHODIMP CDsoFramerControl::PrintPreview()
{
HRESULT hr;
ODS("CDsoFramerControl::PrintPreview\n");
CHECK_NULL_RETURN(m_pDocObjFrame, ProvideErrorInfo(DSO_E_DOCUMENTNOTOPEN));
if (m_fModalState) // Cannot access object if in modal condition...
return ProvideErrorInfo(DSO_E_INMODALSTATE);
// Try to set object into print preview mode...
hr = m_pDocObjFrame->StartPrintPreview();
// If call failed because interface doesn't exist, change error
// to let caller know it is because DocObj doesn't support this command...
if (FAILED(hr) && (hr == E_NOINTERFACE))
hr = DSO_E_COMMANDNOTSUPPORTED;
return ProvideErrorInfo(hr);
}
////////////////////////////////////////////////////////////////////////
// CDsoFramerControl::PrintPreviewExit
//
// Closes an active preview.
//
STDMETHODIMP CDsoFramerControl::PrintPreviewExit()
{
ODS("CDsoFramerControl::PrintPreviewExit\n");
CHECK_NULL_RETURN(m_pDocObjFrame, ProvideErrorInfo(DSO_E_DOCUMENTNOTOPEN));
// Try to set object out of print preview mode...
if (m_pDocObjFrame->InPrintPreview())
m_pDocObjFrame->ExitPrintPreview(TRUE);
return S_OK;
}
////////////////////////////////////////////////////////////////////////
// CDsoDocObject::PrintDocument
//
// We can use the IPrint interface for an ActiveX Document object to
// selectively print object to a given printer.
//
STDMETHODIMP CDsoDocObject::PrintDocument(LPCWSTR pwszPrinter, LPCWSTR pwszOutput, UINT cCopies, UINT nFrom, UINT nTo, BOOL fPromptUser)
{
HRESULT hr;
IPrint *print;
HANDLE hPrint;
DVTARGETDEVICE* ptd = NULL;
ODS("CDsoDocObject::PrintDocument\n");
CHECK_NULL_RETURN(m_pole, E_UNEXPECTED);
// First thing we need to do is ask object for IPrint. If it does not
// support it, we cannot continue. It is up to DocObj if this is allowed...
hr = m_pole->QueryInterface(IID_IPrint, (void**)&print);
RETURN_ON_FAILURE(hr);
// Now setup printer settings into DEVMODE for IPrint. Open printer
// settings and gather default DEVMODE...
if (FOpenPrinter(pwszPrinter, &hPrint))
{
LPDEVMODEW pdevMode = NULL;
LPWSTR pwszDefProcessor = NULL;
LPWSTR pwszDefDriver = NULL;
LPWSTR pwszDefPort = NULL;
LPWSTR pwszPort;
DWORD cbDevModeSize;
if (FGetPrinterSettings(hPrint, &pwszDefProcessor,
&pwszDefDriver, &pwszDefPort, &pdevMode, &cbDevModeSize) && (pdevMode))
{
DWORD cbPrintName, cbDeviceName, cbOutputName;
DWORD cbDVTargetSize;
pdevMode->dmFields |= DM_COPIES;
pdevMode->dmCopies = (WORD)((cCopies) ? cCopies : 1);
pwszPort = ((pwszOutput) ? (LPWSTR)pwszOutput : pwszDefPort);
// We calculate the size we will need for the TARGETDEVICE structure...
cbPrintName = ((lstrlenW(pwszDefProcessor) + 1) * sizeof(WCHAR));
cbDeviceName = ((lstrlenW(pwszDefDriver) + 1) * sizeof(WCHAR));
cbOutputName = ((lstrlenW(pwszPort) + 1) * sizeof(WCHAR));
cbDVTargetSize = sizeof(DWORD) + sizeof(DEVNAMES) + cbPrintName +
cbDeviceName + cbOutputName + cbDevModeSize;
// Allocate new target device using COM Task Allocator...
ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(cbDVTargetSize);
if (ptd)
{
// Copy all the data in the DVT...
DWORD dwOffset = sizeof(DWORD) + sizeof(DEVNAMES);
ptd->tdSize = cbDVTargetSize;
ptd->tdDriverNameOffset = (WORD)dwOffset;
memcpy((BYTE*)(((BYTE*)ptd) + dwOffset), pwszDefProcessor, cbPrintName);
dwOffset += cbPrintName;
ptd->tdDeviceNameOffset = (WORD)dwOffset;
memcpy((BYTE*)(((BYTE*)ptd) + dwOffset), pwszDefDriver, cbDeviceName);
dwOffset += cbDeviceName;
ptd->tdPortNameOffset = (WORD)dwOffset;
memcpy((BYTE*)(((BYTE*)ptd) + dwOffset), pwszPort, cbOutputName);
dwOffset += cbOutputName;
ptd->tdExtDevmodeOffset = (WORD)dwOffset;
memcpy((BYTE*)(((BYTE*)ptd) + dwOffset), pdevMode, cbDevModeSize);
dwOffset += cbDevModeSize;
ASSERT(dwOffset == cbDVTargetSize);
}
else hr = E_OUTOFMEMORY;
// We're done with the devmode...
DsoMemFree(pdevMode);
}
else hr = E_WIN32_LASTERROR;
SAFE_FREESTRING(pwszDefPort);
SAFE_FREESTRING(pwszDefDriver);
SAFE_FREESTRING(pwszDefProcessor);
ClosePrinter(hPrint);
}
else hr = E_WIN32_LASTERROR;
// If we were successful in getting TARGETDEVICE struct, provide the page range
// for the print job and ask docobj server to print it...
if (SUCCEEDED(hr))
{
PAGESET *ppgset;
DWORD cbPgRngSize = sizeof(PAGESET) + sizeof(PAGERANGE);
LONG cPages, cLastPage;
DWORD grfPrintFlags;
// Setup the page range to print...
if ((ppgset = (PAGESET*)CoTaskMemAlloc(cbPgRngSize)) != NULL)
{
ppgset->cbStruct = cbPgRngSize;
ppgset->cPageRange = 1;
ppgset->fOddPages = TRUE;
ppgset->fEvenPages = TRUE;
ppgset->cPageRange = 1;
ppgset->rgPages[0].nFromPage = ((nFrom) ? nFrom : 1);
ppgset->rgPages[0].nToPage = ((nTo) ? nTo : PAGESET_TOLASTPAGE);
// Give indication we are waiting (on the print)...
HCURSOR hCur = SetCursor(LoadCursor(NULL, IDC_WAIT));
SEH_TRY
// Setup the initial page number (optional)...
print->SetInitialPageNum(ppgset->rgPages[0].nFromPage);
grfPrintFlags = (PRINTFLAG_MAYBOTHERUSER | PRINTFLAG_RECOMPOSETODEVICE);
if (fPromptUser) grfPrintFlags |= PRINTFLAG_PROMPTUSER;
if (pwszOutput) grfPrintFlags |= PRINTFLAG_PRINTTOFILE;
// Now ask server to print it using settings passed...
hr = print->Print(grfPrintFlags, &ptd, &ppgset, NULL, (IContinueCallback*)&m_xContinueCallback,
ppgset->rgPages[0].nFromPage, &cPages, &cLastPage);
SEH_EXCEPT(hr)
SetCursor(hCur);
if (ppgset)
CoTaskMemFree(ppgset);
}
else hr = E_OUTOFMEMORY;
}
// We are done...
if (ptd) CoTaskMemFree(ptd);
print->Release();
return hr;
}
////////////////////////////////////////////////////////////////////////
// CDsoDocObject::StartPrintPreview
//
// Ask embedded object to go into print preview (if supportted).
//
STDMETHODIMP CDsoDocObject::StartPrintPreview()
{
HRESULT hr;
IOleInplacePrintPreview *prev;
HCURSOR hCur;
ODS("CDsoDocObject::StartPrintPreview\n");
CHECK_NULL_RETURN(m_pole, E_UNEXPECTED);
// No need to do anything if already in preview...
if (InPrintPreview()) return S_FALSE;
// Otherwise, ask document server if it supports preview...
hr = m_pole->QueryInterface(IID_IOleInplacePrintPreview, (void**)&prev);
if (SUCCEEDED(hr))
{
// Tell user we waiting (switch to preview can be slow for very large docs)...
hCur = SetCursor(LoadCursor(NULL, IDC_WAIT));
// If it does, make sure it can go into preview mode...
hr = prev->QueryStatus();
if (SUCCEEDED(hr))
{
SEH_TRY
if (m_hwndCtl) // Notify the control that preview started...
SendMessage(m_hwndCtl, DSO_WM_ASYNCH_STATECHANGE, DSO_STATE_INTERACTIVE, (LPARAM)FALSE);
// We will allow application to bother user and switch printers...
hr = prev->StartPrintPreview(
(PREVIEWFLAG_MAYBOTHERUSER | PREVIEWFLAG_PROMPTUSER | PREVIEWFLAG_USERMAYCHANGEPRINTER),
NULL, (IOlePreviewCallback*)&m_xPreviewCallback, 1);
SEH_EXCEPT(hr)
// If the call succeeds, we keep hold of interface to close preview later
if (SUCCEEDED(hr))
{
SAFE_SET_INTERFACE(m_pprtprv, prev);
}
else
{ // Otherwise, notify the control that preview failed...
if (m_hwndCtl)
PostMessage(m_hwndCtl, DSO_WM_ASYNCH_STATECHANGE, DSO_STATE_INTERACTIVE, (LPARAM)TRUE);
}
}
SetCursor(hCur);
prev->Release();
}
else if (IsPPTObject() && (m_hwndUIActiveObj))
{
// PowerPoint doesn't have print preview, but it does have slide show mode, so we can use this to
// toggle the viewing into slideshow...
if (PostMessage(m_hwndUIActiveObj, WM_KEYDOWN, VK_F5, 0x00000001) &&
PostMessage(m_hwndUIActiveObj, WM_KEYUP, VK_F5, 0xC0000001))
{
hr = S_OK; m_fAttemptPptPreview = TRUE;
}
}
return hr;
}
////////////////////////////////////////////////////////////////////////
// CDsoDocObject::ExitPrintPreview
//
// Drop out of print preview and restore items as needed.
//
STDMETHODIMP CDsoDocObject::ExitPrintPreview(BOOL fForceExit)
{
TRACE1("CDsoDocObject::ExitPrintPreview(fForceExit=%d)\n", (DWORD)fForceExit);
// Need to be in preview to run this function...
if (!InPrintPreview()) return S_FALSE;
// If the user closes the app or otherwise terminates the preview, we need
// to notify the ActiveDocument server to leave preview mode...
if (m_pprtprv)
{
if (fForceExit) // Tell docobj we want to end preview...
{
HRESULT hr = m_pprtprv->EndPrintPreview(TRUE);
ASSERT(SUCCEEDED(hr)); (void)hr;
}
}
else if (m_fInPptSlideShow)
{
if ((fForceExit) && (m_hwndUIActiveObj))
{
// HACK: When it goes into slideshow, PPT 2007 changes the active window but
// doesn't call SetActiveObject to update us with new object and window handle.
// If we post VK_ESCAPE to the window handle we have, it can fail. It needs to go
// to the slideshow window that PPT failed to give us handle for. As workaround,
// setting focus to the UI window we have handle for will automatically forward
// to the right window, so we can use that trick to get the right window and
// make the call in a way that that should succeed regardless of PPT version...
SetFocus(m_hwndUIActiveObj);
PostMessage(GetFocus(), WM_KEYDOWN, VK_ESCAPE, 0x00000001);
PostMessage(GetFocus(), WM_KEYUP, VK_ESCAPE, 0xC0000001);
}
m_fAttemptPptPreview = FALSE;
m_fInPptSlideShow = FALSE;
}
if (m_hwndCtl) // Notify the control that preview ended...
SendMessage(m_hwndCtl, DSO_WM_ASYNCH_STATECHANGE, DSO_STATE_INTERACTIVE, (LPARAM)TRUE);
// Free our reference to preview interface...
SAFE_RELEASE_INTERFACE(m_pprtprv);
return S_OK;
}
////////////////////////////////////////////////////////////////////////
// CDsoDocObject::CheckForPPTPreviewChange
//
// Used to update control when PPT goes in/out of slideshow asynchronously.
//
STDMETHODIMP_(void) CDsoDocObject::CheckForPPTPreviewChange()
{
if (m_fInPptSlideShow)
{
ExitPrintPreview(FALSE);
}
else if (m_fAttemptPptPreview)
{
m_fInPptSlideShow = TRUE;
m_fAttemptPptPreview = FALSE;
if (m_hwndCtl) // Notify the control that preview started...
SendMessage(m_hwndCtl, DSO_WM_ASYNCH_STATECHANGE, DSO_STATE_INTERACTIVE, (LPARAM)FALSE);
}
}

View File

@ -0,0 +1,6 @@
LIBRARY dsoframer.ocx
EXPORTS
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE

View File

@ -0,0 +1,205 @@
# Microsoft Developer Studio Project File - Name="dsoframer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=dsoframer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "dsoframer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "dsoframer.mak" CFG="dsoframer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "dsoframer - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "dsoframer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "dsoframer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G5 /Gz /Zp4 /W3 /Zi /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib oledlg.lib winspool.lib shell32.lib urlmon.lib /nologo /base:"0x22000000" /version:1.2 /subsystem:windows /dll /map /debug /machine:I386 /out:"Release/dsoframer.ocx" /pdbtype:con /opt:nowin98 /merge:.rdata=.text
# SUBTRACT LINK32 /pdb:none
# Begin Custom Build - Performing registration
OutDir=.\Release
TargetPath=.\Release\dsoframer.ocx
InputPath=.\Release\dsoframer.ocx
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
# End Custom Build
!ELSEIF "$(CFG)" == "dsoframer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib oledlg.lib winspool.lib shell32.lib urlmon.lib /nologo /base:"0x22000000" /version:1.2 /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/dsoframer.ocx" /pdbtype:con
# SUBTRACT LINK32 /pdb:none
# Begin Custom Build - Performing registration
OutDir=.\Debug
TargetPath=.\Debug\dsoframer.ocx
InputPath=.\Debug\dsoframer.ocx
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
regsvr32 /s /c "$(TargetPath)"
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
# End Custom Build
!ENDIF
# Begin Target
# Name "dsoframer - Win32 Release"
# Name "dsoframer - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "c;cpp;rc;idl"
# Begin Source File
SOURCE=.\classfactory.cpp
# End Source File
# Begin Source File
SOURCE=.\dsofauto.cpp
# End Source File
# Begin Source File
SOURCE=.\dsofcontrol.cpp
# End Source File
# Begin Source File
SOURCE=.\dsofdocobj.cpp
# End Source File
# Begin Source File
SOURCE=.\dsofprint.cpp
# End Source File
# Begin Source File
SOURCE=.\lib\dsoframer.idl
# ADD MTL /h "lib/dsoframerlib.h" /iid "lib/dsoframerlib.c"
# End Source File
# Begin Source File
SOURCE=.\res\dsoframer.rc
# End Source File
# Begin Source File
SOURCE=.\mainentry.cpp
!IF "$(CFG)" == "dsoframer - Win32 Release"
# ADD CPP /D "DSO_MIN_CRT_STARTUP"
!ELSEIF "$(CFG)" == "dsoframer - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\utilities.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;def"
# Begin Source File
SOURCE=.\dsofdocobj.h
# End Source File
# Begin Source File
SOURCE=.\dsoframer.def
# End Source File
# Begin Source File
SOURCE=.\dsoframer.h
# End Source File
# Begin Source File
SOURCE=.\utilities.h
# End Source File
# Begin Source File
SOURCE=.\version.h
# End Source File
# End Group
# Begin Group "Resources"
# PROP Default_Filter "ico;cur;tlb;bmp"
# Begin Source File
SOURCE=.\res\dso.ico
# End Source File
# Begin Source File
SOURCE=.\lib\dsoframer.olb
# End Source File
# Begin Source File
SOURCE=.\res\toolbox.bmp
# End Source File
# End Group
# End Target
# End Project

View File

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "dsoframer"=.\dsoframer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -0,0 +1,689 @@
/***************************************************************************
* DSOFRAMER.H
*
* Developer Support Office ActiveX Document Framer Control Sample
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only.
*
* You have a royalty-free right to use, modify, reproduce and distribute
* this sample application, and/or any modified version, in any way you
* find useful, provided that you agree that Microsoft has no warranty,
* obligations or liability for the code or information provided herein.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
* See the EULA.TXT file included in the KB download for full terms of use
* and restrictions. You should consult documentation on MSDN Library for
* possible updates or changes to behaviors or interfaces used in this sample.
*
***************************************************************************/
#ifndef DS_DSOFRAMER_H
#define DS_DSOFRAMER_H
////////////////////////////////////////////////////////////////////
// We compile at level 4 and disable some unnecessary warnings...
//
#pragma warning(push, 4) // Compile at level-4 warnings
#pragma warning(disable: 4100) // unreferenced formal parameter (in OLE this is common)
#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
#pragma warning(disable: 4268) // const static/global data initialized with compiler generated default constructor
#pragma warning(disable: 4310) // cast truncates constant value
#pragma warning(disable: 4786) // identifier was truncated in the debug information
////////////////////////////////////////////////////////////////////
// Compile Options For Modified Behavior...
//
#define DSO_MSDAIPP_USE_DAVONLY // Default to WebDAV protocol for open by HTTP/HTTPS
#define DSO_WORD12_PERSIST_BUG // Perform workaround for IPersistFile bug in Word 2007
////////////////////////////////////////////////////////////////////
// Needed include files (both standard and custom)
//
#include <windows.h>
#include <ole2.h>
#include <olectl.h>
#include <oleidl.h>
#include <objsafe.h>
#include "version.h"
#include "utilities.h"
#include "dsofdocobj.h"
#include ".\lib\dsoframerlib.h"
#include ".\res\resource.h"
////////////////////////////////////////////////////////////////////
// Global Variables
//
extern HINSTANCE v_hModule;
extern CRITICAL_SECTION v_csecThreadSynch;
extern HICON v_icoOffDocIcon;
extern ULONG v_cLocks;
extern BOOL v_fUnicodeAPI;
extern BOOL v_fWindows2KPlus;
////////////////////////////////////////////////////////////////////
// Custom Errors - we support a very limited set of custom error messages
//
#define DSO_E_ERR_BASE 0x80041100
#define DSO_E_UNKNOWN 0x80041101 // "An unknown problem has occurred."
#define DSO_E_INVALIDPROGID 0x80041102 // "The ProgID/Template could not be found or is not associated with a COM server."
#define DSO_E_INVALIDSERVER 0x80041103 // "The associated COM server does not support ActiveX Document embedding."
#define DSO_E_COMMANDNOTSUPPORTED 0x80041104 // "The command is not supported by the document server."
#define DSO_E_DOCUMENTREADONLY 0x80041105 // "Unable to perform action because document was opened in read-only mode."
#define DSO_E_REQUIRESMSDAIPP 0x80041106 // "The Microsoft Internet Publishing Provider is not installed, so the URL document cannot be open for write access."
#define DSO_E_DOCUMENTNOTOPEN 0x80041107 // "No document is open to perform the operation requested."
#define DSO_E_INMODALSTATE 0x80041108 // "Cannot access document when in modal condition."
#define DSO_E_NOTBEENSAVED 0x80041109 // "Cannot Save file without a file path."
#define DSO_E_FRAMEHOOKFAILED 0x8004110A // "Unable to set frame hook for the parent window."
#define DSO_E_ERR_MAX 0x8004110B
////////////////////////////////////////////////////////////////////
// Custom OLE Command IDs - we use for special tasks
//
#define OLECMDID_GETDATAFORMAT 0x7001 // 28673
#define OLECMDID_SETDATAFORMAT 0x7002 // 28674
#define OLECMDID_LOCKSERVER 0x7003 // 28675
#define OLECMDID_RESETFRAMEHOOK 0x7009 // 28681
#define OLECMDID_NOTIFYACTIVE 0x700A // 28682
////////////////////////////////////////////////////////////////////
// Custom Window Messages (only apply to CDsoFramerControl window proc)
//
#define DSO_WM_ASYNCH_OLECOMMAND (WM_USER + 300)
#define DSO_WM_ASYNCH_STATECHANGE (WM_USER + 301)
#define DSO_WM_HOOK_NOTIFY_COMPACTIVE (WM_USER + 400)
#define DSO_WM_HOOK_NOTIFY_APPACTIVATE (WM_USER + 401)
#define DSO_WM_HOOK_NOTIFY_FOCUSCHANGE (WM_USER + 402)
#define DSO_WM_HOOK_NOTIFY_SYNCPAINT (WM_USER + 403)
#define DSO_WM_HOOK_NOTIFY_PALETTECHANGE (WM_USER + 404)
// State Flags for DSO_WM_ASYNCH_STATECHANGE:
#define DSO_STATE_MODAL 1
#define DSO_STATE_ACTIVATION 2
#define DSO_STATE_INTERACTIVE 3
#define DSO_STATE_RETURNFROMMODAL 4
////////////////////////////////////////////////////////////////////
// Menu Bar Items
//
#define DSO_MAX_MENUITEMS 16
#define DSO_MAX_MENUNAME_LENGTH 32
#ifndef DT_HIDEPREFIX
#define DT_HIDEPREFIX 0x00100000
#define DT_PREFIXONLY 0x00200000
#endif
#define SYNCPAINT_TIMER_ID 4
////////////////////////////////////////////////////////////////////
// Control Class Factory
//
class CDsoFramerClassFactory : public IClassFactory
{
public:
CDsoFramerClassFactory(): m_cRef(0){}
~CDsoFramerClassFactory(void){}
// IUnknown Implementation
STDMETHODIMP QueryInterface(REFIID riid, void ** ppv);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
// IClassFactory Implementation
STDMETHODIMP CreateInstance(LPUNKNOWN punk, REFIID riid, void** ppv);
STDMETHODIMP LockServer(BOOL fLock);
private:
ULONG m_cRef; // Reference count
};
////////////////////////////////////////////////////////////////////
// CDsoFramerControl -- Main Control (OCX) Object
//
// The CDsoFramerControl control is standard OLE control designed around
// the OCX94 specification. Because we plan on doing custom integration to
// act as both OLE object and OLE host, it does not use frameworks like ATL
// or MFC which would only complicate the nature of the sample.
//
// The control inherits from its automation interface, but uses nested
// classes for all OLE interfaces. This is not a requirement but does help
// to clearly seperate the tasks done by each interface and makes finding
// ref count problems easier to spot since each interface carries its own
// counter and will assert (in debug) if interface is over or under released.
//
// The control is basically a stage for the ActiveDocument embedding, and
// handles any external (user) commands. The task of actually acting as
// a DocObject host is done in the site object CDsoDocObject, which this
// class creates and uses for the embedding.
//
class CDsoFramerControl : public _FramerControl
{
public:
CDsoFramerControl(LPUNKNOWN punk);
~CDsoFramerControl(void);
// IUnknown Implementation -- Always delgates to outer unknown...
STDMETHODIMP QueryInterface(REFIID riid, void ** ppv){return m_pOuterUnknown->QueryInterface(riid, ppv);}
STDMETHODIMP_(ULONG) AddRef(void){return m_pOuterUnknown->AddRef();}
STDMETHODIMP_(ULONG) Release(void){return m_pOuterUnknown->Release();}
// IDispatch Implementation
STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo);
STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId);
STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr);
// _FramerControl Implementation
STDMETHODIMP Activate();
STDMETHODIMP get_ActiveDocument(IDispatch** ppdisp);
STDMETHODIMP CreateNew(BSTR ProgIdOrTemplate);
STDMETHODIMP Open(VARIANT Document, VARIANT ReadOnly, VARIANT ProgId, VARIANT WebUsername, VARIANT WebPassword);
STDMETHODIMP Save(VARIANT SaveAsDocument, VARIANT OverwriteExisting, VARIANT WebUsername, VARIANT WebPassword);
STDMETHODIMP _PrintOutOld(VARIANT PromptToSelectPrinter);
STDMETHODIMP Close();
STDMETHODIMP put_Caption(BSTR bstr);
STDMETHODIMP get_Caption(BSTR* pbstr);
STDMETHODIMP put_Titlebar(VARIANT_BOOL vbool);
STDMETHODIMP get_Titlebar(VARIANT_BOOL* pbool);
STDMETHODIMP put_Toolbars(VARIANT_BOOL vbool);
STDMETHODIMP get_Toolbars(VARIANT_BOOL* pbool);
STDMETHODIMP put_ModalState(VARIANT_BOOL vbool);
STDMETHODIMP get_ModalState(VARIANT_BOOL* pbool);
STDMETHODIMP ShowDialog(dsoShowDialogType DlgType);
STDMETHODIMP put_EnableFileCommand(dsoFileCommandType Item, VARIANT_BOOL vbool);
STDMETHODIMP get_EnableFileCommand(dsoFileCommandType Item, VARIANT_BOOL* pbool);
STDMETHODIMP put_BorderStyle(dsoBorderStyle style);
STDMETHODIMP get_BorderStyle(dsoBorderStyle* pstyle);
STDMETHODIMP put_BorderColor(OLE_COLOR clr);
STDMETHODIMP get_BorderColor(OLE_COLOR* pclr);
STDMETHODIMP put_BackColor(OLE_COLOR clr);
STDMETHODIMP get_BackColor(OLE_COLOR* pclr);
STDMETHODIMP put_ForeColor(OLE_COLOR clr);
STDMETHODIMP get_ForeColor(OLE_COLOR* pclr);
STDMETHODIMP put_TitlebarColor(OLE_COLOR clr);
STDMETHODIMP get_TitlebarColor(OLE_COLOR* pclr);
STDMETHODIMP put_TitlebarTextColor(OLE_COLOR clr);
STDMETHODIMP get_TitlebarTextColor(OLE_COLOR* pclr);
STDMETHODIMP ExecOleCommand(LONG OLECMDID, VARIANT Options, VARIANT* vInParam, VARIANT* vInOutParam);
STDMETHODIMP put_Menubar(VARIANT_BOOL vbool);
STDMETHODIMP get_Menubar(VARIANT_BOOL* pbool);
STDMETHODIMP put_HostName(BSTR bstr);
STDMETHODIMP get_HostName(BSTR* pbstr);
STDMETHODIMP get_DocumentFullName(BSTR* pbstr);
STDMETHODIMP PrintOut(VARIANT PromptUser, VARIANT PrinterName, VARIANT Copies, VARIANT FromPage, VARIANT ToPage, VARIANT OutputFile);
STDMETHODIMP PrintPreview();
STDMETHODIMP PrintPreviewExit();
STDMETHODIMP get_IsReadOnly(VARIANT_BOOL* pbool);
STDMETHODIMP get_IsDirty(VARIANT_BOOL* pbool);
STDMETHODIMP put_LockServer(VARIANT_BOOL vbool);
STDMETHODIMP get_LockServer(VARIANT_BOOL* pvbool);
STDMETHODIMP GetDataObjectContent(VARIANT ClipFormatNameOrNumber, VARIANT *pvResults);
STDMETHODIMP SetDataObjectContent(VARIANT ClipFormatNameOrNumber, VARIANT DataByteArray);
STDMETHODIMP put_ActivationPolicy(dsoActivationPolicy lPolicy);
STDMETHODIMP get_ActivationPolicy(dsoActivationPolicy *plPolicy);
STDMETHODIMP put_FrameHookPolicy(dsoFrameHookPolicy lPolicy);
STDMETHODIMP get_FrameHookPolicy(dsoFrameHookPolicy *plPolicy);
STDMETHODIMP put_MenuAccelerators(VARIANT_BOOL vbool);
STDMETHODIMP get_MenuAccelerators(VARIANT_BOOL* pvbool);
STDMETHODIMP put_EventsEnabled(VARIANT_BOOL vbool);
STDMETHODIMP get_EventsEnabled(VARIANT_BOOL* pvbool);
STDMETHODIMP get_DocumentName(BSTR* pbstr);
// IInternalUnknown Implementation
BEGIN_INTERFACE_PART(InternalUnknown, IUnknown)
END_INTERFACE_PART(InternalUnknown)
// IPersistStreamInit Implementation
BEGIN_INTERFACE_PART(PersistStreamInit, IPersistStreamInit)
STDMETHODIMP GetClassID(CLSID *pClassID);
STDMETHODIMP IsDirty(void);
STDMETHODIMP Load(LPSTREAM pStm);
STDMETHODIMP Save(LPSTREAM pStm, BOOL fClearDirty);
STDMETHODIMP GetSizeMax(ULARGE_INTEGER* pcbSize);
STDMETHODIMP InitNew(void);
END_INTERFACE_PART(PersistStreamInit)
// IPersistPropertyBag Implementation
BEGIN_INTERFACE_PART(PersistPropertyBag, IPersistPropertyBag)
STDMETHODIMP GetClassID(CLSID *pClassID);
STDMETHODIMP InitNew(void);
STDMETHODIMP Load(IPropertyBag* pPropBag, IErrorLog* pErrorLog);
STDMETHODIMP Save(IPropertyBag* pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties);
END_INTERFACE_PART(PersistPropertyBag)
// IPersistStorage Implementation
BEGIN_INTERFACE_PART(PersistStorage, IPersistStorage)
STDMETHODIMP GetClassID(CLSID *pClassID);
STDMETHODIMP IsDirty(void);
STDMETHODIMP InitNew(LPSTORAGE pStg);
STDMETHODIMP Load(LPSTORAGE pStg);
STDMETHODIMP Save(LPSTORAGE pStg, BOOL fSameAsLoad);
STDMETHODIMP SaveCompleted(LPSTORAGE pStg);
STDMETHODIMP HandsOffStorage(void);
END_INTERFACE_PART(PersistStorage)
// IOleObject Implementation
BEGIN_INTERFACE_PART(OleObject, IOleObject)
STDMETHODIMP SetClientSite(IOleClientSite *pClientSite);
STDMETHODIMP GetClientSite(IOleClientSite **ppClientSite);
STDMETHODIMP SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContainerObj);
STDMETHODIMP Close(DWORD dwSaveOption);
STDMETHODIMP SetMoniker(DWORD dwWhichMoniker, IMoniker *pmk);
STDMETHODIMP GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk);
STDMETHODIMP InitFromData(IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved);
STDMETHODIMP GetClipboardData(DWORD dwReserved, IDataObject **ppDataObject);
STDMETHODIMP DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect);
STDMETHODIMP EnumVerbs(IEnumOLEVERB **ppEnumOleVerb);
STDMETHODIMP Update();
STDMETHODIMP IsUpToDate();
STDMETHODIMP GetUserClassID(CLSID *pClsid);
STDMETHODIMP GetUserType(DWORD dwFormOfType, LPOLESTR *pszUserType);
STDMETHODIMP SetExtent(DWORD dwDrawAspect, SIZEL *psizel);
STDMETHODIMP GetExtent(DWORD dwDrawAspect, SIZEL *psizel);
STDMETHODIMP Advise(IAdviseSink *pAdvSink, DWORD *pdwConnection);
STDMETHODIMP Unadvise(DWORD dwConnection);
STDMETHODIMP EnumAdvise(IEnumSTATDATA **ppenumAdvise);
STDMETHODIMP GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus);
STDMETHODIMP SetColorScheme(LOGPALETTE *pLogpal);
END_INTERFACE_PART(OleObject)
// IOleControl Implementation
BEGIN_INTERFACE_PART(OleControl, IOleControl)
STDMETHODIMP GetControlInfo(CONTROLINFO* pCI);
STDMETHODIMP OnMnemonic(LPMSG pMsg);
STDMETHODIMP OnAmbientPropertyChange(DISPID dispID);
STDMETHODIMP FreezeEvents(BOOL bFreeze);
END_INTERFACE_PART(OleControl)
// IOleInplaceObject Implementation
BEGIN_INTERFACE_PART(OleInplaceObject, IOleInPlaceObject)
STDMETHODIMP GetWindow(HWND *phwnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP InPlaceDeactivate();
STDMETHODIMP UIDeactivate();
STDMETHODIMP SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect);
STDMETHODIMP ReactivateAndUndo();
END_INTERFACE_PART(OleInplaceObject)
// IOleInplaceActiveObject Implementation
BEGIN_INTERFACE_PART(OleInplaceActiveObject, IOleInPlaceActiveObject)
STDMETHODIMP GetWindow(HWND *phwnd);
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
STDMETHODIMP TranslateAccelerator(LPMSG lpmsg);
STDMETHODIMP OnFrameWindowActivate(BOOL fActivate);
STDMETHODIMP OnDocWindowActivate(BOOL fActivate);
STDMETHODIMP ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow);
STDMETHODIMP EnableModeless(BOOL fEnable);
END_INTERFACE_PART(OleInplaceActiveObject)
// IViewObjectEx Implementation
BEGIN_INTERFACE_PART(ViewObjectEx, IViewObjectEx)
STDMETHODIMP Draw(DWORD dwDrawAspect, LONG lIndex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDevice, HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, BOOL (__stdcall *pfnContinue)(DWORD dwContinue), DWORD dwContinue);
STDMETHODIMP GetColorSet(DWORD dwAspect, LONG lindex, void* pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE** ppColorSet);
STDMETHODIMP Freeze(DWORD dwAspect, LONG lindex, void* pvAspect, DWORD* pdwFreeze);
STDMETHODIMP Unfreeze(DWORD dwFreeze);
STDMETHODIMP SetAdvise(DWORD dwAspect, DWORD advf, IAdviseSink* pAdviseSink);
STDMETHODIMP GetAdvise(DWORD* pdwAspect, DWORD* padvf, IAdviseSink** ppAdviseSink);
STDMETHODIMP GetExtent(DWORD dwDrawAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL psizel);
STDMETHODIMP GetRect(DWORD dwAspect, LPRECTL pRect);
STDMETHODIMP GetViewStatus(DWORD* pdwStatus);
STDMETHODIMP QueryHitPoint(DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHint, DWORD *pHitResult);
STDMETHODIMP QueryHitRect(DWORD dwAspect, LPCRECT pRectBounds, LPCRECT pRectLoc, LONG lCloseHint, DWORD *pHitResult);
STDMETHODIMP GetNaturalExtent(DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, HDC hicTargetDev, DVEXTENTINFO *pExtentInfo, LPSIZEL pSizel);
END_INTERFACE_PART(ViewObjectEx)
// IDataObject Implementation
BEGIN_INTERFACE_PART(DataObject, IDataObject)
STDMETHODIMP GetData(FORMATETC *pfmtc, STGMEDIUM *pstgm);
STDMETHODIMP GetDataHere(FORMATETC *pfmtc, STGMEDIUM *pstgm);
STDMETHODIMP QueryGetData(FORMATETC *pfmtc);
STDMETHODIMP GetCanonicalFormatEtc(FORMATETC * pfmtcIn, FORMATETC * pfmtcOut);
STDMETHODIMP SetData(FORMATETC *pfmtc, STGMEDIUM *pstgm, BOOL fRelease);
STDMETHODIMP EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenum);
STDMETHODIMP DAdvise(FORMATETC *pfmtc, DWORD advf, IAdviseSink *psink, DWORD *pdwConnection);
STDMETHODIMP DUnadvise(DWORD dwConnection);
STDMETHODIMP EnumDAdvise(IEnumSTATDATA **ppenum);
END_INTERFACE_PART(DataObject)
// IProvideClassInfo Implementation
BEGIN_INTERFACE_PART(ProvideClassInfo, IProvideClassInfo)
STDMETHODIMP GetClassInfo(ITypeInfo** ppTI);
END_INTERFACE_PART(ProvideClassInfo)
// IConnectionPointContainer Implementation
BEGIN_INTERFACE_PART(ConnectionPointContainer, IConnectionPointContainer)
STDMETHODIMP EnumConnectionPoints(IEnumConnectionPoints **ppEnum);
STDMETHODIMP FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP);
END_INTERFACE_PART(ConnectionPointContainer)
// IEnumConnectionPoints Implementation
BEGIN_INTERFACE_PART(EnumConnectionPoints, IEnumConnectionPoints)
STDMETHODIMP Next(ULONG cConnections, IConnectionPoint **rgpcn, ULONG *pcFetched);
STDMETHODIMP Skip(ULONG cConnections);
STDMETHODIMP Reset(void);
STDMETHODIMP Clone(IEnumConnectionPoints **ppEnum);
END_INTERFACE_PART(EnumConnectionPoints)
// IConnectionPoint Implementation
BEGIN_INTERFACE_PART(ConnectionPoint, IConnectionPoint)
STDMETHODIMP GetConnectionInterface(IID *pIID);
STDMETHODIMP GetConnectionPointContainer(IConnectionPointContainer **ppCPC);
STDMETHODIMP Advise(IUnknown *pUnk, DWORD *pdwCookie);
STDMETHODIMP Unadvise(DWORD dwCookie);
STDMETHODIMP EnumConnections(IEnumConnections **ppEnum);
END_INTERFACE_PART(ConnectionPoint)
// IOleCommandTarget Implementation
BEGIN_INTERFACE_PART(OleCommandTarget , IOleCommandTarget)
STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvaIn, VARIANTARG *pvaOut);
END_INTERFACE_PART(OleCommandTarget)
// ISupportErrorInfo Implementation
BEGIN_INTERFACE_PART(SupportErrorInfo, ISupportErrorInfo)
STDMETHODIMP InterfaceSupportsErrorInfo(REFIID riid);
END_INTERFACE_PART(SupportErrorInfo)
// IObjectSafety Implementation
BEGIN_INTERFACE_PART(ObjectSafety, IObjectSafety)
STDMETHODIMP GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions,DWORD *pdwEnabledOptions);
STDMETHODIMP SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions);
END_INTERFACE_PART(ObjectSafety)
// IDsoDocObjectSite Implementation (for DocObject Callbacks to control)
BEGIN_INTERFACE_PART(DsoDocObjectSite, IDsoDocObjectSite)
STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv);
STDMETHODIMP GetWindow(HWND* phWnd);
STDMETHODIMP GetBorder(LPRECT prcBorder);
STDMETHODIMP GetHostName(LPWSTR *ppwszHostName);
STDMETHODIMP SysMenuCommand(UINT uiCharCode);
STDMETHODIMP SetStatusText(LPCOLESTR pszText);
END_INTERFACE_PART(DsoDocObjectSite)
STDMETHODIMP InitializeNewInstance();
STDMETHODIMP InPlaceActivate(LONG lVerb);
STDMETHODIMP UIActivate(BOOL fForceUIActive);
STDMETHODIMP_(void) SetInPlaceVisible(BOOL fShow);
STDMETHODIMP_(void) UpdateModalState(BOOL fModeless, BOOL fNotifyIPObject);
STDMETHODIMP_(void) UpdateInteractiveState(BOOL fActive);
STDMETHODIMP_(void) EnableDropFile(BOOL fEnable);
STDMETHODIMP_(void) OnDraw(DWORD dvAspect, HDC hdcDraw, LPRECT prcBounds, LPRECT prcWBounds, HDC hicTargetDev, BOOL fOptimize);
STDMETHODIMP_(void) OnDestroyWindow();
STDMETHODIMP_(void) OnResize();
STDMETHODIMP_(void) OnMouseMove(UINT x, UINT y);
STDMETHODIMP_(void) OnButtonDown(UINT x, UINT y);
STDMETHODIMP_(void) OnMenuMessage(UINT msg, WPARAM wParam, LPARAM lParam);
STDMETHODIMP_(void) OnToolbarAction(DWORD cmd);
STDMETHODIMP_(void) OnDropFile(HDROP hdrpFile);
STDMETHODIMP_(void) OnTimer(UINT id);
STDMETHODIMP_(void) OnForegroundCompChange(BOOL fCompActive);
STDMETHODIMP_(void) OnAppActivationChange(BOOL fActive, DWORD dwThreadID);
STDMETHODIMP_(void) OnComponentActivationChange(BOOL fActivate);
STDMETHODIMP_(void) OnCtrlFocusChange(BOOL fCtlGotFocus, HWND hFocusWnd);
STDMETHODIMP_(void) OnUIFocusChange(BOOL fUIActive);
STDMETHODIMP_(void) OnPaletteChanged(HWND hwndPalChg);
STDMETHODIMP_(void) OnSyncPaint();
STDMETHODIMP_(void) OnWindowEnable(BOOL fEnable){TRACE1("CDsoFramerControl::OnWindowEnable(%d)\n", fEnable);}
STDMETHODIMP_(BOOL) OnSysCommandMenu(CHAR ch);
STDMETHODIMP_(HMENU) GetActivePopupMenu();
STDMETHODIMP_(BOOL) FAlertUser(HRESULT hr, LPWSTR pwsFileName);
STDMETHODIMP_(BOOL) FRunningInDesignMode();
STDMETHODIMP DoDialogAction(dsoShowDialogType item);
STDMETHODIMP_(void) RaiseActivationEvent(BOOL fActive);
STDMETHODIMP ProvideErrorInfo(HRESULT hres);
STDMETHODIMP RaiseAutomationEvent(DISPID did, ULONG cargs, VARIANT *pvtargs);
STDMETHODIMP SetTempServerLock(BOOL fLock);
STDMETHODIMP ResetFrameHook(HWND hwndFrameWindow);
// Some inline methods are provided for common tasks such as site notification
// or calculation of draw size based on user selection of tools and border style.
void __fastcall ViewChanged()
{
if (m_pDataAdviseHolder) // Send data change notification.
m_pDataAdviseHolder->SendOnDataChange((IDataObject*)&m_xDataObject, NULL, 0);
if (m_pViewAdviseSink) // Send the view change notification....
{
m_pViewAdviseSink->OnViewChange(DVASPECT_CONTENT, -1);
if (m_fViewAdviseOnlyOnce) // If they asked to be advised once, kill the connection
m_xViewObjectEx.SetAdvise(DVASPECT_CONTENT, 0, NULL);
}
InvalidateRect(m_hwnd, NULL, TRUE); // Ensure a full repaint...
}
void __fastcall GetSizeRectAfterBorder(LPRECT lprcx, LPRECT lprc)
{
if (lprcx) CopyRect(lprc, lprcx);
else SetRect(lprc, 0, 0, m_Size.cx, m_Size.cy);
if (m_fBorderStyle) InflateRect(lprc, -(4-m_fBorderStyle), -(4-m_fBorderStyle));
}
void __fastcall GetSizeRectAfterTitlebar(LPRECT lprcx, LPRECT lprc)
{
GetSizeRectAfterBorder(lprcx, lprc);
if (m_fShowTitlebar) lprc->top += 21;
}
void __fastcall GetSizeRectForMenuBar(LPRECT lprcx, LPRECT lprc)
{
GetSizeRectAfterTitlebar(lprcx, lprc);
lprc->bottom = lprc->top + 24;
}
void __fastcall GetSizeRectForDocument(LPRECT lprcx, LPRECT lprc)
{
GetSizeRectAfterTitlebar(lprcx, lprc);
if (m_fShowMenuBar) lprc->top += 24;
if (lprc->top > lprc->bottom) lprc->top = lprc->bottom;
}
void __fastcall RedrawCaption()
{
RECT rcT;
if ((m_hwnd) && (m_fShowTitlebar))
{ GetClientRect(m_hwnd, &rcT); rcT.bottom = 21;
InvalidateRect(m_hwnd, &rcT, FALSE);
}
if ((m_hwnd) && (m_fShowMenuBar))
{ GetSizeRectForMenuBar(NULL, &rcT);
InvalidateRect(m_hwnd, &rcT, FALSE);
}
}
BOOL __fastcall FUseFrameHook(){return (m_lHookPolicy != dsoDisableHook);};
BOOL __fastcall FDelayFrameHookSet(){return (m_lHookPolicy == dsoSetOnFirstOpen);};
BOOL __fastcall FDrawBitmapOnAppDeactive(){return (!(m_lActivationPolicy & dsoKeepUIActiveOnAppDeactive));}
BOOL __fastcall FChangeObjActiveOnFocusChange(){return (m_lActivationPolicy & dsoCompDeactivateOnLostFocus);};
BOOL __fastcall FIPDeactivateOnCompChange(){return (m_lActivationPolicy & dsoIPDeactivateOnCompDeactive);};
// The control window proceedure is handled through static class method.
static STDMETHODIMP_(LRESULT) ControlWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// Force redaw of all child windows...
STDMETHODIMP_(BOOL) InvalidateAllChildWindows(HWND hwnd);
static STDMETHODIMP_(BOOL) InvalidateAllChildWindowsCallback(HWND hwnd, LPARAM lParam);
// The variables for the control are kept private but accessible to the
// nested classes for each interface.
private:
ULONG m_cRef; // Reference count
IUnknown *m_pOuterUnknown; // Outer IUnknown (points to m_xInternalUnknown if not agg)
ITypeInfo *m_ptiDispType; // ITypeInfo Pointer (IDispatch Impl)
EXCEPINFO *m_pDispExcep; // EXCEPINFO Pointer (IDispatch Impl)
HWND m_hwnd; // our window
HWND m_hwndParent; // immediate parent window
SIZEL m_Size; // the size of this control
RECT m_rcLocation; // where we at
IOleClientSite *m_pClientSite; // active client site of host containter
IOleControlSite *m_pControlSite; // control site
IOleInPlaceSite *m_pInPlaceSite; // inplace site
IOleInPlaceFrame *m_pInPlaceFrame; // inplace frame
IOleInPlaceUIWindow *m_pInPlaceUIWindow; // inplace ui window
IAdviseSink *m_pViewAdviseSink; // advise sink for view (only 1 allowed)
IOleAdviseHolder *m_pOleAdviseHolder; // OLE advise holder (for oleobject sinks)
IDataAdviseHolder *m_pDataAdviseHolder; // OLE data advise holder (for dataobject sink)
IDispatch *m_dispEvents; // event sink (we only support 1 at a time)
IStorage *m_pOleStorage; // IStorage for OLE hosts.
CDsoDocObject *m_pDocObjFrame; // The Embedding Class
CDsoDocObject *m_pServerLock; // Optional Server Lock for out-of-proc DocObject
OLE_COLOR m_clrBorderColor; // Control Colors
OLE_COLOR m_clrBackColor; // "
OLE_COLOR m_clrForeColor; // "
OLE_COLOR m_clrTBarColor; // "
OLE_COLOR m_clrTBarTextColor; // "
BSTR m_bstrCustomCaption; // A custom caption (if provided)
HMENU m_hmenuFilePopup; // The File menu popup
WORD m_wFileMenuFlags; // Bitflags of enabled file menu items.
WORD m_wSelMenuItem; // Which item (if any) is selected
WORD m_cMenuItems; // Count of items on menu bar
RECT m_rgrcMenuItems[DSO_MAX_MENUITEMS]; // Menu bar items
CHAR m_rgchMenuAccel[DSO_MAX_MENUITEMS]; // Menu bar accelerators
LPWSTR m_pwszHostName; // Custom name for SetHostNames
class CDsoFrameHookManager* m_pHookManager; // Frame Window Hook Manager Class
LONG m_lHookPolicy; // Policy on how to use frame hook for this host.
LONG m_lActivationPolicy; // Policy on activation behavior for comp focus
HBITMAP m_hbmDeactive; // Bitmap used for IPDeactiveOnXXX policies
UINT m_uiSyncPaint; // Sync paint counter for draw issues with UIDeactivateOnXXX
unsigned int m_fDirty:1; // does the control need to be resaved?
unsigned int m_fInPlaceActive:1; // are we in place active or not?
unsigned int m_fInPlaceVisible:1; // we are in place visible or not?
unsigned int m_fUIActive:1; // are we UI active or not.
unsigned int m_fHasFocus:1; // do we have current focus.
unsigned int m_fViewAdvisePrimeFirst: 1;// for IViewobject2::setadvise
unsigned int m_fViewAdviseOnlyOnce: 1; // for IViewobject2::setadvise
unsigned int m_fUsingWindowRgn:1; // for SetObjectRects and clipping
unsigned int m_fFreezeEvents:1; // should events be frozen?
unsigned int m_fDesignMode:1; // are we in design mode?
unsigned int m_fModeFlagValid:1; // has mode changed since last check?
unsigned int m_fBorderStyle:2; // the border style
unsigned int m_fShowTitlebar:1; // should we show titlebar?
unsigned int m_fShowToolbars:1; // should we show toolbars?
unsigned int m_fModalState:1; // are we modal?
unsigned int m_fObjectMenu:1; // are we over obj menu item?
unsigned int m_fConCntDone:1; // for enum connectpts
unsigned int m_fAppActive:1; // is the app active?
unsigned int m_fComponentActive:1; // is the component active?
unsigned int m_fShowMenuBar:1; // should we show menubar?
unsigned int m_fInDocumentLoad:1; // set when loading file
unsigned int m_fNoInteractive:1; // set when we don't allow interaction with docobj
unsigned int m_fShowMenuPrev:1; // were menus visible before loss of interactivity?
unsigned int m_fShowToolsPrev:1; // were toolbars visible before loss of interactivity?
unsigned int m_fSyncPaintTimer:1; // is syncpaint timer running?
unsigned int m_fInControlActivate:1; // is currently in activation call?
unsigned int m_fInFocusChange:1; // are we in a focus change?
unsigned int m_fActivateOnStatus:1; // we need to activate on change of status
unsigned int m_fDisableMenuAccel:1; // using menu accelerators
unsigned int m_fBkgrdPaintTimer:1; // using menu accelerators
};
////////////////////////////////////////////////////////////////////
// CDsoFrameWindowHook -- Frame Window Hook Class
//
// Used by the control to allow for proper host notification of focus
// and activation events occurring at top-level window frame. Because
// this DocObject host is an OCX, we don't own these notifications and
// have to "steal" them from our parent using a subclass.
//
// IMPORTANT: Since the parent frame may exist on a separate thread, this
// class does nothing but the hook. The code to notify the active component
// is in a separate global class that is shared by all threads.
//
class CDsoFrameWindowHook
{
public:
CDsoFrameWindowHook(){ODS("CDsoFrameWindowHook created\n");m_cHookCount=0;m_hwndTopLevelHost=NULL;m_pfnOrigWndProc=NULL;m_fHostUnicodeWindow=FALSE;}
~CDsoFrameWindowHook(){ODS("CDsoFrameWindowHook deleted\n");}
static STDMETHODIMP_(CDsoFrameWindowHook*) AttachToFrameWindow(HWND hwndParent);
STDMETHODIMP Detach();
static STDMETHODIMP_(CDsoFrameWindowHook*) GetHookFromWindow(HWND hwnd);
inline STDMETHODIMP_(void) AddRef(){InterlockedIncrement((LONG*)&m_cHookCount);}
static STDMETHODIMP_(LRESULT)
HostWindowProcHook(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
protected:
DWORD m_cHookCount;
HWND m_hwndTopLevelHost; // Top-level host window (hooked)
WNDPROC m_pfnOrigWndProc;
BOOL m_fHostUnicodeWindow;
};
// THE MAX NUMBER OF DSOFRAMER CONTROLS PER PROCESS
#define DSOF_MAX_CONTROLS 20
////////////////////////////////////////////////////////////////////
// CDsoFrameHookManager -- Hook Manager Class
//
// Used to keep track of which control is active and forward notifications
// to it using window messages (to cross thread boundaries).
//
class CDsoFrameHookManager
{
public:
CDsoFrameHookManager(){ODS("CDsoFrameHookManager created\n"); m_fAppActive=TRUE; m_idxActive=DSOF_MAX_CONTROLS; m_cComponents=0;}
~CDsoFrameHookManager(){ODS("CDsoFrameHookManager deleted\n");}
static STDMETHODIMP_(CDsoFrameHookManager*)
RegisterFramerControl(HWND hwndParent, HWND hwndControl);
STDMETHODIMP AddComponent(HWND hwndParent, HWND hwndControl);
STDMETHODIMP DetachComponent(HWND hwndControl);
STDMETHODIMP SetActiveComponent(HWND hwndControl);
STDMETHODIMP OnComponentNotify(DWORD msg, WPARAM wParam, LPARAM lParam);
inline STDMETHODIMP_(HWND)
GetActiveComponentWindow(){return m_pComponents[m_idxActive].hwndControl;}
inline STDMETHODIMP_(CDsoFrameWindowHook*)
GetActiveComponentFrame(){return m_pComponents[m_idxActive].phookFrame;}
STDMETHODIMP_(BOOL) SendNotifyMessage(HWND hwnd, DWORD msg, WPARAM wParam, LPARAM lParam);
protected:
BOOL m_fAppActive;
DWORD m_idxActive;
DWORD m_cComponents;
struct FHOOK_COMPONENTS
{
HWND hwndControl;
CDsoFrameWindowHook *phookFrame;
} m_pComponents[DSOF_MAX_CONTROLS];
};
#endif //DS_DSOFRAMER_H

View File

@ -0,0 +1,69 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsoframer", "dsoframer.vcproj", "{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Any CPU.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.Build.0 = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Any CPU.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.Build.0 = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.Build.0 = Release|Win32
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.Build.0 = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Win32.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Win32.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.Build.0 = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Win32.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Win32.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.Build.0 = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Win32.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Win32.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.Build.0 = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,77 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsoframer", "dsoframer.vcproj", "{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleCSharp", "..\SampleCSharp\SampleCSharp.csproj", "{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestC1DockingTab", "..\TestC1DockingTab\TestC1DockingTab.csproj", "{D066A5C4-72B8-45F8-A117-B967019F41AE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarDockable", "..\DotNetBarDockable\DotNetBarDockable.csproj", "{96DC8B48-A4E2-4826-A182-BE112B628B50}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetBarControl", "..\DotNetBarControl\DotNetBarControl.csproj", "{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Any CPU.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug|Win32.Build.0 = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Any CPU.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Mixed Platforms.Build.0 = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release|Win32.Build.0 = Release|Win32
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Any CPU.Build.0 = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E7C7BC82-10A6-459B-8D48-9CE1C070E9FD}.Release|Win32.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Debug|Win32.ActiveCfg = Debug|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Any CPU.Build.0 = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D066A5C4-72B8-45F8-A117-B967019F41AE}.Release|Win32.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Debug|Win32.ActiveCfg = Debug|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Any CPU.Build.0 = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{96DC8B48-A4E2-4826-A182-BE112B628B50}.Release|Win32.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Debug|Win32.ActiveCfg = Debug|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Any CPU.Build.0 = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9939DC3D-AFB6-4B0D-813A-3EBE3FF7249D}.Release|Win32.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsoframer", "dsoframer.vcproj", "{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug.ActiveCfg = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Debug.Build.0 = Debug|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release.ActiveCfg = Release|Win32
{005801E1-A867-4CBB-995F-BA2EF4360BDF}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,470 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="dsoframer"
ProjectGUID="{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;&#x0D;&#x0A;"
Outputs="$(OutDir)\regsvr32.trg"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/dsoframer.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
RuntimeLibrary="1"
StructMemberAlignment="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/dsoframer.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="oledlg.lib urlmon.lib"
OutputFile="Debug/dsoframer.ocx"
Version="1.2"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\dsoframer.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/dsoframer.pdb"
GenerateMapFile="true"
MapFileName=".\Debug/dsoframer.map"
SubSystem="2"
EntryPointSymbol=""
BaseAddress="0x22000000"
ImportLibrary=".\Debug/dsoframer.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"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;&#x0D;&#x0A;"
Outputs="$(OutDir)\regsvr32.trg"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/dsoframer.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="0"
StructMemberAlignment="3"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/dsoframer.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CallingConvention="2"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="oledlg.lib urlmon.lib"
OutputFile="Release/dsoframer.ocx"
Version="1.2"
LinkIncremental="1"
SuppressStartupBanner="true"
ModuleDefinitionFile=".\dsoframer.def"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Release/dsoframer.pdb"
GenerateMapFile="true"
MapFileName=".\Release/dsoframer.map"
SubSystem="2"
OptimizeForWindows98="1"
BaseAddress="0x22000000"
TurnOffAssemblyGeneration="true"
ImportLibrary=".\Release/dsoframer.lib"
MergeSections=".rdata=.text"
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"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="c;cpp;rc;idl"
>
<File
RelativePath="classfactory.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="dsofauto.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="dsofcontrol.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="dsofdocobj.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="dsofprint.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\Lib\dsoframer.idl"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCMIDLTool"
HeaderFileName=".\lib\dsoframerlib.h"
DLLDataFileName=""
InterfaceIdentifierFileName=".\lib\dsoframerlib.c"
/>
</FileConfiguration>
</File>
<File
RelativePath="res\dsoframer.rc"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res;$(OUTDIR)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res;$(OUTDIR)"
/>
</FileConfiguration>
</File>
<File
RelativePath="mainentry.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
<File
RelativePath="utilities.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;def"
>
<File
RelativePath="dsofdocobj.h"
>
</File>
<File
RelativePath="dsoframer.def"
>
</File>
<File
RelativePath="dsoframer.h"
>
</File>
<File
RelativePath="utilities.h"
>
</File>
<File
RelativePath="version.h"
>
</File>
</Filter>
<Filter
Name="Resources"
Filter="ico;cur;tlb;bmp"
>
<File
RelativePath="res\dso.ico"
>
</File>
<File
RelativePath="lib\dsoframer.olb"
>
</File>
<File
RelativePath="res\toolbox.bmp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,360 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="dsoframer"
ProjectGUID="{005801E1-A867-4CBB-995F-BA2EF4360BDF}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="2"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
RuntimeLibrary="5"
StructMemberAlignment="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/dsoframer.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;
echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;
"
Outputs="$(OutDir)\regsvr32.trg"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="oledlg.lib urlmon.lib"
OutputFile="Debug/dsoframer.ocx"
Version="1.2"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\dsoframer.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/dsoframer.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Debug/dsoframer.map"
SubSystem="2"
EntryPointSymbol=""
BaseAddress="0x22000000"
ImportLibrary=".\Debug/dsoframer.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/dsoframer.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
FavorSizeOrSpeed="2"
OptimizeForProcessor="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="4"
StructMemberAlignment="3"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/dsoframer.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CallingConvention="2"/>
<Tool
Name="VCCustomBuildTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;
echo regsvr32 exec. time &gt; &quot;$(OutDir)\regsvr32.trg&quot;
"
Outputs="$(OutDir)\regsvr32.trg"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="oledlg.lib urlmon.lib"
OutputFile="Release/dsoframer.ocx"
Version="1.2"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\dsoframer.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Release/dsoframer.pdb"
GenerateMapFile="TRUE"
MapFileName=".\Release/dsoframer.map"
SubSystem="2"
OptimizeForWindows98="1"
BaseAddress="0x22000000"
TurnOffAssemblyGeneration="TRUE"
ImportLibrary=".\Release/dsoframer.lib"
MergeSections=".rdata=.text"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/dsoframer.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="c;cpp;rc;idl">
<File
RelativePath="classfactory.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="dsofauto.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="dsofcontrol.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="dsofdocobj.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="dsofprint.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath=".\Lib\dsoframer.idl">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCMIDLTool"
HeaderFileName=".\lib\dsoframerlib.h"
DLLDataFileName=""
InterfaceIdentifierFileName=".\lib\dsoframerlib.c"/>
</FileConfiguration>
</File>
<File
RelativePath="res\dsoframer.rc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res;$(OUTDIR)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="res;$(OUTDIR)"/>
</FileConfiguration>
</File>
<File
RelativePath="mainentry.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
<File
RelativePath="utilities.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;$(NoInherit)"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;def">
<File
RelativePath="dsofdocobj.h">
</File>
<File
RelativePath="dsoframer.def">
</File>
<File
RelativePath="dsoframer.h">
</File>
<File
RelativePath="utilities.h">
</File>
<File
RelativePath="version.h">
</File>
</Filter>
<Filter
Name="Resources"
Filter="ico;cur;tlb;bmp">
<File
RelativePath="res\dso.ico">
</File>
<File
RelativePath="lib\dsoframer.olb">
</File>
<File
RelativePath="res\toolbox.bmp">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="RHMDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="RHMDESKTOP"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,88 @@
/***************************************************************************
* IPPREVIEW.H
*
* DSOFramer: IOleInplacePrintPreview/IOlePreviewCallback
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#ifndef __IPPREVIEW_H
#define __IPPREVIEW_H
////////////////////////////////////////////////////////////////////////
//
// IOlePreviewCallback
//
// Implemented by host to receive notifaction messages
// from ip object while displaying a print preview.
//
DEFINE_GUID(IID_IOlePreviewCallback, 0xB722BCD5, 0x4E68, 0x101B, 0xA2, 0xBC, 0x00, 0xAA, 0x00, 0x40, 0x47, 0x70);
#undef INTERFACE
#define INTERFACE IOlePreviewCallback
DECLARE_INTERFACE_(IOlePreviewCallback, IUnknown)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
// IUnknown methods
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
#endif
// IOlePreviewCallback methods
STDMETHOD(Notify)(THIS_ DWORD wStatus, LONG nLastPage, LPOLESTR pwszPreviewStatus) PURE;
};
#define NOTIFY_FINISHED 1
#define NOTIFY_BUSY 2
#define NOTIFY_IDLE 4
#define NOTIFY_DISABLERESIZE 8
#define NOTIFY_QUERYCLOSEPREVIEW 16
#define NOTIFY_FORCECLOSEPREVIEW 32
#define NOTIFY_UIACTIVE 64
#define NOTIFY_UNABLETOPREVIEW 128
////////////////////////////////////////////////////////////////////////
//
// IOleInplacePrintPreview
//
// Implemented by server to start/stop print preview. Hosts should
// call QueryStatus to make sure server is able to enter preview mode
// before calling StartPrintPreview.
//
DEFINE_GUID(IID_IOleInplacePrintPreview, 0xB722BCD4, 0x4E68, 0x101B, 0xA2, 0xBC, 0x00, 0xAA, 0x00, 0x40, 0x47, 0x70);
#undef INTERFACE
#define INTERFACE IOleInplacePrintPreview
DECLARE_INTERFACE_(IOleInplacePrintPreview, IUnknown)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
// IUnknown methods
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
#endif
// IOleInplacePrintPreview methods
STDMETHOD(StartPrintPreview)(THIS_ DWORD grfFlags, DVTARGETDEVICE *ptd, IOlePreviewCallback *ppCallback, LONG nFirstPage) PURE;
STDMETHOD(EndPrintPreview)(THIS_ BOOL fForceClose) PURE;
STDMETHOD(QueryStatus)(THIS_ void) PURE;
};
#define PREVIEWFLAG_MAYBOTHERUSER 1
#define PREVIEWFLAG_PROMPTUSER 2
#define PREVIEWFLAG_USERMAYCHANGEPRINTER 4
#define PREVIEWFLAG_RECOMPOSETODEVICE 8
#endif //__IPPREVIEW_H

View File

@ -0,0 +1,318 @@
/***************************************************************************
* MAINENTRY.CPP
*
* Main DLL Entry and Required COM Entry Points.
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#define INITGUID // Init the GUIDS for the control...
#include "dsoframer.h"
HINSTANCE v_hModule = NULL; // DLL module handle
HANDLE v_hPrivateHeap = NULL; // Private Memory Heap
ULONG v_cLocks = 0; // Count of server locks
HICON v_icoOffDocIcon = NULL; // Small office icon (for caption bar)
BOOL v_fUnicodeAPI = FALSE; // Flag to determine if we should us Unicode API
BOOL v_fWindows2KPlus = FALSE;
CRITICAL_SECTION v_csecThreadSynch;
////////////////////////////////////////////////////////////////////////
// DllMain -- OCX Main Entry
//
//
extern "C" BOOL APIENTRY DllMain(HINSTANCE hDllHandle, DWORD dwReason, LPVOID /*lpReserved*/)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
v_hModule = hDllHandle;
v_hPrivateHeap = HeapCreate(0, 0x1000, 0);
v_icoOffDocIcon = (HICON)LoadImage(hDllHandle, MAKEINTRESOURCE(IDI_SMALLOFFDOC), IMAGE_ICON, 16, 16, 0);
{
DWORD dwVersion = GetVersion();
v_fUnicodeAPI = ((dwVersion & 0x80000000) == 0);
v_fWindows2KPlus = ((v_fUnicodeAPI) && (LOBYTE(LOWORD(dwVersion)) > 4));
}
InitializeCriticalSection(&v_csecThreadSynch);
DisableThreadLibraryCalls(hDllHandle);
break;
case DLL_PROCESS_DETACH:
if (v_icoOffDocIcon) DeleteObject(v_icoOffDocIcon);
if (v_hPrivateHeap) HeapDestroy(v_hPrivateHeap);
DeleteCriticalSection(&v_csecThreadSynch);
break;
}
return TRUE;
}
#ifdef DSO_MIN_CRT_STARTUP
extern "C" BOOL APIENTRY _DllMainCRTStartup(HINSTANCE hDllHandle, DWORD dwReason, LPVOID lpReserved)
{return DllMain(hDllHandle, dwReason, lpReserved);}
#endif
////////////////////////////////////////////////////////////////////////
// Standard COM DLL Entry Points
//
//
////////////////////////////////////////////////////////////////////////
// DllCanUnloadNow
//
//
STDAPI DllCanUnloadNow()
{
return ((v_cLocks == 0) ? S_OK : S_FALSE);
}
////////////////////////////////////////////////////////////////////////
// DllGetClassObject
//
// Returns IClassFactory instance for FramerControl. We only support
// this one object for creation.
//
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv)
{
HRESULT hr;
CDsoFramerClassFactory* pcf;
CHECK_NULL_RETURN(ppv, E_POINTER);
*ppv = NULL;
// The only component we can create is the BinderControl...
if (rclsid != CLSID_FramerControl)
return CLASS_E_CLASSNOTAVAILABLE;
// Create the needed class factory...
pcf = new CDsoFramerClassFactory();
CHECK_NULL_RETURN(pcf, E_OUTOFMEMORY);
// Get requested interface.
if (FAILED(hr = pcf->QueryInterface(riid, ppv)))
{
*ppv = NULL; delete pcf;
}
else InterlockedIncrement((LPLONG)&v_cLocks);
return hr;
}
////////////////////////////////////////////////////////////////////////
// DllRegisterServer
//
// Registration of the OCX.
//
STDAPI DllRegisterServer()
{
HRESULT hr = S_OK;
HKEY hk, hk2;
DWORD dwret;
CHAR szbuffer[256];
LPWSTR pwszModule;
ITypeInfo* pti;
// If we can't find the path to the DLL, we can't register...
if (!FGetModuleFileName(v_hModule, &pwszModule))
return E_FAIL;
// Setup the CLSID. This is the most important. If there is a critical failure,
// we will set HR = GetLastError and return...
if ((dwret = RegCreateKeyEx(HKEY_CLASSES_ROOT,
"CLSID\\"DSOFRAMERCTL_CLSIDSTR, 0, NULL, 0, KEY_WRITE, NULL, &hk, NULL)) != ERROR_SUCCESS)
{
DsoMemFree(pwszModule);
return HRESULT_FROM_WIN32(dwret);
}
lstrcpy(szbuffer, DSOFRAMERCTL_SHORTNAME);
RegSetValueEx(hk, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
// Setup the InprocServer32 key...
dwret = RegCreateKeyEx(hk, "InprocServer32", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, "Apartment");
RegSetValueEx(hk2, "ThreadingModel", 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
// We call a wrapper function for this setting since the path should be
// stored in Unicode to handle non-ANSI file path names on some systems.
// This wrapper will convert the path to ANSI if we are running on Win9x.
// The rest of the Reg calls should be OK in ANSI since they do not
// contain non-ANSI/Unicode-specific characters...
if (!FSetRegKeyValue(hk2, pwszModule))
hr = E_ACCESSDENIED;
RegCloseKey(hk2);
dwret = RegCreateKeyEx(hk, "ProgID", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, DSOFRAMERCTL_PROGID);
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
}
else hr = HRESULT_FROM_WIN32(dwret);
if (SUCCEEDED(hr))
{
dwret = RegCreateKeyEx(hk, "Control", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
RegCloseKey(hk2);
}
else hr = HRESULT_FROM_WIN32(dwret);
}
// If we succeeded so far, andle the remaining (non-critical) reg keys...
if (SUCCEEDED(hr))
{
dwret = RegCreateKeyEx(hk, "ToolboxBitmap32", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
LPWSTR pwszT = DsoCopyStringCat(pwszModule, L",102");
if (pwszT)
{
FSetRegKeyValue(hk2, pwszT);
DsoMemFree(pwszT);
}
RegCloseKey(hk2);
}
dwret = RegCreateKeyEx(hk, "TypeLib", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, DSOFRAMERCTL_TLIBSTR);
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
dwret = RegCreateKeyEx(hk, "Version", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, DSOFRAMERCTL_VERSIONSTR);
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
dwret = RegCreateKeyEx(hk, "MiscStatus", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, "131473");
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
dwret = RegCreateKeyEx(hk, "DataFormats\\GetSet\\0", 0, NULL, 0, KEY_WRITE, NULL, &hk2, NULL);
if (dwret == ERROR_SUCCESS)
{
lstrcpy(szbuffer, "3,1,32,1");
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
}
RegCloseKey(hk);
DsoMemFree(pwszModule);
// This should catch any critical failures during setup of CLSID...
RETURN_ON_FAILURE(hr);
// Setup the ProgID (non-critical)...
if (RegCreateKeyEx(HKEY_CLASSES_ROOT, DSOFRAMERCTL_PROGID, 0,
NULL, 0, KEY_WRITE, NULL, &hk, NULL) == ERROR_SUCCESS)
{
lstrcpy(szbuffer, DSOFRAMERCTL_FULLNAME);
RegSetValueEx(hk, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
if (RegCreateKeyEx(hk, "CLSID", 0,
NULL, 0, KEY_WRITE, NULL, &hk2, NULL) == ERROR_SUCCESS)
{
lstrcpy(szbuffer, DSOFRAMERCTL_CLSIDSTR);
RegSetValueEx(hk2, NULL, 0, REG_SZ, (BYTE *)szbuffer, lstrlen(szbuffer));
RegCloseKey(hk2);
}
RegCloseKey(hk);
}
// Load the type info (this should register the lib once)...
hr = DsoGetTypeInfoEx(LIBID_DSOFramer, 0,
DSOFRAMERCTL_VERSION_MAJOR, DSOFRAMERCTL_VERSION_MINOR, v_hModule, CLSID_FramerControl, &pti);
if (SUCCEEDED(hr)) pti->Release();
return hr;
}
////////////////////////////////////////////////////////////////////////
// RegRecursiveDeleteKey
//
// Helper function called by DllUnregisterServer for nested key removal.
//
static HRESULT RegRecursiveDeleteKey(HKEY hkParent, LPCSTR pszSubKey)
{
HRESULT hr = S_OK;
HKEY hk;
DWORD dwret, dwsize;
FILETIME time ;
CHAR szbuffer[512];
dwret = RegOpenKeyEx(hkParent, pszSubKey, 0, KEY_ALL_ACCESS, &hk);
if (dwret != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(dwret);
// Enumerate all of the decendents of this child...
dwsize = 510 ;
while (RegEnumKeyEx(hk, 0, szbuffer, &dwsize, NULL, NULL, NULL, &time) == ERROR_SUCCESS)
{
// If there are any sub-folders, delete them first (to make NT happy)...
hr = RegRecursiveDeleteKey(hk, szbuffer);
if (FAILED(hr)) break;
dwsize = 510;
}
// Close the child...
RegCloseKey(hk);
RETURN_ON_FAILURE(hr);
// Delete this child.
dwret = RegDeleteKey(hkParent, pszSubKey);
if (dwret != ERROR_SUCCESS)
hr = HRESULT_FROM_WIN32(dwret);
return hr;
}
////////////////////////////////////////////////////////////////////////
// DllUnregisterServer
//
// Removal code for the OCX.
//
STDAPI DllUnregisterServer()
{
HRESULT hr;
hr = RegRecursiveDeleteKey(HKEY_CLASSES_ROOT, "CLSID\\"DSOFRAMERCTL_CLSIDSTR);
if (SUCCEEDED(hr))
{
RegRecursiveDeleteKey(HKEY_CLASSES_ROOT, DSOFRAMERCTL_PROGID);
RegRecursiveDeleteKey(HKEY_CLASSES_ROOT, "TypeLib\\"DSOFRAMERCTL_TLIBSTR);
}
// This means the key does not exist (i.e., the DLL
// was alreay unregistered, so return OK)...
if (hr == 0x80070002) hr = S_OK;
return hr;
}

View File

@ -0,0 +1,253 @@
/***************************************************************************
* RBBINDER.H
*
* DSOFramer: Internet Publishing Provider (MSDAIPP) Compatible Header
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#ifndef DS_RBBINDER_H
#define DS_RBBINDER_H
////////////////////////////////////////////////////////////////////////
// The Microsoft OLEDB Provider for Internet Publishing (MSDAIPP) is now
// standard with MDAC 2.5. However, it will run with MDAC 2.1, so this
// header will allow us to safely compile without 2.5.
//
#define OLEDBVER 0x0250
#include <oledb.h>
#include <oledberr.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <pshpack2.h> // 2-byte structure packing
#ifndef BEGIN_INTERFACE
#define BEGIN_INTERFACE
#endif
////////////////////////////////////////////////////////////////////////
// MSDAIPP Specific GUIDs (not defined in OLEDB.H)
//
DEFINE_GUID(CLSID_MSDAIPP_DSO, 0xAF320921L, 0x9381, 0x11d1, 0x9C, 0x3C, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x61);
DEFINE_GUID(CLSID_MSDAIPP_BINDER, 0xE1D2BF40L, 0xA96B, 0x11d1, 0x9C, 0x6B, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x61);
DEFINE_GUID(DBPROPSET_MSDAIPP_INIT, 0x8F1033E3L, 0xB2CD, 0x11d1, 0x9C, 0x74, 0x00, 0x00, 0xF8, 0x75, 0xAC, 0x61);
////////////////////////////////////////////////////////////////////////
// OLEDB Additional defines -- included for machines with MDAC 2.0/2.1
//
////////////////////////////////////////////////////////////////////////
// OLEDB 2.5 GUIDS Redefined for use here; this is to avoid linker errors
// on machines that have different versions of MDAC libs.
//
DEFINE_GUID(IIDX_IBindResource, 0x0c733ab1L, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
DEFINE_GUID(IIDX_IDBBinderProperties, 0x0c733ab3L, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
DEFINE_GUID(IIDX_ICreateRow, 0x0c733ab2L, 0x2a1c, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
DEFINE_GUID(IIDX_IAuthenticate, 0x79eac9d0L, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa, 0x00, 0x4b, 0xa9, 0x0b);
DEFINE_GUID(DBGUIDX_STREAM, 0xc8b522f9L, 0x5cf3, 0x11ce, 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d);
///////////////////////////////////////////////////////////////////////
// MSDAIPP Binding Interfaces (all this should be standard in MDAC 2.5)
//
#ifndef __IBindResource_FWD_DEFINED__
#define __IBindResource_FWD_DEFINED__
typedef interface IBindResource IBindResource;
typedef DWORD DBBINDURLFLAG;
enum DBBINDURLFLAGENUM
{
DBBINDURLFLAG_READ = 0x1L,
DBBINDURLFLAG_WRITE = 0x2L,
DBBINDURLFLAG_READWRITE = 0x3L,
DBBINDURLFLAG_SHARE_DENY_READ = 0x4L,
DBBINDURLFLAG_SHARE_DENY_WRITE = 0x8L,
DBBINDURLFLAG_SHARE_EXCLUSIVE = 0xcL,
DBBINDURLFLAG_SHARE_DENY_NONE = 0x10L,
DBBINDURLFLAG_ASYNCHRONOUS = 0x1000L,
DBBINDURLFLAG_COLLECTION = 0x2000L,
DBBINDURLFLAG_DELAYFETCHSTREAM = 0x4000L,
DBBINDURLFLAG_DELAYFETCHCOLUMNS = 0x8000L,
DBBINDURLFLAG_RECURSIVE = 0x400000L,
DBBINDURLFLAG_OUTPUT = 0x800000L,
DBBINDURLFLAG_WAITFORINIT = 0x1000000L,
DBBINDURLFLAG_OPENIFEXISTS = 0x2000000L,
DBBINDURLFLAG_OVERWRITE = 0x4000000L,
DBBINDURLFLAG_ISSTRUCTUREDDOCUMENT = 0x8000000L
};
typedef DWORD DBBINDURLSTATUS;
enum DBBINDURLSTATUSENUM
{
DBBINDURLSTATUS_S_OK = 0L,
DBBINDURLSTATUS_S_DENYNOTSUPPORTED = 0x1L,
DBBINDURLSTATUS_S_DENYTYPENOTSUPPORTED = 0x4L,
DBBINDURLSTATUS_S_REDIRECTED = 0x8L
};
enum DBPROP_OLEDB25_RB
{
DBPROP_INIT_BINDFLAGS = 0x10eL,
DBPROP_INIT_LOCKOWNER = 0x10fL
};
typedef ULONG DBCOUNTITEM;
typedef struct tagDBIMPLICITSESSION
{
IUnknown __RPC_FAR *pUnkOuter;
IID __RPC_FAR *piid;
IUnknown __RPC_FAR *pSession;
} DBIMPLICITSESSION;
#endif //__IBindResource_FWD_DEFINED__
#ifndef __IBindResource_INTERFACE_DEFINED__
#define __IBindResource_INTERFACE_DEFINED__
#undef INTERFACE
#define INTERFACE IBindResource
DECLARE_INTERFACE_(IBindResource, IUnknown)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
#endif
/* IBindResource methods */
STDMETHOD(Bind)(THIS_
/* [in] */ IUnknown __RPC_FAR *pUnkOuter,
/* [in] */ LPCOLESTR pwszURL,
/* [in] */ DBBINDURLFLAG dwBindURLFlags,
/* [in] */ REFGUID rguid,
/* [in] */ REFIID riid,
/* [in] */ IAuthenticate __RPC_FAR *pAuthenticate,
/* [unique][out][in] */ DBIMPLICITSESSION __RPC_FAR *pImplSession,
/* [unique][out][in] */ DBBINDURLSTATUS __RPC_FAR *pdwBindStatus,
/* [iid_is][out] */ IUnknown __RPC_FAR *__RPC_FAR *ppUnk) PURE;
};
#endif //__IBindResource_INTERFACE_DEFINED__
#ifndef __ICreateRow_INTERFACE_DEFINED__
#define __ICreateRow_INTERFACE_DEFINED__
#undef INTERFACE
#define INTERFACE ICreateRow
DECLARE_INTERFACE_(ICreateRow, IUnknown)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
#endif
/* ICreateRow methods */
STDMETHOD(CreateRow)(THIS_
/* [unique][in] */ IUnknown __RPC_FAR *pUnkOuter,
/* [in] */ LPCOLESTR pwszURL,
/* [in] */ DBBINDURLFLAG dwBindURLFlags,
/* [in] */ REFGUID rguid,
/* [in] */ REFIID riid,
/* [unique][in] */ IAuthenticate __RPC_FAR *pAuthenticate,
/* [unique][out][in] */ IUnknown __RPC_FAR *pImplSession,
/* [unique][out][in] */ DBBINDURLSTATUS __RPC_FAR *pdwBindStatus,
/* [out] */ LPOLESTR __RPC_FAR *ppwszNewURL,
/* [iid_is][out] */ IUnknown __RPC_FAR *__RPC_FAR *ppUnk) PURE;
};
#endif //__ICreateRow_INTERFACE_DEFINED__
#ifndef __IDBBinderProperties_INTERFACE_DEFINED__
#define __IDBBinderProperties_INTERFACE_DEFINED__
#undef INTERFACE
#define INTERFACE IDBBinderProperties
DECLARE_INTERFACE_(IDBBinderProperties, IDBProperties)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
/* IDBProperties methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetProperties)(THIS_ ULONG cPropertyIDSets, const DBPROPIDSET __RPC_FAR rgPropertyIDSets[], ULONG __RPC_FAR *pcPropertySets, DBPROPSET __RPC_FAR *__RPC_FAR *prgPropertySets) PURE;
STDMETHOD(GetPropertyInfo)(THIS_ ULONG cPropertyIDSets, const DBPROPIDSET __RPC_FAR rgPropertyIDSets[], ULONG __RPC_FAR *pcPropertyInfoSets, DBPROPINFOSET __RPC_FAR *__RPC_FAR *prgPropertyInfoSets, OLECHAR __RPC_FAR *__RPC_FAR *ppDescBuffer) PURE;
STDMETHOD(SetProperties)(THIS_ ULONG cPropertySets, DBPROPSET __RPC_FAR rgPropertySets[]) PURE;
#endif
/* IDBBinderProperties methods */
STDMETHOD(Reset)(THIS) PURE;
};
#endif //__IDBBinderProperties_INTERFACE_DEFINED__
////////////////////////////////////////////////////////////////////////
// IAuthenticate (borrowed from urlmon.h to avoid extra includes)
//
#ifndef __IAuthenticate_INTERFACE_DEFINED__
#define __IAuthenticate_INTERFACE_DEFINED__
#undef INTERFACE
#define INTERFACE IAuthenticate
DECLARE_INTERFACE_(IAuthenticate, IUnknown)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
#endif
/* IAuthenticate methods */
STDMETHOD(Authenticate)(THIS_ HWND __RPC_FAR *phwnd, LPWSTR __RPC_FAR *pszUsername, LPWSTR __RPC_FAR *pszPassword) PURE;
};
#endif //__IAuthenticate_INTERFACE_DEFINED__
//OLEDB 2.1 Error values
#ifndef DB_E_READONLY
#define DB_E_READONLY ((HRESULT)0x80040E94L)
#define DB_E_RESOURCELOCKED ((HRESULT)0x80040E92L)
#define DB_E_CANNOTCONNECT ((HRESULT)0x80040E96L)
#define DB_E_TIMEOUT ((HRESULT)0x80040E97L)
#define DB_E_RESOURCEEXISTS ((HRESULT)0x80040E98L)
#define DB_E_OUTOFSPACE ((HRESULT)0x80040E9AL)
#endif
//OLEDB 2.5 Error values
#ifndef DB_SEC_E_SAFEMODE_DENIED
#define DB_SEC_E_SAFEMODE_DENIED ((HRESULT)0x80040E9BL)
#endif
#ifdef __cplusplus
} //extern "C"
#endif
#endif // DS_RBBINDER_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,242 @@
/***************************************************************************
* UTILITIES.H
*
* DSOFramer: Common Utilities and Macros (Shared)
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
#ifndef DS_UTILITIES_H
#define DS_UTILITIES_H
#include <commdlg.h>
#include <oledlg.h>
////////////////////////////////////////////////////////////////////////
// Fixed Win32 Errors as HRESULTs
//
#define E_WIN32_BUFFERTOOSMALL 0x8007007A //HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
#define E_WIN32_ACCESSVIOLATION 0x800701E7 //HRESULT_FROM_WIN32(ERROR_INVALID_ADDRESS)
#define E_WIN32_LASTERROR (0x80070000 | GetLastError()) // Assured Error with last Win32 code
#define E_VBA_NOREMOTESERVER 0x800A01CE
////////////////////////////////////////////////////////////////////////
// Heap Allocation
//
STDAPI_(LPVOID) DsoMemAlloc(DWORD cbSize);
STDAPI_(void) DsoMemFree(LPVOID ptr);
// Override new/delete to use our task allocator
// (removing CRT dependency will improve code performance and size)...
void * _cdecl operator new(size_t size);
void _cdecl operator delete(void *ptr);
////////////////////////////////////////////////////////////////////////
// String Manipulation Functions
//
STDAPI DsoConvertToUnicodeEx(LPCSTR pszMbcsString, DWORD cbMbcsLen, LPWSTR pwszUnicode, DWORD cbUniLen, UINT uiCodePage);
STDAPI DsoConvertToMBCSEx(LPCWSTR pwszUnicodeString, DWORD cbUniLen, LPSTR pwszMbcsString, DWORD cbMbcsLen, UINT uiCodePage);
STDAPI_(LPWSTR) DsoConvertToLPWSTR(LPCSTR pszMbcsString);
STDAPI_(BSTR) DsoConvertToBSTR(LPCSTR pszMbcsString);
STDAPI_(LPWSTR) DsoConvertToLPOLESTR(LPCWSTR pwszUnicodeString);
STDAPI_(LPSTR) DsoConvertToMBCS(LPCWSTR pwszUnicodeString);
STDAPI_(UINT) DsoCompareStringsEx(LPCWSTR pwsz1, INT cch1, LPCWSTR pwsz2, INT cch2);
STDAPI_(LPWSTR) DsoCopyString(LPCWSTR pwszString);
STDAPI_(LPWSTR) DsoCopyStringCat(LPCWSTR pwszString1, LPCWSTR pwszString2);
STDAPI_(LPWSTR) DsoCopyStringCatEx(LPCWSTR pwszBaseString, UINT cStrs, LPCWSTR *ppwszStrs);
STDAPI_(LPSTR) DsoCLSIDtoLPSTR(REFCLSID clsid);
////////////////////////////////////////////////////////////////////////
// URL Helpers
//
STDAPI_(BOOL) LooksLikeLocalFile(LPCWSTR pwsz);
STDAPI_(BOOL) LooksLikeUNC(LPCWSTR pwsz);
STDAPI_(BOOL) LooksLikeHTTP(LPCWSTR pwsz);
STDAPI_(BOOL) GetTempPathForURLDownload(WCHAR* pwszURL, WCHAR** ppwszLocalFile);
STDAPI URLDownloadFile(LPUNKNOWN punk, WCHAR* pwszURL, WCHAR* pwszLocalFile);
////////////////////////////////////////////////////////////////////////
// OLE Conversion Functions
//
STDAPI_(void) DsoHimetricToPixels(LONG* px, LONG* py);
STDAPI_(void) DsoPixelsToHimetric(LONG* px, LONG* py);
////////////////////////////////////////////////////////////////////////
// GDI Helper Functions
//
STDAPI_(HBITMAP) DsoGetBitmapFromWindow(HWND hwnd);
////////////////////////////////////////////////////////////////////////
// Windows Helper Functions
//
STDAPI_(BOOL) IsWindowChild(HWND hwndParent, HWND hwndChild);
////////////////////////////////////////////////////////////////////////
// OLE/Typelib Function Wrappers
//
STDAPI DsoGetTypeInfoEx(REFGUID rlibid, LCID lcid, WORD wVerMaj, WORD wVerMin, HMODULE hResource, REFGUID rguid, ITypeInfo** ppti);
STDAPI DsoDispatchInvoke(LPDISPATCH pdisp, LPOLESTR pwszname, DISPID dspid, WORD wflags, DWORD cargs, VARIANT* rgargs, VARIANT* pvtret);
STDAPI DsoReportError(HRESULT hr, LPWSTR pwszCustomMessage, EXCEPINFO* peiDispEx);
////////////////////////////////////////////////////////////////////////
// Unicode Win32 API wrappers (handles thunk down for Win9x)
//
STDAPI_(BOOL) FFileExists(WCHAR* wzPath);
STDAPI_(BOOL) FOpenLocalFile(WCHAR* wzFilePath, DWORD dwAccess, DWORD dwShareMode, DWORD dwCreate, HANDLE* phFile);
STDAPI_(BOOL) FPerformShellOp(DWORD dwOp, WCHAR* wzFrom, WCHAR* wzTo);
STDAPI_(BOOL) FGetModuleFileName(HMODULE hModule, WCHAR** wzFileName);
STDAPI_(BOOL) FIsIECacheFile(LPWSTR pwszFile);
STDAPI_(BOOL) FDrawText(HDC hdc, WCHAR* pwsz, LPRECT prc, UINT fmt);
STDAPI_(BOOL) FSetRegKeyValue(HKEY hk, WCHAR* pwsz);
STDAPI_(BOOL) FOpenPrinter(LPCWSTR pwszPrinter, LPHANDLE phandle);
STDAPI_(BOOL) FGetPrinterSettings(HANDLE hprinter, LPWSTR *ppwszProcessor, LPWSTR *ppwszDevice, LPWSTR *ppwszOutput, LPDEVMODEW *ppdvmode, DWORD *pcbSize);
STDAPI DsoGetFileFromUser(HWND hwndOwner, LPCWSTR pwzTitle, DWORD dwFlags,
LPCWSTR pwzFilter, DWORD dwFiltIdx, LPCWSTR pwszDefExt, LPCWSTR pwszCurrentItem, BOOL fShowSave,
BSTR *pbstrFile, BOOL *pfReadOnly);
STDAPI DsoGetOleInsertObjectFromUser(HWND hwndOwner, LPCWSTR pwzTitle, DWORD dwFlags,
BOOL fDocObjectOnly, BOOL fAllowControls, BSTR *pbstrResult, UINT *ptype);
////////////////////////////////////////////////////////////////////////
// Common macros -- Used to make code more readable.
//
#define SEH_TRY __try {
#define SEH_EXCEPT(hr) } __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION){hr = E_WIN32_ACCESSVIOLATION;}
#define SEH_EXCEPT_NULL } __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION){}
#define SEH_START_FINALLY } __finally {
#define SEH_END_FINALLY }
#define RETURN_ON_FAILURE(x) if (FAILED(x)) return (x)
#define GOTO_ON_FAILURE(x, lbl) if (FAILED(x)) goto lbl
#define CHECK_NULL_RETURN(v, e) if ((v) == NULL) return (e)
#define SAFE_ADDREF_INTERFACE if (x) { (x)->AddRef(); }
#define SAFE_RELEASE_INTERFACE(x) if (x) { (x)->Release(); (x) = NULL; }
#define SAFE_SET_INTERFACE(x, y) if (((x) = (y)) != NULL) ((IUnknown*)(x))->AddRef()
#define SAFE_FREESTRING(s) if (s) { DsoMemFree(s); (s) = NULL; }
#define SAFE_FREEBSTR(s) if (s) { SysFreeString(s); (s) = NULL; }
VARIANT* __fastcall DsoPVarFromPVarRef(VARIANT* px);
BOOL __fastcall DsoIsVarParamMissing(VARIANT* px);
LPWSTR __fastcall DsoPVarWStrFromPVar(VARIANT* px);
SAFEARRAY* __fastcall DsoPVarArrayFromPVar(VARIANT* px);
IUnknown* __fastcall DsoPVarUnkFromPVar(VARIANT* px);
SHORT __fastcall DsoPVarShortFromPVar(VARIANT* px, SHORT fdef);
LONG __fastcall DsoPVarLongFromPVar(VARIANT* px, LONG fdef);
BOOL __fastcall DsoPVarBoolFromPVar(VARIANT* px, BOOL fdef);
#define PARAM_IS_MISSING(x) DsoIsVarParamMissing(DsoPVarFromPVarRef((x)))
#define LPWSTR_FROM_VARIANT(x) DsoPVarWStrFromPVar(DsoPVarFromPVarRef(&(x)))
#define LONG_FROM_VARIANT(x, y) DsoPVarLongFromPVar(DsoPVarFromPVarRef(&(x)), (y))
#define BOOL_FROM_VARIANT(x, y) DsoPVarBoolFromPVar(DsoPVarFromPVarRef(&(x)), (y))
#define PUNK_FROM_VARIANT(x) DsoPVarUnkFromPVar(DsoPVarFromPVarRef(&(x)))
#define PSARRAY_FROM_VARIANT(x) DsoPVarArrayFromPVar(DsoPVarFromPVarRef(&(x)))
#define ASCII_UPPERCASE(x) ((((x) > 96) && ((x) < 123)) ? (x) - 32 : (x))
#define ASCII_LOWERCASE(x) ((((x) > 64) && ((x) < 91)) ? (x) + 32 : (x))
////////////////////////////////////////////////////////////////////////
// Debug macros
//
#ifdef _DEBUG
#define ASSERT(x) if(!(x)) DebugBreak()
#define ODS(x) OutputDebugString(x)
#define TRACE1(sz, arg1) { \
CHAR ach[1024]; \
wsprintf(ach, (sz), (arg1)); \
ODS(ach); }
#define TRACE2(sz, arg1, arg2) { \
CHAR ach[1024]; \
wsprintf(ach, (sz), (arg1), (arg2)); \
ODS(ach); }
#define TRACE3(sz, arg1, arg2, arg3) { \
CHAR ach[1024]; \
wsprintf(ach, (sz), (arg1), (arg2), (arg3)); \
ODS(ach); }
#define TRACE_LPRECT(sz, lprc) { \
CHAR ach[1024]; \
wsprintf(ach, "RECT %s - left=%d, top=%d, right=%d, bottom=%d\n", \
(sz), (lprc)->left, (lprc)->top, (lprc)->right, (lprc)->bottom); \
ODS(ach); }
#else // !defined(_DEBUG)
#define ASSERT(x)
#define ODS(x)
#define TRACE1(sz, arg1)
#define TRACE2(sz, arg1, arg2)
#define TRACE3(sz, arg1, arg2, arg3)
#define TRACE_LPRECT(sz, lprc)
#endif // (_DEBUG)
////////////////////////////////////////////////////////////////////////
// Macros for Nested COM Interfaces
//
#ifdef _DEBUG
#define DEFINE_REFCOUNT ULONG m_cRef;
#define IMPLEMENT_DEBUG_ADDREF m_cRef++;
#define IMPLEMENT_DEBUG_RELEASE(x) ASSERT(m_cRef > 0); m_cRef--; if (m_cRef == 0){ODS(" > I" #x " released\n");}
#define IMPLEMENT_DEBUG_REFSET m_cRef = 0;
#define IMPLEMENT_DEBUG_REFCHECK(x) ASSERT(m_cRef == 0); if (m_cRef != 0){ODS(" * I" #x " NOT released!!\n");}
#else
#define DEFINE_REFCOUNT
#define IMPLEMENT_DEBUG_ADDREF
#define IMPLEMENT_DEBUG_RELEASE(x)
#define IMPLEMENT_DEBUG_REFSET
#define IMPLEMENT_DEBUG_REFCHECK(x)
#endif /* !_DEBUG */
#define BEGIN_INTERFACE_PART(localClass, baseClass) \
class X##localClass : public baseClass \
{ public: X##localClass(){IMPLEMENT_DEBUG_REFSET} \
~X##localClass(){IMPLEMENT_DEBUG_REFCHECK(##localClass)} \
STDMETHOD(QueryInterface)(REFIID iid, PVOID* ppvObj); \
STDMETHOD_(ULONG, AddRef)(); \
STDMETHOD_(ULONG, Release)(); \
DEFINE_REFCOUNT
#define END_INTERFACE_PART(localClass) \
} m_x##localClass; \
friend class X##localClass;
#define METHOD_PROLOGUE(theClass, localClass) \
theClass* pThis = \
((theClass*)(((BYTE*)this) - (size_t)&(((theClass*)0)->m_x##localClass)));
#define IMPLEMENT_INTERFACE_UNKNOWN(theClass, localClass) \
ULONG theClass::X##localClass::AddRef() { \
METHOD_PROLOGUE(theClass, localClass) \
IMPLEMENT_DEBUG_ADDREF \
return pThis->AddRef(); \
} \
ULONG theClass::X##localClass::Release() { \
METHOD_PROLOGUE(theClass, localClass) \
IMPLEMENT_DEBUG_RELEASE(##localClass) \
return pThis->Release(); \
} \
STDMETHODIMP theClass::X##localClass::QueryInterface(REFIID iid, void **ppvObj) { \
METHOD_PROLOGUE(theClass, localClass) \
return pThis->QueryInterface(iid, ppvObj); \
}
#endif //DS_UTILITIES_H

View File

@ -0,0 +1,59 @@
/***************************************************************************
* VERSION.H - Contol version defines
*
* DSOFramer: Version Information Header (Shared)
*
* Copyright ©1999-2004; Microsoft Corporation. All rights reserved.
* Written by Microsoft Developer Support Office Integration (PSS DSOI)
*
* This code is provided via KB 311765 as a sample. It is not a formal
* product and has not been tested with all containers or servers. Use it
* for educational purposes only. See the EULA.TXT file included in the
* KB download for full terms of use and restrictions.
*
* THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*
***************************************************************************/
/***************************************************************************
*
* IMPORTANT: If you modify this sample, you should change all of the values
* below to differentiate your control from this sample.
*
***************************************************************************/
#ifndef DS_VERSION_H
#define DS_VERSION_H
#define DSOFRAMERCTL_VERSION 1.3
#define DSOFRAMERCTL_VERSION_MAJOR 1
#define DSOFRAMERCTL_VERSION_MINOR 3
#define DSOFRAMERCTL_VERSION_BUILD 1323
#define DSOFRAMERCTL_VERSIONSTR "1.3"
#define DSOFRAMERCTL_VERSIONSTRFULL "1.3.1323.1"
#define DSOFRAMERCTL_FULLNAME "DSO ActiveX Document Framer Control"
#define DSOFRAMERCTL_SHORTNAME "DSO Framer Control Object"
#define DSOFRAMERCTL_PROGID "DSOFramer.FramerControl"
#define DSOFRAMERCTL_TLIB 00460180-9E5E-11d5-B7C8-B8269041DD57
#define DSOFRAMERCTL_TLIBSTR "{00460180-9E5E-11d5-B7C8-B8269041DD57}"
#define DSOFRAMERCTL_INTERFACE 00460181-9E5E-11d5-B7C8-B8269041DD57
#define DSOFRAMERCTL_CLSID 00460182-9E5E-11d5-B7C8-B8269041DD57
#define DSOFRAMERCTL_CLSIDSTR "{00460182-9E5E-11d5-B7C8-B8269041DD57}"
#define DSOFRAMERCTL_DISPEVTS 00460185-9E5E-11d5-B7C8-B8269041DD57
#define DSOF_DISPID_FILECMD 1
#define DSOF_DISPID_DOCOPEN 2
#define DSOF_DISPID_DOCCLOSE 3
#define DSOF_DISPID_ACTIVATE 4
#define DSOF_DISPID_BDOCCLOSE 5
#define DSOF_DISPID_BDOCSAVE 6
#define DSOF_DISPID_ENDPREVIEW 7
#define DSOF_DISPID_SAVECOMPLETE 8
#endif //DS_VERSION_H