Code: Select all
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DSOFramer; // DSO ActiveX Document Framer Control
UUID {00460180-9E5E-11D5-B7C8-B8269041DD57};
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
==================================================================================
enum dsoBorderStyle;
{
dsoBorderNone = 0,
dsoBorderFlat = 1,
dsoBorder3D = 2,
dsoBorder3DThin = 3
};
==================================================================================
enum dsoShowDialogType;
{
dsoDialogNew = 0,
dsoDialogOpen = 1,
dsoDialogSave = 2,
dsoDialogSaveCopy = 3,
dsoDialogPrint = 4,
dsoDialogPageSetup = 5,
dsoDialogProperties = 6
};
==================================================================================
enum dsoFileCommandType;
{
dsoFileNew = 0,
dsoFileOpen = 1,
dsoFileClose = 2,
dsoFileSave = 3,
dsoFileSaveAs = 4,
dsoFilePrint = 5,
dsoFilePageSetup = 6,
dsoFileProperties = 7,
dsoFilePrintPreview = 8
};
==================================================================================
IDispatch _FramerControl;
IID = {00460181-9E5E-11D5-B7C8-B8269041DD57};
// Inherits from: IDispatch {00020400-0000-0000-C000-000000000046}
1. Activates the current document object.
STDCALL FUNC PUREVIRTUAL;
HRESULT Activate(
);
2. Returns the Automation interface of the document object.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT ActiveDocument(
[out,retval] idispatch* ppdisp
);
3. Creates a new document based on the ProgId or Template file provided.
STDCALL FUNC PUREVIRTUAL;
HRESULT CreateNew(
[in] BSTR ProgIdOrTemplate
);
4. Opens a document from a file, URL, or Automation object.
STDCALL FUNC PUREVIRTUAL;
HRESULT Open(
[in] VARIANT Document,
[in,optional] VARIANT ReadOnly,
[in,optional] VARIANT ProgId,
[in,optional] VARIANT WebUsername,
[in,optional] VARIANT WebPassword
);
5. Saves the document to specified location or its original location.
STDCALL FUNC PUREVIRTUAL;
HRESULT Save(
[in,optional] VARIANT SaveAsDocument,
[in,optional] VARIANT OverwriteExisting,
[in,optional] VARIANT WebUsername,
[in,optional] VARIANT WebPassword
);
6.
STDCALL FUNC PUREVIRTUAL;
HRESULT _PrintOutOld(
[in,optional] VARIANT PromptToSelectPrinter
);
7. Closes the currently open document.
STDCALL FUNC PUREVIRTUAL;
HRESULT Close(
);
8. Returns/sets the titlebar caption.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT Caption(
[in] BSTR PromptToSelectPrinter
);
9.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT Caption(
[out,retval] BSTR* pbstr
);
10. Returns/sets whether the titlebar should be displayed.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT Titlebar(
[in] bool pbstr
);
11.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT Titlebar(
[out,retval] bool* pbool
);
12. Returns/sets whether toolbars should be displayed.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT Toolbars(
[in] bool pbool
);
13.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT Toolbars(
[out,retval] bool* pbool
);
14. Returns/sets the controls modal state.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT ModalState(
[in] bool pbool
);
15.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT ModalState(
[out,retval] bool* pbool
);
16. Displays a modal dialog of the given type for user action.
STDCALL FUNC PUREVIRTUAL;
HRESULT ShowDialog(
[in] <enum> dsoShowDialogType DlgType
);
17. Returns/sets whether a specific action item is enabled.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT EnableFileCommand(
[in] <enum> dsoFileCommandType Item,
[in] bool Item
);
18.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT EnableFileCommand(
[in] <enum> dsoFileCommandType Item,
[out,retval] bool* pbool
);
19. Returns/sets the border style for the control.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT BorderStyle(
[in] <enum> dsoBorderStyle pbool
);
20.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT BorderStyle(
[out,retval] int* pstyle
);
21. Returns/sets the border color of the control.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT BorderColor(
[in] <enum> DSOFramer pstyle
);
22.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT BorderColor(
[out,retval] <enum> DSOFramer* pclr
);
23. Returns/sets the background color of the control.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT BackColor(
[in] <enum> DSOFramer pclr
);
24.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT BackColor(
[out,retval] <enum> DSOFramer* pclr
);
25. Returns/sets the foreground color of the control.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT ForeColor(
[in] <enum> DSOFramer pclr
);
26.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT ForeColor(
[out,retval] <enum> DSOFramer* pclr
);
27. Returns/sets the color of the titlebar.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT TitlebarColor(
[in] <enum> DSOFramer pclr
);
28.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT TitlebarColor(
[out,retval] <enum> DSOFramer* pclr
);
29. Returns/sets the color of text for the titlebar.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT TitlebarTextColor(
[in] <enum> DSOFramer pclr
);
30.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT TitlebarTextColor(
[out,retval] <enum> DSOFramer* pclr
);
31. Calls IOleCommandTarget::Exec on embedded object.
STDCALL FUNC PUREVIRTUAL;
HRESULT ExecOleCommand(
[in] int OLECMDID,
[in,optional] VARIANT Options,
[in,optional] VARIANT* vInParam,
[in,out,optional] VARIANT* vInOutParam
);
32. Returns/sets whether a menu bar should be displayed.
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT Menubar(
[in] bool vInOutParam
);
33.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT Menubar(
[out,retval] bool* pbool
);
34. Returns/sets host application name HostName(used in embedding).
STDCALL PROPERTYPUTREF PUREVIRTUAL;
HRESULT HostName(
[in] BSTR pbool
);
35.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT HostName(
[out,retval] BSTR* pbstr
);
36. Returns full document path name for object.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT DocumentFullName(
[out,retval] BSTR* pbstr
);
37. Prints current document to specific printer with settings.
STDCALL FUNC PUREVIRTUAL;
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
);
38. Starts a print preview PrintPreview(if document supports it).
STDCALL FUNC PUREVIRTUAL;
HRESULT PrintPreview(
);
39. Exits a current print preview.
STDCALL FUNC PUREVIRTUAL;
HRESULT PrintPreviewExit(
);
40. Returns True/False if file was open read-only, or has not been saved.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT IsReadOnly(
[out,retval] bool* pbool
);
41. Returns True/False if file has been altered or needs save.
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT IsDirty(
[out,retval] bool* pbool
);
42. Init the Http Engine. First
STDCALL FUNC PUREVIRTUAL;
HRESULT HttpInit(
[out,retval] bool* pbool
);
43. Add Post Data
STDCALL FUNC PUREVIRTUAL;
HRESULT HttpAddPostString(
[in] BSTR strName,
[in] BSTR strValue,
[out,retval] bool* pbool
);
44. Post the data to the URLHttpPost(bstr). End
STDCALL FUNC PUREVIRTUAL;
HRESULT HttpPost(
[in] BSTR bstr,
[out,retval] BSTR* pRet
);
45. Set the document to TrackRevisions state
STDCALL FUNC PUREVIRTUAL;
HRESULT SetTrackRevisions(
[in] int vbool,
[out,retval] bool* pbool
);
46. Set Curr User
STDCALL FUNC PUREVIRTUAL;
HRESULT SetCurrUserName(
[in] BSTR strCurrUserName,
[out,retval] bool* pbool
);
47. Add Post Data
STDCALL FUNC PUREVIRTUAL;
HRESULT HttpAddPostCurrFile(
[in] BSTR strFileID,
[in] BSTR strFileName,
[out,retval] bool* pbool
);
48. Set Curr Time ; Linke 2006:02:07 11:11:11
STDCALL FUNC PUREVIRTUAL;
HRESULT SetCurrTime(
[in] BSTR strValue,
[out,retval] bool* pbool
);
49. Get the application dispatch
STDCALL PROPERTYGET PUREVIRTUAL;
HRESULT GetApplication(
[out,retval] idispatch* ppdisp
);
50. Set Field Or sheetValue
STDCALL FUNC PUREVIRTUAL;
HRESULT SetFieldValue(
[in] BSTR strFieldName,
[in] BSTR strValue,
[in] BSTR strCmdOrSheetName,
[out,retval] bool* pbool
);
51. Get Field Or sheetValue
STDCALL FUNC PUREVIRTUAL;
HRESULT GetFieldValue(
[in] BSTR strFieldName,
[in] BSTR strCmdOrSheetName,
[out,retval] BSTR* strValue
);
52. Set Menu Enable
STDCALL FUNC PUREVIRTUAL;
HRESULT SetMenuDisplay(
[in] int lMenuFlag,
[out,retval] bool* pbool
);
53. ProtectDoc
STDCALL FUNC PUREVIRTUAL;
HRESULT ProtectDoc(
[in] int lProOrUn,
[in] int lProType,
[in] BSTR strProPWD,
[out,retval] bool* pbool
);
54. ShowRevisions
STDCALL FUNC PUREVIRTUAL;
HRESULT ShowRevisions(
[in] int nNewValue,
[out,retval] bool* pbool
);
55. Set Field Or sheetValue
STDCALL FUNC PUREVIRTUAL;
HRESULT InSertFile(
[in] BSTR strFieldPath,
[in] int lPos,
[out,retval] bool* pbool
);
56. Load File
STDCALL FUNC PUREVIRTUAL;
HRESULT LoadOriginalFile(
[in] VARIANT strFieldPath,
[in] VARIANT strFileType,
[out,retval] int* pbool
);
57. Save As
STDCALL FUNC PUREVIRTUAL;
HRESULT SaveAs(
[in] VARIANT strFileName,
[in] VARIANT dwFileFormat,
[out,retval] int* pbool
);
58. DeleteLocalFile
STDCALL FUNC PUREVIRTUAL;
HRESULT DeleteLocalFile(
[in] BSTR strFilePath
);
59. GetTempFilePath
STDCALL FUNC PUREVIRTUAL;
HRESULT GetTempFilePath(
[out,retval] BSTR* strValue
);
60. ShowView
STDCALL FUNC PUREVIRTUAL;
HRESULT ShowView(
[in] int dwViewType,
[out,retval] int* pbool
);
61. FtpConnect
STDCALL FUNC PUREVIRTUAL;
HRESULT FtpConnect(
[in] BSTR strURL,
[in] int lPort,
[in] BSTR strUser,
[in] BSTR strPwd,
[out,retval] int* pbool
);
62. FtpGetFile
STDCALL FUNC PUREVIRTUAL;
HRESULT FtpGetFile(
[in] BSTR strRemoteFile,
[in] BSTR strLocalFile,
[out,retval] int* pbool
);
63. FtpPutFile
STDCALL FUNC PUREVIRTUAL;
HRESULT FtpPutFile(
[in] BSTR strLocalFile,
[in] BSTR strRemoteFile,
[in] int blOverWrite,
[out,retval] int* pbool
);
64. FtpDisConnect
STDCALL FUNC PUREVIRTUAL;
HRESULT FtpDisConnect(
[out,retval] int* pbool
);
65. Download File
STDCALL FUNC PUREVIRTUAL;
HRESULT DownloadFile(
[in] BSTR strRemoteFile,
[in] BSTR strLocalFile,
[out,retval] BSTR* strValue
);
66. Add Post File
STDCALL FUNC PUREVIRTUAL;
HRESULT HttpAddPostFile(
[in] BSTR strFileID,
[in] BSTR strFileName,
[out,retval] int* pbool
);
67. Get Rev Index
STDCALL FUNC PUREVIRTUAL;
HRESULT GetRevCount(
[out,retval] int* pbool
);
68. Get Rev Index Info
STDCALL FUNC PUREVIRTUAL;
HRESULT GetRevInfo(
[in] int lIndex,
[in] int lType,
[out,retval] BSTR* pbool
);
69. Set Doc Prop
STDCALL FUNC PUREVIRTUAL;
HRESULT SetValue(
[in] BSTR strValue,
[in] BSTR strName,
[out,retval] int* pbool
);
70. Set Doc Variable
STDCALL FUNC PUREVIRTUAL;
HRESULT SetDocVariable(
[in] BSTR strVarName,
[in] BSTR strValue,
[in] int lOpt,
[out,retval] int* pbool
);
71. Save page To Doc
STDCALL FUNC PUREVIRTUAL;
HRESULT SetPageAs(
[in] BSTR strLocalFile,
[in] int lPageNum,
[in] int lType,
[out,retval] int* pbool
);
72. Replace Text
STDCALL FUNC PUREVIRTUAL;
HRESULT ReplaceText(
[in] BSTR strSearchText,
[in] BSTR strReplaceText,
[in] int lGradation,
[out,retval] int* pbool
);
73. Get EnvironmentVariable
STDCALL FUNC PUREVIRTUAL;
HRESULT GetEnvironmentVariable(
[in] BSTR EnvironmentName,
[out,retval] BSTR* strValue
);
74. Get Office Version
STDCALL FUNC PUREVIRTUAL;
HRESULT GetOfficeVersion(
[in] BSTR strName,
[out,retval] BSTR* strValue
);
==================================================================================
IDispatch _DFramerCtlEvents;
IID = {00460185-9E5E-11D5-B7C8-B8269041DD57};
// Inherits from: IDispatch {00020400-0000-0000-C000-000000000046}
1. Called when File menu item is selected by user OnFileCommand(may be canceled).
STDCALL FUNC DISPATCH;
HRESULT OnFileCommand(
[in] <enum> dsoFileCommandType Item,
[in,out] bool* Cancel
);
2. Called when document is opened or new document added.
STDCALL FUNC DISPATCH;
HRESULT OnDocumentOpened(
[in] BSTR File,
[in] idispatch Document
);
3. Called when document is closed.
STDCALL FUNC DISPATCH;
HRESULT OnDocumentClosed(
);
4. Called when component gains/loses activation.
STDCALL FUNC DISPATCH;
HRESULT OnActivationChange(
[in] bool fGoingActive
);
5. Called before document is closed BeforeDocumentClosed(may be canceled).
STDCALL FUNC DISPATCH;
HRESULT BeforeDocumentClosed(
[in] idispatch Document,
[in,out] bool* Cancel
);
6. Called before document is saved BeforeDocumentSaved(may be canceled).
STDCALL FUNC DISPATCH;
HRESULT BeforeDocumentSaved(
[in] idispatch Document,
[in] BSTR Location,
[in,out] bool* Cancel
);
7. Called when print preview is closed.
STDCALL FUNC DISPATCH;
HRESULT OnPrintPreviewExit(
);
8. Ctrl Ready
STDCALL FUNC DISPATCH;
HRESULT NotifyCtrlReady(
);
==================================================================================
coclass FramerControl; // DSO Framer Control Object
CLSID = {00460182-9E5E-11D5-B7C8-B8269041DD57};
// Implemented interface: <IDispatch> _FramerControl
// Implemented interface: <IDispatch> _DFramerCtlEvents
==================================================================================