Pre-notifies an application when a document is about to close.
.NET Syntax
Visual Basic (Declaration) | |
---|
Public Delegate Sub _IDocumentEvents_DestroyPreNotifyEventHandler() |
C# | |
---|
public delegate void _IDocumentEvents_DestroyPreNotifyEventHandler() |
JavaScript | |
---|
Event Not Supported |
COM native C++ | |
---|
DestroyPreNotify(); |
Example
See the following code snippets:
COM native C++
Header file
//Register the events for the IDocument class
BEGIN_SINK_MAP(CDsAddinDocument)
SINK_ENTRY_EX(IDC_DSAPPLICATIONEVENT, DIID__IDocumentEvents, dsDocument_DestroyNotify_id, OnDestroyNotify)
SINK_ENTRY_EX(IDC_DSAPPLICATIONEVENT, DIID__IDocumentEvents, dsDocument_DestroyPreNotify_id, OnDestroyPreNotify)
SINK_ENTRY_EX(IDC_DSAPPLICATIONEVENT, DIID__IDocumentEvents, dsDocument_FileSavePostNotify_id, OnFileSavePostNotify)
SINK_ENTRY_EX(IDC_DSAPPLICATIONEVENT, DIID__IDocumentEvents, dsDocument_ModifyNotify_id, OnModifyNotify)
END_SINK_MAP()
//Declare the callbacks for IDocument class
void __stdcall OnDestroyNotify();
void __stdcall OnDestroyPreNotify();
void __stdcall OnFileSavePostNotify();
void __stdcall OnModifyNotify();
Source file
void
__stdcall CDsAddinDocument::OnDestroyPreNotify()
{
// TODO: Add your code here
}
C++
Header file
class
DSADDINSAMPLE_EXPORT DsAddinDocument :
public dsDocumentEvents_c
{
public
:
DsAddinDocument(dsDocument_c *dsDoc) : m_dsDoc(dsDoc) {
RegisterDocumentDestroyNotifyHook(m_dsDoc);
RegisterDocumentDestroyPreNotifyHook(m_dsDoc);
RegisterDocumentFileSavePostNotifyHook(m_dsDoc);
RegisterDocumentModifyNotifyHook(m_dsDoc);
}
~DsAddinDocument() {
UnRegisterDocumentDestroyNotifyHook(m_dsDoc);
UnRegisterDocumentDestroyPreNotifyHook(m_dsDoc);
UnRegisterDocumentFileSavePostNotifyHook(m_dsDoc);
UnRegisterDocumentModifyNotifyHook(m_dsDoc);
}
DeclareDocumentDestroyNotifyHook
DeclareDocumentDestroyPreNotifyHook
DeclareDocumentFileSavePostNotifyHook
DeclareDocumentModifyNotifyHook
dsDocument_c* getMyDoc() {
return m_dsDoc;}
bool DestroyNotify();
bool DestroyPreNotify();
bool FileSavePostNotify();
bool ModifyNotify();
Source file
ImplementDocumentDestroyNotifyHook(DsAddinDocument)
ImplementDocumentDestroyPreNotifyHook(DsAddinDocument)
ImplementDocumentModifyNotifyHook(DsAddinDocument)
ImplementDocumentFileSavePostNotifyHook(DsAddinDocument)
bool
DsAddinDocument::DestroyNotify()
{
//TODO: Add your code here
return true;
}
bool DsAddinDocument::DestroyPreNotify()
{
//TODO: Add your code here
return true;
}
bool
DsAddinDocument::FileSavePostNotify()
{
//TODO: Add your code here
return true;
}
bool
DsAddinDocument::ModifyNotify()
{
//TODO: Add your code here
return true;
}
Back to top
Remarks
Availability
DraftSight V1R4.0