commit fb064541d6e0982a1d56415209ce128a57bbd214
Author: Raten
Date: Thu Nov 27 16:46:48 2025 +0900
new
diff --git a/UltimateToolbox93_docs/Problems.txt b/UltimateToolbox93_docs/Problems.txt
new file mode 100644
index 0000000..e75bba9
--- /dev/null
+++ b/UltimateToolbox93_docs/Problems.txt
@@ -0,0 +1,29 @@
+The help files for Ultimate Toolbox, Ultimate Grid, and Ultimate TCP/IP are now distributed in a compiled htm format - this avoids some IE7 problems encountered with the previous WebHelp offering, allows for a simpler download, and better index and search capabilities.
+
+Since the downloads first became available, several users have discovered some problems on first usage, and this text is intended as a troubleshooting guide.
+
+EXPLORER:
+
+When you first open the .chm file, you may see a message such as:
+
+"Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable." or "This program cannot display the webpage", etc.
+
+Later versions of windows will associate zone information with files downloaded from the internet - and this zone info may be applied to the files contained within the .zip when extracted. This may block Explorer's navigation to the html topics.
+
+To solve this problem, right click on the .chm file, select Properties, and Unblock.
+
+PATH:
+
+You may also receive this message if the path to the .chm file contains a '#' character - this will require either the renaming of a directory or moving the files - the '#' sign is being interpreted by the viewer as a bookmark indicator.
+
+Lastly, a '%' sign in the path will prevent the main window from appearing, with the contents pane displaying, e.g., 'Cannot locate "mk:MSITStore:D:\This% is a test\UTCP_IP42.chm::/TCP_IP.hhc". Again, renaming or moving the file should help.
+
+INDEX:
+
+There are chm compilations distributed with each of the Ultimate Toolbox, Ultimate Grid, and Ultimate TCP/IP libraries. Of these, the Ultimate Grid (UGrid72.chm) and Ultimate TCP/IP (UTCP_IP42.chm) use external index (chi) files. If these are not available in the path along with the .chm files, you should see a message box stating 'The window name "NewWindow" passed to HH_GET_WIN_TYPE has not been specified.' To resolve, make sure the associated .chi file is available.
+
+Thanks for your interest in The Ultimate Toolbox. If you encounter any problems with these help compilations not addressed by this text, please post a message at http://www.codeproject.com/MFC/UltimateToolbox.asp.
+
+
+
+
diff --git a/UltimateToolbox93_docs/UTBX93.chm b/UltimateToolbox93_docs/UTBX93.chm
new file mode 100644
index 0000000..0b5e653
Binary files /dev/null and b/UltimateToolbox93_docs/UTBX93.chm differ
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/BDIFCALC.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/BDIFCALC.h
new file mode 100644
index 0000000..8ecdd38
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/BDIFCALC.h
@@ -0,0 +1,276 @@
+// ==========================================================================
+// Class Specification : COXBinDiffCalculator
+// ==========================================================================
+
+// Header file : bdifcalc.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class can be used to compute the binary differnce between two files
+// (the original and the updated file)
+// A third file that contains the difference is generated then.
+// difference = updated - original
+// Using the difference file and the original one, the updated file can be
+// computed
+// updated = original + difference
+// This class can be used by supplying the names of the files directly
+// An alternative use is that three CFile-derived objects are created and
+// opened and than passed as parameter. This permits other media besides
+// disk access (e.g. CMemFile for in-memory computation)
+
+// Remark:
+// The progress of the computation is routed to an object of a COXDiffProgress
+// derived object. The default implementation writes to the console
+// using cprintf. You can derive a class from COXDiffProgress and override
+// the virtual functions Init(), Adjust(), Abort() and Close().
+// The new progreesbar will be used after a call to ReplaceProgressBar()
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __BDIFCALC_H__
+#define __BDIFCALC_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+// By #defining BDEXTR as 1, a reduced, decode-only version is created
+// If BDEXTR is not defined or 0, a complete version is created.
+#ifndef BDEXTR
+#define BDEXTR 0
+#endif
+
+class COXDiffProgress;
+class COXDiffFileHeader;
+
+class OX_CLASS_DECL COXBinDiffCalculator : public CObject
+{
+DECLARE_DYNAMIC(COXBinDiffCalculator)
+// Data members -------------------------------------------------------------
+public:
+ static const double m_cMinMeanChunkLen;
+ static const double m_cMaxMeanChunkLen;
+ static const double m_cBigChunkLen;
+ static const TCHAR* m_cFileHeader;
+ static const BOOL m_cDropEOL;
+ static const DWORD m_cBufSiz;
+ static const WORD m_cMinMatchLen;
+ static const WORD m_cMinEqualRunLen;
+
+ static const BYTE m_cTagSmallDiff;
+ static const BYTE m_cTagMediumDiff;
+ static const BYTE m_cTagLargeDiff;
+ static const BYTE m_cTagSmallNearCopy;
+ static const BYTE m_cTagMediumNearCopy;
+ static const BYTE m_cTagLargeNearCopy;
+ static const BYTE m_cTagSmallDistantCopy;
+ static const BYTE m_cTagMediumDistantCopy;
+ static const BYTE m_cTagLargeDistantCopy;
+ static const BYTE m_cTagSmallFarCopy;
+ static const BYTE m_cTagMediumFarCopy;
+ static const BYTE m_cTagLargeFarCopy;
+ static const BYTE m_cTagEOF;
+
+ static const DWORD m_cSmallSize;
+ static const DWORD m_cMediumSize;
+ static const DWORD m_cLargeSize;
+ static const DWORD m_cNearDistance;
+ static const DWORD m_cDistantDistance;
+ static const DWORD m_cMaxStrLen;
+
+protected:
+#if ! BDEXTR
+// The following structures are not needed in extraction program */
+
+// Tree node: has 3 pointers: a pointer to lesser, and greater or equal nodes
+// The third pointer is a linked list pointer: the root node of the tree is also
+// the head of the linked list. The linked list is not built in a special order:
+// nodes are added to it in order of occurence. The tree is a binary tree.
+
+struct COXTreeNode
+ {
+ LONG filPos;
+ BYTE* bytes;
+ COXTreeNode* pGE; /* Greater or equal */
+ COXTreeNode* pLT; /* Less than */
+ COXTreeNode() { bytes = new BYTE[m_cMinMatchLen]; }
+ ~COXTreeNode() { delete[] bytes; }
+ };
+
+// Match block structure: for each match found between the two files, we
+// encode the positions in the two files and the length of the match.
+
+struct COXMatchBlock
+ {
+ LONG len;
+ LONG orgFilPos;
+ LONG derivedFilPos;
+ LONG distance; /* = orgFilPos - derivedFilPos */
+ COXMatchBlock* pNxt;
+ };
+
+struct COXByteAttribs
+ {
+ DWORD sum;
+ double sumSquares;
+ double mean;
+ double stdDev;
+
+ // ... Last file position where a byte was encountered, for all bytes.
+ // Initialized to -1 ('before' the first FILE position).
+ LONG lastPos;
+
+ // ... Count of occurences
+ LONG cnt;
+ };
+
+ COXTreeNode* m_LstFreeTreeNode;
+ COXMatchBlock* m_LstFreeMatchBlock;
+
+#endif /* ! BDEXTR */
+
+ COXDiffProgress* m_pProgressBar;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXBinDiffCalculator();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+#if ! BDEXTR
+ void SubtractFiles(LPCTSTR orgFilNam, LPCTSTR derivedFilNam, LPCTSTR diffFilNam,
+ COXDiffFileHeader* pHeader = NULL);
+ // --- In : orgFilNam : Full path of the original file
+ // derivedFilNam : Full path of the updated file
+ // diffFilNam : Full path of the difference file
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Calculates the binary differences between the
+ // original and updated file and writes it
+ // in the difference file
+#endif // ! BDEXTR
+
+ void AddFiles(LPCTSTR orgFilNam, LPCTSTR derivedFilNam, LPCTSTR diffFilNam,
+ COXDiffFileHeader* pHeader = NULL);
+ // --- In : orgFilNam : Full path of the original file
+ // derivedFilNam : Full path of the updated file
+ // diffFilNam : Full path of the difference file
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Applies the binary difference to the original file
+ // writes the updated file
+
+#if ! BDEXTR
+ virtual void SubtractFiles(CFile* pOrgFil, CFile* pDerivedFil, CFile* pDiffFil,
+ COXDiffFileHeader* pHeader = NULL);
+ // --- In : orgFilNam : Pointer to OPENED file (Read)
+ // derivedFilNam : Pointer to OPENED file (Read)
+ // diffFilNam : Pointer to OPENED file (Create/Read/Write)
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Calculates the binary differences between the
+ // original and updated file and writes it
+ // in the difference file
+#endif // ! BDEXTR
+
+ virtual void AddFiles(CFile* pOrgFil, CFile* pDerivedFil, CFile* pDiffFil,
+ COXDiffFileHeader* pHeader = NULL);
+ // --- In : orgFilNam : Pointer to OPENED file (Read)
+ // derivedFilNam : Pointer to OPENED file (Create/Read/Write)
+ // diffFilNam : Pointer to OPENED file (Read)
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Applies the binary difference to the original file
+ // writes the updated file
+
+ void ReplaceProgressBar(COXDiffProgress* pProgressBar);
+ // --- In : pProgressBar : The new progress bar to use
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Replaces the standard progress bar by
+ // another (COXDiffProgress derived)
+ // This will be automatically deleted when
+ // this COXBinDiffCalculator is destructed
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+ virtual ~COXBinDiffCalculator();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+ void CopyFileChars(LONG count, CFile* pInFile, CFile* pOutFile, LONG& sum);
+ LONG ReadLongNBytes(CFile* pFile,int n);
+#if ! BDEXTR
+ void WriteLongNBytes(LONG x, CFile* pFile,int n);
+ void ScanFile(CFile* pFile, COXByteAttribs* byteTable);
+ int FindDelimiter(CFile* pFile, double minMeanChunkLen, double maxMeanChunkLen);
+ void DeleteTreeNode(COXTreeNode* pTreeNode);
+ COXTreeNode* NewTreeNode();
+ void FreeTreeNode(COXTreeNode* pTreeNode);
+ int CmpNode(COXTreeNode* pNode1, CFile* pFil1, COXTreeNode* pNode2,
+ CFile* pFil2, int delim, LONG* pEqualLen);
+ void FindBestMatch(COXTreeNode* pOrgTreeRoot,
+ COXTreeNode** ppOrgTreeNode, CFile* pOrgFil, COXTreeNode* pDerivedTreeNode,
+ CFile* pDerivedFil, int delim, LONG* pMatchLen);
+ void AddTreeNode(COXTreeNode** ppTreeRoot, CFile* pFile,
+ int delim, COXTreeNode* pNewNode);
+ COXTreeNode* BuildTree(CFile* pFile, int delim, LONG& OrgSum);
+ void ExtendMatch(LONG& OrgFilPos, CFile* pOrgFil,
+ LONG& DerivedFilPos, CFile* pDerivedFil, LONG& MatchLen);
+ void DeleteMatchBlocks(COXMatchBlock* pBlock);
+ COXMatchBlock* NewMatchBlock(void);
+ void FreeMatchBlock(COXBinDiffCalculator::COXMatchBlock* pMatchBlock);
+ void AddMatch(COXTreeNode* pOrgTreeNode,
+ CFile* pOrgFil, COXTreeNode* pDerivedTreeNode,
+ CFile* pDerivedFil, LONG matchLen, COXMatchBlock** ppMatchLst);
+ void ShrinkMatchList(COXMatchBlock** ppMatchLst);
+ COXMatchBlock* MatchFiles(COXTreeNode* pOrgTreeRoot,CFile* pOrgFil,
+ CFile* pDerivedFil, int delim, LONG& DerivedSum);
+ void DumpDiff(COXMatchBlock* pMatchLst, CFile* pDerivedFil, CFile* pDiffFil);
+
+#endif // ! BDEXTR
+
+private:
+
+};
+
+#endif // __BDIFCALC_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.h
new file mode 100644
index 0000000..e910c9f
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.h
@@ -0,0 +1,115 @@
+// ==========================================================================
+// Class Specification : COXBlob
+// ==========================================================================
+
+// Header file : OXBlob.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CByteArray
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class is an extension of CByteArray and it can by used
+// to contain a Binary Large Object
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXBLOB_H__
+#define __OXBLOB_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "OXVariant.h"
+
+
+class OX_CLASS_DECL COXBlob : public CByteArray
+{
+DECLARE_DYNAMIC(COXBlob);
+
+// Data members -------------------------------------------------------------
+public:
+protected:
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+
+ // Constructors
+ COXBlob();
+ COXBlob(const COXBlob& blobSrc);
+ COXBlob(const CByteArray& arrSrc);
+ COXBlob(const CLongBinary& lbSrc);
+
+ COXBlob(const VARIANT& varSrc);
+ COXBlob(LPCVARIANT pSrc);
+ COXBlob(const COleVariant& varSrc);
+ COXBlob(const COXVariant& varSrc);
+
+ // Assignemnt operators
+ COXBlob& operator=(const COXBlob& blobSrc);
+ COXBlob& operator=(const CByteArray& arrSrc);
+ COXBlob& operator=(const CLongBinary& lbSrc);
+
+ COXBlob& operator=(const VARIANT& varSrc);
+ COXBlob& operator=(LPCVARIANT pSrc);
+ COXBlob& operator=(const COleVariant& varSrc);
+ COXBlob& operator=(const COXVariant& varSrc);
+
+ BOOL ReadRaw(LPCTSTR pszPath);
+ // --- In : pszPath : The full path specification
+ // --- Out :
+ // --- Returns : Whether it succeeded or not
+ // --- Effect : Reads data from the specified file into this object
+
+ BOOL WriteRaw(LPCTSTR pszPath);
+ // --- In : pszPath : The full path specification
+ // --- Out :
+ // --- Returns : Whether it succeeded or not
+ // --- Effect : Writes the data of this object to the specified file
+
+ // Destructor
+ virtual ~COXBlob();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+ BOOL CopyVariant(LPCVARIANT pSrc);
+
+private:
+
+};
+
+#include "OXBlob.inl"
+
+#endif // __OXBLOB_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.inl b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.inl
new file mode 100644
index 0000000..5c4ba76
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBlob.inl
@@ -0,0 +1,97 @@
+// ==========================================================================
+// Inline Implementation : COXBlob
+// ==========================================================================
+
+// Source file : OXBlob.inl
+
+// Source : R.Mortelmans
+// Creation Date : 7th March 1996
+// Last Modification : 7th March 1996
+
+// //////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Definition of static members
+
+// Member functions ---------------------------------------------------------
+// public:
+inline COXBlob::COXBlob()
+ {
+ }
+
+inline COXBlob::COXBlob(const COXBlob& blobSrc)
+ {
+ Copy(blobSrc);
+ }
+
+inline COXBlob::COXBlob(const CByteArray& arrSrc)
+ {
+ Copy(arrSrc);
+ }
+
+inline COXBlob::COXBlob(const VARIANT& varSrc)
+ {
+ CopyVariant(&varSrc);
+ }
+
+inline COXBlob::COXBlob(LPCVARIANT pSrc)
+ {
+ CopyVariant(pSrc);
+ }
+
+inline COXBlob::COXBlob(const COleVariant& varSrc)
+ {
+ CopyVariant(&varSrc);
+ }
+
+inline COXBlob::COXBlob(const COXVariant& varSrc)
+ {
+ CopyVariant(&varSrc);
+ }
+
+inline COXBlob& COXBlob::operator=(const COXBlob& blobSrc)
+ {
+ if(this==&blobSrc)
+ return *this;
+ Copy(blobSrc);
+ return *this;
+ }
+
+inline COXBlob& COXBlob::operator=(const CByteArray& arrSrc)
+ {
+ Copy(arrSrc);
+ return *this;
+ }
+
+inline COXBlob& COXBlob::operator=(const VARIANT& varSrc)
+ {
+ CopyVariant(&varSrc);
+ return *this;
+ }
+
+inline COXBlob& COXBlob::operator=(LPCVARIANT pSrc)
+ {
+ CopyVariant(pSrc);
+ return *this;
+ }
+
+inline COXBlob& COXBlob::operator=(const COleVariant& varSrc)
+ {
+ CopyVariant(&varSrc);
+ return *this;
+ }
+
+inline COXBlob& COXBlob::operator=(const COXVariant& varSrc)
+ {
+ CopyVariant(&varSrc);
+ return *this;
+ }
+
+inline COXBlob::~COXBlob()
+ {
+ }
+
+// protected:
+// private:
+
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBmpPrv.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBmpPrv.h
new file mode 100644
index 0000000..8552dc3
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXBmpPrv.h
@@ -0,0 +1,100 @@
+// ==========================================================================
+// Class Specification : COXBmpFileDialog
+// ==========================================================================
+
+// Header file : oxbmpprv.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from COXPreviewDialog
+
+// YES Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// YES Has a message map
+// YES Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class implements the two virtual function of COXPreviewDialog, to display
+// BMP/DIB format.
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __BMP_PREVDLG_H__
+#define __BMP_PREVDLG_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "OXPrvDlg.h"
+#include "oxdib.h"
+
+
+class OX_CLASS_DECL COXBmpFileDialog : public COXPreviewDialog
+{
+DECLARE_DYNAMIC(COXBmpFileDialog)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ COXDIB m_dib;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXBmpFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs
+ LPCTSTR lpszDefExt = NULL,
+ LPCTSTR lpszFileName = NULL,
+ DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
+ LPCTSTR lpszFilter = NULL,
+ CWnd* pParentWnd = NULL);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+
+ virtual ~COXBmpFileDialog();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+#ifndef WIN32
+ int DoModal();
+#endif
+
+
+protected:
+ virtual void OnNewFileSelect(const CString& sFilename);
+ virtual void OnPaintPreview(CDC* pDC, const CRect& paintRect);
+ virtual void OnDoRealizePalette(CWnd* pFocusWnd);
+
+private:
+
+};
+
+#endif
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdLne.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdLne.h
new file mode 100644
index 0000000..6307d73
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdLne.h
@@ -0,0 +1,129 @@
+// ==========================================================================
+// Class Specification : COXCommandLine
+// ==========================================================================
+
+// Header file : oxcmdlne.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// Yes Uses exceptions (same as CFile)
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// Tokenizes the commandline string and serves them up one by one for
+// COXCommandOptions::ParseCommandLine(). Constructor has two forms, one which
+// takes a CStdioFile pointer to support response files to get arround cmd line
+// limitations, the other takes a Character pointer.
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __CMDLINE_H__
+#define __CMDLINE_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXCommandLine : public CObject
+{
+DECLARE_DYNAMIC(COXCommandLine)
+// Expands any meta chars (*, ?, etc) (well, one day it will :-)
+// for files in the current working directory...
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CStringArray m_Tokens;
+ int m_NumTokens;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXCommandLine(LPCSTR pszCmdLine);
+ // --- In : pszCmdLine : the ANSI command line to be tokenized
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+#ifdef WIN32
+ COXCommandLine(LPCWSTR pszCmdLine);
+ // --- In : pszCmdLine : the UNICODE command line to be tokenized
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+#endif
+
+ COXCommandLine(CStdioFile* pInfile);
+ // --- In : pInfile : The file containing a command line
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ inline int GetNumArgs() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The number of separate command line options in this command line
+ // --- Effect :
+
+ inline CString operator[] (const int iElem) const;
+ // --- In : iElem : index of a Command line option
+ // --- Out :
+ // --- Returns : a command line option
+ // --- Effect :
+
+ virtual ~COXCommandLine();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+
+private:
+ void Tokenize(LPTSTR pszCmdLine);
+};
+
+inline int COXCommandLine::GetNumArgs() const
+ {
+ return m_NumTokens;
+ }
+
+inline CString COXCommandLine::operator[] (const int iElem) const
+ {
+ ASSERT((iElem >= 0) && (iElem <= m_NumTokens));
+ return m_Tokens[iElem];
+ }
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpd.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpd.h
new file mode 100644
index 0000000..973a0af
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpd.h
@@ -0,0 +1,262 @@
+// ==========================================================================
+// Class Specification : COXCommandOptionDesc
+// ==========================================================================
+
+// Header file : oxcmdopd.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// Yes Uses exceptions (same as CFile)
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// Contains information about a command option, its full name, abbreviations,
+// description, etc.
+// For detailed explanation, see constructor with parameters.
+
+// Remark:
+// The option descriptor class, each instance of
+// this class represents a valid option to the
+// program and some properties about that option.
+// Can be used by CmdOptions to produce a
+// usage message as well as to parse valid options.
+// Example:
+// void CMyApp::CreateValidOptions()
+// {
+// COXCommandOptionDesc codHelp (_T("HELP"), NULL, _T("Prints a help message"));
+// COXCommandOptionDesc codRun (_T("RUN"), NULL, _T("Automatically execute a testcase"));
+// COXCommandOptionDesc codEmf (_T("EMF"), COD_LASTARG, _T("MetaFile which specified GDI calls to make"));
+// COXCommandOptionDesc codVerify(_T("VERIFY"), COD_ARGOK, _T("Verification option"));
+// COXCommandOptionDesc codDiff (_T("DIFFERENCE"),COD_FIRSTARG,_T("File to write screen differences to"));
+// COXCommandOptionDesc codCmpScr(_T("CMPSCR"), COD_FIRSTARG,_T("File to compare screen to"));
+// COXCommandOptionDesc codOutScr(_T("OUTSCR"), COD_FIRSTARG,_T("File to write actual screen to"));
+// COXCommandOptionDesc codMask (_T("MASK"), COD_FIRSTARG,_T("File to mask screen differences with"));
+// COXCommandOptionDesc codCrc (_T("CRC"), COD_FIRSTARG,_T("File to read/write CRC code from/to"));
+// COXCommandOptionDesc codGen (_T("GENERATE"), NULL, _T("Interactive session for generating EMF file"));
+// COXCommandOptionDesc codRes (_T("RES"), COD_ARRAY, _T("Resources available"));
+// COXCommandOptionDesc codXList (_T("X"), COD_ASSOCARRAY,_T("Variable/Value pairs"));
+// }
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __CMDOPTD_H__
+#define __CMDOPTD_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+const int COD_ARGOK = 0x1; // Does option take argument?
+const int COD_REPEATOK = 0x2; // Is option valid more than once?
+const int COD_REP_FIRST = 0x4; // Use first if option is repeated
+const int COD_REP_LAST = 0x8; // Use last if option is repeated
+const int COD_REP_ARRAY = 0x10; // Build array if option is repeated
+const int COD_ASSOCIATIVE = 0x20; // Takes two arguments i.e. /X=variable=value
+const int COD_FIRSTARG = COD_ARGOK | COD_REPEATOK | COD_REP_FIRST;
+const int COD_LASTARG = COD_ARGOK | COD_REPEATOK | COD_REP_LAST;
+const int COD_ARRAY = COD_ARGOK | COD_REPEATOK | COD_REP_ARRAY;
+const int COD_ASSOCARRAY = COD_ARGOK | COD_REPEATOK | COD_ASSOCIATIVE;
+
+// Currently allows for COD_REP_FIRST && COD_REP_LAST, and other nonsense combinations.
+// This is not correct so pay attention to which flags you are combining !!!!!
+
+class OX_CLASS_DECL COXCommandOptionDesc : public CObject
+{
+DECLARE_DYNAMIC(COXCommandOptionDesc)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CString m_sOptionName;
+ int m_nFlags;
+ CString m_sDescription;
+ CString m_sAbbr;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXCommandOptionDesc();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ COXCommandOptionDesc(LPCTSTR psczOptionName, int iFlags,
+ LPCTSTR psczDescription, LPCTSTR psczAbbr = _T(""));
+ // --- In : psczOptionName : the name of the option, CASE-INSENSITIVE
+ // iFlags : the flags of the option
+ // COD_ARGOK Does option take an argument
+ // COD_REPEATOK Is option valid morethan once?
+ // COD_REP_FIRST Use first if option is repeated
+ // COD_REP_LAST Use last if option is repeated (i.e. /l dir1 /l dir2)
+ // COD_REP_ARRAY Build array if option is repeated
+ // COD_ASSOCIATIVE Takes two arguments i.e. /D variable=value or /D variable value
+ // COD_FIRSTARG Takes an argument, is repeatable, and repeats are ignored
+ // COD_LASTARG Takes an argument, is repeatable, and repeats are ignored
+ // COD_ARRAY Takes an argument, is repeatable, builds an array
+ // (i.e. The INCLUDE option would use this)
+ // COD_ASSOCARRAY Takes two arguments, is repeatable, builds associative array
+ //
+ // psczDescription : the description of the option, for usage messages
+ // psczAbbr : the abbreviation of the option.
+ // A DEFINITE abbreviation of the argument, this abbreviation will
+ // be used unless it conflicts with another option's DEFINITE abbreviation.
+ // This can be used to have an abbreviation of I for the INCLUDE option, even
+ // if there is another option which begins with I.
+ // For all options, any UNIQUE shortening of the option name is acceptable.
+ // For example, with an option name of INCLUDE, possible abbreviations would
+ // be I, IN, INC, INCL, INCLU, INCLUD. Which of these possibilities are
+ // valid, depends on which ones are are unique for a given option set.
+ // The DEFINITE abbreviation need not be a true abbreviation of the option name.
+ // For example, an option name EXPORT, could have a DEFINITE abbreviation
+ // of X even though that is not strictly an abbreviation of the name.
+ //
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ COXCommandOptionDesc(const COXCommandOptionDesc& OptDescSrc);
+ // --- In : OptDescSrc : COXCommandOptionDesc object which will be copied
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Copy contruction.
+
+ COXCommandOptionDesc& operator=(const COXCommandOptionDesc& OptDescSrc);
+ // --- In : OptDescSrc : COXCommandOptionDesc object which will be assign to 'this' COXCommandOptionDesc object
+ // --- Out:
+ // --- Returns:
+ // --- Effect : Assignment operator
+
+ int TakesArg() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : does this option takes arguments or not
+ // --- Effect :
+
+ int IsRepeatable() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : can this option appear more than once on a command line
+ // --- Effect :
+
+ int ReturnsFirstRep() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : will only the first occurrence of this option be recorded or not
+ // --- Effect :
+
+ int ReturnsLastRep() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : will only the last occurrence of this option be recorded or not
+ // --- Effect :
+
+ int ReturnsArray() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : will the occurrences of this option build an array or not
+ // --- Effect :
+
+ int ReturnsAssociative() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : will the occurrences of this option build an associative array or not
+ // --- Effect :
+
+ LPCTSTR GetDescription() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : the description of this option
+ // --- Effect :
+
+ CString GetOptName() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : the name of this option
+ // --- Effect :
+
+ CString GetOptAbbr() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : the DEFINITE abbreviation of this option
+ // --- Effect :
+
+ virtual ~COXCommandOptionDesc();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+private:
+};
+
+inline int COXCommandOptionDesc::TakesArg() const
+ {
+ return m_nFlags & COD_ARGOK;
+ }
+
+inline int COXCommandOptionDesc::IsRepeatable() const
+ {
+ return m_nFlags & COD_REPEATOK;
+ }
+inline int COXCommandOptionDesc::ReturnsFirstRep() const
+ {
+ return m_nFlags & COD_REP_FIRST;
+ }
+inline int COXCommandOptionDesc::ReturnsLastRep() const
+ {
+ return m_nFlags & COD_REP_LAST;
+ }
+inline int COXCommandOptionDesc::ReturnsArray() const
+ {
+ return m_nFlags & COD_REP_ARRAY;
+ }
+inline int COXCommandOptionDesc::ReturnsAssociative() const
+ {
+ return m_nFlags & COD_ASSOCIATIVE;
+ }
+inline LPCTSTR COXCommandOptionDesc::GetDescription() const
+ {
+ return m_sDescription;
+ }
+
+inline CString COXCommandOptionDesc::GetOptName() const
+ {
+ return m_sOptionName;
+ }
+
+inline CString COXCommandOptionDesc::GetOptAbbr() const
+ {
+ return m_sAbbr;
+ }
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpt.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpt.h
new file mode 100644
index 0000000..d181dab
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdOpt.h
@@ -0,0 +1,200 @@
+// ==========================================================================
+// Class Specification : COXCommandOptions
+// ==========================================================================
+
+// Header file : oxcmdopt.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// Yes Uses exceptions (same as CFile)
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// Parses the command line options and
+// answers questions about what was requested.
+// This is the 'workhorse' of the whole thing, contains the list of valid options, the map of
+// abbreviations to options, and the values of arguments to the options.
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __CMDOPT_H__
+#define __CMDOPT_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "OXCmdOpD.h"
+#include "OXCmdLne.h"
+
+
+class OX_CLASS_DECL COXCommandOptions : public CObject
+{
+DECLARE_DYNAMIC(COXCommandOptions)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CObArray m_CmdOptDescList; // Descriptions of possible command line switches
+
+ CMapStringToOb m_AbbrMap; // Points abbreviations to objects
+
+ CMapStringToOb m_Values; // Points to actual values from user
+ // -RUN is stored as Values[RUN] = 1
+ // -EMF=foobar is stored as Values[EMF] = foobar.emf
+ // -RES=disk -RES=tape is stored as Values[RES] = "disk\ntape"
+ // -x a=b is stored as Values[x] = "a=b"
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXCommandOptions();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ void Add(COXCommandOptionDesc* pOptionDesc);
+ // --- In : OptionDesc : An Option Description
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Add the Option Description to the array
+ // You need not to worry about Option descriptions
+ // going out of scope because they are copied internally
+ // before being added to an option description array.
+
+ void Add(LPCTSTR psczOptionName, int iFlags,
+ LPCTSTR psczDescription, LPCTSTR psczsAbbr = _T(""));
+ // --- In : psczOptionName : the name of the option, CASE-INSENSITIVE
+ // iFlags : the flags of the option
+ // COD_ARGOK Does option take an argument
+ // COD_REPEATOK Is option valid morethan once?
+ // COD_REP_FIRST Use first if option is repeated
+ // COD_REP_LAST Use last if option is repeated (i.e. /l dir1 /l dir2)
+ // COD_REP_ARRAY Build array if option is repeated
+ // COD_ASSOCIATIVE Takes two arguments i.e. /D variable=value or /D variable value
+ // COD_FIRSTARG Takes an argument, is repeatable, and repeats are ignored
+ // COD_LASTARG Takes an argument, is repeatable, and repeats are ignored
+ // COD_ARRAY Takes an argument, is repeatable, builds an array
+ // (i.e. The INCLUDE option would use this)
+ // COD_ASSOCARRAY Takes two arguments, is repeatable, builds associative array
+ //
+ // psczDescription : the description of the option, for usage messages
+ // psczAbbr : the abbreviation of the option.
+ // A DEFINITE abbreviation of the argument, this abbreviation will
+ // be used unless it conflicts with another option's DEFINITE abbreviation.
+ // This can be used to have an abbreviation of I for the INCLUDE option, even
+ // if there is another option which begins with I.
+ // For all options, any UNIQUE shortening of the option name is acceptable.
+ // For example, with an option name of INCLUDE, possible abbreviations would
+ // be I, IN, INC, INCL, INCLU, INCLUD. Which of these possibilities are
+ // valid, depends on which ones are are unique for a given option set.
+ // The DEFINITE abbreviation need not be a true abbreviation of the option name.
+ // For example, an option name EXPORT, could have a DEFINITE abbreviation
+ // of X even though that is not strictly an abbreviation of the name.
+ //
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Add the Option Description to the array
+
+ BOOL Remove(LPCTSTR pszcOption);
+ // --- In : pszcOption : the option to delete
+ // --- Out :
+ // --- Returns : succeeded or not
+ // --- Effect : Removes this option from all internal lists
+
+ CString ParseCmdLine(COXCommandLine& cl, CStringList* pRestList = NULL);
+ // --- In : cl : the Command line object to parse
+ // pRestList : when provided will contain the strings on the command line
+ // that aren't flags. Is actually the same as the return string
+ // except that the separate parts are stored in a Stringlist.
+ // --- Out :
+ // --- Returns : Anything left over on the command line after parsing the valid options
+ // --- Effect : Construct array of actual parameters based on command line object
+ // Can throw an COXCommandLineException
+
+ const COXCommandOptionDesc* GetOptionObject(LPCTSTR psczOption) const;
+ // --- In : psczOption : the name of the option
+ // --- Out :
+ // --- Returns : the option object with pszcOption as NAME. NULL if not found.
+ // --- Effect :
+
+ BOOL IsEnabled(LPCTSTR psczOption) const;
+ // --- In :
+ // --- Out :
+ // --- Returns : Did the option appeared on the command line or not
+ // --- Effect : It works for any of the argument forms
+
+ CString GetValue(LPCTSTR psczOption) const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The argument associated with the option
+ // --- Effect : It is used with single-occurrence, single-argument options
+
+ const CStringList* GetValues(LPCTSTR psczOption) const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The list of arguments associated with the option
+ // --- Effect : It is used with single-argument, multiple-occurrence options
+
+ const CMapStringToString* GetAssocPairs(LPCTSTR psczOption) const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The list of combined arguments associated with the option
+ // --- Effect : It is used with options that take two arguments, the first being
+ // a key name, the second the value of of the key. This is useful
+ // for options that set variables like -Dfoo=bar in a compiler
+
+ CString Usage(LPCTSTR psczMsg) const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : prints usage message if StdHandles are available
+
+ virtual ~COXCommandOptions();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+ // Construct abbreviation map from given OptionDesc's
+ void BuildAbbrTable();
+
+ // Reset contents of all maps and lists. Called by destructor
+ void ResetMaps();
+
+private:
+
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdlEx.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdlEx.h
new file mode 100644
index 0000000..3b732f1
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCmdlEx.h
@@ -0,0 +1,96 @@
+// ==========================================================================
+// Class Specification : COXCommandLineException
+// ==========================================================================
+
+// Header file : oxcmdlex.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CException
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates a new exception for Command line parsing
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __CMDLEXCEPTION_H__
+#define __CMDLEXCEPTION_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class COXCommandOptions;
+
+class OX_CLASS_DECL COXCommandLineException : public CException
+{
+DECLARE_DYNAMIC(COXCommandLineException)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CString m_sErrMsg;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXCommandLineException(LPCTSTR pszcError, COXCommandOptions* pCmdOpt = NULL);
+ // --- In : pszcError : the actual Errormessage
+ // pCmdOpt : the command option object that parses the command line.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+ // This constructor will expand the error message with some
+ // extra information concerning the command line being parsed
+
+ virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError, UINT* pnHelpContext = NULL );
+ // --- In : see CException::GetErrorMessage()
+ // --- Out :
+ // --- Returns : TRUE if string available, otherwise FALSE
+ // --- Effect : retrieves the error string if available
+
+ BOOL WriteToStdErr();
+ // --- In :
+ // --- Out :
+ // --- Returns : TRUE if write was successful, otherwise FALSE
+ // --- Effect : Writes the error message to the STDERR (for use in CONSOLE programs)
+
+
+protected:
+
+private:
+
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommMsg.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommMsg.h
new file mode 100644
index 0000000..e24c497
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommMsg.h
@@ -0,0 +1,142 @@
+// ==========================================================================
+// Class Specification : COXCommMsg
+// ==========================================================================
+
+// Header file : OXCommMSg.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CArray
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates strict typed data
+// It is an array of OLE variants.
+// It can be used to communicate data together with the type
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXCOMMMSG_H__
+#define __OXCOMMMSG_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include
+#include "OXVariant.h"
+
+
+class OX_CLASS_DECL COXCommMsg : public CArray
+{
+DECLARE_DYNAMIC(COXCommMsg)
+// Data members -------------------------------------------------------------
+public:
+ // Possible types
+ enum EOXArgumentTypes // ID bytes C-type member name
+ {
+ ATEmpty = VT_EMPTY, // (0) 0 - -
+ ATNull = VT_NULL, // (1) 0 - -
+ ATBool = VT_BOOL, // (11) 2 VARIANT_BOOL bool
+ ATUI1 = VT_UI1, // (17) 1 unsigned char bVal
+ ATI2 = VT_I2, // (2) 2 short iVal
+ ATI4 = VT_I4, // (3) 4 long lVal
+ ATCy = VT_CY, // (6) 8 CY cyVal
+ ATR4 = VT_R4, // (4) 4 float fltVal
+ ATR8 = VT_R8, // (5) 8 double dblVal
+ ATStr = VT_BSTR, // (8) 4+len BSTR bstrVal
+ ATDate = VT_DATE, // (7) 8 DATE date
+ ATError = VT_ERROR, // (10) 4 SCODE scode
+ ATBlob = VT_UI1 | VT_ARRAY
+ // (8209)4+len - -
+ };
+
+ // Total number of types
+ enum
+ {
+ m_nArgumentTypesCount = 13
+ };
+ // Array containing all the types
+ static EOXArgumentTypes m_types[m_nArgumentTypesCount];
+ static LPCTSTR m_typeNames[m_nArgumentTypesCount];
+
+protected:
+ static WORD m_nMagicNumber;
+ static WORD m_nVariantType;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+
+ COXCommMsg();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object
+
+ virtual void Serialize(CArchive& ar);
+ // --- In : ar : Archive used in serialization
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Serializes the object
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+
+ virtual void Dump(CDumpContext& dc) const;
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+ // Note The Dump function does not print a newline character
+ // at the end of its output.
+#endif
+
+ virtual ~COXCommMsg();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+
+private:
+
+};
+
+#endif // __OXCOMMMSG_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.h
new file mode 100644
index 0000000..b7d587a
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.h
@@ -0,0 +1,31 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by OXCommon.rc
+//
+#define psh14 0x040d
+#define chx1 0x0410
+#define stc1 0x0440
+#define stc2 0x0441
+#define stc3 0x0442
+#define stc4 0x0443
+#define stc32 0x045f
+#define lst1 0x0460
+#define lst2 0x0461
+#define cmb1 0x0470
+#define cmb2 0x0471
+#define edt1 0x0480
+#define IDC_PREVIEW_WND 23080
+#define IDC_PREVIEW_FRAME 23081
+#define IDC_PREVIEW 23082
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_3D_CONTROLS 1
+#define _APS_NEXT_RESOURCE_VALUE 23083
+#define _APS_NEXT_COMMAND_VALUE 53080
+#define _APS_NEXT_CONTROL_VALUE 23080
+#define _APS_NEXT_SYMED_VALUE 23080
+#endif
+#endif
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.rc b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.rc
new file mode 100644
index 0000000..3d54756
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommon.rc
@@ -0,0 +1,118 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "OXCommon.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
+ "OXCommon.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
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+PREVIEWFILEOPEN DIALOG DISCARDABLE 36, 24, 279, 132
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Open"
+FONT 8, "Helv"
+BEGIN
+ LTEXT "File &Name:",stc3,6,6,76,10
+ EDITTEXT edt1,6,16,90,12,ES_LOWERCASE | ES_AUTOHSCROLL |
+ ES_OEMCONVERT
+ LISTBOX lst1,6,32,90,68,LBS_SORT | LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_EXTENDEDSEL | LBS_DISABLENOSCROLL |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Directories:",IDC_STATIC,110,6,92,9
+ LTEXT "",stc1,110,16,92,9,SS_NOPREFIX
+ LISTBOX lst2,110,32,92,68,LBS_SORT | LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "List Files of &Type:",stc2,6,102,90,9
+ COMBOBOX cmb1,6,112,90,36,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL |
+ WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Dri&ves:",stc4,110,102,92,9
+ COMBOBOX cmb2,110,112,92,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
+ CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
+ WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OK",IDOK,213,2,50,13,WS_GROUP
+ PUSHBUTTON "Cancel",IDCANCEL,213,16,50,13,WS_GROUP
+ PUSHBUTTON "&Help",1038,159,95,6,6,WS_GROUP
+ PUSHBUTTON "Net&work...",psh14,213,112,50,13,WS_GROUP
+ CONTROL "&Read Only",chx1,"Button",BS_AUTOCHECKBOX | WS_GROUP |
+ WS_TABSTOP,176,94,8,8
+ CONTROL "&Preview",IDC_PREVIEW,"Button",BS_AUTOCHECKBOX |
+ WS_GROUP | WS_TABSTOP,213,101,50,11
+ GROUPBOX "",IDC_PREVIEW_FRAME,212,28,59,68
+ CONTROL "",IDC_PREVIEW_WND,"Button",BS_OWNERDRAW | WS_TABSTOP,
+ 213,34,56,61
+END
+
+PREVIEWFILEOPEN95 DIALOG DISCARDABLE 36, 24, 353, 152
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_VISIBLE |
+ WS_CLIPSIBLINGS
+FONT 8, "Helv"
+BEGIN
+ LTEXT "",stc32,5,9,266,123
+ CONTROL "&Preview",IDC_PREVIEW,"Button",BS_AUTOCHECKBOX |
+ WS_GROUP | WS_TABSTOP,283,98,50,11
+ GROUPBOX "",IDC_PREVIEW_FRAME,281,25,60,68
+ CONTROL "",IDC_PREVIEW_WND,"Button",BS_OWNERDRAW | WS_TABSTOP,
+ 283,31,56,61
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommunicator.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommunicator.h
new file mode 100644
index 0000000..ed644cd
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXCommunicator.h
@@ -0,0 +1,328 @@
+// ==========================================================================
+// Class Specification : COXCommunicator
+// ==========================================================================
+
+// Header file : OXCommunicator.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CSocket
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class can be used to create a client server communication
+// using WinSockets.
+// This class can be used as a client that will connect to a server
+// This is much like the base class CSocket
+// * Initialize(nTimeOut, pCancelWnd)
+// * Create()
+// * Connect(sRemoteAddress, nRemotePort)
+// When you use this class as a server that listens to multiple clients
+// a socket for each client connection will be created.
+// * Initialize(nTimeOut, pCancelWnd)
+// * Create(nServerPort)
+// * Listen()
+// Yo end a communication, just call
+// * Close()
+// To simplify the communications two archives are available,
+// one for reading and one for writing
+// * GetInStream()
+// * GetOutStream()
+
+// All client connections are also COXCommunicator objects
+// They will be created automatically when a server gets a request
+// from a new client. They can be address by a handle HCLIENT_COMMUNICATOR
+
+// All callbacks are virtual functions of this class
+
+
+// Remark:
+// This type of communication will block like a socket
+// This means that during Send() and Receive() the entire thread will block
+// until the function completes
+// There are three exceptions to this rule :
+// 1) A timer can be specified. When the time out is reached
+// the blocking operation will be cancelled
+// 2) Tou can specify a cancel window. All the messages for this
+// window and its children will still be dispatched
+// 3) WM_PAINT messages will still be dispatched
+
+// While a communicator is blocking, it may not start a new operation
+// Such a recursive call could occur when the cancel window would
+// initiate a new operation. So be sure to avoid this situation
+
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXCOMMUNICATOR_H__
+#define __OXCOMMUNICATOR_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include
+
+#define HCLIENT_COMMUNICATOR long
+
+
+class OX_CLASS_DECL COXCommunicator : public CSocket
+{
+DECLARE_DYNAMIC(COXCommunicator)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ COXCommunicator* m_pMasterCommunicator;
+ CMap m_connections;
+ CSocketFile* m_pFile;
+ CArchive* m_pInStream;
+ CArchive* m_pOutStream;
+ HWND m_hCancelWindow;
+ UINT m_nTimeOut;
+ UINT m_nTimerID;
+ UINT m_nStreamBufferSize;
+
+ static HCLIENT_COMMUNICATOR m_nLastUsedHandle;
+ static CMap m_TimerToCommunicator;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+
+ COXCommunicator(UINT nStreamBufferSize = 4096, COXCommunicator* pMasterCommunicator = NULL);
+ // --- In : nStreamBufferSize : The size of the buffer used for the input and output stream
+ // If you intend to use very large objects, increase the buffer size
+ // pMasterCommunicator : The master communicator to notify
+ // This parameter is only used for client connections
+ // and should always by NULL
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object
+
+ HCLIENT_COMMUNICATOR GetClientHandle(COXCommunicator* pClientCommunicator);
+ // --- In : pClientCommunicator : The client communicator which handle is requested
+ // --- Out :
+ // --- Returns : The handle of the specified communicator (or NULL when not found)
+ // --- Effect :
+
+ COXCommunicator* GetClientCommunicator(HCLIENT_COMMUNICATOR hClient);
+ // --- In : hClient : The client communicator handle which object is requested
+ // --- Out :
+ // --- Returns : A pointer to the specified communicator (or NULL when not found)
+ // --- Effect :
+
+ void Initialize(UINT uTimeOut = 10000, CWnd* pCancelWnd = NULL);
+ // --- In : uTimeOut : Time out value in milli seconds
+ // pCancelWnd : Pointer to the cancel window
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Initializes the communicator
+
+ void SetCancelWindow(CWnd* pCancelWnd);
+ // --- In : pCancelWnd : Pointer to the cancel window
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets a new cancel window
+
+ void SetTimeOut(UINT uTimeOut);
+ // --- In : uTimeOut : Time out value in milli seconds
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets a new timeout value
+
+ BOOL IsOpen();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether a valid socket is associated with this communicator
+ // --- Effect :
+
+ BOOL IsListening();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this communicator is listening
+ // --- Effect :
+
+ BOOL IsBlocking();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this communicator is blocking on an operation
+ // --- Effect :
+
+ BOOL AreAnyBlocking();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this communicator or any client communicators
+ // are blocking on an operation
+ // --- Effect :
+
+ void CancelAllBlockingCalls();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Cancels the blocking call of this communicator and all the
+ // client communicators
+
+ DWORD GetMaxReadable();
+ // --- In :
+ // --- Out :
+ // --- Returns : Determine the maximum number of bytes that can be read with
+ // one Receive() call.
+ // This is normally the same as the total amount of data queued
+ // --- Effect :
+
+ CArchive* GetInStream();
+ // --- In :
+ // --- Out :
+ // --- Returns : The input stream of which may be read
+ // --- Effect : The communicator must be open
+ // Use IsBufferEmpty() to see whether data is still waiting
+
+ CArchive* GetOutStream();
+ // --- In :
+ // --- Out :
+ // --- Returns : The output stream to which may be written
+ // --- Effect : The communicator must be open
+
+ // Notifications of a client communicator
+ virtual void OnClientCreate(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator);
+ // --- In : hClient : The handle of the client communicator
+ // pClientCommunicator : A pointer to the client communicator
+ // nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that a new client communicator has been created
+
+ virtual void OnClientReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, DWORD nSize, int nErrorCode);
+ // --- In : hClient : The handle of the client communicator
+ // pClientCommunicator : A pointer to the client communicator
+ // nSize : The number of bytes that can be read in one Receive()
+ // nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that the specified client communicator has received data
+ // which can be read using the input stream of the communicator
+
+ virtual void OnClientClose(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, int nErrorCode);
+ // --- In : hClient : The handle of the client communicator
+ // pClientCommunicator : A pointer to the client communicator
+ // nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that the specified client communicator has closed
+
+ virtual void OnClientDestroy(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator);
+ // --- In : hClient : The handle of the client communicator
+ // pClientCommunicator : A pointer to the client communicator
+ // nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that an existent client communicator will be destroyed
+
+ // Notifications of this communicator
+ virtual void OnServerReceive(DWORD nSize, int nErrorCode);
+ // --- In : nSize : The number of bytes that can be read in one Receive()
+ // nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that this communicator has received data
+ // which can be read using the input stream
+
+ virtual void OnServerClose(int nErrorCode);
+ // --- In : nErrorCode : The most recent error code of the communicator
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Notifies that this communicator has closed
+
+ // The following functions have the save effect as those of the base class CSocket
+ // with the additional features of a timeout value and a cancel window
+ virtual BOOL Accept(CAsyncSocket& rConnectedSocket,
+ SOCKADDR* lpSockAddr = NULL, int* lpSockAddrLen = NULL);
+ virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0);
+ virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0);
+ virtual void Close();
+
+ virtual BOOL OnMessagePending();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Overrides the base class implementation to add additional features
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+
+ virtual void Dump(CDumpContext& dc) const;
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+ // Note The Dump function does not print a newline character
+ // at the end of its output.
+#endif
+
+ virtual ~COXCommunicator();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+ virtual void OnAccept(int nErrorCode);
+ virtual void OnReceive(int nErrorCode);
+ virtual void OnClose(int nErrorCode);
+
+ void OnNotifyReceive(COXCommunicator* pClientCommunicator, DWORD nSize, int nErrorCode);
+ void OnNotifyClose(COXCommunicator* pClientCommunicator, int nErrorCode);
+ void OnNotifyKill(COXCommunicator* pClientCommunicator, int nErrorCode);
+
+ void CreateTimer();
+ void CloseTimer();
+ static UINT StartTimer(COXCommunicator* pCommunicator, UINT nTimeOut);
+ static void StopTimer(UINT nTimerID);
+ static void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT nTimerID, DWORD dwTime);
+
+ virtual BOOL ConnectHelper(const SOCKADDR* lpSockAddr, int nSockAddrLen);
+ virtual int ReceiveFromHelper(void* lpBuf, int nBufLen,
+ SOCKADDR* lpSockAddr, int* lpSockAddrLen, int nFlags);
+ virtual int SendToHelper(const void* lpBuf, int nBufLen,
+ const SOCKADDR* lpSockAddr, int nSockAddrLen, int nFlags);
+
+private:
+
+};
+
+#endif // __OXCOMMUNICATOR_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDFlHdr.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDFlHdr.h
new file mode 100644
index 0000000..c6ab5ad
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDFlHdr.h
@@ -0,0 +1,135 @@
+// ==========================================================================
+// Class Specification : COXDiffFileHeader
+// ==========================================================================
+
+// Header file : OXDFlHdr.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// YES Persistent objects (saveable on disk)
+// YES Uses exceptions
+// Throws CArchiveException::badSchema : Incorrect file type
+// Verion incorrect
+// CArchiveException::badClass : Value of object out of range
+// Passes through CArchiveException
+// CFileException
+// CMemoryException
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates the header of a binary difference file
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __DIFF_HEADER_H__
+#define __DIFF_HEADER_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXDiffFileHeader : public CObject
+{
+DECLARE_DYNAMIC(COXDiffFileHeader)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CString m_sSignText;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXDiffFileHeader(CString sSignature);
+ // --- In : sSignature : Signature of object
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ CString GetSignature() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : the signature of the file that was read from disk
+ // Identifies a file as one of this category
+ // --- Effect :
+
+ virtual void ReadHeader(CFile* pFile);
+ // --- In : pFile : pointer to file
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Reads the object (header) from the file
+
+ virtual void WriteHeader(CFile* pFile);
+ // --- In : pFile : pointer to file
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Writes the object (header) to the file
+
+ virtual void Serialize(CArchive& ar);
+ // --- In : ar : archive
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Reads or writes the object (header and/or data) to the archive
+
+ COXDiffFileHeader(const COXDiffFileHeader& HdrSrc);
+ // --- In : HdrSrc : Header object which will be copied
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Copy contruction.
+ // Notice that global memory will be copied
+
+ COXDiffFileHeader& operator=(const COXDiffFileHeader& HdrSrc);
+ // --- In : HdrSrc : Header object which will be assign to 'this' Header object
+ // --- Out:
+ // --- Returns:
+ // --- Effect : Assignment operator
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+ virtual ~COXDiffFileHeader();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+ virtual void Read(CArchive& ar, BOOL bReportLogicalErrors = TRUE);
+ virtual void Write(CArchive& ar);
+
+private:
+
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDispatchMarshaller.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDispatchMarshaller.h
new file mode 100644
index 0000000..0593544
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXDispatchMarshaller.h
@@ -0,0 +1,104 @@
+// ==========================================================================
+// Class Specification : COXDispatchMarshaller
+// ==========================================================================
+
+// Header file : OXDispatchMarshaller.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// Encapsulation of a IStream object used for marshalling between thread.
+//
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXDISPATCHMARSHALLER_H__
+#define __OXDISPATCHMARSHALLER_H__
+
+
+/////////////////////////////////////////////////////////////////////////////
+// COXDispatchMarshaller definition
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXDispatchMarshaller
+{
+// Data Members
+public:
+
+protected:
+ LPSTREAM m_pStream; // A IStream object used for marshalling between thread (appartements)
+ HANDLE m_hMutexEvent; // Mutex for synchronisation of Marshall and Unmarshall.
+
+private:
+
+// Member Functions
+public:
+ COXDispatchMarshaller();
+ // --- In : none
+ // --- Out : none
+ // --- Returns :
+ // --- Effect : constructs the object ans allocates memory for the Stream
+
+ virtual ~COXDispatchMarshaller();
+ // --- In : none
+ // --- Out : none
+ // --- Returns :
+ // --- Effect : destructs the object ans releases the Stream
+
+ HRESULT Marshal(IDispatch* pDisp);
+ // --- In : pDisp: the dispatch object that needs to be marshalled between to threads
+ // --- Out : none
+ // --- Returns : the result of the marshalling
+ // --- Effect : calls internally CoMarshalInterface (see DSK Ref. for return values)
+
+ HRESULT Unmarshal(void** pDisp);
+ // --- In : none
+ // --- Out : none
+ // --- Returns : the result of the Unmarshalling
+ // --- Effect : calls internally CoUnmarshalInterface (see DSK Ref. for return values)
+
+ BOOL CheckStream();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : If the internal stream pointer is created successfully
+ // --- Effect :
+
+protected:
+
+private:
+
+};
+
+#endif //__OXDISPATCHMARSHALLER_H__
\ No newline at end of file
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXFinalReleaseWnd.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXFinalReleaseWnd.h
new file mode 100644
index 0000000..0da8b4b
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXFinalReleaseWnd.h
@@ -0,0 +1,102 @@
+// ==========================================================================
+// Class Specification : COXFinalReleaseWnd
+// ==========================================================================
+
+// Header file : OXFinalReleaseWnd.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+
+// YES Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// This object serves as a message sink for the COXOwnThread object
+// It's important that the COXOwnThread object is deleted by the same
+// thread that instantiation ed the object (the Owner thread).
+// The OnFinalRelease function of COXOwnThread will check which thread
+// (Owner or Own thread) tries to delete the object. If it is the Own
+// thread, a message is send to this object (which is a data member of
+// the COWOwnThread object). Because this object is a window created by
+// the Owner thread, the message will be handled by the Owner thread and
+// consequently the COXOwnThread object can be safely destroyed from here.
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXFINALERELEASEWND_H__
+#define __OXFINALERELEASEWND_H__
+
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#define WMOX_FINAL_RELEASE WM_USER+1
+
+
+class COXOwnThread;
+
+class OX_CLASS_DECL COXFinalReleaseWnd : public CWnd
+{
+// Data Members
+public:
+
+protected:
+ static CString m_sClassName; // the class name used for registration
+ COXOwnThread* m_pOwnThread; // a pointer to the parent object
+ // initialized by constructor
+
+private:
+
+// Member Functions
+public:
+ COXFinalReleaseWnd(COXOwnThread* pOwnThread);
+ // --- In : pOwnThread: a pointer to the parent object COXOwnThread
+ // so that we can delete the parent from within this object
+ // --- Out : none
+ // --- Returns :
+ // --- Effect : Constructs the object
+
+ virtual ~COXFinalReleaseWnd();
+ // --- In : none
+ // --- Out : none
+ // --- Returns :
+ // --- Effect : Destructs the object
+
+protected:
+ afx_msg LONG OnObjectFinalRelease(UINT, LONG);
+
+ DECLARE_MESSAGE_MAP()
+
+private:
+
+};
+
+#endif //__OXFINALERELEASEWND_H__
+
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXMetafileViewer.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXMetafileViewer.h
new file mode 100644
index 0000000..c32ef29
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXMetafileViewer.h
@@ -0,0 +1,72 @@
+#if !defined(_OXMETAFILEVIEWER_H__)
+#define _OXMETAFILEVIEWER_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+// OXMetafileViewer.h : header file
+//
+
+#include "OXMetaFile.h"
+#include "OXScrollWnd.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMetafileViewer window
+
+class OX_CLASS_DECL COXMetafileViewer : public COXScrollWnd
+{
+ DECLARE_DYNAMIC(COXMetafileViewer)
+// Construction
+public:
+ COXMetafileViewer();
+
+// Attributes
+public:
+
+protected:
+ // metafile image
+ COXMetaFile m_MetaFile;
+
+// Operations
+public:
+
+ BOOL LoadFile(LPCTSTR lpszPathName);
+ inline BOOL LoadResource(UINT nIDResource, CString strResType=_T("METAFILE"));
+
+ inline COXMetaFile* GetImage() { return &m_MetaFile; }
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(COXMetafileViewer)
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~COXMetafileViewer();
+
+protected:
+ CSize GetMetafileSize();
+
+ virtual BOOL InitializeImage(const CSize& sizePage=CSize(100,100),
+ const CSize& sizeLine=CSize(10,10));
+
+ BOOL DrawMetafile(CDC* pDC, const CRect& rectSrc);
+
+ // Generated message map functions
+protected:
+ //{{AFX_MSG(COXMetafileViewer)
+ afx_msg void OnPaint();
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(_OXMETAFILEVIEWER_H__)
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThread.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThread.h
new file mode 100644
index 0000000..4aec3dd
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThread.h
@@ -0,0 +1,172 @@
+// ==========================================================================
+// Class Specification : COXOwnThread
+// ==========================================================================
+
+// Header file : OXOwnThread.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// The purpose of this class is to serve as a base class for COXOwnThreadCmdTarget,
+// COXOwnThreadDocument or user derived classes from CCmdTarget (Encapsulation around
+// a IDispatch OLE object).
+// The class mainly encapsulates the marshalling of IDispatch object between the
+// Owner thread (the thread that created the object) and the Own thread (a own
+// message loop).
+// By marshalling the IDispatch object, the OLE calls to the object will be
+// re-routed to the Own thread.
+// The derived class needs to derive from CCmdTarget (or other derived class from
+// CCmdTarget) and from this class, in order to re-route the OLE calls complete
+// transparently. COXOwnThreadCmdTarget and COXOwnThreadDocument are 2 (ready to use)
+// examples of how to use this COwnThread engine class.
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXOWNTHREAD_H__
+#define __OXOWNTHREAD_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+#include "OXDispatchMarshaller.h"
+#include "OXFinalReleaseWnd.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// COwnThread engine
+
+class OX_CLASS_DECL COXOwnThread
+{
+// Data Members
+public:
+
+protected:
+ BOOL m_bHasOwnThread;
+ HANDLE m_hCreatedEvent;
+ HANDLE m_hThreadEvent;
+ HANDLE m_hEndEvent;
+ HRESULT m_hCreateResult;
+ LPUNKNOWN m_pMarshalledPunk;
+ BOOL m_bEndThread;
+ DWORD m_nOwnerThreadID;
+ DWORD m_nOwnThreadID;
+ COXDispatchMarshaller
+ m_dispatchMarshaller;
+ COXFinalReleaseWnd
+ m_finalReleaseWnd;
+
+ friend COXFinalReleaseWnd;
+
+private:
+
+
+// Member Functions
+public:
+ COXOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : nothing
+ // --- Effect : constructs the object
+
+ virtual ~COXOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : nothing
+ // --- Effect : constructs the object
+
+ BOOL EnableOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : If the own thread is started successful or not
+ // This function should always succeed unless
+ // the operating systems is extremely low on resources
+ // --- Effect : All the OLE Calls to this object will be re-routed
+ // by the own thread.
+ // Different objects can be served simultaneous.
+
+ BOOL HasOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the CmdTarget has a own thread started.
+ // --- Effect :
+
+ BOOL FinalReleaseRouter();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the call is re-routed or not
+ // --- Effect : If you override the virtual member function 'OnFinalRelease' of CCmdTarget,
+ // you have to call this function before you do anything else.
+ // If the call returns TRUE, you have to return immediately.
+ // Example with CMyCmdTarget derived from COXOwnThreadCmdTarget
+ // void CMyCmdTarget::OnFinalRelease()
+ // {
+ // if (FinalReleaseRouter())
+ // return;
+ //
+ // // TODO: Add your specialised code here and/or call the base class
+ //
+ // CCmdTarget::OnFinalRelease();
+ // }
+
+ void SetThreadEvent();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : nothing
+ // --- Effect : Fires an event to the own thread, which will call the overridable
+ // function 'OnThreadEvent'.
+
+ virtual LPDISPATCH GetIDispatch(BOOL bAddRef) = 0;
+ // --- In : bAddRef: Specifies whether to increment the reference count for the object.
+ // --- Out : none
+ // --- Returns : The IDispatch pointer associated with the object
+ // --- Effect : This is a pure virtual function, so the implementation of the derived class is used.
+ // This declaration is needed to give access to the real CCmdTarget implementation of this function
+
+protected:
+ LPUNKNOWN GetInterfaceHook(const void*);
+ virtual void OnFinalRelease() = 0;
+ void Run();
+ static UINT __cdecl StartThread(LPVOID pOwnThread);
+ void EndThread();
+ virtual void OnThreadEvent();
+ virtual void OnThreadDestroy();
+
+
+private:
+
+};
+
+#endif //__OXOWNTHREAD_H__
+
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThreadCmdTarget.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThreadCmdTarget.h
new file mode 100644
index 0000000..4aeefc9
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXOwnThreadCmdTarget.h
@@ -0,0 +1,162 @@
+// ==========================================================================
+// Class Specification : COXOwnThreadCmdTarget
+// ==========================================================================
+
+// Header file : OXOwnThreadCmdTarget.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// This class is an alternative for CCmdTarget. It offers multi-threading
+// functionality to your automation server.
+// By deriving from this class instead of CCmdTarget, all your OLE calls
+// are handled by a separate Own thread. In that way more concurrently
+// calls can be handled simultaneously.
+// The main part of the implementation is done in the COXOwnThread class, so
+// the code can be shared by other derivation of CCmdTarget (see COXOwnThreadDocument).
+
+// HOW TO USE -> it is as easy as this:
+// As said above, you need to derive from this class instead of CCmdTarget.
+// Further more you need to call the 'EnableOwnthread' function from within
+// the constructor of your derived class.
+// If you are overriding the 'OnFinalRelease' function of CCmdTarget
+// you need also to call 'FinalReleaseRouter()' (see 'FinalReleaseRouter' further on)
+
+// For derivation of CDocument you have to use COXOwnThreadDocument.
+// For other derivation you can build your own class analogue to COXOwnThreadCmdTarget
+// and COXOwnThreadDocument.
+
+// Remark:
+//
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXOWNTHREADCMDTARGET_H__
+#define __OXOWNTHREADCMDTARGET_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// COwnThreadCmdTarget command target
+
+#include "OXOwnThread.h"
+
+
+class OX_CLASS_DECL COXOwnThreadCmdTarget : public CCmdTarget, public COXOwnThread
+{
+DECLARE_DYNCREATE(COXOwnThreadCmdTarget)
+
+// Data Members
+public:
+
+protected:
+
+private:
+
+// Member Functions
+public:
+
+// The public interface of this class contains 3 easy functions.
+// They are defined in COXOwnThread where this class is derived from:
+
+// BOOL EnableOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : If the own thread is started successful or not
+ // This function should always succeed unless
+ // the operating systems is extremely low on resources
+ // --- Effect : All the OLE Calls to this object will be re-routed
+ // by the own thread.
+ // Different objects can be served simultaneous.
+
+// BOOL HasOwnThread();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the CmdTarget has a own thread started.
+ // --- Effect :
+
+// BOOL FinalReleaseRouter();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the call is re-routed or not
+ // --- Effect : If you override the virtual member function 'OnFinalRelease' of CCmdTarget,
+ // you have to call this function before you do anything else.
+ // If the call returns TRUE, you have to return immediately.
+ // Example:
+ // void CMyCmdTarget::OnFinalRelease()
+ // {
+ // if (FinalReleaseRouter())
+ // return;
+ //
+ // // TODO: Add your specialised code here and/or call the base class
+ //
+ // CCmdTarget::OnFinalRelease();
+ // }
+
+
+ virtual LPDISPATCH GetIDispatch(BOOL bAddRef);
+ // --- In : bAddRef: Specifies whether to increment the reference count for the object.
+ // --- Out : none
+ // --- Returns : The IDispatch pointer associated with the object
+ // --- Effect : provides access to the IDispatch handle
+ // Is used by the COXOwnThread base class
+
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(COXOwnThreadCmdTarget)
+ public:
+ virtual void OnFinalRelease();
+ //}}AFX_VIRTUAL
+
+
+protected:
+ COXOwnThreadCmdTarget(); // protected constructor used by dynamic creation
+ virtual ~COXOwnThreadCmdTarget();
+
+ virtual LPUNKNOWN GetInterfaceHook(const void*);
+
+ // Generated message map functions
+ //{{AFX_MSG(COXOwnThreadCmdTarget)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+ // Generated OLE dispatch map functions
+ //{{AFX_DISPATCH(COXOwnThreadCmdTarget)
+ //}}AFX_DISPATCH
+ DECLARE_DISPATCH_MAP()
+
+private:
+
+};
+#endif //__OXOWNTHREADCMDTARGET_H__
+
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXPrvDlg.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXPrvDlg.h
new file mode 100644
index 0000000..4b5a5e2
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXPrvDlg.h
@@ -0,0 +1,136 @@
+// ==========================================================================
+// Class Specification : COXPreviewDialog
+// ==========================================================================
+
+// Header file : OXPrvDlg.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CFileDialog
+
+// YES Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// YES Has a message map
+// YES Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class extends the Common File Dialog with a specific
+// custom template in order to have a preview area in this dialog. To implement a
+// dialog that previews BMP's, derive a class from this class and implement two
+// virtual functions : OnNewFileSelect() and
+// OnPaintPreview(CDC* pDC, const CRect& paintRect)
+
+// Remark:
+// This file uses resources.
+// The reserved ID ranges are : 23080 -> 23099 and 53080 -> 53099
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __OXPRVDLG_H__
+#define __OXPRVDLG_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXPreviewDialog : public CFileDialog
+{
+DECLARE_DYNAMIC(COXPreviewDialog)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CStatic m_previewFrame;
+ BOOL m_bPreview;
+ BOOL m_bPrevPreview;
+ CString m_sSelectedFile;
+ CString m_sPrevSelectedFile;
+
+ class OX_CLASS_DECL COXPreview : public CButton
+ {
+ // Data Members
+ public:
+ protected:
+ private:
+ // Member Functions
+ public:
+ COXPreview();
+ virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
+ protected:
+ private:
+ } m_preview;
+
+
+private:
+
+friend COXPreview;
+
+// Member functions ---------------------------------------------------------
+public:
+ COXPreviewDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs
+ LPCTSTR lpszDefExt = NULL,
+ LPCTSTR lpszFileName = NULL,
+ DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
+ LPCTSTR lpszFilter = NULL,
+ CWnd* pParentWnd = NULL);
+ // --- In : see constructor MFC CFiledialog
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+
+ virtual ~COXPreviewDialog();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+
+protected:
+ virtual void OnNewFileSelect(const CString& sFilename);
+ virtual void OnPaintPreview(CDC* pDC, const CRect& paintRect);
+ virtual void OnDoRealizePalette(CWnd* pFocusWnd);
+
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ void CheckFileSelection();
+
+#ifdef WIN32
+ BOOL IsWin95();
+ virtual void OnFileNameChange();
+ CString GetFilePath() const;
+#endif
+
+ afx_msg void OnPreview();
+ virtual BOOL OnInitDialog();
+
+ afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
+ afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
+
+ DECLARE_MESSAGE_MAP()
+
+private:
+ virtual void OnLBSelChangedNotify( UINT nIDBox, UINT iCurSel, UINT nCode);
+
+};
+
+#endif //__OXPRVDLG_H__
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultObj.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultObj.h
new file mode 100644
index 0000000..c8eab66
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultObj.h
@@ -0,0 +1,187 @@
+// ==========================================================================
+// Class Specification : COXResultObj
+// ==========================================================================
+
+// Header file : OXResultObj.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// YES Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates a collection of COXResultParts
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXRESULTOBJ_H__
+#define __OXRESULTOBJ_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "AfxTempl.h"
+#include "OXResultPart.h"
+
+
+class OX_CLASS_DECL COXResultObj : public CArray
+{
+DECLARE_DYNAMIC(COXResultObj);
+
+// Data members -------------------------------------------------------------
+public:
+protected:
+ COXResultPart m_defaultPart;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXResultObj();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object
+
+ COXResultObj(const COXResultPart& defaultPart);
+ // --- In : defaultPart
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object and sets the default part
+ // The default part will be returned when
+ // you want to retrieve a part when this object is empty
+
+ COXResultObj(const COXResultObj& result);
+ // --- In : result : Object to copy
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Copy constructor
+
+ COXResultObj& operator=(const COXResultObj& result);
+ // --- In : result : Object to assigne
+ // --- Out :
+ // --- Returns : This object
+ // --- Effect : Assignment operator
+
+ void operator+=(const COXResultObj& result);
+ // --- In : result : Object to add
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Adds the specified result to this object
+
+ void operator+=(const COXResultPart& resultPart);
+ // --- In : resultPart : Object to add
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Adds the specified result part to this result object
+
+ COXResultPart& GetDefaultPart();
+ // --- In :
+ // --- Out :
+ // --- Returns : The default part
+
+ COXResultPart GetDefaultPart() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The default part
+
+ void SetDefaultPart(const COXResultPart& defaultPart);
+ // --- In : defaultPart
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets the default part
+ // The default part will be returned when
+ // you want to retrieve a part when this object is empty
+
+ void Empty();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Empties this result object
+
+ BOOL IsEmpty() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this object contains any result itemùs (FALSE) or not (TRUE)
+ // --- Effect :
+
+ COXResultPart& GetMostSeverePart();
+ // --- In :
+ // --- Out :
+ // --- Returns : The result part with the highest extended severity
+ // --- Effect : When this object does not contain any parts,
+ // a new part is added to this object and returned
+
+ COXResultPart GetMostSeverePart() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The result part with the highest extended severity
+ // --- Effect : When this object does not contain any parts,
+ // a new empty part is returned
+
+ COXResultPart* operator->();
+ // --- In :
+ // --- Out :
+ // --- Returns : The result part with the highest extended severity
+ // --- Effect : When this object does not contain any parts,
+ // a new part is added to this object and returned
+ // This is a quick way to get the most severe part from
+ // the collection and perform a function on it
+
+ virtual void Serialize(CArchive& ar);
+ // --- In : ar : Archive used in serialization
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Serializes the object
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+
+ virtual void Dump(CDumpContext& dc) const;
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+#endif
+
+ virtual ~COXResultObj();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+
+private:
+
+};
+
+#endif // __OXRESULTOBJ_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPart.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPart.h
new file mode 100644
index 0000000..e104b41
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPart.h
@@ -0,0 +1,269 @@
+// ==========================================================================
+// Class Specification : COXResultPart
+// ==========================================================================
+
+// Header file : OXResultPart.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// YES Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates a single result code and its message
+
+// An object can be constructed from an HRESULT value.
+// Now the accompanying message will be retrieved from the message resource
+// When optional parameters are needed they can be supplied
+
+// A group of these object can be stored in a COXResultObj
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXRESULTPART_H__
+#define __OXRESULTPART_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#ifndef __AFXOLE_H__
+#include
+#define __AFXOLE_H__
+#endif
+
+
+class OX_CLASS_DECL COXResultPart : public CObject
+{
+DECLARE_SERIAL(COXResultPart);
+
+// Data members -------------------------------------------------------------
+public:
+protected:
+ COleDateTime m_creationTime;
+ HRESULT m_resultCode;
+ CString m_sResultMessage;
+ DWORD m_dwExtra;
+
+ static DWORD m_dwLangID;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXResultPart();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs an empty result item object
+
+ COXResultPart(HRESULT resultCode, ...);
+ COXResultPart(LPCTSTR pszModuleName, HRESULT resultCode, ...);
+ // --- In : (optional) pszModuleName : Name of the module containing the message resource
+ // resultCode : Result code to use
+ // ... : Optional parameters used to build the message
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs a result item object with the specified
+ // resultcode
+ // The appropriate message is retrieved from resource
+ // and for this the optional parameters may be used
+
+ COXResultPart(const COXResultPart& resultItem);
+ // --- In : resultItem : Object to copy
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Copy constructor
+
+ BOOL Initialize();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Initializes to an empty result item object
+
+ BOOL Initialize(HRESULT resultCode, ...);
+ BOOL Initialize(LPCTSTR pszModuleName, HRESULT resultCode, ...);
+ BOOL InitializeSpecial(LPCTSTR pszModuleName, DWORD resultCode, ...);
+ // --- In : (optional) pszModuleName : Name of the module containing the message resource
+ // resultCode : Result code to use
+ // ... : Optional parameters used to build the message
+ // --- Out :
+ // --- Returns : Whether the message could be retrieved successfully
+ // --- Effect : Initializes a result item object with the specified
+ // resultcode
+ // The appropriate message is retrieved from resource
+ // and for this the optional parameters may be used
+
+ HRESULT GetResultCode() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The result code of this object
+ // --- Effect :
+
+ void SetResultCode(HRESULT resultCode);
+ // --- In : resultCode : New result code to set
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets the result code to a new value
+ // Other parts (message etc) are not automatically updated
+
+ CString GetResultMessage() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The result message of this object
+ // --- Effect :
+
+ void SetResultMessage(CString sResultMessage);
+ // --- In : sResultMessage : New result message to set
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets the result code to a new value
+ // Other parts (code etc) are not automatically updated
+
+ void AppendMessage(CString sMessage);
+ // --- In : sMessage : Message to append
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Appends the specified text to the result message
+
+ CString BuildExtendedMessage() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The extended result message of this object
+ // --- Effect :
+
+ COleDateTime GetTimeStamp() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The time stamp when the item was created
+ // --- Effect :
+
+ void SetTimeStamp(COleDateTime creationTime);
+ // --- In : creationTime : New creation time to set
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets the creation date to a new value
+ // Other parts (code etc) are not automatically updated
+ // The date must be valid
+
+ DWORD GetExtraData() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The extra data of this object
+ // --- Effect :
+
+ void SetExtraData(DWORD dwExtra);
+ // --- In : dwExtra : New extra data to set
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Sets the extra data to a new value
+ // Other parts (code etc) are not automatically updated
+
+ COXResultPart& operator=(const COXResultPart& resultItem);
+ // --- In : resultItem : Object to assigne
+ // --- Out :
+ // --- Returns : This object
+ // --- Effect : Assignment operator
+
+ BOOL Succeeded() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether the result code specifies success (SUCCEEDED)
+ // --- Effect :
+
+ BOOL Failed() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether the result code specifies failure (FAILED)
+ // --- Effect :
+
+ WORD GetCode() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The code part of the result code (HRESULT_CODE)
+ // --- Effect :
+
+ WORD GetFacility() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The facility part of the result code (HRESULT_FACILITY)
+ // --- Effect :
+
+ WORD GetSeverity() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The severity part of the result code (HRESULT_SEVERITY)
+ // --- Effect :
+
+ WORD GetSeverityEx() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The extended severity part of the result code (bits 31 and 30)
+ // --- Effect :
+
+ virtual void Serialize(CArchive& ar);
+ // --- In : ar : Archive used in serialization
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Serializes the object
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+
+ virtual void Dump(CDumpContext& dc) const;
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+#endif
+
+ virtual ~COXResultPart();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+ BOOL InitializeEx(HRESULT resultCode, va_list* pArgs);
+ BOOL InitializeEx(LPCTSTR pszModuleName, HRESULT resultCode, va_list* pArgs);
+ BOOL InitializeExSpecial(LPCTSTR pszModuleName, DWORD dwResultCode, va_list* pArgs);
+ static BOOL RetrieveResultMessage(CString sModuleName, HRESULT resultCode,
+ va_list* pArgs, CString& sResultMessage);
+ static BOOL RetrieveSpecialMessage(CString sModuleName, DWORD dwResultCode,
+ va_list* pArgs, CString& sResultMessage);
+
+private:
+
+};
+
+// Define some handy macros
+#include "OXResultPartDef.h"
+
+#endif // __OXRESULTPART_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPartDef.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPartDef.h
new file mode 100644
index 0000000..a6bf5e0
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXResultPartDef.h
@@ -0,0 +1,81 @@
+// ==========================================================================
+// Macro Definition for COXResultPart
+// ==========================================================================
+
+// Header file : OXResultPartDef.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// These macros only have an actual implementation if _DEBUG is defined
+// otherwise they all are defined empty
+
+#ifndef __OXRESULTPARTDEF_H__
+#define __OXRESULTPARTDEF_H__
+
+#ifdef _DEBUG
+ // OX_TRACE_ERROR_EX(RES, TX)
+ // --- In : RES : The numeric result code (long)
+ // TX : A string which will be used as prefix
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Traces the messages associated with sepcified result code
+ // together with leading text
+#define OX_TRACE_ERROR_EX(RES, TX) \
+ { \
+ HRESULT r = (RES); \
+ if (HRESULT_FACILITY(r) == 0) \
+ r = HRESULT_FROM_WIN32(r); \
+ if (FAILED(r)) \
+ { \
+ COXResultPart resultPart(r); \
+ TRACE(_T("%s : HRESULT = 0x%X\n\t%s"), (TX), r, resultPart.GetResultMessage()); \
+ } \
+ }
+
+ // OX_TRACE_ERROR_EX(RES)
+ // --- In : RES : The numeric result code (long)
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Traces the messages associated with sepcified result code
+ // together with the current file name and line number
+#define OX_TRACE_ERROR(RES) \
+ { \
+ CString sLine; \
+ sLine.Format(_T("%i"), __LINE__); \
+ OX_TRACE_ERROR_EX(RES, CString(__FILE__) + _T(" (") + sLine + _T(")")); \
+ }
+
+ // OX_TRACE_LAST_ERROR_EX(TX)
+ // --- In : TX : A string which will be used as prefix
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Traces the message associated with the last error
+ // together with leading text
+#define OX_TRACE_LAST_ERROR_EX(TX) \
+ { \
+ HRESULT nLastError = ::GetLastError(); \
+ OX_TRACE_ERROR_EX(HRESULT_FROM_WIN32(nLastError), TX); \
+ }
+
+ // OX_TRACE_LAST_ERROR()
+ // --- In : TX : A string which will be used as prefix
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Traces the message associated with the last error
+ // together with the current file name and line number
+#define OX_TRACE_LAST_ERROR() \
+ { \
+ HRESULT nLastError = ::GetLastError(); \
+ CString sLine; \
+ sLine.Format(_T("%i"), __LINE__); \
+ OX_TRACE_ERROR_EX(HRESULT_FROM_WIN32(nLastError), CString(__FILE__) + _T(" (") + sLine + _T(")")); \
+ }
+
+#else
+#define OX_TRACE_ERROR_EX(RES, TX)
+#define OX_TRACE_ERROR(RES)
+#define OX_TRACE_LAST_ERROR_EX(TX)
+#define OX_TRACE_LAST_ERROR()
+#endif
+#endif // __OXRESULTPARTDEF_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCFG.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCFG.H
new file mode 100644
index 0000000..12508c5
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCFG.H
@@ -0,0 +1,144 @@
+// ==========================================================================
+// Class Specification : COXSerialCommConfig
+// ==========================================================================
+
+// Header file : OXSCCFG.H
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// NO Is derived from Wnd
+// NO Two stage creation (constructor & Initialize())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// COXSerialCommConfig class
+// This object defines the port configuration settings like port ID, baudrate,
+// bytesize, parity, stopbits and flowcontrol. You can set also the size of
+// the software buffers and the timeout values of the ‘clear to send’,
+// ‘data set ready’ and ‘Carrier detect’ signals. These settings can be loaded
+// and saved to disk.
+
+// Remark:
+//
+
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXSCCFG_H_
+#define __OXSCCFG_H_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXSerialCommConfig : public CObject
+{
+ DECLARE_SERIAL(COXSerialCommConfig);
+
+// Data Members
+public:
+ enum EFlowControl // flow control enum type
+ {
+ NONE,
+ HARDWARE,
+ XON_XOFF
+ };
+
+ BYTE m_nPortId; // 0..8 (COM1..COM9)
+ UINT m_nBaudRate; // CBR_xxx (as in DCB)
+ BYTE m_nByteSize; // 7..8 (as in DCB)
+ BYTE m_nParity; // 0..2 (as in DCB)
+ BYTE m_nStopBits; // 0/2 (as in DCB)
+ EFlowControl m_eFlowControl; // flow control type
+
+ UINT m_nSizeReceivingQueue; // buffer size of the incomming queue
+ UINT m_nSizeTransmissionQueue; // buffer size of the outgoing queue
+ UINT m_nCdTimeout; // the time that the carrier must be down
+ // before the signal is changing state
+ UINT m_nCtsTimeout; // Clear to send timeout
+ UINT m_nDsrTimeout; // Data set ready timeout
+
+protected:
+
+private:
+
+// Member Functions
+public:
+ COXSerialCommConfig();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Constructs the configutration object
+
+ COXSerialCommConfig(COXSerialCommConfig& config);
+ // --- In: config: another COXSerialCommConfig object
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: copy constructor
+
+ COXSerialCommConfig& operator = (const COXSerialCommConfig& config);
+ // --- In: config: another COXSerialCommConfig object
+ // --- Out: none
+ // --- Returns: the reference of the object that is copied into
+ // --- Effect: copy operator
+
+ CString GetCommName() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the communication device as a stdio filename
+ // (example: "COM1" for port com1)
+ // --- Effect: none
+
+ int DoConfigDialog(CString sTitle = _T(""));
+ // --- In: sTitle: the title of the dialog box (a default title is used if empty)
+ // --- Out: none
+ // --- Returns: IDOK or IDCANCEL
+ // --- Effect: start a modal configuration dialog box
+
+ BOOL IsPortAvailable() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if the port is available or not
+ // --- Effect: tries to open the port
+
+ BOOL Load(CString sFileName);
+ // --- In: sFileName: the filename of the configuration file
+ // --- Out: none
+ // --- Returns: if the configuration file is successfully loaded
+ // --- Effect: loads the configuration file into this object
+
+ BOOL Save(CString sFileName);
+ // --- In: sFileName: the filename of the configuration file
+ // --- Out: none
+ // --- Returns: if the configuration file is successfully saved
+ // --- Effect: saves the configuration setting to file
+
+protected:
+ virtual void Serialize(CArchive& ar);
+
+private:
+
+};
+
+#endif //__OXSCCFG_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCNST.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCNST.H
new file mode 100644
index 0000000..207b36e
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCCNST.H
@@ -0,0 +1,22 @@
+#ifndef __OXSCCNST_H_
+#define __OXSCCNST_H_
+
+const int COMM_MSRSHADOW = 35; // Modem Status Register "shadow"
+const int MSR_CTS = 0x10; // see Microsoft PSS ID Q101417
+const int MSR_DSR = 0x20;
+const int MSR_RI = 0x40;
+const int MSR_RLSD = 0x80;
+
+const UINT DefaultSizeReceivingQueue = 4096;
+const UINT DefaultSizeTransmissionQueue = 4096;
+const UINT DefaultCdTimeout = 2000;
+const UINT DefaultCtsTimeout = 5000;
+const UINT DefaultDsrTimeout = 5000;
+
+const int MaxNumberOfBuffers = 4;
+const int RS232TimerId = 0x1245;
+const int RS232TimerValue = 100; // 100 mSec.
+const UINT _Rs232PostMessage_ = WM_USER;
+const UINT _Rs232InternalNotify_ = WM_USER+1;
+
+#endif __OXSCCNST_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCEXCP.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCEXCP.H
new file mode 100644
index 0000000..7e5d9dd
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCEXCP.H
@@ -0,0 +1,55 @@
+#ifndef __OXSCEXCP_H_
+#define __OXSCEXCP_H_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+OX_API_DECL void AFXAPI AfxThrowSerialCommException(int cause,
+ LPCTSTR lpszSerialCommName = NULL);
+
+class OX_CLASS_DECL COXSerialCommException: public CFileException
+{
+DECLARE_DYNAMIC(COXSerialCommException)
+
+// Data Members
+public:
+ enum VALUE
+ {
+ none,
+ notAvailable,
+ breakDetect,
+ rxTimeout,
+ ctsTimeout,
+ dsrTimeout,
+ cdTimeout,
+ frameError,
+ parityError,
+ overrunError,
+ rxQueueOverflow,
+ txQueueFull,
+ wmQuitReceived,
+ ioError,
+ modeError
+ };
+
+ int m_ext_cause;
+
+// Member Functions
+public:
+ COXSerialCommException(int cause = none,
+ LPCTSTR lpszSerialCommName = NULL);
+ COXSerialCommException(COXSerialCommException& other);
+ COXSerialCommException& operator = (const COXSerialCommException& other);
+ virtual BOOL GetErrorMessage( LPTSTR lpszError, UINT nMaxError, PUINT pnHelpContext = NULL );
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+
+};
+
+#endif //__OXSCEXCP_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCFILE.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCFILE.H
new file mode 100644
index 0000000..a231797
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCFILE.H
@@ -0,0 +1,274 @@
+// ==========================================================================
+// Class Specification : COXSerialCommFile
+// ==========================================================================
+
+// Header file : OXSCFILE.H
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Is derived from CFile
+// NO Two stage creation (constructor & Initialize())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// COXSerialCommFile class
+// The COXSerialCommFile class is the main class which controls the serial port.
+// It is derived from CFile and is therefor compatible with MFC serialization.
+// Next to the derived interface, COXSerialCommFile is extended with some other
+// function for controlling the handshake signals, the read and write buffers and
+// the time-out values.
+//
+
+// Remark:
+// If the following error appears the only solution is to add at the top of the
+// initinstance the following code: (the default depth is only 8!. Maximum = 120.)
+// int QueueDepth = 32;
+// while (!::SetMessageQueue(QueueDepth))
+// QueueDepth--;
+//
+// ERROR MESSAGE:
+// FATAL ERROR!
+// The Windows message queue is full!
+// Rs232 messages lost!
+// Increase the message queue depth.
+
+
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXSCFILE_H_
+#define __OXSCFILE_H_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "OXSCCFG.H"
+#include "OXSCEXCP.H"
+
+
+class OX_CLASS_DECL COXSerialCommFile : public CFile
+{
+// Data Members
+public:
+
+protected:
+ HANDLE m_hCommDevice;
+
+private:
+
+// Member Functions
+public:
+ COXSerialCommFile();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Constructs the object and initialize the internal state
+
+ virtual ~COXSerialCommFile();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Destructs the object
+
+ BOOL Open(const COXSerialCommConfig& config, COXSerialCommException* pException = NULL);
+ // --- In: config: the configurations of the serial communication device to open
+ // pException:
+ // --- Out: none
+ // --- Returns: if the opening was successful
+ // --- Effect: opens the serial communication device configured in the config struct.
+
+ virtual void Close();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: closes this serial comunication device
+
+ BOOL SetTimeouts(DWORD dwRxTimeout=5000, DWORD dwTxTimeout=5000); // time in milliseconds
+ // --- In: dwRxTimeout:
+ // dwTxTimeout:
+ // --- Out: none
+ // --- Returns: if ot was successful or not
+ // --- Effect: sets the time-out parameters for all read and write operations on this serial
+ // communications device.
+
+ BOOL IsOpen() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if the port is already opened or not
+ // --- Effect: none
+
+ UINT Read( void* lpBuf, UINT nCount );
+ // --- In: none
+ // --- Out: lpBuf: reserved memory block to receive data
+ // nCount: size of the reserved buffer
+ // --- Returns: actual number of bytes received
+ // --- Effect:
+
+ void Write( const void* lpBuf, UINT nCount );
+ // --- In: lpBuf: address of data block to transmit
+ // nCount: number of bytes to transmit
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: transmits the data to the serial port
+
+ void PurgeRx();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: makes the receive queue empty
+
+ void PurgeTx();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: makes the transmit queue empty
+
+ BOOL IsRxQueueEmpty() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if the Receive queue is empty or not
+ // --- Effect: none
+
+ BOOL IsTxQueueEmpty() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if the Transmit queue is empty or not
+ // --- Effect: none
+
+ void SetDTR(BOOL bValue);
+ // --- In: bValue: new value of the DTR flag
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the handshake signal 'DTR' (data terminal ready )
+
+ void SetRTS(BOOL bValue);
+ // --- In: bValue: new value of the RTS flag
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the handshake signal 'RDSR' (request to send)
+
+ BOOL GetCTS() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the state of the 'CTS' (clear to send) flag
+ // --- Effect: none
+
+ BOOL GetDSR() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the state of the 'DSR' (data set ready) flag
+ // --- Effect: none
+
+ BOOL GetCD() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the state of the 'CD' (carrier detect) flag
+ // --- Effect: none
+
+ BOOL GetRI() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the state of the 'RI' (ring indicator) flag
+ // --- Effect: none
+
+ HANDLE GetSafeHandle() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a HANDLE to the COMM Device or NULL if no open handle exists
+ // --- Effect:
+ // --- Note: You may call this function on a non-attached COMM device. It will
+ // return NULL.
+
+ BOOL SetCommMask(const DWORD dwEventMask);
+ // --- In: dwEventMask: Specifies the events to be enabled. A value of zero
+ // disables all events. The below table summarizes the
+ // possible values for dwEventMask, you may combine these
+ // using the bit-wise OR operator.
+ //
+ // Value Meaning
+ // --------------------------------------------------------------------
+ // EV_BREAK A break was detected on input.
+ // EV_CTS The CTS (clear-to-send) signal changed state.
+ // EV_DSR The DSR (data-set-ready) signal changed state.
+ // EV_ERR A line-status error occurred. Line-status errors are CE_FRAME,
+ // CE_OVERRUN, and CE_RXPARITY.
+ // EV_RING A ring indicator was detected.
+ // EV_RLSD The RLSD (receive-line-signal-detect) signal changed state.
+ // EV_RXCHAR A character was received and placed in the input buffer.
+ // EV_RXFLAG The event character was received and placed in the input
+ // buffer. The event character is specified in the device's
+ // DCB structure, which is applied to a serial port by using
+ // the SetCommState function.
+ // EV_TXEMPTY The last character in the output buffer was sent.
+ //
+ // --- Out: none
+ // --- Returns: If the function succeeds, the return value is nonzero. Otherwise it is zero.
+ // --- Effect: The SetCommMask function specifies the set of events that can be monitored
+ // for a particular communications resource.
+
+ BOOL GetCommMask(DWORD& dwEventMask) const;
+ // --- In: dwEventMask: a reference to a DWORD value to receive the event mask
+ // --- Out: dwEventMask: this value receives the event mask
+ // (see COXSerialCommFile::SetCommMask for more information)
+ // --- Returns: If the function succeeds, the return value is nonzero. Otherwise it is zero.
+ // --- Effect: none
+
+ BOOL GetCommProperties(LPCOMMPROP lpCommProp) const;
+ // --- In: lpCommProp: address of communications properties structure
+ // --- Out: lpCommProp: Pointer to a COMMPROP structure in which the
+ // communications properties information is returned
+ // --- Returns: If the function succeeds, the return value is nonzero. Otherwise it is zero.
+ // --- Effect: The GetCommProperties function returns information from a device driver
+ // about the configuration settings that are supported by the driver
+
+ UINT GetBytesToRead() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: Number of bytes waiting to be read from the COMM port, 0 if none.
+ // --- Effect: none
+
+ UINT GetBytesToWrite() const;
+ // --- In: none
+ // --- Out: none
+ // --- Returns: Number of bytes waiting to be sent to the COMM port, 0 if none.
+ // --- Effect: none
+
+protected:
+ COXSerialCommException::VALUE GetCommException(COMSTAT& comstat) const;
+
+private:
+
+};
+
+inline BOOL COXSerialCommFile::IsOpen() const
+{
+ return GetSafeHandle() != NULL;
+}
+
+inline HANDLE COXSerialCommFile::GetSafeHandle() const
+{
+ return this == NULL ? NULL : m_hCommDevice;
+}
+
+#endif // __OXSCFILE_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCSTP.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCSTP.H
new file mode 100644
index 0000000..01ace3a
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSCSTP.H
@@ -0,0 +1,112 @@
+// ==========================================================================
+// Class Specification : COXSerialCommSetup
+// ==========================================================================
+
+// Header file : OXSCSTP.H
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Is derived from CDialog
+// YES Two stage creation (constructor & Initialize())
+// YES Has a message map
+// YES Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// COXSerialCommSetup class
+// The COXSerialCommSetup is a standard dialog for setting the Serial
+// Communication Configuration settings. This dialog can be popped up
+// with the DoConfigDialog() function of the COXSerialCommConfig class.
+
+// Remark:
+//
+
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXSCSTP_H_
+#define __OXSCSTP_H_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "OXSCCFG.H"
+
+// private header
+#include "OXRSERCM.H"
+
+
+/////////////////////////////////////////////////////////////////////////////
+class OX_CLASS_DECL COXSerialCommSetup : public CDialog
+/////////////////////////////////////////////////////////////////////////////
+{
+// Data Members
+public:
+ const CString m_sCommTitle;
+ COXSerialCommConfig m_config;
+
+ //{{AFX_DATA(COXSerialCommSetup)
+ enum { IDD = IDD_COMMSETUP };
+ CString m_sBaudRate;
+ CString m_sDataBit;
+ CString m_sParity;
+ CString m_sPort;
+ CString m_sStopBit;
+ CString m_sFlowControl;
+ //}}AFX_DATA
+
+
+protected:
+private:
+
+// Member Functions
+public:
+ COXSerialCommSetup(CString sTitle = _T(""), CWnd* pParent = NULL);
+ // --- In: sTitle: the title of the dialog box (used default title if ignored)
+ // pParent: parent window
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs the dialog object
+
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ // Generated message map functions
+ //{{AFX_MSG(COXSerialCommSetup)
+ virtual BOOL OnInitDialog();
+ virtual void OnOK();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+ CString BaudRateToString(UINT Val);
+ CString ParityToString(BYTE Val);
+ CString FlowControlToString(COXSerialCommConfig::EFlowControl eVal);
+ UINT BaudRateToVal(CString sString);
+ BYTE ParityToVal(CString sString);
+ COXSerialCommConfig::EFlowControl FlowControlToVal(CString sString);
+private:
+
+};
+/////////////////////////////////////////////////////////////////////////////
+
+#endif //__OXSCSTP_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSEH.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSEH.h
new file mode 100644
index 0000000..b44b311
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSEH.h
@@ -0,0 +1,292 @@
+// ==========================================================================
+// Class Specification : COXSEHException
+// ==========================================================================
+
+// Header File : OXSEH.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CException
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class is a C++ wrapper around Structured Exception Handling.
+// SEH-exceptions that are thrown can now be catched using the
+// C++ try - catch statements or by the MFC TRY - CATCH macros
+
+// Remark:
+// Call the function EnableSEHTrapping() to enable this exception wrapper
+// All SEH exceptions are from that point onwwards translated to a
+// COXSEHException* exception.
+// The original exception code can be retrieved by calling the member function
+// GetCause()
+
+// Example
+
+// COXSEHException::EnableSEHTrapping();
+// TRY
+// {
+// int x = 1;
+// x = x / 0;
+// }
+// CATCH(COXSEHException, px)
+// {
+// if (pe->GetCause() == EXCEPTION_INT_DIVIDE_BY_ZERO)
+// ::AfxMessageBox(_T("Integer divide by zero trapped with TRY, CATCH"));
+// }
+// END_CATCH
+
+// COXSEHException::EnableSEHTrapping();
+// try
+// {
+// int x = 1;
+// x = x / 0;
+// }
+// catch(COXSEHException* px)
+// {
+// if (pe->GetCause() == EXCEPTION_INT_DIVIDE_BY_ZERO)
+// ::AfxMessageBox(_T("Integer divide by zero trapped with try, catch"));
+// px->Delete();
+// }
+
+// Note that all settings are organized on a per-thread base. So functions such as
+// EnableSEHTrapping() will enable trapping in the current thread.
+// If you are building a multi-threaded application and you want to trap all
+// exceptions, you should call EnableSEHTrapping() from within every thread
+
+// Prerequisites (necessary conditions):
+// This wrapper works only in WIN32 because WIN16 does not support SEH
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __SEHEXCPT_H__
+#define __SEHEXCPT_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include // For _set_se_translator
+
+// If you do not want to trap Floating Point exceptions, define OXSEH_USE_FP as 0
+#ifndef OXSEH_USE_FP
+#define OXSEH_USE_FP 1
+#endif //OXSEH_USE_FP
+
+#if (0 < OXSEH_USE_FP)
+#include
+#endif // (0 < OXSEH_USE_FP)
+
+
+class OX_CLASS_DECL COXSEHException : public CException
+{
+DECLARE_DYNAMIC(COXSEHException)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ _EXCEPTION_POINTERS* m_pEP;
+
+ typedef void (__cdecl *_se_translator_function)( unsigned int, _EXCEPTION_POINTERS*);
+ class OX_CLASS_DECL COXSEHState : public CNoTrackObject
+ {
+ public:
+ BOOL m_bSEHTrapping;
+ BOOL m_bFPTrapping;
+ unsigned int m_nPreviousFPControl;
+ unsigned int m_nFPControlMask;
+ _se_translator_function m_pfPreviousTranslator;
+
+ COXSEHState()
+ :
+ m_bSEHTrapping(FALSE),
+ m_bFPTrapping(FALSE),
+ m_nPreviousFPControl(0),
+#if (0 < OXSEH_USE_FP)
+ m_nFPControlMask(_EM_ZERODIVIDE | _EM_INVALID | _EM_DENORMAL | _EM_OVERFLOW | _EM_UNDERFLOW | _EM_INEXACT),
+#else
+ m_nFPControlMask(0),
+#endif // (0 < OXSEH_USE_FP)
+ m_pfPreviousTranslator(0)
+ {
+ }
+
+ };
+ static CThreadLocal m_pSEHState;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ static void EnableSEHTrapping(BOOL bTrapFP = FALSE);
+ // --- In : bTrapFP : Whether floating point exceptions should be trapped as well
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Start the mapping of SEH to C++ exceptions;
+
+ static void DisableSEHTrapping();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Stops the mapping of SEH to C++ exceptions;
+ // EnableSEHTrapping() must have been called previously
+
+ static BOOL IsSEHTrappingEnabled();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether the mapping of SEH to C++ exceptions is enabled
+ // --- Effect :
+
+ static BOOL IsSEHFPTrappingEnabled();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether FP exception will be trapped
+ // --- Effect :
+
+ COXSEHException(_EXCEPTION_POINTERS* pEP = NULL);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ UINT GetCause();
+ // --- In :
+ // --- Out :
+ // --- Returns : The cause why the exception was thrown.
+ // It is the code used by SEH (e.g. EXCEPTION_ACCESS_VIOLATION)
+ // See for possible codes
+ // --- Effect :
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+
+ virtual ~COXSEHException();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+ static void __cdecl MapSEHToCPPExceptions(UINT uCode, _EXCEPTION_POINTERS* pep);
+
+private:
+
+// Message handlers ---------------------------------------------------------
+
+};
+
+class OX_CLASS_DECL COXSEHMemoryException : public COXSEHException
+{
+DECLARE_DYNAMIC(COXSEHMemoryException)
+// Data members -------------------------------------------------------------
+// Member functions ---------------------------------------------------------
+public:
+ COXSEHMemoryException(_EXCEPTION_POINTERS* pEP = NULL);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ BOOL IsInfoAvailable();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether extra information is available
+ // (Read/Write flag and virtual memory address)
+ // --- Effect :
+
+ BOOL GetReadWriteFlag();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether the exception occurred when trying to read (FALSE)
+ // or to write (TRUE) to a virtual memory address
+ // --- Effect : Be sure that IsInfoAvailable() == TRUE
+
+ DWORD GetAddress();
+ // --- In :
+ // --- Out :
+ // --- Returns : Get the virtual memory address that resulted in an exception
+ // --- Effect :
+ // --- Effect : Be sure that IsInfoAvailable() == TRUE
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+ virtual ~COXSEHMemoryException();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+};
+
+class OX_CLASS_DECL COXSEHMathException : public COXSEHException
+{
+DECLARE_DYNAMIC(COXSEHMathException)
+// Data members -------------------------------------------------------------
+// Member functions ---------------------------------------------------------
+public:
+ COXSEHMathException(_EXCEPTION_POINTERS* pEP = NULL);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+ virtual ~COXSEHMathException();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+};
+
+class OX_CLASS_DECL COXSEHSpecialException : public COXSEHException
+{
+DECLARE_DYNAMIC(COXSEHSpecialException)
+// Data members -------------------------------------------------------------
+// Member functions ---------------------------------------------------------
+public:
+ COXSEHSpecialException(_EXCEPTION_POINTERS* pEP = NULL);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+ virtual ~COXSEHSpecialException();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.H
new file mode 100644
index 0000000..a6405d8
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.H
@@ -0,0 +1,5 @@
+#include "OXSCFILE.H"
+#include "OXSCEXCP.H"
+#include "OXSCSTP.H"
+#include "OXSCCFG.H"
+#include "OXSCFILE.H"
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.RC b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.RC
new file mode 100644
index 0000000..3e4c8b5
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSERCOM.RC
@@ -0,0 +1,257 @@
+//Microsoft Developer Studio generated resource script.
+//
+#ifndef _OXSerCom_RC__
+#define _OXSerCom_RC__
+
+#include "OXRSERCM.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
+ "OXRSERCM.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
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_COMMSETUP DIALOG DISCARDABLE 0, 0, 163, 107
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Serial Comm Setup"
+FONT 8, "Helv"
+BEGIN
+ LTEXT "&Port:",-1,6,9,17,8
+ COMBOBOX IDC_PORT,45,7,48,50,CBS_DROPDOWNLIST | CBS_HASSTRINGS |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Baud Rate:",-1,6,24,38,8,NOT WS_GROUP
+ COMBOBOX IDC_BAUDRATE,45,22,48,84,CBS_DROPDOWNLIST |
+ CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Data Bits:",-1,6,39,34,8,NOT WS_GROUP
+ COMBOBOX IDC_DATABIT,45,37,48,57,CBS_DROPDOWNLIST |
+ CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ LTEXT "P&arity:",-1,6,54,22,8,NOT WS_GROUP
+ COMBOBOX IDC_PARITY,45,52,48,57,CBS_DROPDOWNLIST | CBS_HASSTRINGS |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Stop Bits:",-1,6,69,33,8,NOT WS_GROUP
+ COMBOBOX IDC_STOPBIT,45,67,48,33,CBS_DROPDOWNLIST |
+ CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "&Ok",IDOK,107,6,50,14
+ PUSHBUTTON "&Cancel",IDCANCEL,107,23,50,14
+ LTEXT "&Flow Ctrl:",-1,6,84,33,8,NOT WS_GROUP
+ COMBOBOX IDC_FLOWCONTROL,45,82,48,42,CBS_DROPDOWNLIST |
+ CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_COMMSETUP DLGINIT
+BEGIN
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0031,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0032,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0033,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0034,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0035,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0036,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0037,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0038,
+ IDC_PORT, 0x403, 6, 0
+0x6f43, 0x206d, 0x0039,
+ IDC_BAUDRATE, 0x403, 4, 0
+0x3131, 0x0030,
+ IDC_BAUDRATE, 0x403, 4, 0
+0x3033, 0x0030,
+ IDC_BAUDRATE, 0x403, 4, 0
+0x3036, 0x0030,
+ IDC_BAUDRATE, 0x403, 5, 0
+0x3231, 0x3030, "\000"
+ IDC_BAUDRATE, 0x403, 5, 0
+0x3432, 0x3030, "\000"
+ IDC_BAUDRATE, 0x403, 5, 0
+0x3834, 0x3030, "\000"
+ IDC_BAUDRATE, 0x403, 5, 0
+0x3639, 0x3030, "\000"
+ IDC_BAUDRATE, 0x403, 6, 0
+0x3431, 0x3034, 0x0030,
+ IDC_BAUDRATE, 0x403, 6, 0
+0x3931, 0x3032, 0x0030,
+ IDC_BAUDRATE, 0x403, 6, 0
+0x3833, 0x3034, 0x0030,
+ IDC_BAUDRATE, 0x403, 6, 0
+0x3735, 0x3036, 0x0030,
+ IDC_BAUDRATE, 0x403, 7, 0
+0x3131, 0x3235, 0x3030, "\000"
+ IDC_DATABIT, 0x403, 2, 0
+0x0034,
+ IDC_DATABIT, 0x403, 2, 0
+0x0035,
+ IDC_DATABIT, 0x403, 2, 0
+0x0036,
+ IDC_DATABIT, 0x403, 2, 0
+0x0037,
+ IDC_DATABIT, 0x403, 2, 0
+0x0038,
+ IDC_PARITY, 0x403, 5, 0
+0x7645, 0x6e65, "\000"
+ IDC_PARITY, 0x403, 4, 0
+0x644f, 0x0064,
+ IDC_PARITY, 0x403, 10, 0
+0x6f4e, 0x5020, 0x7261, 0x7469, 0x0079,
+ IDC_PARITY, 0x403, 5, 0
+0x614d, 0x6b72, "\000"
+ IDC_PARITY, 0x403, 6, 0
+0x7053, 0x6361, 0x0065,
+ IDC_STOPBIT, 0x403, 2, 0
+0x0031,
+ IDC_STOPBIT, 0x403, 2, 0
+0x0032,
+ IDC_FLOWCONTROL, 0x403, 5, 0
+0x6f4e, 0x656e, "\000"
+ IDC_FLOWCONTROL, 0x403, 9, 0
+0x6148, 0x6472, 0x6177, 0x6572, "\000"
+ IDC_FLOWCONTROL, 0x403, 11, 0
+0x6f58, 0x206e, 0x202f, 0x6f58, 0x6666, "\000"
+ 0
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_DEFAULT_TITLE "General Purpose Comm. Handler"
+ IDS_MSG_DEFAULT_CONFIG "%s:\nConfiguration file not found.\nDefault Parameters Assumed."
+ IDS_MSG_BAD_CONFIG "%s:\nError loading the parameters file.\nDefault Parameters Assumed."
+ IDS_MSG_NO_SAVE "%s:\nError saving the parameters file."
+ IDS_MSG_NO_PORT_AVAILABLE
+ "The selected COM port is either not supported\nor is being used by another application.\nPlease select another port."
+ IDS_MSG_PORT_UNAVAILABLE
+ "%s:\nFailed to open the communication device.\nThe configurated COM port is either not supported\nor is being used by another application."
+ IDS_SERIAL_NONAME "Unknown Name"
+ IDS_SERIAL_NONE "No Error"
+ IDS_SERIAL_NOT_AVAILABLE
+ "%1:\nThe selected COM port is either not supported\nor is being used by another application.\nPlease select another port."
+ IDS_SERIAL_BREAK_DETECT "%1:\nBreak Detect !"
+ IDS_SERIAL_RX_TIMEOUT "%1:\nRx Timeout !"
+ IDS_SERIAL_CTS_TIMEOUT "%1:\nClear To Send Timeout !"
+ IDS_SERIAL_DSR_TIMEOUT "%1:\nData Set Ready Timeout !"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_SERIAL_CD_TIMEOUT "%1:\nCarrier Detect Timeout !"
+ IDS_SERIAL_FRAME_ERROR "%1:\nFrame Error !"
+ IDS_SERIAL_PARITY_ERROR "%1:\nParity Error !"
+ IDS_SERIAL_OVERRUN_ERROR "%1:\nOverrun Error !"
+ IDS_SERIAL_RX_QUEUE_OVERFLOW "%1:\nRx Buffer Overflow !"
+ IDS_SERIAL_TX_QUEUE_FULL "%1:\nTx Buffer Full !"
+ IDS_SERIAL_WM_QUIT_RECEIVED "%1:\nUnexpected WM_QUIT received !"
+ IDS_SERIAL_IO_ERROR "%1:\nI/O Error !"
+ IDS_SERIAL_MODE_ERROR "%1:\nMode Error ! (request mode not supported)"
+ IDS_SERIAL_UNKNOWN_ERROR "%1:\nUnknown Error !"
+ IDS_SERIAL_LOST_MESSAGES
+ "FATAL ERROR!\nThe Windows message queue is full!\nSerial Comm messages lost!\nIncrease the message queue depth."
+ IDS_DEFAULTFILE "unknown.cfg"
+ IDS_110 "110"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_300 "300"
+ IDS_600 "600"
+ IDS_1200 "1200"
+ IDS_2400 "2400"
+ IDS_4800 "4800"
+ IDS_9600 "9600"
+ IDS_14400 "14400"
+ IDS_19200 "19200"
+ IDS_38400 "38400"
+ IDS_56000 "56000"
+ IDS_128000 "128000"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_256000 "256000"
+ IDS_EVEN "Even"
+ IDS_ODD "Odd"
+ IDS_NOPARITY "No Parity"
+ IDS_MARK "Mark"
+ IDS_SPACE "Space"
+ IDS_NONE "None"
+ IDS_HARDWARE "Hardware"
+ IDS_XONXOFF "Xon / Xoff"
+ IDS_NOTIMER_AVAIL "RS232 Driver Internal Error:\nNo timer available to handle the timeout function.\nSolution: close some other application and then restart this one."
+ IDS_57600 "57600"
+ IDS_115200 "115200"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+#endif //_OXSerCom_RC__
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.h
new file mode 100644
index 0000000..123ae5d
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.h
@@ -0,0 +1,381 @@
+// ==========================================================================
+// Template Specification : COXSPtr
+// ==========================================================================
+
+// Header file : OXSPtr.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// NO Derived from
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+// (CMemoryException by NULL-pointer dereference)
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class works together with CObject derived classesto provide
+// a solution for smart pointers and objects
+// All access to the object must be done through its smart pointer
+
+// Normally construction of the object is done together with the
+// smart pointer. So when a smart pointer is constructed it also constructs
+// the object
+// When you specify NULL as parameter when construcing a smart pointer
+// it will not construct an object
+
+// The lifetime of objects is ruled by reference counting
+// When no references to the object exists it will be deleted.
+// You can remove the reference to an object explicitely by assigning
+// NULL to the smart pointer
+// You can also construct a new object explicitely by assigning the special value
+// NEW_OBJECT to it.
+
+// Apart from construction and destruction everything that can be done with a
+// normal (dumb) pointer can also be done with a smart pointer
+
+// Remark:
+// The runtime overhead of using a smart pointer instead of a dumb pointer
+// are very minimal
+// COXSPtr is a class with no base class and no virtual functions
+// The size of a smart pointer thus equals the size of its members :
+// two pointer (to the object and to the reference count).
+// All access functions of COXSPtr are inline and are very short.
+// E.g. operator-> just checks whether the pointer is not NULL
+// and returns it then
+// So computational overhead is minimal too.
+
+// When you try to dereference a smart pointer that is NULL
+// a CMemoryException will be thrown (and in DEBUG the function will ASSERT)
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __OXSPTR_H__
+#define __OXSPTR_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+// Defining ENABLE_SMART_WRAPPER enables the possibility to wrap a smart pointer
+// around an existing object. The locking functions are also available then.
+// By default this is not defined and thus not enabled
+// #define ENABLE_SMART_WRAPPER 1
+
+// Defining DISABLE_SMART_DOWNCAST_TEST disnables the runtime test when a
+// smart pointer is downcasted (from base class to derived class)
+// By default this is not defined and thus enabled
+// #define DISABLE_SMART_DOWNCAST_TEST 1
+
+// Defining DISABLE_SMART_SERIALIZATION disnables the serialization functionality
+// of a smart pointer (and groups)
+// By default this is not defined and thus enabled
+// #define DISABLE_SMART_SERIALIZATION 1
+
+// Defining DISABLE_SMART_CHECK disables the runtime checks during Debug
+// These checks include wrapping a smart pointer around an existing object,
+// a smart pointer around a steck based object and cyclic graphs.
+// By default this is not defined and thus enabled
+// #define DISABLE_SMART_CHECK 1
+
+// Use special creator object (NEW_OBJECT) that can be used in the
+// constructor and assignment operator of a smart pointer
+// to construct a new object
+class OX_CLASS_DECL COXObjectCreator
+ {
+ // This class is only used to mark a special parameter
+ // during construction or assignment of a smart pointer
+ // No actual members are needed
+ };
+extern OX_CLASS_DECL COXObjectCreator NEW_OBJECT;
+
+template class OX_CLASS_DECL COXSPtr;
+#ifndef DISABLE_SMART_SERIALIZATION
+template CArchive& AFXAPI operator<<(CArchive& ar, const COXSPtr& pSObj);
+template CArchive& AFXAPI operator>>(CArchive& ar, COXSPtr& pSObj);
+#endif // DISABLE_SMART_SERIALIZATION
+
+template class OX_CLASS_DECL COXSPtr
+{
+// Data members -------------------------------------------------------------
+public:
+protected:
+ T* m_pSmartObject;
+ LONG* m_pnReferenceCount;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXSPtr(const COXObjectCreator& objCreator = NEW_OBJECT);
+ // --- In : objCreator : NEW_OBJECT : Creates a new object
+ // --- Out :
+ // --- Returns :
+ // --- Effect : This constructs a smart pointer and it also
+ // creates the associated object
+ // This is the default constructor
+ // The only valid parameter is NEW_OBJECT
+
+#ifndef ENABLE_SMART_WRAPPER
+ COXSPtr(const COXObjectCreator* pNull);
+ // --- In : pNull : NULL
+ // --- Out :
+ // --- Returns :
+ // --- Effect : This constructs a smart NULL pointer
+ // The only valid parameter is NULL
+
+#else
+
+ COXSPtr(T* pSObj);
+ // --- In : pSObj : Pointer to the object
+ // around which this smart pointer will be created
+ // or NULL : Makes this a NULL-pointer
+ // --- Out :
+ // --- Returns :
+ // --- Effect : This constructs a smart pointer around an existing
+ // object or constructs a smart NULL pointer
+ // The object's lifetime is now decided by the smart pointer
+ // You should not delete the object directly
+#endif // ENABLE_SMART_WRAPPER
+
+ COXSPtr(const COXSPtr& sPtr);
+ // --- In : sPtr : The smart pointer to be copied
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Copy constructor
+
+ COXSPtr& operator=(const COXSPtr& sPtr);
+ // --- In : sPtr : A smart pointer
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Assignment operator
+
+ COXSPtr& operator=(const COXObjectCreator& objCreator);
+ // --- In : objCreator : NEW_OBJECT
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs a new object and assigns it to this smart pointer
+ // The only valid parameter is NEW_OBJECT
+
+#ifndef ENABLE_SMART_WRAPPER
+ COXSPtr& operator=(const COXObjectCreator* pNull);
+ // --- In : pNull : NULL
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Makes this smart pointer a smart NULL pointer
+ // The only valid parameter is NULL
+
+#else
+
+ COXSPtr& operator=(T* pSObj);
+ // --- In : pSObj : A pointer to the object or NULL
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Assignment operator
+ // If pSObj == NULL this smart pointer becomes a smart NULL pointer
+ // The object's lifetime is now decided by the smart pointer
+ // You should not delete the object directly
+#endif // ENABLE_SMART_WRAPPER
+
+ T& operator*() const;
+ // throw(CMemoryException);
+ // --- In :
+ // --- Out :
+ // --- Returns : The object pointed to
+ // --- Effect : Dereference operator
+
+ T* operator->() const;
+ // throw(CMemoryException);
+ // --- In :
+ // --- Out :
+ // --- Returns : Pointer to the object
+ // --- Effect : Member operator
+
+ operator T*() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Conversion operator
+
+ BOOL operator!() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this pointer points to NULL (TRUE) or to
+ // a valid object (FALSE)
+ // --- Effect :
+
+ BOOL operator==(T* pSObj) const;
+ // --- In : pSObj : Pointer to a smart element
+ // --- Out :
+ // --- Returns : Whether this pointer points to the specified
+ // object
+ // --- Effect :
+
+ BOOL operator!=(T* pSObj) const;
+ // --- In : pSObj : Pointer to a smart element
+ // --- Out :
+ // --- Returns : Whether this pointer does not point to the specified
+ // object
+ // --- Effect :
+
+#ifndef DISABLE_SMART_SERIALIZATION
+ friend CArchive& AFXAPI operator<<(CArchive& ar, const COXSPtr& pSObj);
+ // --- In : ar : Archive to store the object in
+ // pSObj : Object to store
+ // --- Out :
+ // --- Returns : The archive itself
+ // --- Effect : This functions serializes the object wrapped by this smart pointer
+ // Object I/O is pointer based to avoid added construction overhead and
+ // to support polymorphism
+ // Use the Serialize member function directly for embedded objects.
+
+ friend CArchive& AFXAPI operator>>(CArchive& ar, COXSPtr& pSObj);
+ // --- In : ar : Archive to load the object from
+ // pSObj : Object pointer to load into
+ // --- Out :
+ // --- Returns : The archive itself
+ // --- Effect : This functions serializes the object into this smart pointer
+ // Object I/O is pointer based to avoid added construction overhead and
+ // to support polymorphism
+ // Use the Serialize member function directly for embedded objects.
+#endif // DISABLE_SMART_SERIALIZATION
+
+ COXSPtr& PolyAssign(T* pSObj, LONG* pnReferenceCount);
+ // --- In : pSObj : Pointer to a T or T derived object
+ // pnReferenceCount : Pointer to its reference count
+ // --- Out :
+ // --- Returns : A smart pointer wrapping the object
+ // --- Effect : Assignment function, internally used for
+ // polymorphic assignment
+ // Do not call this function directly, use
+ // the operator <<= instead
+
+ LONG* GetRefCountAddress() const;
+ // --- In :
+ // --- Out :
+ // --- Returns : The address of the reference count of the object
+ // or NULL when smart null pointer
+ // --- Effect : Helper function, internally used for polymorphic assignment
+ // Do not call this function directly, use
+ // the operator <<= instead
+
+#ifdef ENABLE_SMART_WRAPPER
+ // CAUTION : THE NEXT THREE FUNCTIONS ARE NOT INTENDED FOR NORMAL USE
+ // THEY DISABLE A LOT OF IMPORTANT FUNCTIONALITY AND
+ // SHOULD ONLY BE USED IN EXCEPTIONAL CIRCUMSTANCES
+
+ void Lock();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Locks all the smart pointers that point to the object
+ // this smart pointer points to
+ // Locking will disable automatic deletion when the
+ // reference count reaches 0
+
+ void Unlock();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Unlocks all the smart pointers that point to the object
+ // this smart pointer points to
+ // Unlocking will re-enable automatic deletion when the
+ // reference count reaches 0
+
+ BOOL IsLocked();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether the smart pointer is locked or not
+ // --- Effect :
+#endif // ENABLE_SMART_WRAPPER
+
+#ifdef _DEBUG
+ void AssertValid() const;
+#endif // _DEBUG
+
+ ~COXSPtr();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : This destructs the pointer object
+
+protected:
+ LONG Grab();
+ LONG Release();
+
+private:
+
+};
+
+template
+inline COXSPtr& SmartUpCast(COXSPtr& pBaseObj, const COXSPtr& pObj)
+ // --- In : pBaseObj : Smart pointer you want to assign to
+ // pObj : Smart pointer being assigned
+ // --- Out :
+ // --- Returns : The smart pointer assigned to
+ // --- Effect : This is the 'polymorphic assignemnt' operator
+ // A smart pointer wrapping a T object can be assigned to a
+ // smart pointer normally wrapping BASE_T object,
+ // if T* could be assigned to BASE_T*
+ // This means T must be derived from BASE_T
+ {
+ // The next line will generate a compiler error (cannot convert parameter 1 from ...)
+ // if T (pObj) is not derived from BASE_T (pBaseObj)
+ return pBaseObj.PolyAssign(pObj, pObj.GetRefCountAddress());
+ };
+
+template
+inline COXSPtr& operator<<=(COXSPtr& pBaseObj, const COXSPtr& pObj)
+ {
+ return SmartUpCast(pBaseObj, pObj);
+ };
+
+template
+inline COXSPtr& SmartDownCast(COXSPtr& pObj, const COXSPtr& pBaseObj)
+ // --- In : pObj : Smart pointer you want to assign to
+ // pBaseObj : Smart pointer being assigned
+ // --- Out :
+ // --- Returns : The smart pointer assigned to
+ // --- Effect : This is the 'cast assignemnt' operator
+ // A smart pointer wrapping a BASE_T object will be assigned to a
+ // smart pointer wrapping a T object,
+ // A runtime check will be performed, to check the validity
+ // When an incorrect cast is performed a smart NULL pointer is returned
+ {
+#ifndef DISABLE_SMART_DOWNCAST_TEST
+ // The macro DYNAMIC_DOWNCAST does not work with templates, so we mimic that functionality
+ // ... Build a (temporary T object) just to get to the runtime class
+ COXSPtr pDummyObj;
+ if (pBaseObj != NULL && !pBaseObj->IsKindOf(pDummyObj->GetRuntimeClass()))
+ {
+ TRACE(_T("SmartDownCast (Cast assignment) returning smart NULL pointer\n"));
+ return pObj.PolyAssign(NULL, NULL);
+ }
+ else
+#endif // DISABLE_SMART_DOWNCAST_TEST
+ return pObj.PolyAssign((T*)(BASE_T*)pBaseObj, pBaseObj.GetRefCountAddress());
+ };
+
+template
+inline COXSPtr& operator>>=(COXSPtr& pObj, const COXSPtr& pBaseObj)
+ {
+ return SmartDownCast(pObj, pBaseObj);
+ };
+
+#include "OXSPtr.inl"
+
+#endif // __OXSPTR_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.inl b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.inl
new file mode 100644
index 0000000..f1eb602
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSPtr.inl
@@ -0,0 +1,517 @@
+// ==========================================================================
+// Template Implementation : COXSPtr
+// ==========================================================================
+
+// Source file : OXSPtr.inl
+
+// Source : R.Mortelmans
+// Creation Date : 19th December 1995
+// Last Modification : 23rd January 1996
+
+// //////////////////////////////////////////////////////////////////////////
+// Definition of static members
+
+#ifndef new
+#define new DEBUG_NEW
+#define _REMOVE_DEBUG_NEW
+#endif
+
+#if defined(_DEBUG) && !defined(DISABLE_SMART_CHECK)
+#include "OXSWatcher.h"
+extern COXSmartWatcher smartWatcher;
+// We will use sizeof(*pObj) to get the size of the object pointed to by the smart pointer
+// This will not be correct when polymorhic assignment is used, but it's the best we can do
+#define REG_PTR_OBJ(pObj) smartWatcher.RegisterPointerAndObject(this, pObj, sizeof(*pObj))
+#define UNREG_OBJ(pObj) smartWatcher.UnRegisterObject(pObj)
+#define UNREG_PTR(pObj) smartWatcher.UnRegisterPointer(this, pObj)
+#define IS_REG_OBJ(pObj) smartWatcher.IsRegisteredObject(pObj)
+#else
+#define REG_PTR_OBJ(pObj)
+#define UNREG_OBJ(pObj)
+#define UNREG_PTR(pObj)
+#define IS_REG_OBJ(pObj) (FALSE)
+#endif // _DEBUG
+
+// Use special ASSERT_VALID_SPTR macro to check the validity of a
+// smart pointer. Because COXSPtr is not derived from CObject the
+// normal ASSERT_VALID does not work
+
+#ifdef _DEBUG
+#define ASSERT_VALID_SPTR(pSPtr) (pSPtr)->AssertValid()
+#else
+#define ASSERT_VALID_SPTR(pSPtr)
+#endif // _DEBUG
+
+// Data members -------------------------------------------------------------
+// protected:
+ // T* m_pSmartObject;
+ // --- Pointer to the object this smart pointer references
+ // or NULL when the smart pointer does not point to anything
+
+ // LONG* m_pnReferenceCount;
+ // --- Pointer to the reference count of the object pointed to
+ // or NULL when the smart pointer does not point to anything
+ // When the object is locked the reference count is a negative number
+
+// private:
+
+// Member functions ---------------------------------------------------------
+// public:
+
+template inline COXSPtr::COXSPtr(const COXObjectCreator& objCreator /* = NEW_OBJECT */)
+ :
+ m_pSmartObject(NULL),
+ m_pnReferenceCount(NULL)
+ {
+ UNUSED(objCreator);
+ ASSERT_VALID_SPTR(this);
+ // ... May only be used to create a new object
+ ASSERT(&objCreator == &NEW_OBJECT);
+
+ m_pSmartObject = new T;
+ m_pnReferenceCount = new LONG(0);
+ // ... Register new smart pointer (for debugging purposes only)
+ Grab();
+
+ ASSERT_VALID_SPTR(this);
+ }
+
+#ifndef ENABLE_SMART_WRAPPER
+template inline COXSPtr::COXSPtr(const COXObjectCreator* pNull)
+ :
+ m_pSmartObject(NULL),
+ m_pnReferenceCount(NULL)
+ {
+ UNUSED(pNull);
+ // ... May only assign NULL pointer
+ ASSERT(pNull == NULL);
+ ASSERT_VALID_SPTR(this);
+ }
+
+#else
+
+template inline COXSPtr::COXSPtr(T* pSObj)
+ :
+ m_pSmartObject(pSObj),
+ m_pnReferenceCount(NULL)
+ {
+ // ... May only assign valid object
+ ASSERT(pSObj == NULL || AfxIsValidAddress(pSObj, sizeof(T)));
+
+ if (pSObj != NULL)
+ {
+ m_pnReferenceCount = new LONG(0);
+ // Make sure this object does not have another smart pointer wrapped
+ // around it yet : For polymorhic assignemnt use SmartUpCast or operator<<=
+ ASSERT(!IS_REG_OBJ(m_pSmartObject));
+ // ... Register new smart pointer (for debugging purposes only)
+ Grab();
+ }
+
+ ASSERT_VALID_SPTR(this);
+ }
+#endif // ENABLE_SMART_WRAPPER
+
+template inline COXSPtr::COXSPtr(const COXSPtr& sPtr)
+ :
+ m_pSmartObject(sPtr.m_pSmartObject),
+ m_pnReferenceCount(sPtr.m_pnReferenceCount)
+ {
+ ASSERT_VALID_SPTR(&sPtr);
+ ASSERT_VALID_SPTR(this);
+
+ if (m_pSmartObject != NULL)
+ {
+ // ... Should at least have one reference
+ ASSERT(sPtr.m_pnReferenceCount != NULL);
+ ASSERT(*sPtr.m_pnReferenceCount != 0);
+ Grab();
+ }
+
+ ASSERT_VALID_SPTR(this);
+ }
+
+template inline COXSPtr& COXSPtr::operator=(const COXSPtr& sPtr)
+ {
+ ASSERT_VALID_SPTR(this);
+ ASSERT_VALID_SPTR(&sPtr);
+
+ // ... Make sure that assigning the same smart element (a = a) works too
+ if (m_pSmartObject != sPtr.m_pSmartObject)
+ {
+ if (m_pSmartObject != NULL)
+ Release();
+ m_pSmartObject = sPtr.m_pSmartObject;
+ m_pnReferenceCount = NULL;
+ if (m_pSmartObject != NULL)
+ {
+ // ... Should at least have one reference
+ ASSERT(sPtr.m_pnReferenceCount != NULL);
+ ASSERT(*sPtr.m_pnReferenceCount != 0);
+ m_pnReferenceCount = sPtr.m_pnReferenceCount;
+ Grab();
+ }
+ }
+
+ ASSERT_VALID_SPTR(this);
+ return *this;
+ }
+
+template inline COXSPtr& COXSPtr::operator=(const COXObjectCreator& objCreator)
+ {
+ ASSERT_VALID_SPTR(this);
+ // ... May only be used to create a new object
+ ASSERT(&objCreator == &NEW_OBJECT);
+
+ if (m_pSmartObject != NULL)
+ Release();
+ m_pSmartObject = new T;
+ m_pnReferenceCount = new LONG(0);
+ // ... Register new smart pointer (for debugging purposes only)
+ Grab();
+
+ ASSERT_VALID_SPTR(this);
+ return *this;
+ }
+
+#ifndef ENABLE_SMART_WRAPPER
+template inline COXSPtr& COXSPtr::operator=(const COXObjectCreator* pNull)
+ {
+ UNUSED(pNull);
+ ASSERT_VALID_SPTR(this);
+ // ... May only assign smart NULL pointer
+ ASSERT(pNull == NULL);
+
+ if (m_pSmartObject != NULL)
+ Release();
+ m_pSmartObject = NULL;
+
+ ASSERT_VALID_SPTR(this);
+ return *this;
+ }
+
+#else
+
+template inline COXSPtr& COXSPtr::operator=(T* pSObj)
+ {
+ ASSERT_VALID_SPTR(this);
+ ASSERT(pSObj == NULL || AfxIsValidAddress(pSObj, sizeof(T)));
+
+ // ... Make sure that assigning the same smart element (a = a) works too
+ if (m_pSmartObject != pSObj)
+ {
+ if (m_pSmartObject != NULL)
+ Release();
+ m_pSmartObject = pSObj;
+ m_pnReferenceCount = NULL;
+ if (m_pSmartObject != NULL)
+ {
+ m_pnReferenceCount = new LONG(0);
+ // Make sure this object does not have another smart pointer wrapped
+ // around it yet : For polymorhic assignemnt use SmartUpCast or operator<<=
+ ASSERT(!IS_REG_OBJ(m_pSmartObject));
+ // ... Register new smart pointer (for debugging purposes only)
+ Grab();
+ }
+ }
+
+ ASSERT_VALID_SPTR(this);
+ return *this;
+ }
+#endif // ENABLE_SMART_WRAPPER
+
+template inline T& COXSPtr::operator*() const
+ {
+ ASSERT_VALID_SPTR(this);
+ if (m_pSmartObject == NULL)
+ {
+ TRACE(TEXT("COXSPtr::operator* : Trying to dereference a NULL pointer, throwing memory exception\n"));
+ ASSERT(FALSE);
+ AfxThrowMemoryException();
+ }
+ return *m_pSmartObject;
+ }
+
+template inline T* COXSPtr::operator->() const
+ {
+ ASSERT_VALID_SPTR(this);
+ if (m_pSmartObject == NULL)
+ {
+ TRACE(TEXT("COXSPtr::operator-> : Trying to dereference a NULL pointer, throwing memory exception\n"));
+ ASSERT(FALSE);
+ AfxThrowMemoryException();
+ }
+ return m_pSmartObject;
+ }
+
+template inline COXSPtr::operator T*() const
+ {
+ ASSERT_VALID_SPTR(this);
+ return m_pSmartObject;
+ }
+
+
+template inline BOOL COXSPtr::operator!() const
+ {
+ ASSERT_VALID_SPTR(this);
+ return (m_pSmartObject == NULL);
+ }
+
+template inline BOOL COXSPtr::operator==(T* pSObj) const
+ {
+ ASSERT_VALID_SPTR(this);
+ return (m_pSmartObject == pSObj);
+ }
+
+template inline BOOL COXSPtr::operator!=(T* pSObj) const
+ {
+ ASSERT_VALID_SPTR(this);
+ return (m_pSmartObject != pSObj);
+ }
+
+#ifndef DISABLE_SMART_SERIALIZATION
+template inline CArchive& AFXAPI operator<<(CArchive& ar, const COXSPtr& pSObj)
+ {
+ ASSERT_VALID_SPTR(&pSObj);
+ // Let the object archive itself
+ ar << pSObj.m_pSmartObject;
+ return ar;
+ }
+
+template inline CArchive& AFXAPI operator>>(CArchive& ar, COXSPtr& pSObj)
+ {
+ ASSERT_VALID_SPTR(&pSObj);
+ T* pObj = NULL;
+
+ // Create an object dynamically when archiving
+ ar >> pObj;
+
+ // Store the newly read object in this smart pointer
+ if (pSObj.m_pSmartObject != NULL)
+ pSObj.Release();
+ pSObj.m_pSmartObject = pObj;
+ pSObj.m_pnReferenceCount = NULL;
+
+ if (pSObj.m_pSmartObject != NULL)
+ {
+ pSObj.m_pnReferenceCount = new LONG(0);
+ // ... Register new smart pointer (for debugging purposes only)
+ pSObj.Grab();
+ }
+
+ ASSERT_VALID_SPTR(&pSObj);
+
+ return ar;
+ }
+#endif // DISABLE_SMART_SERIALIZATION
+
+template inline COXSPtr& COXSPtr::PolyAssign(T* pSObj, LONG* pnReferenceCount)
+ {
+ ASSERT_VALID_SPTR(this);
+
+ // ... May only assign valid object
+ ASSERT(pSObj == NULL || AfxIsValidAddress(pSObj, sizeof(T)));
+ ASSERT(pnReferenceCount == NULL || AfxIsValidAddress(pnReferenceCount, sizeof(LONG)));
+
+ // ... Make sure that assigning the same smart element (a = a) works too
+ if (m_pSmartObject != pSObj)
+ {
+ if (m_pSmartObject != NULL)
+ Release();
+ m_pSmartObject = pSObj;
+ m_pnReferenceCount = NULL;
+ if (m_pSmartObject != NULL)
+ {
+ // ... Should at least have one reference
+ ASSERT(pnReferenceCount != NULL);
+ ASSERT(*pnReferenceCount != 0);
+ m_pnReferenceCount = pnReferenceCount;
+ Grab();
+ }
+ }
+
+ ASSERT_VALID_SPTR(this);
+ return *this;
+ }
+
+template inline LONG* COXSPtr::GetRefCountAddress() const
+ {
+ ASSERT_VALID_SPTR(this);
+ return m_pnReferenceCount;
+ }
+
+#ifdef ENABLE_SMART_WRAPPER
+template inline void COXSPtr::Lock()
+ {
+ ASSERT_VALID_SPTR(this);
+#ifdef _DEBUG
+ if (m_pSmartObject == NULL)
+ {
+ ASSERT(m_pnReferenceCount == NULL);
+ TRACE(TEXT("COXSPtr::Lock : Trying to lock smart NULL pointer, ignoring\n"));
+ }
+#endif // _DEBUG
+ // Make reference count negative to mark a locked object
+ if (m_pnReferenceCount != NULL && 0 < *m_pnReferenceCount)
+ *m_pnReferenceCount = -*m_pnReferenceCount;
+ ASSERT_VALID_SPTR(this);
+ }
+
+template inline void COXSPtr::Unlock()
+ {
+ ASSERT_VALID_SPTR(this);
+#ifdef _DEBUG
+ if (m_pSmartObject == NULL)
+ {
+ ASSERT(m_pnReferenceCount == NULL);
+ TRACE(TEXT("COXSPtr::Unlock : Trying to lock smart NULL pointer, ignoring\n"));
+ }
+#endif // _DEBUG
+ // Make reference count positive to mark an unlocked object
+ if (m_pnReferenceCount != NULL && *m_pnReferenceCount < 0)
+ *m_pnReferenceCount = -*m_pnReferenceCount;
+ ASSERT_VALID_SPTR(this);
+ }
+
+template inline BOOL COXSPtr::IsLocked()
+ {
+ ASSERT_VALID_SPTR(this);
+ return (m_pnReferenceCount != NULL && *m_pnReferenceCount < 0);
+ }
+#endif // ENABLE_SMART_WRAPPER
+
+#ifdef _DEBUG
+template inline void COXSPtr::AssertValid() const
+ {
+ ASSERT(this != NULL);
+ ASSERT(AfxIsValidAddress(this, sizeof(COXSPtr)));
+ ASSERT(m_pSmartObject == NULL || AfxIsValidAddress(m_pSmartObject, sizeof(T)));
+
+ // Because thee next check has to many exceptions we skip it.
+/*
+#if defined(_INC_CRTDBG) && !defined(DISABLE_SMART_CHECK)
+ // ... The next assert will fail if a block of memory was not allocated
+ // on the local heap.
+ // NEVER allocate objects for smart pointers on the STACK !!!
+ // ... Because of polymorphic assignment we use _msize(m_pSmartObject) instead of sizeof(T)
+ // ... NOTE : This test may also fail if a dynamically linked library (DLL)
+ // contains a static link to the run-time library.
+ // ... NOTE : If the object is not derived from CObject it will be allocated
+ // as a _NORMAL_BLOCK instead of _CLIENT_BLOCK.
+ // In this case you may recieve an assertion of the Debug Heap CRT library
+ // (pHead->nBlockUse == nBlockUse). You may savely ignore this assert
+ ASSERT(m_pSmartObject == NULL ||
+ _CrtIsMemoryBlock((const void *)m_pSmartObject, _msize_dbg(m_pSmartObject, _CLIENT_BLOCK), NULL, NULL, NULL));
+#endif // _INC_CRTDBG
+*/
+ ASSERT(m_pnReferenceCount == NULL || AfxIsValidAddress(m_pnReferenceCount, sizeof(LONG)));
+ ASSERT( (m_pSmartObject == NULL && m_pnReferenceCount == NULL) ||
+ (m_pSmartObject != NULL && m_pnReferenceCount != NULL) );
+ ASSERT(m_pnReferenceCount == NULL || *m_pnReferenceCount != 0);
+#ifndef ENABLE_SMART_WRAPPER
+ ASSERT(m_pnReferenceCount == NULL || 0 <= *m_pnReferenceCount);
+#endif // ENABLE_SMART_WRAPPER
+ }
+#endif // _DEBUG
+
+template inline COXSPtr::~COXSPtr()
+ {
+ ASSERT_VALID_SPTR(this);
+ if (m_pSmartObject != NULL)
+ Release();
+ }
+
+// protected:
+template inline LONG COXSPtr::Grab()
+ // --- In :
+ // --- Out :
+ // --- Returns : The reference count after Grab()
+ // --- Effect : Increases the reference count by 1 for not locked objects
+ // otherwise the reference count is decreased by 1
+ {
+ ASSERT(m_pnReferenceCount != NULL);
+ REG_PTR_OBJ(m_pSmartObject);
+#ifndef ENABLE_SMART_WRAPPER
+ ASSERT(0 <= *m_pnReferenceCount);
+ (*m_pnReferenceCount)++;
+ return *m_pnReferenceCount;
+#else
+ if (0 <= *m_pnReferenceCount)
+ {
+ (*m_pnReferenceCount)++;
+ return *m_pnReferenceCount;
+ }
+ else
+ // Object is locked : use negative reference count
+ {
+ (*m_pnReferenceCount)--;
+ // ... Always return a positive number
+ return -*m_pnReferenceCount;
+ }
+#endif // ENABLE_SMART_WRAPPER
+ }
+
+template inline LONG COXSPtr::Release()
+ // --- In :
+ // --- Out :
+ // --- Returns : The reference count after Release()
+ // --- Effect : Decreases the reference count of non-locked objects by 1
+ // for loked objects the reference count is increased by 1
+ // Deletes the object and the reference count when 0 is reached
+ {
+ ASSERT_VALID_SPTR(this);
+ ASSERT(m_pnReferenceCount != NULL);
+ ASSERT(*m_pnReferenceCount != 0);
+
+ LONG nTempReferenceCount = 0;
+ if (*m_pnReferenceCount == 1)
+ {
+ // ... Unregister smart pointer (for debugging purposes only)
+ UNREG_OBJ(m_pSmartObject);
+ // ... Object will be deleted and thus does not have to be reachable
+ UNREG_PTR(NULL);
+ delete m_pnReferenceCount;
+ delete m_pSmartObject;
+ }
+#ifndef ENABLE_SMART_WRAPPER
+ else
+ {
+ ASSERT(0 < *m_pnReferenceCount);
+ nTempReferenceCount = --(*m_pnReferenceCount);
+ UNREG_PTR(m_pSmartObject);
+ }
+#else
+ else if (*m_pnReferenceCount == -1)
+ {
+ // Reference count of locked object reached 0, object NOT deleted
+ // ... Unregister smart pointer (for debugging purposes only)
+ UNREG_OBJ(m_pSmartObject);
+ // ... Object will be deleted and thus does not have to be reachable
+ UNREG_PTR(NULL);
+ delete m_pnReferenceCount;
+ }
+ else
+ {
+ if (0 <= *m_pnReferenceCount)
+ nTempReferenceCount = --(*m_pnReferenceCount);
+ else
+ // ... Object is locked : use negative reference count
+ // ... Always return a positive number
+ nTempReferenceCount = -(++(*m_pnReferenceCount));
+ UNREG_PTR(m_pSmartObject);
+ }
+#endif // ENABLE_SMART_WRAPPER
+
+ m_pnReferenceCount = NULL;
+ m_pSmartObject = NULL;
+ return nTempReferenceCount;
+ }
+
+
+// private:
+
+#ifdef _REMOVE_DEBUG_NEW
+#undef new
+#undef _REMOVE_DEBUG_NEW
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSRLZR.H b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSRLZR.H
new file mode 100644
index 0000000..deee6ac
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSRLZR.H
@@ -0,0 +1,130 @@
+// ==========================================================================
+// Class Specification : COXSerializer
+// ==========================================================================
+
+// Header file : OXSRLZR.H
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// NO Is derived from CWnd
+// NO Two stage creation (constructor & Initialize())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// COXSerializer class
+// BOOL Initialize(LPCTSTR pFileName, CObject* pObject);
+// ---------------------------------------------------------
+// Set the filename that has to be serialized and its relative object.
+// return FALSE only if an invalid string pointer or a CObject derived
+// object pointer or a not serializable object is passed .
+// Initialize can be called anytime.
+//
+// BOOL Load(BOOL DisplayException = TRUE);
+// ----------------------------------------
+// Loads the object from the archive. The object and the file name
+// are to be set by the Initialize function.
+// DisplayException=FALSE: No messages by messagebox are displayed
+// return FALSE if this object was not initialized or a Exception was
+// encounterd. (see FileException,ArchiveException and MemoryException
+// public data member to obtains more informations)
+//
+// BOOL Save(BOOL DisplayException = TRUE);
+// ----------------------------------------------------
+// Store the object to the archive. The object and the file name
+// are to be set by the Initialize function.
+// DisplayException=FALSE: No messages by messagebox are displayed
+// return FALSE if this object was not initialized or a Exception was
+// encounterd. (see FileException,ArchiveException and MemoryException
+// public data member to obtains more informations)
+
+// Remark:
+//
+
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+#ifndef __OXSRLZR_H__
+#define __OXSRLZR_H__
+
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXSerializer : public CObject
+{
+// Data Members
+public:
+ CFileException m_fileException; // exceptions as data member
+ CArchiveException m_archiveException; // if you chose not to display exceptions
+ BOOL m_bMemoryException; // then you can check them via these members
+
+protected:
+ BOOL m_bInitialized; // if initialized or not
+ CString m_sFileName; // the filename of the file to serialize from or to
+ CObject* m_pObject; // the object to serialize
+
+private:
+
+// Member Functions
+public:
+ COXSerializer();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs the object
+
+ virtual ~COXSerializer();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: destructs the object
+
+ BOOL Initialize(CString sFileName, CObject* pObject);
+ // --- In: sFileName: the filename of the file you want to serialize to or from
+ // pObject: the parent object you want to serialize
+ // --- Out: none
+ // --- Returns: if the initialization was successful
+ // --- Effect: initialize and checks if the object is serializable
+
+ BOOL Load(BOOL bDisplayException = TRUE);
+ // --- In: bDisplayException: if the exception is reported
+ // --- Out: none
+ // --- Returns: if successful or not
+ // --- Effect: loads the object (see initialize) from file
+
+ BOOL Save(BOOL bDisplayException = TRUE);
+ // --- In: bDisplayException: if the exception is reported
+ // --- Out: none
+ // --- Returns: if successful or not
+ // --- Effect: saves the object (see initialize) to file
+
+protected:
+
+private:
+};
+
+#endif // __SERIALIZE_ENH_H__
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSendMail.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSendMail.h
new file mode 100644
index 0000000..6d521b7
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXSendMail.h
@@ -0,0 +1,227 @@
+// ==========================================================================
+// Class Specification : COXSendMail
+// ==========================================================================
+
+// Header file : OXSendMail.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// The COXSendMail class is designed to send Mail from Windows NT service applications
+// like the Microsoft IIS server. The class has an extremely simple interface which
+// enables you to send mail with only 3 function calls.
+// The COXSendMail class is based on our MFC framework for extended MAPI (through
+// OLE Messaging). This framework provides 14 powerful classes which allow you to add
+// quickly and easily the ability to send and receive mail messages to your MFC application.
+// It also enables easy interaction with folders and address books. You can create
+// programmable messaging objects. The functionality of these objects can be used to build
+// workflow automation solutions.
+// You can add different kind of recipients (CC, BCC, distribution lists) and attachments
+// (binary, ole-objects) and send it to a MAPI compatible mail system (Exchange, Microsoft
+// Mail, Internet Mail, ...).
+//
+
+// Remark:
+// If your NT service application logs on with a specific user account you must provide an
+// additional privilege for this account: the user-right "Restore Files and Directories" must
+// be granted. If the service uses the system account you have to impersonate a specific
+// user account if you send a message. For example, if you use the Microsoft IIS to call
+// your ISAPI extensions, the IIS will impersonate the anonymous WWW-account ‘USR_COMPUTER_NAME’
+// before calling your extension DLL.
+// You have to provide a suitable Profile for that user account. If MAPI logs on to a store or
+// transport provider it uses a MAPI profile which defines the providers to use.
+// Instantiate a COXSendMail object and call the Logon() function with the profile name and
+// password as parameters. Call the CreateMessage() function and add your recipients and attachments
+// with the AddRecipient() and AddAttachment() functions. Finally call the SendMessage() function
+// and you are done.
+//
+// *** There are two compile version of this class. One that uses our OXMapi framework (don't define
+// the OX_MAPI_DIRECT switch. And one that uses extended MAPI direct (use the #define OX_MAPI_DIRECT
+// switch.
+
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __SENDMAIL_H__
+#define __SENDMAIL_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+// See the *** remark section for the following switch
+//#define OX_MAPI_DIRECT
+
+#ifndef OX_MAPI_DIRECT
+#include "oxmdisp.h"
+#else
+#include
+#endif
+
+
+#define CRecipientArray CArray
+#define CAttachmentArray CArray
+#define CInternRecipientArray CArray
+#define CInternAttachmentArray CArray
+
+class OX_CLASS_DECL COXSendMail : public CObject
+{
+// Data Members
+public:
+ enum ERecipientType
+ {
+ rtTO = 1,
+ rtCC = 2,
+ rtBCC = 3
+ };
+ enum EAttachmentType
+ {
+ atFileData = 1,
+ atFileLink = 2,
+ atOleObject = 3
+ };
+ class OX_CLASS_DECL CMessage
+ {
+ friend COXSendMail;
+ // Data Members
+ public:
+ CString m_sSubject;
+ CString m_sContent;
+
+ protected:
+ struct SRecipient
+ {
+ CString sName;
+ ERecipientType eType;
+ };
+ struct SAttachment
+ {
+ CString sPath;
+ EAttachmentType eType;
+ CString sOleDocument;
+ };
+ CInternRecipientArray m_recipients;
+ CInternAttachmentArray m_attachments;
+
+ // Member Functions
+ public:
+ CMessage();
+ virtual ~CMessage();
+ void AddRecipient(CString sRecipient, ERecipientType eType);
+ void AddAttachment(CString sAttachment, EAttachmentType eType, CString sOleDocument = _T(""));
+ };
+
+protected:
+
+ CString m_sMAPIProfile;
+
+#ifndef OX_MAPI_DIRECT
+ COXMSession m_objSession;
+#endif
+
+public:
+ COXSendMail();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ virtual ~COXSendMail();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+ BOOL Initialize(CString sProfileName, CString sPassword = _T(""));
+ // --- In: sProfileName: name of the profile you want to log on with
+ // sPassword: optional password to log on
+ // --- Out: none
+ // --- Returns: if successful or not
+ // --- Effect: Logs on to the mail services defined in the given profile
+
+ BOOL IsInitialized();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if initialized or not
+ // --- Effect: none
+
+ void Uninitialize();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: logs off from the mail system and does some cleaning
+
+ CString GetProfile();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: if initialized the name of the profile
+ // --- Effect: none
+
+ BOOL SendMessage(CMessage& message);
+ // --- In: message: the message to send
+ // --- Out: none
+ // --- Returns: if message was send successful or not
+ // --- Effect: sends the message
+
+ static CString GetReturnMsg(int nErr);
+ // --- In: nErr: the error code returned by MAPI
+ // --- Out: none
+ // --- Returns: a description of the error message
+ // --- Effect: none
+
+protected:
+
+
+// ******************************************************************
+// this is needed for the Extended MAPI alternative; see the *** remark section
+// ******************************************************************
+#ifdef OX_MAPI_DIRECT
+ BOOL InitializeMessageStore();
+ LPMESSAGE ComposeMessage(CMessage& message);
+ HRESULT AddRecipients(LPMESSAGE pMessage, CRecipientArray& recipients);
+ HRESULT AddAttachments(LPMESSAGE pMessage, CAttachmentArray& attachments);
+ LPMAPISESSION m_pMAPISession;
+ LPADRBOOK m_pAddressBook;
+ LPENTRYID m_peidDefaultMDB;
+ ULONG m_cbeidDefaultMDB;
+ LPMDB m_pDefaultMDB;
+ LPMAPIFOLDER m_pRootFolder;
+ LPSTR m_szRecipient;
+ ULONG m_uLogoffFlags;
+ LPSTR m_szAttachData;
+#endif
+// ******************************************************************
+
+};
+
+#endif // __MAILTO_H__
+// ==========================================================================
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXStaticMenuItem.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXStaticMenuItem.h
new file mode 100644
index 0000000..2d8312a
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXStaticMenuItem.h
@@ -0,0 +1,114 @@
+#if !defined(_OXSSTATICMENUITEM_H__)
+#define _OXSSTATICMENUITEM_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+// OXStaticMenuItem.h : header file
+//
+
+#include "OXHookWnd.h"
+#include "OXStaticText.h"
+#include "OXMainRes.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// COXStaticMenuItem window
+
+class OX_CLASS_DECL COXStaticMenuItem : public COXStaticText
+{
+// Construction
+public:
+ // --- In :
+ // --- Out :
+ // --- Returns:
+ // --- Effect : Constructs the object
+ COXStaticMenuItem();
+
+// Attributes
+public:
+
+protected:
+ // flag specifies whether the mouse button is currently pressed in
+ BOOL m_bPressedDown;
+ // color of the text when item is active
+ COLORREF m_clrActive;
+ // color of the text when item is inactive
+ COLORREF m_clrNormalText;
+
+ // helper object to spy for mouse entering and leaving events
+ COXHookWnd m_MouseSpy;
+
+// Operations
+public:
+
+ // --- In : clrText - text color in the inactive (normal) state
+ // clrBack - background color
+ // clrActive - text color in the active state
+ // nFontHeight - text font height
+ // nFontWeight - text font weight
+ // sFontName - text font name
+ // bEmboss - if TRUE then font will be drawn
+ // with 3D effect
+ // nHorzAlignment - horizontal alignment of the text
+ // in the control
+ // nVertAlignment - vertical alignment of the text
+ // in the control
+ // --- Out :
+ // --- Returns:
+ // --- Effect : Constructs the object
+ void SetProperties(COLORREF clrText=::GetSysColor(COLOR_BTNTEXT),
+ COLORREF clrBack=::GetSysColor(COLOR_BTNFACE),
+ COLORREF clrActive=RGB(192,0,0), int nFontHeight=12,
+ int nFontWeight=FW_NORMAL, CString sFontName=_T("MS Sans Serif"),
+ BOOL bEmboss=TRUE, int nHorzAlignment=OX_ALIGNHORZ_LEFT,
+ int nVertAlignment=OX_ALIGNVERT_CENTER);
+
+
+ inline void SetActiveColor(COLORREF clrActive, BOOL bPrepareNow=FALSE)
+ {
+ m_clrActive=clrActive;
+ if(m_MouseSpy.IsMouseOver())
+ PrepareBitmap(bPrepareNow);
+ }
+
+ inline COLORREF GetActiveColor() const { return m_clrActive; }
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(COXStaticMenuItem)
+ protected:
+ virtual void PreSubclassWindow();
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~COXStaticMenuItem();
+
+ // Generated message map functions
+protected:
+
+ // helper to notify parent about COXStaticMenuItem events
+ void NotifyParent(int nEventID);
+
+ //{{AFX_MSG(COXStaticMenuItem)
+ afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
+ afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ //}}AFX_MSG
+ afx_msg LONG OnMouseEnter(WPARAM wParam, LPARAM lParam);
+ afx_msg LONG OnMouseLeave(WPARAM wParam, LPARAM lParam);
+
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(_OXSSTATICMENUITEM_H__)
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXThreadEngine.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXThreadEngine.h
new file mode 100644
index 0000000..c9ee100
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXThreadEngine.h
@@ -0,0 +1,261 @@
+// ==========================================================================
+// Class Specification : COXThreadEngine
+// ==========================================================================
+
+// Header file : OXOwnThread.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// NO Is a Cwnd.
+// YES Two stage creation (constructor & Initialize())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// YES Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Description :
+// CThreadEngine class
+// You can use the COXThreadEngine for dedicated access to data objects.
+// It is a good approach to the design of multithreaded applications to prevent
+// as much as possible that specific data is accessed from more than one thread.
+// The class provides build-in functionality such as communication techniques
+// to communicate to and between different engines.
+// Suppose for example that we want to access a CMyOLEObject from more threads.
+// *** The first step is to derive a CMyEngine class from the COXThreadEngine base class.
+// We add the CMyOLEObject as a protected data member of the engine class.
+// Then we overload the pure virtual function "OnExecuteCmd()". This function will
+// be called internally by the COXThreadEngine and needs to dispatch the commands
+// to the appropriated function. Most of the time this can be implemented with a simply
+// switch structure.
+// Next, we have to derive a CMyCmd from the COXEngineCmd class to hold your
+// command parameters and return values. This class will be used internally to queue
+// multiple calls to the engine object.
+// Finally we provide a public wrapper function "DoSomething" which queues the CDoSomethingCmd
+// commands. We instantiate a CDoSomethingCmd object which we pass on to the PostCommand()
+// function. The PostCommand function will wait until the engine has executed the
+// command (in this example the command is synchronous). Before we return in this function
+// we need to release the command object. This object is reference counted and will
+// be destroyed automatically. If we now want to return a data member of the command
+// object, we need to copy the value to a temporary variable, because the command object could
+// be destroyed after we called the Release() function.
+//
+// *** Communication techniques:
+// + Synchronous, queued: create a COXEngineCmd without optional parameters and
+// post it with the PostCommand() function to the COXThreadEngine
+// + Synchronous, ASAP: create a COXEngineCmd without optional parameters and
+// post it with the PostCommand() function with the bASAP parameter set to TRUE
+// + Asynchronous, queued: create a COXEngineCmd with the first parameter set to FALSE
+// and post it with the PostCommand() function
+// + Asynchronous, ASAP: create a COXEngineCmd with the first parameter set to FALSE
+// and post it with the PostCommand() function with the bASAP parameter set to TRUE
+// * OPTIONAL for all the techniques, you can use a second parameter in the
+// constructor of COXEngineCmd if you want to receive a DONE notification.
+// This can be important for the asynchronous techniques. For this: the requesting
+// object need to be derived of COXDoneNotifier. You need to pass the this pointer
+// of the requesting object to the constructor of COXEngineCmd. Your requesting object
+// will now receive a DoneCommand() call after the execution of the command.
+// The command itself will be passed on as a parameter. You can use the command type and
+// the command index to track the initial request. For this, it is important that you
+// catalogue the index of the command after the construction of it.
+// Important is that you need to call the Release() function of your command also after
+// DONE notification.
+
+// Remark:
+// If you forget the call the Release() function of COXEngineCmd you will end up
+// with memory leaks.
+// You need to call the COXEngineCmd::Release() function after you posted the command
+// with the COXThreadEngine::PostCommand() function. And you need to call the Release()
+// function ones again if you implement a "done notification" for your command.
+// If the object that requested the command is also running in his own engine,
+// it can be necessary to post done notification commands to the queue of your requesting
+// engine. In this case you need to use a own command for this "Post" which takes the first
+// one, that came with the "done notification" as a data member. In this case you must call
+// the Release() function of the first command in the destructor of the second one.
+
+// Prerequisites (necessary conditions):
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+#ifndef __OXTHREADENGINE_H_
+#define __OXTHREADENGINE_H_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+
+class COXEngineCmd;
+class COXThreadEngine;
+
+class OX_CLASS_DECL COXDoneNotifier
+{
+friend COXThreadEngine;
+protected:
+ virtual void DoneCommand(COXEngineCmd* pCmd) = 0;
+};
+
+class OX_CLASS_DECL COXEngineCmd : public CObject
+{
+ DECLARE_DYNAMIC(COXEngineCmd)
+
+friend COXThreadEngine;
+
+// Data Members
+public:
+ DWORD m_dwIndex; // every instantiated command has an unique index
+
+protected:
+ COXDoneNotifier* m_pDoneNotifier; // for optional notification after execution
+ HANDLE m_hFinishedEvent; // use for synchronisation of synchrone commands
+ LONG m_nRef; // used for reference counting
+
+private:
+ static DWORD m_dwGlobalIndex; // internal cyclic counter
+
+// Member Functions
+public:
+ COXEngineCmd(BOOL bSynchrone = TRUE, COXDoneNotifier* pDoneNotifier = NULL);
+ // --- In : bSynchrone: defines if the command will be executed synchronous or asynchronous
+ // pDoneNotifier: will be notified when the execution of the command is done
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : Contructor of an egine command
+
+ void Release();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : decreases the reference count and deletes the object if zero
+
+ BOOL IsSynchrone() const;
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the command is synchronous or not
+ // --- Effect :
+
+protected:
+ virtual ~COXEngineCmd();
+
+private:
+};
+
+class OX_CLASS_DECL COXThreadEngine : public CObject
+{
+// Data Members
+public:
+
+protected:
+ BOOL m_bEndThread; // thread shall terminate during next thread event
+ BOOL m_bInitialized; // if successfully initialised
+ CWinThread* m_pThread; // thread pointer of the engines thread
+ HANDLE m_hCreatedEvent;// event for initialisation synchronisation
+ HANDLE m_hEndEvent; // event for termination synchronisation
+ HANDLE m_hThreadEvent; // event when a new command is posted
+ DWORD m_nTerinationTimeout;
+
+ class OX_CLASS_DECL COXEngineCmdList : public CTypedPtrList
+ {
+ // Data Members
+ public:
+ protected:
+ HANDLE m_hMutex;
+ private:
+ // Member functions
+ public:
+ COXEngineCmdList();
+ virtual ~COXEngineCmdList();
+ void Lock();
+ void Unlock();
+ protected:
+ private:
+ } m_cmdList;
+
+private:
+
+// Member Functions
+public:
+ COXThreadEngine();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : construction of engine (still need to be initialised)
+
+ virtual ~COXThreadEngine();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : destructs the engine (need to be terminated first)
+
+ BOOL Initialize();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the engine is successfully initialised
+ // --- Effect : start the engines thread (as a result
+ // OnThreadConstruction() will be called)
+
+ BOOL IsInitialized();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : if the engine is successfully initialised
+ // --- Effect :
+
+ void Terminate();
+ // --- In : none
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : stops the engines thread (first
+ // OnThreadDestruction() will be called)
+
+ void PostCommand(COXEngineCmd* pCmd, BOOL bASAP = FALSE);
+ // --- In : pCmd : the command that will be added to the engines queue
+ // bASAP : the command will be executed as soon as possible
+ // when this flag is used the command will be added to
+ // the head instead of the tail of the queue
+ // --- Out : none
+ // --- Returns : none
+ // --- Effect : the command is added to the engines queue and the engine
+ // thread is notified by an event
+
+protected:
+/////////////////////////////////////////////////////////////////////////////
+// --- this function must be overloaded in your derived engine
+ virtual void OnExecuteCmd(COXEngineCmd* pCmd) = 0;
+ // --- In: pCmd: the next command in the queue that should be executed
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Up to YOU !!!!!
+
+ // these two function can be overloaded if some specific initialisation and
+ // uninitialisation is needed
+ virtual BOOL OnThreadCreation();
+ virtual void OnThreadDestruction();
+
+ // these two function can be overloaded if some specific initialisation and
+ // uninitialisation is needed
+ virtual void OnThreadEvent();
+
+private:
+ void Run();
+ static UINT StartThread( LPVOID pParam );
+
+};
+
+
+#endif // __OXTHREADENGINE_H_
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXTimer.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXTimer.h
new file mode 100644
index 0000000..9870bfc
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXTimer.h
@@ -0,0 +1,216 @@
+// ==========================================================================
+// Class Specification : COXTimer
+// ==========================================================================
+
+// Header file : OXTimer.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class can be used to measure the elapsed time between two moments
+// (interval timer) or the trigger a notification when a specified amount
+// of time has elapsed (notification timer)
+
+// Remark:
+// All time is expressed in nanoseconds. But it is possible that such an
+// accuracy is not met (either by the hardware or by Win32).
+// An interval timer can be queried for its resolution
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXTIMER_H__
+#define __OXTIMER_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include
+
+
+class COXTimer;
+
+// ... Type definition of the callback function
+typedef void (CALLBACK OX_TIMER_NOTIFICATION) (COXTimer* pTimer);
+typedef OX_TIMER_NOTIFICATION* P_OX_TIMER_NOTIFICATION;
+
+// Some handy macros to convert between unit, milli, micro and nano
+// Nano seconds use a LONGLONG, unit, milli and micro use an int
+#define NANO_TO_MICRO(nano) (int)((LONGLONG)(nano) / 1000)
+#define NANO_TO_MILLI(nano) (int)((LONGLONG)(nano) / 1000000)
+#define NANO_TO_UNIT(nano) (int)((LONGLONG)(nano) / 1000000000)
+#define MICRO_TO_NANO(micro) ((LONGLONG)(micro) * 1000)
+#define MILLI_TO_NANO(milli) ((LONGLONG)(milli) * 1000000)
+#define UNIT_TO_NANO(unit) ((LONGLONG)(unit) * 1000000000)
+
+class OX_CLASS_DECL COXTimer : public CObject
+{
+DECLARE_DYNAMIC(COXTimer);
+
+// Data members -------------------------------------------------------------
+public:
+protected:
+ LARGE_INTEGER m_startIntervalCounter;
+ LARGE_INTEGER m_stopIntervalCounter;
+ static LARGE_INTEGER m_nIntervalTimerFrequency; // -1 = not available, 0 = unknown, other OK
+
+ DWORD m_nUserData;
+ P_OX_TIMER_NOTIFICATION m_pfNotification;
+ UINT m_nNonSynchronizedTimerNotifierID;
+ UINT m_nSynchronizedTimerNotifierID;
+ BOOL m_bPeriodic;
+ static CMap m_allTimers;
+ static CMap m_synchronizedTimers;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object
+ COXTimer();
+
+ // *** Interval Timer functions
+
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether it succeeded or not. This function may fail if the platform
+ // does not support a high accuracy interval timer
+ // --- Effect : Starts the interval timer
+ BOOL StartInterval();
+
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Stops the interval timer
+ void StopInterval();
+
+
+ // --- In :
+ // --- Out :
+ // --- Returns : The elapsed time of the counter in nanoseconds
+ // There are 1,000,000,000 nanoseconds in 1 second
+ // If the value is not strictly positive an error has occurred
+ // --- Effect : This function returns the elapsed time between the last start and stop
+ // of the counter
+ LONGLONG GetInterval() const;
+
+ // --- In :
+ // --- Out :
+ // --- Returns : The maximum accuracy of an interval timer specified in nanoseconds
+ // There are 1,000,000,000 nanoseconds in 1 second
+ // (return -1 in case the platform does not support a
+ // high accuracy interval timer)
+ // --- Effect :
+ static LONGLONG GetIntervalAccuracy();
+
+
+ // *** Notification Timer functions
+
+ // --- In : nDelay : The delay in nanoseconds that must elaps before the
+ // notificvation function is called
+ // pfTimerNotification : The notification function to call
+ // bPeriodic : Whether the function should be called periodically (TRUE)
+ // or just one (FALSE)
+ // bSynchronized : Whether the callback should be called from this thread (TRUE)
+ // or from a seperate dedicated thread (TRUE)
+ // Using a seperate thread will produce more superieur results
+ // nAccuracy : The minimum accuracy in nanoseconds. Bu default this is 1%
+ // of the specified delay with a maximum of 1 second
+ // --- Out :
+ // --- Returns : Whether it succeeded or not.
+ // --- Effect : Starts the timer notifier
+ // Using this function with a very small delay time (< 10 ms) might
+ // use so much CPU time that your computers seems to hang
+ BOOL StartNotifier(LONGLONG nDelay, P_OX_TIMER_NOTIFICATION pfTimerNotification,
+ BOOL bPeriodic = FALSE, BOOL bSynchronized = FALSE, LONGLONG nAccuracy = -1);
+
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Stops the timer notifier
+ void StopNotifier();
+
+
+ // --- In : nUserData : The user data to associate with this timer
+ // --- Out :
+ // --- Returns :
+ // --- Effect :
+ void SetUserData(DWORD nUserData = 0);
+
+
+ // --- In :
+ // --- Out :
+ // --- Returns : The user data associated with this timer
+ // --- Effect :
+ DWORD GetUserData() const;
+
+
+#ifdef _DEBUG
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+ virtual void AssertValid() const;
+
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+ // Note The Dump function does not print a newline character
+ // at the end of its output.
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+ virtual ~COXTimer();
+
+protected:
+ BOOL StartNonSynchronizedNotifier(int nMilliDelay, P_OX_TIMER_NOTIFICATION pfTimerNotification,
+ BOOL bPeriodic, int nMilliAccuracy);
+ static void CALLBACK NonSynchronizedNotificationCallback(UINT uTimerID, UINT uMsg,
+ DWORD dwUser, DWORD dw1, DWORD dw2);
+ void OnNonSynchronizedNotification();
+ void StopNonSynchronizedNotifier();
+
+ BOOL StartSynchronizedNotifier(int nMilliDelay, P_OX_TIMER_NOTIFICATION pfTimerNotification,
+ BOOL bPeriodic, int nMilliAccuracy);
+ static void CALLBACK SynchronizedNotificationCallback(HWND hWnd, UINT uMsg,
+ UINT nTimerID, DWORD nTime);
+ void OnSynchronizedNotification();
+ void StopSynchronizedNotifier();
+
+private:
+
+};
+
+#endif // __OXTIMER_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.h
new file mode 100644
index 0000000..4f1e6b2
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.h
@@ -0,0 +1,142 @@
+// ==========================================================================
+// Class Specification : COXVariant
+// ==========================================================================
+
+// Header file : OXVariant.h
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from COleVariant
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class is an extension on COleVariant
+// It supports the serialization of byte arrays (VT_UI1 | VT_ARRAY)
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXVARIANT_H__
+#define __OXVARIANT_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXVariant : public COleVariant
+{
+// Data members -------------------------------------------------------------
+public:
+protected:
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+
+ // Constructors
+ COXVariant();
+
+ COXVariant(const VARIANT& varSrc);
+ COXVariant(LPCVARIANT pSrc);
+ COXVariant(const COleVariant& varSrc);
+ COXVariant(const COXVariant& varSrc);
+
+ COXVariant(LPCTSTR lpszSrc);
+ COXVariant(CString& strSrc);
+
+ COXVariant(BYTE nSrc);
+ COXVariant(short nSrc, VARTYPE vtSrc = VT_I2);
+ COXVariant(long lSrc, VARTYPE vtSrc = VT_I4);
+ COXVariant(const COleCurrency& curSrc);
+ COXVariant(bool bSrc);
+
+ COXVariant(float fltSrc);
+ COXVariant(double dblSrc);
+ COXVariant(const COleDateTime& timeSrc);
+
+ COXVariant(const CByteArray& arrSrc);
+ COXVariant(const CLongBinary& lbSrc);
+
+ COXVariant(LPCTSTR lpszSrc, VARTYPE vtSrc); // Used by DAO classes
+
+ // Assignemnt operators
+ const COXVariant& operator=(const VARIANT& varSrc);
+ const COXVariant& operator=(LPCVARIANT pSrc);
+ const COXVariant& operator=(const COleVariant& varSrc);
+ const COXVariant& operator=(const COXVariant& varSrc);
+
+ const COXVariant& operator=(const LPCTSTR lpszSrc);
+ const COXVariant& operator=(const CString& strSrc);
+
+ const COXVariant& operator=(BYTE nSrc);
+ const COXVariant& operator=(short nSrc);
+ const COXVariant& operator=(long lSrc);
+ const COXVariant& operator=(const COleCurrency& curSrc);
+ const COXVariant& operator=(bool bSrc);
+
+ const COXVariant& operator=(float fltSrc);
+ const COXVariant& operator=(double dblSrc);
+ const COXVariant& operator=(const COleDateTime& dateSrc);
+
+ const COXVariant& operator=(const CByteArray& arrSrc);
+ const COXVariant& operator=(const CLongBinary& lbSrc);
+
+ static void CheckError(SCODE sc);
+ // --- In : The result an OLE call
+ // --- Out :
+ // --- Returns :
+ // --- Effect : If the result code indicates failure an COleException is thrown
+ // unless it indicates out of memory, then a CMemoryException is thrown
+ // When no failure is indicated, this function does nothing
+
+ virtual ~COXVariant();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+
+private:
+
+};
+
+// COXVariant diagnostics and serialization
+#ifdef _DEBUG
+OX_API_DECL CDumpContext& AFXAPI operator<<(CDumpContext& dc, COXVariant varSrc);
+#endif
+OX_API_DECL CArchive& AFXAPI operator<<(CArchive& ar, COXVariant varSrc);
+OX_API_DECL CArchive& AFXAPI operator>>(CArchive& ar, COXVariant& varSrc);
+
+// special collections functions for COXVariant
+OX_API_DECL void AFXAPI ConstructElements(COXVariant* pElements, int nCount);
+OX_API_DECL void AFXAPI DestructElements(COXVariant* pElements, int nCount);
+OX_API_DECL void AFXAPI CopyElements(COXVariant* pDest, const COXVariant* pSrc,
+ int nCount);
+OX_API_DECL void AFXAPI SerializeElements(CArchive& ar, COXVariant* pElements,
+ int nCount);
+OX_API_DECL void AFXAPI DumpElements(CDumpContext& dc, COXVariant* pElements,
+ int nCount);
+
+#include "OXVariant.inl"
+
+#endif // __OXVARIANT_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.inl b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.inl
new file mode 100644
index 0000000..9f30e61
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVariant.inl
@@ -0,0 +1,235 @@
+// ==========================================================================
+// Inline Implementation : COXVariant
+// ==========================================================================
+
+// Source file : OXVariant.inl
+
+// Source : R.Mortelmans
+// Creation Date : 7th March 1996
+// Last Modification : 7th March 1996
+
+// //////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////
+// Definition of static members
+
+// Member functions ---------------------------------------------------------
+// public:
+inline COXVariant::COXVariant()
+ :
+ COleVariant()
+ {
+ }
+
+inline COXVariant::COXVariant(const VARIANT& varSrc)
+ :
+ COleVariant(varSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(LPCVARIANT pSrc)
+ :
+ COleVariant(pSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const COleVariant& varSrc)
+ :
+ COleVariant(varSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const COXVariant& varSrc)
+ :
+ COleVariant((COleVariant) varSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(LPCTSTR lpszSrc)
+ :
+ COleVariant(lpszSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(CString& strSrc)
+ :
+ COleVariant(strSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(BYTE nSrc)
+ :
+ COleVariant(nSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(short nSrc, VARTYPE vtSrc /* = VT_I2 */)
+ :
+ COleVariant(nSrc, vtSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(long lSrc, VARTYPE vtSrc /* = VT_I4 */)
+ :
+ COleVariant(lSrc, vtSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const COleCurrency& curSrc)
+ :
+ COleVariant(curSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(bool bSrc)
+ :
+ COleVariant((short)bSrc, VT_BOOL)
+ {
+ }
+
+inline COXVariant::COXVariant(float fltSrc)
+ :
+ COleVariant(fltSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(double dblSrc)
+ :
+ COleVariant(dblSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const COleDateTime& timeSrc)
+ :
+ COleVariant(timeSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const CByteArray& arrSrc)
+ :
+ COleVariant(arrSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(const CLongBinary& lbSrc)
+ :
+ COleVariant(lbSrc)
+ {
+ }
+
+inline COXVariant::COXVariant(LPCTSTR lpszSrc, VARTYPE vtSrc)
+ :
+ COleVariant(lpszSrc, vtSrc)
+ {
+ }
+
+inline const COXVariant& COXVariant::operator=(const VARIANT& varSrc)
+ {
+ COleVariant::operator=(varSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(LPCVARIANT pSrc)
+ {
+ COleVariant::operator=(pSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const COXVariant& varSrc)
+ {
+ COleVariant::operator=(varSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const COleVariant& varSrc)
+ {
+ COleVariant::operator=(varSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const LPCTSTR lpszSrc)
+ {
+ COleVariant::operator=(lpszSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const CString& strSrc)
+ {
+ COleVariant::operator=(strSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(BYTE nSrc)
+ {
+ COleVariant::operator=(nSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(short nSrc)
+ {
+ COleVariant::operator=(nSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(long lSrc)
+ {
+ COleVariant::operator=(lSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const COleCurrency& curSrc)
+ {
+ COleVariant::operator=(curSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(bool bSrc)
+ {
+ vt = VT_BOOL;
+
+ if (!bSrc)
+ V_BOOL(this) = AFX_OLE_FALSE;
+ else
+ V_BOOL(this) = AFX_OLE_TRUE;
+
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(float fltSrc)
+ {
+ COleVariant::operator=(fltSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(double dblSrc)
+ {
+ COleVariant::operator=(dblSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const COleDateTime& dateSrc)
+ {
+ COleVariant::operator=(dateSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const CByteArray& arrSrc)
+ {
+ COleVariant::operator=(arrSrc);
+ return *this;
+ }
+
+inline const COXVariant& COXVariant::operator=(const CLongBinary& lbSrc)
+ {
+ COleVariant::operator=(lbSrc);
+ return *this;
+ }
+
+inline COXVariant::~COXVariant()
+ {
+ }
+
+// protected:
+// private:
+
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVerinfo.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVerinfo.h
new file mode 100644
index 0000000..1167efe
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXVerinfo.h
@@ -0,0 +1,150 @@
+// ==========================================================================
+// Class Specification : COXVersionInfo
+// ==========================================================================
+
+// Header file : OXVerinfo.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class can be used to retrieve the version information
+// from a file 5EXE, DLL, etc)
+
+// Remark:
+// ***
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __VERINFO_H__
+#define __VERINFO_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXVersionInfo : public CObject
+{
+DECLARE_DYNAMIC(COXVersionInfo)
+
+// Data members -------------------------------------------------------------
+public:
+ DWORD m_dwSignature;
+ DWORD m_dwStrucVersion;
+ DWORD m_dwFileVersionMS;
+ DWORD m_dwFileVersionLS;
+ DWORD m_dwProductVersionMS;
+ DWORD m_dwProductVersionLS;
+ DWORD m_dwFileFlagsMask;
+ DWORD m_dwFileFlags;
+ DWORD m_dwFileOS;
+ DWORD m_dwFileType;
+ DWORD m_dwFileSubtype;
+ DWORD m_dwFileDateMS;
+ DWORD m_dwFileDateLS;
+
+ DWORD m_dwLanguageCountryID;
+ CString m_sLanguageCountry;
+
+ CString m_sComments;
+ CString m_sCompanyName;
+ CString m_sFileDescription;
+ CString m_sFileVersion;
+ CString m_sInternalName;
+ CString m_sLegalCopyright;
+ CString m_sLegalTrademarks;
+ CString m_sOriginalFilename;
+ CString m_sPrivateBuild;
+ CString m_sProductName;
+ CString m_sProductVersion;
+ CString m_sSpecialBuild;
+
+protected:
+ BOOL m_bValid;
+
+ static const DWORD m_dwFixedFileInfoSignature;
+ static const DWORD m_dwAmericanEnglishTranslation;
+ static LPCTSTR m_pszTranslation;
+ static LPCTSTR m_pszFileInfo;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXVersionInfo();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ BOOL ReadInfo(LPCTSTR pszPathName);
+ // --- In : pszPathName : The full path of the file of which the version info is requested
+ // --- Out :
+ // --- Returns : Whether version info was found
+ // --- Effect : Extracts the version info for the file
+
+ BOOL ContainsValidInfo();
+ // --- In :
+ // --- Out :
+ // --- Returns : Whether this version info contains valid info
+ // --- Effect :
+
+ CString GetOSName();
+ // --- In :
+ // --- Out :
+ // --- Returns : A text specifying the Operating System
+ // --- Effect :
+
+ void Empty();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Clears the object
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+ virtual ~COXVersionInfo();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+
+private:
+
+// Message handlers ---------------------------------------------------------
+
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.h
new file mode 100644
index 0000000..22ddbdb
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.h
@@ -0,0 +1,153 @@
+// =============================================================================
+// Class Specification : COXWebView
+// =============================================================================
+//
+// Header file : OXWebView.h
+//
+// /////////////////////////////////////////////////////////////////////////////
+//
+// Properties:
+//
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+// YES Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// YES Has a message map
+// NO Needs a resource (template)
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// Desciption :
+// This class provides a simple to use html viewer by leveraging
+// Microsoft's Internet Explorer web control.
+//
+// Remark:
+//
+// Prerequisites (necessary conditions):
+// The user must have Microsoft Internet Explorer v3.x (or higher)
+// installed on his machine in order for this class to function.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXWEBVIEW_H__
+#define __OXWEBVIEW_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+#include
+#include "OXWebCtrl.h"
+
+
+class OX_CLASS_DECL COXWebView : public CView
+{
+// Data members -------------------------------------------------------------
+public:
+protected:
+private:
+ static CFont* m_pfontToolbarURL;
+ static int m_nNumInstantiated;
+
+ CComboBox m_cbxToolbarURL;
+ COXWebCtrl m_WebCtrl;
+ CToolBar m_Toolbar;
+ CToolTipCtrl m_Tooltips;
+
+ BOOL m_bCanGoBack;
+ BOOL m_bCanGoForward;
+ BOOL m_bCanRefresh;
+
+// Member functions ---------------------------------------------------------
+public:
+ virtual ~COXWebView();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+ COXWebCtrl& GetWebControl()
+ { return m_WebCtrl; }
+ // --- In :
+ // --- Out :
+ // --- Returns : A reference to the web control embedded within the view.
+ // --- Effect : This method allows the user to get at the web control
+ // if access is needed.
+
+ CToolBar& GetToolbar()
+ { return m_Toolbar; }
+ // --- In :
+ // --- Out :
+ // --- Returns : A reference to the toolbar contained within the view.
+ // --- Effect : This method allows the user to get at the toolbar of
+ // the web view.
+
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(COXWebView)
+ public:
+ virtual void OnDraw(CDC* pDC); // overridden to draw this view
+ protected:
+ virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
+ virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
+ virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
+ //}}AFX_VIRTUAL
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+ DECLARE_DYNCREATE(COXWebView)
+ enum { IDC_WEB_CTRL = 100, IDC_TOOLBAR_URL = 101 };
+
+ COXWebView(); // create from serialization only
+ virtual void BeforeNavigate(LPCTSTR pcszURL, long lFlags, LPCTSTR pcszTargetFrameName, VARIANT* PostData, LPCTSTR pcszHeaders, VARIANT_BOOL* pbCancel);
+ virtual void NavigateComplete(LPCTSTR pcszURL);
+ virtual void StatusTextChange(LPCTSTR pcszText);
+ virtual void Quit(VARIANT_BOOL* pbCancel);
+ virtual void DownloadBegin();
+ virtual void NewWindow(LPCTSTR pcszURL, long lFlags, LPCTSTR pcszTargetFrameName, VARIANT* PostData, LPCTSTR pcszHeaders, VARIANT_BOOL* pbCancel);
+ virtual void ProgressChange(long lProgress, long lProgressMax);
+ virtual void DownloadComplete();
+ virtual void CommandStateChange(long lCmdID, BOOL bEnabled);
+ virtual void PropertyChange(LPCTSTR pcszProperty);
+ virtual void TitleChange(LPCTSTR pcszTitle);
+ virtual void FrameBeforeNavigate(LPCTSTR pcszURL, long lFlags, LPCTSTR pcszTargetFrameName, VARIANT* PostData, LPCTSTR pcszHeaders, VARIANT_BOOL* pbCancel);
+ virtual void FrameNavigateComplete(LPCTSTR pcszURL);
+ virtual void FrameNewWindow(LPCTSTR pcszURL, long lFlags, LPCTSTR pcszTargetFrameName, VARIANT* PostData, LPCTSTR pcszHeaders, VARIANT_BOOL* pbCancel);
+
+ //{{AFX_MSG(COXWebView)
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnWebviewBack();
+ afx_msg void OnWebviewForward();
+ afx_msg void OnUpdateWebviewBack(CCmdUI* pCmdUI);
+ afx_msg void OnUpdateWebviewForward(CCmdUI* pCmdUI);
+ afx_msg void OnWebviewHome();
+ afx_msg void OnWebviewSearch();
+ afx_msg void OnUpdateWebviewStop(CCmdUI* pCmdUI);
+ afx_msg void OnWebviewStop();
+ afx_msg void OnUpdateFilePrintPreview(CCmdUI* pCmdUI);
+ afx_msg void OnFilePrint();
+ afx_msg void OnUpdateWebviewRefresh(CCmdUI* pCmdUI);
+ afx_msg void OnWebviewRefresh();
+ //}}AFX_MSG
+ afx_msg void OnToolbarURLChange();
+ afx_msg BOOL OnTooltipNeedText(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
+ DECLARE_MESSAGE_MAP()
+ DECLARE_EVENTSINK_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // __OXWEBVIEW_H__
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.rc b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.rc
new file mode 100644
index 0000000..d0dfe61
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/OXWebView.rc
@@ -0,0 +1,117 @@
+//Microsoft Developer Studio generated resource script.
+//
+#ifndef _OXWEBVIEW_RC__
+#define _OXWEBVIEW_RC__
+#include "OXMainRes.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
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_OX_WEBVIEW_BAR TOOLBAR DISCARDABLE 16, 15
+BEGIN
+ BUTTON ID_OX_WEBVIEW_BACK
+ BUTTON ID_OX_WEBVIEW_FORWARD
+ BUTTON ID_OX_WEBVIEW_STOP
+ BUTTON ID_OX_WEBVIEW_REFRESH
+ BUTTON ID_OX_WEBVIEW_HOME
+ BUTTON ID_OX_WEBVIEW_SEARCH
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_OX_WEBVIEW_BAR BITMAP DISCARDABLE "res\\OXWebBar.bmp"
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Dutch (Belgium) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB)
+#ifdef _WIN32
+LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resrc1.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
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_OX_WEBVIEW_BACK "Navigates to previous page\nBack"
+ ID_OX_WEBVIEW_STOP "Stops downloading the current page\nStop"
+ ID_OX_WEBVIEW_HOME "Navigates to your start page\nHome"
+ ID_OX_WEBVIEW_SEARCH "Navigates to your search page\nSearch"
+ ID_OX_WEBVIEW_FORWARD "Navigates to next page\nForward"
+ ID_OX_WEBVIEW_REFRESH "Refreshes the current page\nRefresh"
+END
+
+#endif // Dutch (Belgium) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
+#endif //_OXWEBVIEW_RC__
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/PROGRESS.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/PROGRESS.h
new file mode 100644
index 0000000..ba9445b
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/PROGRESS.h
@@ -0,0 +1,122 @@
+// ==========================================================================
+// Class Specification : COXDiffProgress
+// ==========================================================================
+
+// Header file : progress.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class encapsulates a progress bar that will be used
+// when calculating the binary differences
+// You can derive from this class and use and own implementation
+
+// Remark:
+// ***
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __PROGRESS_H__
+#define __PROGRESS_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+class OX_CLASS_DECL COXDiffProgress : public CObject
+{
+DECLARE_DYNAMIC(COXDiffProgress)
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ LONG m_MinVal;
+ LONG m_MaxVal;
+ LONG m_CurPos;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+ COXDiffProgress();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+
+ virtual void Init(LONG minVal, LONG maxVal, LPCTSTR pszMessage);
+ // --- In : minVal : Minimum value
+ // maxVal : Maximum value
+ // pszMessage : Message text to show
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Initializes the progress bar
+
+ virtual BOOL Adjust(LONG curVal);
+ // --- In : curVal : The new current value
+ // representing the progress
+ // --- Out :
+ // --- Returns : Whether the action may continue (TRUE)
+ // returning FALSE will abort the action in progress
+ // --- Effect : Adjust the progress bar
+
+ virtual void Abort(LPCTSTR pszMessage);
+ // --- In : pszMessage : The abort message
+ // --- Out :
+ // --- Returns :
+ // --- Effect : This function shows a message to the user and
+ // aborts the program
+ // This function should never return
+
+ virtual void Close();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Closes the progress bar
+
+#ifdef _DEBUG
+ virtual void Dump(CDumpContext&) const;
+ virtual void AssertValid() const;
+#endif //_DEBUG
+
+ virtual ~COXDiffProgress();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+protected:
+
+private:
+
+};
+
+#endif // __PROGRESS_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/UTB64Bit.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/UTB64Bit.h
new file mode 100644
index 0000000..b1ae65c
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/UTB64Bit.h
@@ -0,0 +1,43 @@
+
+
+#if _MSC_VER < 1400
+
+#ifndef GetWindowLongPtr
+#define GetWindowLongPtr GetWindowLong
+#endif
+
+#ifndef SetWindowLongPtr
+#define SetWindowLongPtr SetWindowLong
+#endif
+
+#ifndef GetClassLongPtr
+#define GetClassLongPtr GetClassLong
+#endif
+
+#ifndef SetClassLongPtr
+#define SetClassLongPtr SetClassLong
+#endif
+
+#ifndef ULongToPtr
+#define ULongToPtr(x) x
+#endif
+
+#ifndef LongToPtr
+#define LongToPtr(x) x
+#endif
+
+#ifndef PtrToUint
+#define PtrToUint(x) x
+#endif
+
+#ifndef PtrToInt
+#define PtrToInt(x) x
+#endif
+
+typedef DWORD DWORD_PTR;
+typedef LONG LONG_PTR;
+typedef ULONG ULONG_PTR;
+
+// Frustratingly, INT_PTR is an int in VC2005, and a long in VC6, so we can't define it here, the code needs to just handle it elsewhere
+
+#endif
\ No newline at end of file
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMAINFRM.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMAINFRM.h
new file mode 100644
index 0000000..cd930ae
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMAINFRM.h
@@ -0,0 +1,151 @@
+// ==========================================================================
+// Class Specification : COXMainFrame
+// ==========================================================================
+
+// Header file : xmainfrm.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CMDIFrameWnd
+
+// YES Is a Cwnd.
+// YES Two stage creation (constructor & Create())
+// YES Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This is a base class that is used to provide a basic layer
+// for all MainFrames that we want to have a bitmap and/or color shown as
+// background. Palette handling is provided. It has a subclass for the MDICLIENT.
+// There is also some functionality to save and restore its position on
+// on the screen
+
+// Remark:
+// ***
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+#ifndef __X_MAINFRAME_H__
+#define __X_MAINFRAME_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "xmdiclt.h"
+
+// User message for sending palette changes to this MDI Childs
+#define WM_DOREALIZE (WM_USER + 105)
+
+class OX_CLASS_DECL COXMainFrame : public CMDIFrameWnd
+{
+DECLARE_DYNAMIC(COXMainFrame)
+
+// Data members -------------------------------------------------------------
+public:
+ WINDOWPLACEMENT* m_pWindowPlacement;
+ // --- The initial window placement.
+ // This is used to initially show the window
+ // The last used placement is persistently saved, and used the next time
+ // the window is created
+
+protected:
+ COXMDIClient m_XMDIClient;
+
+// Member functions ---------------------------------------------------------
+public:
+ COXMainFrame();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ virtual BOOL CreateClient(LPCREATESTRUCT lpCreateStruct, CMenu* pWindowMenu );
+ // --- In : lpCreateStruct : A long pointer to a CREATESTRUCT structure.
+ // pWindowMenu : A pointer to the Window pop-up menu.
+ // --- Out :
+ // --- Returns : Nonzero if successful; otherwise 0.
+ // --- Effect : Creates the MDI client window that manages the CMDIChildWnd objects.
+ // This member function should be called if you override the
+ // OnCreate member function directly.
+
+ void InitialShowWindow(WINDOWPLACEMENT& windowPlacement, UINT nCmdShow);
+ // --- In : windowPlacement : The placement of the mainframe
+ // that must be used the show the window initialy
+ // nCmdShow :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Show the window in the correct state
+
+ BOOL SetPaletteState(BOOL bBackGround = TRUE);
+ // --- In : bBackGround : whether the DIB on the MDI CLIENT is treated as
+ // a background image or foreground for palette selecting
+ // --- Out :
+ // --- Returns : successful or not
+ // --- Effect : Set this parameter always BEFORE you set a new Background
+
+ BOOL GetPaletteState();
+ // --- In :
+ // --- Out :
+ // --- Returns : whether the DIB on the MDI CLIENT is treated as
+ // a background or foreground image for palette selecting
+ // --- Effect :
+
+ BOOL SetWallPaper(COLORREF rgbColor = RGB(192, 192, 192),
+ EWallOrg eWallOrganisation = WP_Center , COXDIB* pDib = NULL );
+ // --- In : rgbColor : The background color of te MDICLIENT
+ // eWallOrganisation : the organisation of the bitmap on the MDI CLIENT
+ // pDib : the Device Independant Bitmap to be painted on the MDI CLIENT
+ // --- Out :
+ // --- Returns : Succeeded or not
+ // --- Effect : Paints a DIB with a special organisation and back color on the
+ // Client area of the MDI Client of this mainframe
+
+ virtual ~COXMainFrame();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+
+// Message handlers ---------------------------------------------------------
+ //{{AFX_MSG(COXMainFrame)
+ afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
+ afx_msg BOOL OnQueryNewPalette();
+ afx_msg void OnClose();
+ afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
+ //}}AFX_MSG
+
+ DECLARE_MESSAGE_MAP()
+
+private:
+
+};
+
+#endif
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMDICLT.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMDICLT.h
new file mode 100644
index 0000000..ea99ff3
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/XMDICLT.h
@@ -0,0 +1,146 @@
+// ==========================================================================
+// Class Specification : COXMDIClient
+// ==========================================================================
+
+// Header file : xmdiclt.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from CWnd
+
+// YES Is a Cwnd.
+// YES Two stage creation (constructor & Create())
+// YES Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// This class implements a MDIClient area. This is the window in the client area
+// of the MDiFrameWindow and which manages all the mdichild framewindows
+// This implementation takes care of painting a bitmap on its paint DC
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __XMDICLT_H__
+#define __XMDICLT_H__
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+#include "oxdib.h" // Encapsulation of a Device independant bitmap
+#include "screen.h" // Enumeration of possible screen organisations
+
+
+// User message for sending palette changes to this MDI CLIENT
+#define WM_DOMDICLTREALIZE (WM_USER + 104)
+
+class OX_CLASS_DECL COXMDIClient : public CWnd
+{
+// Data members -------------------------------------------------------------
+public:
+protected:
+ COXDIB m_bmpBackGround;
+ CPalette* m_pPictPalette;
+ CBitmap* m_pTotalNewBitmap;
+ COLORREF m_rgbBkColor;
+ EWallOrg m_eWallPaperOrganisation;
+
+ CSize m_sizeClient;
+ CSize m_DibSize;
+
+ HBITMAP m_hOldDestBitmap;
+ HBITMAP m_hOldSrcBitmap;
+ CDC m_MemDCSrc;
+ CDC m_MemDCDest;
+
+ BOOL m_bFirstCreation;
+ BOOL m_bBackGround;
+ BOOL m_bWin4;
+
+ static WNDPROC pfnSuper;
+
+// Member functions ---------------------------------------------------------
+public:
+ COXMDIClient();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Contructor of object
+ // It will initialize the internal state
+
+ virtual ~COXMDIClient();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of object
+
+ BOOL SetPaletteState(BOOL bBackGround = TRUE, EPalUpdate ePalUpdate = PU_IntelUpdate);
+ // --- In : bBackGround : whether the DIB on the MDI CLIENT is treated as
+ // a background image or foreground for palette selecting
+ // ePalUpdate : Specifying PU_NoUpdate causes the palette not to be realized now
+ // Specifying PU_IntelUpdate causes the palette to be realized intelligently
+ // Specifying PU_ForceUpdate causes the palette to be realized now
+ // --- Out :
+ // --- Returns : successful or not
+ // --- Effect : Set this parameter always BEFORE you set a new Background
+
+ BOOL GetPaletteState();
+ // --- In :
+ // --- Out :
+ // --- Returns : whether the DIB on the MDI CLIENT is treated as
+ // a background or foreground image for palette selecting
+ // --- Effect :
+
+ BOOL SetNewBackGround(COLORREF rgbColor = GetSysColor(COLOR_APPWORKSPACE),
+ EWallOrg eWallOrganisation = WP_Center , COXDIB* pDib = NULL );
+ // --- In : rgbColor : The background color of te MDICLIENT
+ // eWallOrganisation : the organisation of the bitmap on the MDI CLIENT
+ // pDib : the Device Independant Bitmap to be painted on the MDI CLIENT
+ // --- Out :
+ // --- Returns : Succeeded or not
+ // --- Effect : Paints a DIB with a special organisation and back color on the
+ // client area of this MDI client window
+
+ virtual WNDPROC* GetSuperWndProcAddr();
+ // --- In :
+ // --- Out :
+ // --- Returns : The address in which to store the default WndProc for this class.
+ // --- Effect : Needed when we subclass a Windows object
+
+
+protected:
+ BOOL PrepareMemDC(int nWidth, int nHeight);
+
+// Message handlers ---------------------------------------------------------
+ // Generated message map functions
+ //{{AFX_MSG(COXMDIClient)
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ //}}AFX_MSG
+
+ afx_msg LRESULT OnDoMDICltRealize(WPARAM wParam, LPARAM lParam); // user message
+ DECLARE_MESSAGE_MAP()
+};
+
+#endif
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/oxmdisp.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/oxmdisp.h
new file mode 100644
index 0000000..9f082f1
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/include/oxmdisp.h
@@ -0,0 +1,1734 @@
+// ==========================================================================
+// Class Specification : MAPI Framework
+// COXMSession;
+// COXMInfoStores;
+// COXMInfoStore;
+// COXMFolders;
+// COXMFolder;
+// COXMMessages;
+// COXMMessage;
+// COXMFields;
+// COXMField;
+// COXMRecipients;
+// COXMRecipient;
+// COXMAttachments;
+// COXMAttachment;
+// COXMAddressEntry;
+
+// ==========================================================================
+
+// Header file : oxmdisp.h
+
+// This software along with its related components, documentation and files ("The Libraries")
+// is © 1994-2007 The Code Project (1612916 Ontario Limited) and use of The Libraries is
+// governed by a software license agreement ("Agreement"). Copies of the Agreement are
+// available at The Code Project (www.codeproject.com), as part of the package you downloaded
+// to obtain this file, or directly from our office. For a copy of the license governing
+// this software, you may contact us at legalaffairs@codeproject.com, or by calling 416-849-8900.
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// NO Derived from CObject
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+// These classes encapsulate the OLE Messaging client interface which was originally
+// designed to develop powerful Visual Basic Messaging applications.
+// The OLE Messaging objects use variants as input and output parameters.
+// This is a good solution for Visual Basic, because Visual Basic can automatically
+// cast variables. In C++ you have to cast these parameters manually to the correct
+// variable types.
+// The classes in this framework do this type conversion for you.
+
+// Remark:
+// For a full documentation on these classes we refer to the Microsoft SDK documentation:
+// SDK
+// Win32 SDK
+// Win32 Messaging API (MAPI)
+// OLE Messaging Library
+
+// Prerequisites (necessary conditions):
+// ***
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXMDISP_H__
+#define __OXMDISP_H__
+
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "OXDllExt.h"
+
+
+// Predeclarations
+class COXMSession;
+class COXMInfoStores;
+class COXMInfoStore;
+class COXMFolders;
+class COXMFolder;
+class COXMMessages;
+class COXMMessage;
+class COXMFields;
+class COXMField;
+class COXMRecipients;
+class COXMRecipient;
+class COXMAttachments;
+class COXMAttachment;
+class COXMAddressEntry;
+
+enum EOXMClass
+{
+ oxmAddressEntry = 8,
+ oxmAttachment = 5,
+ oxmAttachments = 21,
+ oxmField = 6,
+ oxmFields = 22,
+ oxmFolder = 2,
+ oxmFolders = 18,
+ oxmInfoStore = 1,
+ oxmInfoStores = 17,
+ oxmMsg = 3,
+ oxmMessages = 19,
+ oxmRecipient = 4,
+ oxmRecipients = 20,
+ oxmSession = 0
+};
+
+enum EOXMDisplayType
+{
+ oxmdtMailUser = 0,
+ oxmdtDistList = 1,
+ oxmdtForum = 2,
+ oxmdtAgent = 3,
+ oxmdtOrganisation = 4,
+ oxmdtPrivateDistList = 5,
+ oxmdtRemoteMailUser = 6
+};
+
+enum EOXMRecipientType
+{
+ oxmrtTo = 1,
+ oxmrtCc = 2,
+ oxmrtBcc = 3
+};
+
+enum EOXMAttachmentType
+{
+ oxmatFileData = 1,
+ oxmatFileLink = 2,
+ oxmatOleObject = 3
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMSession wrapper class
+
+class OX_CLASS_DECL COXMSession : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMSession() {} // Calls COleDispatchDriver default constructor
+ COXMSession(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMSession(const COXMSession& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Session object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ LPUNKNOWN GetMapiobject();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: an IUnknown pointer to the real Extended MAPI Session (IMAPISession) object.
+ // --- Effect: none
+
+ void SetMapiobject(LPUNKNOWN pSession);
+ // --- In: pSession: IUnknown pointer of an Extended MAPI Session (IMAPISession) object
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Attaches an IUnknown pointer of an Extended MAPI Session (IMAPISession) object.
+
+ CString GetVersion();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the version number of the OLE Messaging Library as a string, for example, "1.00".
+ // --- Effect: none
+
+ CString GetOperatingSystem();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name and version number of the current operating system.
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the profile logged on to this session.
+ // --- Effect: none
+
+ COXMAddressEntry GetCurrentUser();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the active user as an AddressEntry object.
+ // --- Effect: none
+
+ COXMFolder GetInbox();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a Folder object representing the current user's default Inbox folder.
+ // --- Effect: none
+
+ COXMFolder GetOutbox();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a Folder object representing the current user's default Outbox folder.
+ // --- Effect: none
+
+ COXMInfoStores GetInfoStores();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: an InfoStores object representing a collection of available information stores. Each InfoStore object contains a root folder object.
+ // --- Effect: none
+
+ void Logon(CString sProfileName = _T(""), CString sProfilePassword = _T(""), BOOL bShowDialog = TRUE, BOOL bNewSession = FALSE, HWND hParentWindow = NULL);
+ // --- In: sProfileName: specifies the user's logon name. To prompt the user to enter a logon name, omit profileName and set showDialog to TRUE.
+ // sProfilePassword: specifies the user's logon password.
+ // bShowDialog: If TRUE, displays a logon dialog box.
+ // bNewSession: Determines whether the application opens a new MAPI session or uses the current shared MAPI session.
+ // hParentWindow: Specifies the parent window handle for the logon dialog box. A value of 0 (the default) specifies that any dialog box
+ // displayed is application modal.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: The Logon method logs on to the MAPI system.
+ // --- COleDispatchException: MAPI_E_LOGON_FAILURE if not successful
+
+ void Logoff();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: logs off from the MAPI system.
+
+ COXMInfoStore GetInfoStore(CString sStoreID);
+ // --- In: specifies the unique identifier of the store to retrieve
+ // --- Out: none
+ // --- Returns: if successful an InfoStore object that can be used to
+ // navigate through both public folders and the user's personal folders.
+ // If not successful: an COXMInfoStore object with an m_lpDispatch member
+ // set to NULL
+ // --- Effect: none
+
+ COXMFolder GetFolder(CString sFolderID, CString sStoreID = _T(""));
+ // --- In: sFolderId: specifies the unique identifier of the folder. When you provide an empty string, some providers return the root folder.
+ // sStoreID: specifies the unique identifier of the store. The default value is an empty string, which corresponds to the default store.
+ // --- Out: none
+ // --- Returns: if successful a Folder object from a MAPI information store.
+ // If not successful: an COXMInfoStore object with an m_lpDispatch member
+ // set to NULL
+ // --- Effect: none
+
+ COXMMessage GetMessage(CString sMessageID, CString sStoreID = _T(""));
+ // --- In: sMessageID:specifies the unique identifier of the message.
+ // sStoreID: specifies the unique identifier of the store. The default value is an empty string, which corresponds to the default store.
+ // --- Out: none
+ // --- Returns: if successful a Message object from a MAPI information store.
+ // If not successful: an COXMInfoStore object with an m_lpDispatch member
+ // set to NULL
+ // --- Effect: none
+
+ COXMAddressEntry GetAddressEntry(CString sEntryID);
+ // --- In: sEntryID: specifies the unique identifier of the address entry.
+ // --- Out: none
+ // --- Returns: On successful return, represents the AddressEntry object specified by entryID.
+ // --- Effect: none
+
+ COXMRecipients AddressBook(LPDISPATCH pRecipients = NULL,
+ CString sTitle = _T(""),
+ BOOL bOneAddress = FALSE,
+ BOOL bForceResolution = TRUE,
+ LONG nRecipLists = 0,
+ CString sTOLabel = _T(""),
+ CString sCCLabel = _T(""),
+ CString sBCCLabel = _T(""),
+ HWND hParentWindow = NULL);
+ // --- In: pRecipients: A Recipients collection object that provides the initial value for the recipient list boxes in the address book.
+ // sTitle: The title or caption of the address book dialog box.
+ // bOneAddress: Allows the user to enter or select only one address.
+ // bForceResolution: If TRUE, attempts to resolve all names before closing the address book. Prompts the user to resolve any ambiguous names.
+ // nRecipLists: The number of recipient list boxes to display in the address book dialog box:
+ // 0: no list boxes; 1: To; 2: To and CC; 3: TO, CC and BCC
+ // sTOLabel:The caption for the button associated with the first list box
+ // sCCLabel:The caption for the button associated with the second list box
+ // sBCCLabel:The caption for the button associated with the third list box
+ // hParentWindow:The parent window handle for the address book dialog box. A value of 0 (the default) specifies that any dialog box displayed is application modal.
+ // --- Out: none
+ // --- Returns: The selections are returned in a Recipients collection object.
+ // --- Effect: The AddressBook method displays the MAPI dialog box that allows the user to select entries from the address book.
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMInfoStores wrapper class
+
+class OX_CLASS_DECL COXMInfoStores : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMInfoStores() {} // Calls COleDispatchDriver default constructor
+ COXMInfoStores(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMInfoStores(const COXMInfoStores& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging InfoStores object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ LONG GetCount();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the number of InfoStore objects in the collection.
+ // --- Effect: none
+
+ COXMInfoStore GetItem(LONG nItem);
+ // --- In: nItem: the index
+ // --- Out: none
+ // --- Returns: a single item from this collection.
+ // --- Effect: none
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMInfoStore wrapper class
+
+class OX_CLASS_DECL COXMInfoStore : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMInfoStore() {} // Calls COleDispatchDriver default constructor
+ COXMInfoStore(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMInfoStore(const COXMInfoStore& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging InfoStore object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMInfoStores GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the collection this store belongs to
+ // --- Effect: none
+
+ LONG GetIndex();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the index number for the InfoStore object within the parent InfoStores collection.
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the InfoStore object as a string. Read-only. The string "Public Folders" is the name of the InfoStore object that contains the public folders.
+ // --- Effect: none
+
+ CString GetId();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique identifier of this InfoStore object as a string.
+ // --- Effect: none
+
+ CString GetProviderName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the InfoStore provider as a string.
+ // --- Effect: none
+
+ COXMFolder GetRootFolder();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a folder object representing the root of the IPM tree for this InfoStore object.
+ // --- Effect: none
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMFolder wrapper class
+
+class OX_CLASS_DECL COXMFolder : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMFolder() {} // Calls COleDispatchDriver default constructor
+ COXMFolder(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMFolder(const COXMFolder& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Folder object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ LPDISPATCH GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The Parent property returns the parent of the object.
+ // An Inbox, Outbox and Root folder return a Session Object
+ // Other Folders return a Folders collection
+ // --- Effect: none
+
+ LPUNKNOWN GetMapiobject();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: returns an IUnknown pointer to the real Extended MAPI Folder (IMAPIFolder) object.
+ // --- Effect:
+
+ void SetMapiobject(LPUNKNOWN pSession);
+ // --- In: pSession: an IUnknown pointer to the real Extended MAPI Folder (IMAPIFolder) object.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Attaches an IUnknown pointer of an Extended MAPI Folder (IMAPIFolder) object.
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the Folder object as a string.
+ // --- Effect: none
+
+ void SetName(CString sName);
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the Folder object as a string.
+ // --- Effect: none
+
+ CString GetId();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique identifier of this Folder object as a string.
+ // --- Effect: none
+
+ CString GetFolderID();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique identifier of this subfolder's parent folder as a string.
+ // --- Effect: none
+
+ CString GetStoreID();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the identifier of the Store object in which this Folder object resides.
+ // --- Effect: none
+
+ COXMFolders GetFolders();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a collection of subfolders within the parent folder.
+ // --- Effect: none
+
+ COXMMessages GetMessages();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a Messages collection object within the folder.
+ // --- Effect: none
+
+ COXMFields GetFields();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a single field (a Field object) or a collection of fields (a Fields collection object) of the Folder object.
+ // --- Effect: none
+
+ void Update(BOOL bMakePermanent = TRUE, BOOL bRrefreshObject = FALSE);
+ // --- In: bMakePermanent: TRUE indicates that the property cache is flushed and all changes are committed in the underlying store.
+ // FALSE indicates that the property cache is flushed and not committed to the store.
+ // bRrefreshObject: TRUE indicates that the property cache is reloaded from the values in the underlying store.
+ // FALSE indicates that the property cache is not reloaded.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Saves the folder in the MAPI system.
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMFolders wrapper class
+
+class OX_CLASS_DECL COXMFolders : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMFolders() {} // Calls COleDispatchDriver default constructor
+ COXMFolders(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMFolders(const COXMFolders& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Folders object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMFolder GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a Folder object
+ // --- Effect: none
+
+ COXMFolder GetFirst();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the first object in the Folders collection.
+ // Returns an object witch a m_lpDispatch member set to NULL if no first object exists.
+ // --- Effect: increments the internal item pointer
+
+ COXMFolder GetNext();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the first object in the Folders collection.
+ // Returns an object with a m_lpDispatch member set to NULL if no first object exists.
+ // --- Effect: increments the internal item pointer
+
+ COXMFolder GetLast();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the last object in the Folders collection.
+ // Returns an object with a m_lpDispatch member set to NULL if no last object exists.
+ // --- Effect: none
+
+ COXMFolder GetPrevious();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the first object in the Folders collection.
+ // Returns an object witch a m_lpDispatch member set to NULL if no first object exists.
+ // --- Effect: decrements the internal item pointer
+
+};
+/////////////////////////////////////////////////////////////////////////////
+// COXMMessages wrapper class
+
+class OX_CLASS_DECL COXMMessages : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMMessages() {} // Calls COleDispatchDriver default constructor
+ COXMMessages(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMMessages(const COXMMessages& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Messages object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMFolder GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object.
+ // --- Effect: none
+
+ COXMMessage Add(CString sSubject = _T(""), CString sText = _T(""), CString sType = _T(""), LONG nImportance=1);
+ // --- In: sSubject: The subject of the message.
+ // sText: The body text of the message.
+ // sType: The message class of the message. When ommited type is IPM.Note.
+ // nImportance: 0: Low priority; 1: Normal priority (default); 2: High priority
+ // --- Out: none
+ // --- Returns: a new created Message object
+ // --- Effect: creates and returns a new Message object in the Messages collection
+
+ void Delete(BOOL bSubFolders = TRUE);
+ // --- In: bSubFolders: if TRUE: deletes all subfolders too
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes all messages in the collection.
+
+ void Sort(LONG nSortOrder);
+ // --- In: nSortOrder: 0: No sort; 1: Ascending; 2: Descending
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sorts the messages in the collection according to the specified sort order
+
+ COXMMessage GetFirst(CString sFilter = _T(""));
+ // --- In: sFilter: Specifies the message class of the object, such as the default value, IPM.Note (if ommitted).
+ // Corresponds to the Type property of the Message object.
+ // --- Out: none
+ // --- Returns: the first Message object in the collection.
+ // --- Effect: increments the internal item pointer
+
+ COXMMessage GetNext();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The next object in the Messages collection. Nothing if no next object exists.
+ // --- Effect: increments the internal item pointer
+
+ COXMMessage GetLast(CString sFilter = _T(""));
+ // --- In: sFilter: Specifies the message class of the object, such as the default value, IPM.Note (if ommitted).
+ // Corresponds to the Type property of the Message object.
+ // --- Out: none
+ // --- Returns: the last Message object in the collection.
+ // --- Effect: remembers the filter
+
+ COXMMessage GetPrevious();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The previous object in the collection. Nothing if no previous object exists.
+ // --- Effect: decrements the internal item pointer
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMMessage wrapper class
+
+class OX_CLASS_DECL COXMMessage : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMMessage() {} // Calls COleDispatchDriver default constructor
+ COXMMessage(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMMessage(const COXMMessage& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Session object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMMessages GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The parent of the object which is the messages collection.
+ // --- Effect: none
+
+ LPUNKNOWN GetMapiobject();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: an IUnknown pointer to the real Extended MAPI Session (IMAPISession) object.
+ // --- Effect: none
+
+ void SetMapiobject(LPUNKNOWN pSession);
+ // --- In: pSession: IUnknown pointer of an Extended MAPI Session (IMAPISession) object
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Attaches an IUnknown pointer of an Extended MAPI Session (IMAPISession) object.
+
+ CString GetId();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique ID of the object as a string.
+ // --- Effect: none
+
+ CString GetFolderID();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique ID of the folder in which the message resides.
+ // --- Effect: none
+
+ CString GetStoreID();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The unique identifier for the information store that contains this message.
+ // --- Effect: none
+
+ CString GetType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the MAPI message class for the message.
+ // --- Effect: none
+
+ void SetType(CString sType);
+ // --- In: the MAPI message class for the message.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the MAPI message class for the message.
+
+ LONG GetSize();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The approximate size in bytes of the message.
+ // --- Effect: none
+
+ LONG GetImportance();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the importance of the message as one of mapiNormal (the default), mapiLow, or mapiHigh.
+ // --- Effect: none
+
+ void SetImportance(LONG);
+ // --- In: the importancy of the message.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the importance of the message as one of mapiNormal (the default), mapiLow, or mapiHigh.
+
+ CString GetSubject();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: Returns the subject of the message as a string.
+ // --- Effect: none
+
+ void SetSubject(CString);
+ // --- In: the subject of the message as a string.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the subject of the message as a string.
+
+ COXMAddressEntry GetSender();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the originator or original author of a message as an AddressEntry object.
+ // --- Effect: none
+
+ COleDateTime GetTimeSent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the date and time the message was sent as a vbDate variant data type.
+ // --- Effect: none
+
+ void SetTimeSent(COleDateTime);
+ // --- In: the date and time the message was sent
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the date and time the message was sent as a vbDate variant data type.
+
+ COleDateTime GetTimeReceived();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the date and time the message was received as a vbDate variant data type.
+ // --- Effect: none
+
+ void SetTimeReceived(COleDateTime);
+ // --- In: the date and time the message was received.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the date and time the message was received as a vbDate variant data type.
+
+ CString GetText();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the body text of the message as a string.
+ // --- Effect: none
+
+ void SetText(CString);
+ // --- In: the body text of the message.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the body text of the message as a string.
+
+ BOOL GetSent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if the message has been sent through the MAPI system.
+ // --- Effect: none
+
+ void SetSent(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags the message that it has been sent or not.
+
+ BOOL GetSubmitted();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE when the message has been submitted.
+ // --- Effect: none
+
+ void SetSubmitted(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags the message that has been submitted or not.
+
+ BOOL GetUnread();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if the message has not been read by the current user.
+ // --- Effect: none
+
+ void SetUnread(BOOL );
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags the message that has not been read by the current user, or not.
+
+ BOOL GetSigned();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if the message has been tagged with a digital signature.
+ // --- Effect: none
+
+ void SetSigned(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags the message that has been tagged with a digital signature, or not.
+
+ BOOL GetEncrypted();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if the message has been encrypted.
+ // --- Effect: none
+
+ void SetEncrypted(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags the message that has been encrypted, or not.
+
+ BOOL GetReadReceipt();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if a read-receipt notification message is requested.
+ // --- Effect: none
+
+ void SetReadReceipt(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags that a read-receipt notification message is requested, or not.
+
+ BOOL GetDeliveryReceipt();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if a delivery-receipt notification message is requested.
+ // --- Effect: none
+
+ void SetDeliveryReceipt(BOOL);
+ // --- In: TRUE or FALSE
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: flags that a delivery-receipt notification message is requested, or not.
+
+ CString GetConversationIndex();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the index to the conversation thread of the message.
+ // --- Effect: none
+
+ void SetConversationIndex(CString);
+ // --- In: index to the conversation thread of the message
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the index to the conversation thread of the message.
+
+ CString GetConversationTopic();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the conversation thread.
+ // --- Effect: none
+
+ void SetConversationTopic(CString);
+ // --- In: name of the conversation thread.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: specifies the name of the conversation thread.
+
+ COXMFields GetFields();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a single field (a Field object) or a collection of fields (a Fields collection object) of the Message object.
+ // --- Effect: none
+
+ COXMRecipients GetRecipients();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a single Recipient object or a Recipients collection object.
+ // --- Effect: none
+
+ COXMAttachments GetAttachments();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a single Attachment object or an Attachments collection.
+ // --- Effect: none
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the Message object.
+
+ void Update(BOOL bMakePermanent = TRUE, BOOL bRefreshObject = FALSE);
+ // --- In: bMakePermanent: TRUE indicates that the property cache is flushed and all changes are committed to the underlying store.
+ // FALSE indicates that the property cache is flushed and not committed to the store.
+ // bRefreshObject: TRUE indicates that the property cache is reloaded from the values in the underlying store.
+ // FALSE indicates that the property cache is not reloaded.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Saves the message in the MAPI system.
+
+ void Send(BOOL bSaveCopy = TRUE, BOOL bShowDialog = FALSE, HWND hParentWindow = NULL);
+ // --- In: bSaveCopy: Saves a copy of the Message in a user folder, such as the Sent Messages folder.
+ // bShowDialog: Displays a Send Message dialog box where the user can change the message contents or recipients.
+ // hParentWindow: The parent window handle for the Send Message dialog box.
+ // A value of NULL (the default) specifies that any dialog box displayed is application-modal.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sends the message to the recipients via the MAPI system.
+
+ void Options(HWND hParentWindow = NULL);
+ // --- In: hParentWindow: The parent window handle for the options dialog box.
+ // A value of NULL (the default) specifies an application-modal dialog box.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Displays a message options dialog box where the user can change the submission options for a message.
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMFields wrapper class
+
+class OX_CLASS_DECL COXMFields : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMFields() {} // Calls COleDispatchDriver default constructor
+ COXMFields(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMFields(const COXMFields& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Fields object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ LPDISPATCH GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The parent of the object (Message or Folder object).
+ // --- Effect: none
+
+ LONG GetCount();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: The number of Field objects in the collection.
+ // --- Effect: none
+
+ COXMField GetItem(COleVariant vItem, CString sPropSetID = _T(""));
+ // --- In: vItem: + short -> index within collection
+ // + LONG -> property tag value for the MAPI property to be retrieved
+ // + string -> Specifies the name of the user-defined property
+ // sPropSetID: Contains the unique identifier for the property set, represented as a string
+ // of hexadecimal characters. When propsetID is not supplied, the property set used for
+ // the access is the default property set value set by this collection's SetNamespace
+ // method, or the initial default property set value, PS_PUBLIC_STRINGS.
+ // --- Out: none
+ // --- Returns: a single item from a collection.
+ // --- Effect: none
+
+ void SetNamespace(CString sPropsetID);
+ // --- In: sPropsetID: Contains a unique identifier that identifies the property set,
+ // represented as a string of hexadecimal characters. The PropsetID
+ // identifies the property set to be used for subsequent property accesses
+ // using the Field object and Fields collection. An empty string resets
+ // the default to the property set PS_PUBLIC_STRINGS.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Selects the property set that is to be used for subsequent property
+ // accesses using the Add method and Item property.
+
+ COXMField Add(CString sName, COleVariant value, CString sPropsetID = _T(""));
+ // --- In: sName: the name of the new field object
+ // value: the value of the field. There are limited number of supported types:
+ // VT_NULL, VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BSTR,
+ // VT_BOOL, VT_UNKNOWN, VT_BLOB
+ // --- Out: none
+ // --- Return: The new added field object
+ // --- Effect: Creates a new Field object in the Fields collection.
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Deletes all user-defined fields of this collection object.
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMField wrapper class
+
+class OX_CLASS_DECL COXMField : public COleDispatchDriver
+{
+// Member Functions
+ public:
+ COXMField() {} // Calls COleDispatchDriver default constructor
+ COXMField(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMField(const COXMField& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Field object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMFields GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object which is the collection object.
+ // --- Effect: none
+
+ LONG GetIndex();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the index number of this Field object within the Fields collection.
+ // --- Effect: none
+
+ LONG GetType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the variant data type of the Field object.
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the field as a string.
+ // --- Effect: none
+
+ LONG GetId();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique ID of the object as a long integer.
+ // --- Effect: none
+
+ COleVariant GetValue();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the value of the Field object.
+ // --- Effect: none
+
+ void SetValue(COleVariant);
+ // --- In: value of the Field object.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets value of the Field object.
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the user-defined or optional Field object
+
+ void ReadFromFile(CString sPath);
+ // --- In: sPath: The full path and file name to read
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: loads the value of a string or binary field from the specified file
+
+ void WriteToFile(CString sPath);
+ // --- In: sPath: The full path and file name to read
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: saves the field value to a file in the file system
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMRecipients wrapper class
+
+class OX_CLASS_DECL COXMRecipients : public COleDispatchDriver
+{
+// member Functions
+public:
+ COXMRecipients() {} // Calls COleDispatchDriver default constructor
+ COXMRecipients(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMRecipients(const COXMRecipients& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Recipients object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMFolder GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object which is a COXMFolder object.
+ // --- Effect: none
+
+ COXMRecipient GetItem(LONG nIndex);
+ // --- In: nIndex: the index within the collection
+ // --- Out: none
+ // --- Returns: a single Recipient from the collection.
+ // --- Effect: none
+
+ LONG GetCount();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the number of Recipient objects in the collection.
+ // --- Effect: none
+
+ BOOL GetResolved();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: TRUE if all of the recipients in the collection are resolved.
+ // --- Effect: none
+
+ COXMRecipient Add(CString sName = _T(""), CString sAddress = _T(""), EOXMRecipientType eType = oxmrtTo, CString sEntryID = _T(""));
+ // --- In: sName: The display name of the recipient.
+ // sAddress: The address of the recipient.
+ // eType: oxmrtTo, oxmrtCc or oxmrtBcc
+ // sEntryID: The identifier of a valid AddressEntry object for this recipient.
+ // When present, the other parameters are not used. When not present,
+ // the method uses the name, address, and type parameters to determine the recipient.
+ // --- Out: none
+ // --- Returns: represents the new Recipient object added to the collection
+ // --- Effect: creates a new Recipient object in the Recipients collection
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes all Recipients in the collection
+
+ void Resolve(BOOL bShowDialog = TRUE);
+ // --- In: bShowDialog: if dialog should be shown or not
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: searches the Recipients collection to resolve all names
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMRecipient wrapper class
+
+class OX_CLASS_DECL COXMRecipient : public COleDispatchDriver
+{
+public:
+ COXMRecipient() {} // Calls COleDispatchDriver default constructor
+ COXMRecipient(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMRecipient(const COXMRecipient& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Recipient object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMRecipients GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object.
+ // --- Effect: none
+
+ LONG GetIndex();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the index number of this Recipient object within the Recipients collection.
+ // --- Effect: none
+
+ EOXMDisplayType GetDisplayType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: Identifies the recipient type. Enables special processing based on the type,
+ // such as displaying an icon associated with that type.
+ // oxmdtMailUser (0) Local user
+ // oxmdtDistList (1) Distribution list
+ // oxmdtForum (2) Public folder
+ // oxmdtAgent (3) Agent
+ // oxmdtOrganisation (4) Organization
+ // oxmdtPrivateDistList (5) Private distribution list
+ // oxmdtRemoteMailUser (6) Remote user
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of this Recipient object.
+ // --- Effect: none
+
+ void SetName(CString);
+ // --- In: the name of this Recipient object.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the name of this Recipient object.
+
+ EOXMRecipientType GetType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the type of the Recipient object
+ // oxmrtTo (1) The recipient is on the To: line
+ // oxmrtCc (2) The recipient is on the Cc: line.
+ // oxmrtBcc (3)The recipient is on the Bcc: line.
+ // --- Effect: none
+
+ void SetType(EOXMRecipientType);
+ // --- In: the type of the Recipient object
+ // oxmrtTo (1) The recipient is on the To: line
+ // oxmrtCc (2) The recipient is on the Cc: line.
+ // oxmrtBcc (3)The recipient is on the Bcc: line.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the type of the Recipient object
+
+ CString GetAddress();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the full address for this recipient.
+ // --- Effect: none
+
+ void SetAddress(CString);
+ // --- In: the full address for this recipient.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the full address for this recipient.
+
+ COXMAddressEntry GetAddressEntry();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the AddressEntry object for this recipient.
+ // --- Effect: none
+
+ void SetAddressEntry(LPDISPATCH);
+ // --- In: the AddressEntry object.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the AddressEntry object for this recipient.
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the Recipient object
+
+ void Resolve(BOOL bShowDialog = TRUE);
+ // --- In: bShowDialog: if dialog should be shown or not
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Resolves address information. When the Recipient object's Name property
+ // is supplied, looks up the corresponding address from the address book.
+ // When the Recipient object's Address property is supplied, resolves as a
+ // custom address.
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMAttachments wrapper class
+
+class OX_CLASS_DECL COXMAttachments : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMAttachments() {} // Calls COleDispatchDriver default constructor
+ COXMAttachments(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMAttachments(const COXMAttachments& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Attachments object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMMessage GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object.
+ // --- Effect: none
+
+ COXMAttachment GetItem(LONG nIndex);
+ // --- In: nIndex: the index within the collection
+ // --- Out: none
+ // --- Returns: a single item from a collection.
+ // --- Effect: none
+
+ LONG GetCount();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the number of Attachment objects in the collection.
+ // --- Effect: none
+
+ COXMAttachment Add(CString sName = _T(""), LONG nPosition = 0, EOXMAttachmentType eType = oxmatFileData, CString sSource = _T(""));
+ // --- In: sName: The display name of the attachment. To allow a user to click on the attachment that
+ // appears in the message and activate an associated application, supply the full filename,
+ // including the file extension. In case of an OleObject you have to specify the Class name
+ // ex: EXCEL.DOCUMENT
+ // nPosition: The position of the attachment within the body text of the message.
+ // eType: oxmatFileData, oxmatFileLink or oxmatOleObject
+ // sSource: depending of the value for type:
+ // FileData Specifies a full path and file name that contains the data for the attachment.
+ // For example, C:\DOCUMENT\BUDGET.XLS. The data is read into the attachment.
+ // FileLink Specifies a full path name in a universal naming convention (UNC) format,
+ // such as \\SALES\INFO\PRODUCTS\NEWS.DOC. The attachment is a link, so the Add
+ // method does not read the data.
+ // OleObject Specifies a full path and file name to a valid OLE docfile. For example,
+ // C:\DOCUMENT\BUDGET2.XLS. The data is read into the attachment.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: creates a new Attachment object in the Attachments collection
+
+ void Delete();
+ // --- In:none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the entire Attachments collection
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMAttachment wrapper class
+
+class OX_CLASS_DECL COXMAttachment : public COleDispatchDriver
+{
+// Member Functions
+public:
+ COXMAttachment() {} // Calls COleDispatchDriver default constructor
+ COXMAttachment(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ COXMAttachment(const COXMAttachment& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging Attachment object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMAttachments GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object.
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the display name of the Attachment object as a string (FileData or FileLink type attachments)
+ // returns the OLE class name for OleObject attachments (see GetType and SetType functions)
+ // --- Effect: none
+
+ void SetName(CString);
+ // --- In: the name of this Attachment object.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the display name of the Attachment object as a string
+
+ EOXMAttachmentType GetType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: describes the attachment type: oxmatFileData, oxmatFileLink or oxmatOleObject
+ // --- Effect: none
+
+ void SetType(EOXMAttachmentType);
+ // --- In: the type of the Attachment object:
+ // oxmatFileData
+ // oxmatFileLink
+ // oxmatOleObject
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the type of the Attachment object
+
+ LONG GetIndex();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the index number for the Attachment object within the Attachments collection.
+ // --- Effect: none
+
+ LONG GetPosition();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the position of the attachment within the body text of the message.
+ // --- Effect: none
+
+ void SetPosition(LONG);
+ // --- In: the position of the attachment.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the position of the attachment within the body text of the message.
+
+ CString GetSource();
+ // --- In: none
+ // --- Out: none
+ // --- Returns:the full path name of the attachment data file (For FileLink attachments).
+ // For OleObject attachments, returns the OLE class name for the attachment.
+ // --- Effect: none
+
+ void SetSource(CString);
+ // --- In: the source for this attachment
+ // --- Out: none
+ // --- Returns:none
+ // --- Effect: When using oxmatFileData or oxmatOleObject this value is set by the ReadFromFile
+ // or WriteToFile functions.
+
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the attachment.
+
+ void ReadFromFile(CString sPath);
+ // --- In: sPath: The full path and file name to read. For example, C:\DOCUMENT\BUDGET.XLS.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: loads the contents of an attachment from a file
+
+ void WriteToFile(CString sPath);
+ // --- In: sPath: The full path and file name for the saved attachment. For example, C:\DOCUMENT\BUDGET.XLS.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Saves the attachment to a file in the file system.
+ // Note that if the file already exists, this method overwrites it without warning.
+
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// COXMAddressEntry wrapper class
+
+class OX_CLASS_DECL COXMAddressEntry : public COleDispatchDriver
+{
+// Data Members
+public:
+ BOOL m_bCurrentSessionUser;
+// Member Functions
+public:
+ COXMAddressEntry() : m_bCurrentSessionUser(FALSE) {} // Calls COleDispatchDriver default constructor
+ COXMAddressEntry(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch), m_bCurrentSessionUser(FALSE) {}
+ COXMAddressEntry(const COXMAddressEntry& dispatchSrc) : COleDispatchDriver(dispatchSrc), m_bCurrentSessionUser(FALSE) {}
+ // --- In: pDispatch: the IDispatch pointer of the OLE messaging AddressEntry object
+ // dispatchSrc: the source object which will be copied
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: constructs this rapper object and attaches the real dispatch Interface with it
+ // The copy constructor version will increment the reference count of the IDispatch interface
+
+ CString GetApplication();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the name of the active application, which is the OLE Messaging Library, "OLE/Messaging."
+ // --- Effect: none
+
+ EOXMClass GetClass();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the OLE Messaging Library class type (see EOXMClass definition)
+ // --- Effect: none
+
+ COXMSession GetSession();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the top-level Session object associated with the specified OLE Messaging Library object
+ // --- Effect: none
+
+ COXMRecipient GetParent();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the parent of the object.
+ // m_lpDispatch member of returned object can be NULL (Current User)
+ // --- Effect: none
+
+ EOXMDisplayType GetDisplayType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: Identifies the type of the address entry. This property enables special
+ // processing based on the type, such as displaying an icon associated with that type.
+ // oxmdtMailUser (0) Local user
+ // oxmdtDistList (1) Distribution list
+ // oxmdtForum (2) Public folder
+ // oxmdtAgent (3) Agent
+ // oxmdtOrganisation (4) Organization
+ // oxmdtPrivateDistList (5) Private distribution list
+ // oxmdtRemoteMailUser (6) Remote user
+ // --- Effect: none
+
+ CString GetName();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the display name or alias of the AddressEntry object as a string.
+ // --- Effect: none
+
+ void SetName(CString);
+ // --- In: the display name or alias of the AddressEntry object
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: sets the display name or alias of the AddressEntry object as a string.
+
+ CString GetAddress();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the messaging address of an address list entry or message recipient.
+ // --- Effect: none
+
+ void SetAddress(CString);
+ // --- In: the messaging address of an address list entry or message recipient.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Sets the messaging address of an address list entry or message recipient.
+
+ CString GetType();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the address type, such as "SMTP," "Fax," or "X.400."
+ // --- Effect: none
+
+ void SetType(CString);
+ // --- In: the address type
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Specifies the address type, such as "SMTP," "Fax," or "X.400."
+
+ CString GetId();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: the unique ID of the object as a string.
+ // --- Effect: none
+
+ COXMFields GetFields();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: a single field (a Field object) or a collection of fields (a Fields collection object) of the Folder object.
+ // --- Effect: none
+
+ void Details(HWND hParentWindow = NULL);
+ // --- In: hParentWindow: The parent window handle for the details dialog box.
+ // A value of NULL specifies a application modal dialog box.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: displays a dialog box that provides detailed information about an AddressEntry object
+
+ void Update(BOOL bMakePermanent = TRUE, BOOL bRefreshObject = FALSE);
+ // --- In: bMakePermanent: TRUE indicates that the property cache is flushed and all changes are
+ // committed in the underlying store. FALSE indicates that the property cache is flushed and
+ // not committed to the store.
+ // bRefreshObject: TRUE indicates that the property cache is reloaded from the values in the
+ // underlying store. FALSE indicates that the property cache is not reloaded.
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: Saves AddressEntry object changes in the MAPI system
+
+ void Delete();
+ // --- In: none
+ // --- Out: none
+ // --- Returns: none
+ // --- Effect: deletes the specified address from the address book
+};
+
+
+#endif
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.cpp
new file mode 100644
index 0000000..d18fd28
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.cpp
@@ -0,0 +1,69 @@
+// ChildFrm.cpp : implementation of the CChildFrame class
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+
+#include "ChildFrm.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame
+
+IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
+
+BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
+ //{{AFX_MSG_MAP(CChildFrame)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code !
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame construction/destruction
+
+CChildFrame::CChildFrame()
+{
+ // TODO: add member initialization code here
+
+}
+
+CChildFrame::~CChildFrame()
+{
+}
+
+BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+ // TODO: Modify the Window class or styles here by modifying
+ // the CREATESTRUCT cs
+ cs.style &= ~WS_MAXIMIZEBOX;
+ cs.style &= ~WS_MINIMIZEBOX;
+ cs.style |= WS_MAXIMIZE;
+
+
+ return CMDIChildWnd::PreCreateWindow(cs);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame diagnostics
+
+#ifdef _DEBUG
+void CChildFrame::AssertValid() const
+{
+ CMDIChildWnd::AssertValid();
+}
+
+void CChildFrame::Dump(CDumpContext& dc) const
+{
+ CMDIChildWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame message handlers
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.h
new file mode 100644
index 0000000..089fffc
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/ChildFrm.h
@@ -0,0 +1,40 @@
+// ChildFrm.h : interface of the CChildFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+class CChildFrame : public CMDIChildWnd
+{
+ DECLARE_DYNCREATE(CChildFrame)
+public:
+ CChildFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CChildFrame)
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CChildFrame();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CChildFrame)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.cpp
new file mode 100644
index 0000000..291ef03
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.cpp
@@ -0,0 +1,188 @@
+// Communicator.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+#include "utsampleAbout.h"
+#include "MainFrm.h"
+#include "ChildFrm.h"
+#include "CommunicatorDoc.h"
+#include "CommunicatorView.h"
+#include "HexView.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorApp
+
+BEGIN_MESSAGE_MAP(CCommunicatorApp, CWinApp)
+ //{{AFX_MSG_MAP(CCommunicatorApp)
+ ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG_MAP
+ // Standard file based document commands
+ ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
+ ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorApp construction
+
+CCommunicatorApp::CCommunicatorApp()
+ :
+ m_pHexDocTemplate(NULL)
+ {
+ }
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CCommunicatorApp object
+
+CCommunicatorApp theApp;
+static HINSTANCE g_hRichEdDLL=NULL;
+
+// This identifier was generated to be statistically unique for your app.
+// You may change it if you prefer to choose a specific identifier.
+
+// {F44C48E0-6DD7-11CF-8508-00AA0021F02C}
+static const CLSID clsid =
+{ 0xf44c48e0, 0x6dd7, 0x11cf, { 0x85, 0x8, 0x0, 0xaa, 0x0, 0x21, 0xf0, 0x2c } };
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorApp initialization
+
+BOOL CCommunicatorApp::InitInstance()
+{
+ if (!AfxSocketInit())
+ {
+ AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
+ return FALSE;
+ }
+
+ // Initialize RichEdit control
+ // for About Dialog
+ if(g_hRichEdDLL==NULL)
+ {
+ g_hRichEdDLL=::LoadLibrary(_T("RICHED32.DLL"));
+ if(g_hRichEdDLL==NULL)
+ TRACE(_T("Cannot load library to display RichEditTextControl"));
+ }
+
+
+ // Initialize OLE libraries
+ if (!AfxOleInit())
+ {
+ AfxMessageBox(IDP_OLE_INIT_FAILED);
+ return FALSE;
+ }
+
+
+
+#ifdef _AFXDLL
+ Enable3dControls(); // Call this when using MFC in a shared DLL
+#else
+ Enable3dControlsStatic(); // Call this when linking to MFC statically
+#endif
+
+ LoadStdProfileSettings(); // Load standard INI file options (including MRU)
+
+ // Register the application's document templates. Document templates
+ // serve as the connection between documents, frame windows and views.
+
+ CMultiDocTemplate* pDocTemplate;
+ pDocTemplate = new CMultiDocTemplate(
+ IDR_COMMTYPE,
+ RUNTIME_CLASS(CCommunicatorDoc),
+ RUNTIME_CLASS(CChildFrame), // custom MDI child frame
+ RUNTIME_CLASS(CCommunicatorView));
+ AddDocTemplate(pDocTemplate);
+
+ m_pHexDocTemplate = new CMultiDocTemplate(
+ IDR_COMMTYPE,
+ RUNTIME_CLASS(CCommunicatorDoc),
+ RUNTIME_CLASS(CChildFrame), // custom MDI child frame
+ RUNTIME_CLASS(CHexView));
+
+ // Connect the COleTemplateServer to the document template.
+ // The COleTemplateServer creates new documents on behalf
+ // of requesting OLE containers by using information
+ // specified in the document template.
+ m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
+
+ // Register all OLE server factories as running. This enables the
+ // OLE libraries to create objects from other applications.
+ COleTemplateServer::RegisterAll();
+ // Note: MDI applications register all server objects without regard
+ // to the /Embedding or /Automation on the command line.
+
+ // create main MDI Frame window
+ CMainFrame* pMainFrame = new CMainFrame;
+ if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
+ return FALSE;
+ m_pMainWnd = pMainFrame;
+
+ // Enable drag/drop open
+ m_pMainWnd->DragAcceptFiles();
+
+ // Enable DDE Execute open
+ EnableShellOpen();
+ RegisterShellFileTypes(TRUE);
+
+ // Parse command line for standard shell commands, DDE, file open
+ CCommandLineInfo cmdInfo;
+ ParseCommandLine(cmdInfo);
+
+ // Check to see if launched as OLE server
+ if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
+ {
+ // Application was run with /Embedding or /Automation. Don't show the
+ // main window in this case.
+ return TRUE;
+ }
+
+ // When a server application is launched stand-alone, it is a good idea
+ // to update the system registry in case it has been damaged.
+ m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
+ COleObjectFactory::UpdateRegistryAll();
+
+ // Dispatch commands specified on the command line
+ if (!ProcessShellCommand(cmdInfo))
+ return FALSE;
+
+ // The main window has been initialized, so show and update it.
+ pMainFrame->ShowWindow(m_nCmdShow);
+ pMainFrame->UpdateWindow();
+
+ return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+
+
+// App command to run the dialog
+void CCommunicatorApp::OnAppAbout()
+{
+ CUTSampleAboutDlg aboutDlg(IDR_MAINFRAME,ID_DESCRIPTION_FILE);
+ aboutDlg.DoModal();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorApp commands
+
+int CCommunicatorApp::ExitInstance()
+ {
+ if (m_pHexDocTemplate != NULL)
+ delete m_pHexDocTemplate;
+
+ // unload the library
+ if(g_hRichEdDLL!=NULL)
+ ::FreeLibrary(g_hRichEdDLL);
+
+ return CWinApp::ExitInstance();
+ }
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsp
new file mode 100644
index 0000000..727ac6f
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsp
@@ -0,0 +1,318 @@
+# Microsoft Developer Studio Project File - Name="Communicator" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=Communicator - Win32 Unicode_Debug
+!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 "Communicator.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 "Communicator.mak" CFG="Communicator - Win32 Unicode_Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Communicator - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "Communicator - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE "Communicator - Win32 Release_Shared" (based on "Win32 (x86) Application")
+!MESSAGE "Communicator - Win32 Unicode_Debug" (based on "Win32 (x86) Application")
+!MESSAGE "Communicator - Win32 Unicode_Release" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Communicator - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir ".\Release"
+# PROP BASE Intermediate_Dir ".\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# 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 /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c
+# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\include" /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x813 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "Communicator - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir ".\Debug"
+# PROP BASE Intermediate_Dir ".\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# 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 /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /c
+# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x813 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386
+# ADD LINK32 /nologo /subsystem:windows /profile /debug /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+
+!ELSEIF "$(CFG)" == "Communicator - Win32 Release_Shared"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Communic"
+# PROP BASE Intermediate_Dir "Communic"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_Shared"
+# PROP Intermediate_Dir "Release_Shared"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W4 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W4 /GX /O2 /I "..\..\include" /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x813 /d "NDEBUG"
+# ADD RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "Communicator - Win32 Unicode_Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Communi0"
+# PROP BASE Intermediate_Dir "Communi0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Unicode_Debug"
+# PROP Intermediate_Dir "Unicode_Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "..\..\include" /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "_UNICODE" /FR /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /profile /debug /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# ADD LINK32 /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /profile /debug /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+
+!ELSEIF "$(CFG)" == "Communicator - Win32 Unicode_Release"
+
+# PROP BASE Use_MFC 5
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Communi1"
+# PROP BASE Intermediate_Dir "Communi1"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 5
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Unicode_Release"
+# PROP Intermediate_Dir "Unicode_Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W4 /GX /O2 /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W4 /GX /O2 /I "..\..\include" /I "..\..\..\include" /I "..\..\..\source\utsampleabout" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_UNICODE" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "NDEBUG"
+# ADD RSC /l 0x813 /i "..\..\..\include" /i "..\..\..\source\utsampleabout" /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /machine:I386 /out:"Communicator.exe" /section:.sdata,rws
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "Communicator - Win32 Release"
+# Name "Communicator - Win32 Debug"
+# Name "Communicator - Win32 Release_Shared"
+# Name "Communicator - Win32 Unicode_Debug"
+# Name "Communicator - Win32 Unicode_Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
+# Begin Group "UTSource"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\source\OXBlob.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\OXCommMsg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\OXCommunicator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\source\OXVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Source\UTSampleAbout\UTSampleAbout.cpp
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ChildFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Communicator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Communicator.odl
+# End Source File
+# Begin Source File
+
+SOURCE=.\Communicator.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommunicatorDoc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommunicatorView.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\HexView.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\OXDataCommunicator.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\SendDataDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
+# Begin Source File
+
+SOURCE=.\ChildFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Communicator.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommunicatorDoc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommunicatorView.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\HexView.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\OXDataCommunicator.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\SendDataDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\Communicator.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Communicator.rc2
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\CommunicatorDoc.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommunicatorInfo.rtf
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsw b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsw
new file mode 100644
index 0000000..7e2c2a4
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Communicator"=.\Communicator.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.h
new file mode 100644
index 0000000..53c3652
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.h
@@ -0,0 +1,45 @@
+// Communicator.h : main header file for the COMMUNICATOR application
+//
+//----------------- Dundas Software ----------------------------------------
+//========================================================================
+
+#ifndef __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorApp:
+// See Communicator.cpp for the implementation of this class
+//
+
+class CCommunicatorApp : public CWinApp
+{
+public:
+ CCommunicatorApp();
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CCommunicatorApp)
+ public:
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+ //}}AFX_VIRTUAL
+
+// Implementation
+ COleTemplateServer m_server;
+ // Server object for document creation
+
+ CMultiDocTemplate* m_pHexDocTemplate;
+
+ //{{AFX_MSG(CCommunicatorApp)
+ afx_msg void OnAppAbout();
+ // NOTE - the ClassWizard will add and remove member functions here.
+ // DO NOT EDIT what you see in these blocks of generated code !
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.odl b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.odl
new file mode 100644
index 0000000..11563a9
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.odl
@@ -0,0 +1,39 @@
+// Communicator.odl : type library source for Communicator.exe
+
+// This file will be processed by the Make Type Library (mktyplib) tool to
+// produce the type library (Communicator.tlb).
+
+[ uuid(F44C48E1-6DD7-11CF-8508-00AA0021F02C), version(1.0) ]
+library Communicator
+{
+ importlib("stdole32.tlb");
+
+ // Primary dispatch interface for CCommunicatorDoc
+
+ [ uuid(F44C48E2-6DD7-11CF-8508-00AA0021F02C) ]
+ dispinterface IComm
+ {
+ properties:
+ // NOTE - ClassWizard will maintain property information here.
+ // Use extreme caution when editing this section.
+ //{{AFX_ODL_PROP(CCommunicatorDoc)
+ //}}AFX_ODL_PROP
+
+ methods:
+ // NOTE - ClassWizard will maintain method information here.
+ // Use extreme caution when editing this section.
+ //{{AFX_ODL_METHOD(CCommunicatorDoc)
+ //}}AFX_ODL_METHOD
+
+ };
+
+ // Class information for CCommunicatorDoc
+
+ [ uuid(F44C48E0-6DD7-11CF-8508-00AA0021F02C) ]
+ coclass CCommunicatorDoc
+ {
+ [default] dispinterface IComm;
+ };
+
+ //{{AFX_APPEND_ODL}}
+};
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.rc b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.rc
new file mode 100644
index 0000000..a2cbb97
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.rc
@@ -0,0 +1,404 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.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
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_COMMTYPE ICON DISCARDABLE "res\\CommunicatorDoc.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINFRAME MENU PRELOAD DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&New\tCtrl+N", ID_FILE_NEW
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_APP_EXIT
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About Communicator...", ID_APP_ABOUT
+ END
+END
+
+IDR_COMMTYPE MENU PRELOAD DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&New\tCtrl+N", ID_FILE_NEW
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_APP_EXIT
+ END
+ POPUP "&Window"
+ BEGIN
+ MENUITEM "Tile ", ID_WINDOW_TILE_VERT
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About Communicator...", ID_APP_ABOUT
+ END
+END
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "COMMUNICATOR MFC Application\0"
+ VALUE "FileVersion", "1, 0, 0, 1\0"
+ VALUE "InternalName", "COMMUNICATOR\0"
+ VALUE "LegalCopyright", "Copyright © 1996\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "COMMUNICATOR.EXE\0"
+ VALUE "ProductName", "COMMUNICATOR Application\0"
+ VALUE "ProductVersion", "1, 0, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDP_OLE_INIT_FAILED "OLE initialization failed. Make sure that the OLE libraries are the correct version."
+ IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
+END
+
+STRINGTABLE PRELOAD DISCARDABLE
+BEGIN
+ IDR_MAINFRAME "Communicator"
+ IDR_COMMTYPE "\nComm\nComm\nCommun Files (*.cmm)\n.CMM\nCommunicator.Document\nComm Document"
+ IDS_INVALID_VALUE "The specified value is not valid for this type"
+ IDS_FAILED_LISTEN "The Listen failed"
+ IDS_FAILED_CONNECT "Failed to establish connection"
+END
+
+STRINGTABLE PRELOAD DISCARDABLE
+BEGIN
+ AFX_IDS_APP_TITLE "Communicator"
+ AFX_IDS_IDLEMESSAGE "Ready"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_INDICATOR_EXT "EXT"
+ ID_INDICATOR_CAPS "CAP"
+ ID_INDICATOR_NUM "NUM"
+ ID_INDICATOR_SCRL "SCRL"
+ ID_INDICATOR_OVR "OVR"
+ ID_INDICATOR_REC "REC"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FILE_NEW "Create a new document\nNew"
+ ID_FILE_OPEN "Open an existing document\nOpen"
+ ID_FILE_CLOSE "Close the active document\nClose"
+ ID_FILE_SAVE "Save the active document\nSave"
+ ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
+ ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_FILE_MRU_FILE1 "Open this document"
+ ID_FILE_MRU_FILE2 "Open this document"
+ ID_FILE_MRU_FILE3 "Open this document"
+ ID_FILE_MRU_FILE4 "Open this document"
+ ID_FILE_MRU_FILE5 "Open this document"
+ ID_FILE_MRU_FILE6 "Open this document"
+ ID_FILE_MRU_FILE7 "Open this document"
+ ID_FILE_MRU_FILE8 "Open this document"
+ ID_FILE_MRU_FILE9 "Open this document"
+ ID_FILE_MRU_FILE10 "Open this document"
+ ID_FILE_MRU_FILE11 "Open this document"
+ ID_FILE_MRU_FILE12 "Open this document"
+ ID_FILE_MRU_FILE13 "Open this document"
+ ID_FILE_MRU_FILE14 "Open this document"
+ ID_FILE_MRU_FILE15 "Open this document"
+ ID_FILE_MRU_FILE16 "Open this document"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
+ ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ AFX_IDS_SCSIZE "Change the window size"
+ AFX_IDS_SCMOVE "Change the window position"
+ AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ AFX_IDS_SCRESTORE "Restore the window to normal size"
+ AFX_IDS_SCTASKLIST "Activate Task List"
+ AFX_IDS_MDICHILD "Activate this window"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ ID_DESCRIPTION_FILE "communicatorinfo.rtf"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Dutch (Belgium) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB)
+#ifdef _WIN32
+LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME ICON DISCARDABLE "res\\Communicator.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_SEND_DATA DIALOG DISCARDABLE 0, 0, 190, 230
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Send data"
+FONT 8, "MS Sans Serif"
+BEGIN
+ EDITTEXT IDC_VALUE,7,104,155,14,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "&Add",IDC_ADD,70,124,50,14
+ LISTBOX IDC_LIST,7,150,176,49,WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "OK",IDOK,40,206,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,100,206,50,14
+ CONTROL "&Empty",IDC_EMPTY,"Button",BS_AUTORADIOBUTTON |
+ WS_GROUP,17,20,35,10
+ CONTROL "&Null",IDC_NULL,"Button",BS_AUTORADIOBUTTON,17,33,28,10
+ CONTROL "&Bool",IDC_BOOL,"Button",BS_AUTORADIOBUTTON,17,46,30,10
+ CONTROL "&UI1 (char)",IDC_UI1,"Button",BS_AUTORADIOBUTTON,17,59,
+ 45,10
+ CONTROL "&I2 (short)",IDC_I2,"Button",BS_AUTORADIOBUTTON,63,20,
+ 41,10
+ CONTROL "&I4 (int)",IDC_I4,"Button",BS_AUTORADIOBUTTON,63,33,33,
+ 10
+ CONTROL "&CY (Currency)",IDC_CY,"Button",BS_AUTORADIOBUTTON,63,
+ 46,57,10
+ CONTROL "&R4 (float)",IDC_R4,"Button",BS_AUTORADIOBUTTON,63,59,
+ 43,10
+ CONTROL "&R8 (double)",IDC_R8,"Button",BS_AUTORADIOBUTTON,120,20,
+ 51,10
+ CONTROL "&Str",IDC_BSTR,"Button",BS_AUTORADIOBUTTON,120,33,29,10
+ CONTROL "&Date",IDC_DATE,"Button",BS_AUTORADIOBUTTON,120,46,33,
+ 10
+ CONTROL "&Error",IDC_ERROR,"Button",BS_AUTORADIOBUTTON,120,59,31,
+ 10
+ CONTROL "&Binary Large Object",IDC_BINARY,"Button",
+ BS_AUTORADIOBUTTON,63,74,73,10
+ LTEXT "&Value",IDC_STATIC,7,91,19,8
+ GROUPBOX "Type",IDC_STATIC,7,7,176,81
+ DEFPUSHBUTTON "...",IDC_BROWSE,168,104,15,14
+END
+
+IDD_COMMUNICATOR_FORM DIALOG DISCARDABLE 0, 0, 246, 277
+STYLE WS_CHILD
+FONT 8, "MS Sans Serif"
+BEGIN
+ GROUPBOX "Server",IDC_SERVER_GROUP,7,7,232,103
+ LTEXT "Local Address",IDC_LOCAL_ADDRESS_LABEL,15,17,46,8
+ EDITTEXT IDC_LOCAL_ADDRESS,15,29,62,12,ES_AUTOHSCROLL |
+ ES_READONLY | NOT WS_TABSTOP
+ LTEXT "Local Port",IDC_LOCAL_PORT_LABEL,82,17,35,8
+ EDITTEXT IDC_LOCAL_PORT,82,29,34,12,ES_AUTOHSCROLL
+ PUSHBUTTON "&Listen",IDC_LISTEN,127,28,50,14
+ PUSHBUTTON "Shut&down",IDC_SHUTDOWN,182,28,50,14
+ LTEXT "Client Addresses",IDC_CLIENT_ADDRESSES_LABEL,15,47,60,8
+ LISTBOX IDC_CLIENT_ADDRESSES,15,58,157,44,LBS_NOINTEGRALHEIGHT |
+ LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Send",IDC_SEND_CLIENT,182,60,50,14
+ PUSHBUTTON "&Disconnect",IDC_DISCONNECT_CLIENT,182,85,50,14
+ GROUPBOX "Client",IDC_CLIENT_GROUP,7,113,232,50
+ LTEXT "Remote Address",IDC_REMOTE_ADDRESS_LABEL,14,127,57,8
+ EDITTEXT IDC_REMOTE_ADDRESS,14,139,62,12,ES_AUTOHSCROLL | NOT
+ WS_TABSTOP
+ LTEXT "Remote Port",IDC_REMOTE_PORT_LABEL,82,128,39,8
+ EDITTEXT IDC_REMOTE_PORT,82,138,34,12,ES_AUTOHSCROLL
+ PUSHBUTTON "&Connect",IDC_CONNECT_SERVER,125,126,50,14
+ PUSHBUTTON "&Send",IDC_SEND_SERVER,182,126,50,14
+ PUSHBUTTON "Disconnect",IDC_DISCONNECT_SERVER,182,144,50,14
+ PUSHBUTTON "&Spy",IDC_SPY,59,170,50,14
+ LTEXT "Received Data",-1,7,175,47,8
+ EDITTEXT IDC_RECEIVED_DATA,7,189,232,61,ES_MULTILINE |
+ ES_AUTOHSCROLL | WS_VSCROLL
+ PUSHBUTTON "Cancel Actions",IDC_CANCEL,93,256,59,14
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_SEND_DATA, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 183
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 220
+ END
+
+ IDD_COMMUNICATOR_FORM, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 239
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 270
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#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
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "#include ""utsampleAbout.rc""\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif\r\n"
+ "#include ""res\\Communicator.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Dutch (Belgium) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+#include "utsampleAbout.rc"
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif
+#include "res\Communicator.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.reg b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.reg
new file mode 100644
index 0000000..2348177
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/Communicator.reg
@@ -0,0 +1,19 @@
+REGEDIT
+; This .REG file may be used by your SETUP program.
+; If a SETUP program is not available, the entries below will be
+; registered in your InitInstance automatically with a call to
+; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
+
+HKEY_CLASSES_ROOT\.CMM = Communicator.Document
+HKEY_CLASSES_ROOT\Communicator.Document\shell\open\command = COMMUNICATOR.EXE %1
+HKEY_CLASSES_ROOT\Communicator.Document\shell\open\ddeexec = [open("%1")]
+HKEY_CLASSES_ROOT\Communicator.Document\shell\open\ddeexec\application = COMMUNICATOR
+ ; note: the application is optional
+ ; (it defaults to the app name in "command")
+
+HKEY_CLASSES_ROOT\Communicator.Document = Comm Document
+HKEY_CLASSES_ROOT\Communicator.Document\CLSID = {F44C48E0-6DD7-11CF-8508-00AA0021F02C}
+
+HKEY_CLASSES_ROOT\CLSID\{F44C48E0-6DD7-11CF-8508-00AA0021F02C} = Comm Document
+HKEY_CLASSES_ROOT\CLSID\{F44C48E0-6DD7-11CF-8508-00AA0021F02C}\LocalServer32 = COMMUNICATOR.EXE
+HKEY_CLASSES_ROOT\CLSID\{F44C48E0-6DD7-11CF-8508-00AA0021F02C}\ProgId = Communicator.Document
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.cpp
new file mode 100644
index 0000000..fdc1072
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.cpp
@@ -0,0 +1,465 @@
+// CommunicatorDoc.cpp : implementation of the CCommunicatorDoc class
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+
+#include "CommunicatorDoc.h"
+#include "OXCommMsg.h"
+#include "HexView.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorDoc
+
+IMPLEMENT_DYNCREATE(CCommunicatorDoc, CDocument)
+
+BEGIN_MESSAGE_MAP(CCommunicatorDoc, CDocument)
+ //{{AFX_MSG_MAP(CCommunicatorDoc)
+ ON_BN_CLICKED(IDC_SPY, OnSpy)
+ ON_BN_CLICKED(IDC_CANCEL, OnCancel)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+BEGIN_DISPATCH_MAP(CCommunicatorDoc, CDocument)
+ //{{AFX_DISPATCH_MAP(CCommunicatorDoc)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_DISPATCH_MAP
+END_DISPATCH_MAP()
+
+// Note: we add support for IID_IComm to support typesafe binding
+// from VBA. This IID must match the GUID that is attached to the
+// dispinterface in the .ODL file.
+
+// {F44C48E2-6DD7-11CF-8508-00AA0021F02C}
+static const IID IID_IComm =
+{ 0xf44c48e2, 0x6dd7, 0x11cf, { 0x85, 0x8, 0x0, 0xaa, 0x0, 0x21, 0xf0, 0x2c } };
+
+BEGIN_INTERFACE_MAP(CCommunicatorDoc, CDocument)
+ INTERFACE_PART(CCommunicatorDoc, IID_IComm, Dispatch)
+END_INTERFACE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorDoc construction/destruction
+
+CCommunicatorDoc::CCommunicatorDoc()
+ :
+ m_dataCommunicator(this),
+ m_pCancelWnd(NULL),
+ m_nTimeOut(10000)
+ {
+ m_pCancelWnd = AfxGetMainWnd();
+
+ EnableAutomation();
+
+ AfxOleLockApp();
+ }
+
+CCommunicatorDoc::~CCommunicatorDoc()
+ {
+ AfxOleUnlockApp();
+ Shutdown();
+ }
+
+BOOL CCommunicatorDoc::OnNewDocument()
+ {
+ if (!CDocument::OnNewDocument())
+ return FALSE;
+
+ // Get the local server name
+ const int nMaxAddressLength = 128;
+ char szLocalAddress[nMaxAddressLength];
+ gethostname(szLocalAddress, nMaxAddressLength);
+ m_sLocalAddress = szLocalAddress;
+
+ return TRUE;
+ }
+
+CString CCommunicatorDoc::GetLocalAddress() const
+ {
+ return m_sLocalAddress;
+ }
+
+UINT CCommunicatorDoc::GetLocalPort() const
+ {
+ CString sAddress;
+ UINT nPort;
+ if ((m_dataCommunicator.m_hSocket != INVALID_SOCKET) &&
+ ((CAsyncSocket*)&m_dataCommunicator)->GetSockName(sAddress, nPort))
+ {
+ return nPort;
+ }
+ else
+ return 0;
+ }
+
+BOOL CCommunicatorDoc::IsOpen()
+ {
+ return m_dataCommunicator.IsOpen();
+ }
+
+BOOL CCommunicatorDoc::IsListening()
+ {
+ return m_dataCommunicator.IsListening();
+ }
+
+BOOL CCommunicatorDoc::IsBlocking()
+ {
+ return m_dataCommunicator.AreAnyBlocking();
+ }
+
+void CCommunicatorDoc::CancelBlocking()
+ {
+ m_dataCommunicator.CancelAllBlockingCalls();
+ }
+
+BOOL CCommunicatorDoc::Listen(long nServerPort)
+ {
+ BOOL bSuccess = TRUE;
+ if (m_dataCommunicator.m_hSocket != INVALID_SOCKET);
+ {
+ if (m_dataCommunicator.Create(nServerPort) &&
+ m_dataCommunicator.Listen())
+ {
+ m_dataCommunicator.Initialize(m_nTimeOut, m_pCancelWnd);
+ }
+ else
+ {
+ TRACE(_T("CComServerDoc::Listen : Failed to create socket server\n"));
+ m_dataCommunicator.Close();
+ bSuccess = FALSE;
+ }
+ }
+ ASSERT(bSuccess == m_dataCommunicator.IsListening());
+ return bSuccess;
+ }
+
+void CCommunicatorDoc::Shutdown()
+ {
+ // ... m_pDataCommunicator may already be NULL
+ TRY
+ {
+ m_dataCommunicator.Close();
+ }
+ END_TRY
+ // Warn view of shutdown
+ UpdateAllViews(NULL, NotifyRemoveAllClients, NULL);
+ }
+
+void CCommunicatorDoc::DisconnectClient(HCLIENT_COMMUNICATOR hClient)
+ {
+ COXCommunicator* pClientCommunicator = m_dataCommunicator.GetClientCommunicator(hClient);
+ if (pClientCommunicator == NULL)
+ return;
+ TRY
+ {
+ pClientCommunicator->Close();
+ }
+ END_TRY
+
+ // Warn view
+ CHintData hintData;
+ hintData.m_hClient = hClient;
+ UpdateAllViews(NULL, NotifyRemoveClient, &hintData);
+ }
+
+BOOL CCommunicatorDoc::Send(HCLIENT_COMMUNICATOR hClient, COXCommMsg* pCommMsg)
+ {
+ ASSERT(pCommMsg != NULL);
+ COXCommunicator* pClientCommunicator = m_dataCommunicator.GetClientCommunicator(hClient);
+ if (pClientCommunicator == NULL)
+ return FALSE;
+ BOOL bSuccess = FALSE;
+ TRY
+ {
+ pCommMsg->Serialize(*pClientCommunicator->GetOutStream());
+ pClientCommunicator->GetOutStream()->Flush();
+ bSuccess = TRUE;
+ }
+ END_TRY
+ return bSuccess;
+ }
+
+BOOL CCommunicatorDoc::ConnectServer(CString sRemoteAddress, int nRemotePort, int nLocalPort)
+ {
+ BOOL bSuccess = TRUE;
+ if (!m_dataCommunicator.Create(nLocalPort) ||
+ !(m_dataCommunicator.Initialize(m_nTimeOut, m_pCancelWnd), TRUE) ||
+ !m_dataCommunicator.Connect(sRemoteAddress, nRemotePort))
+ {
+ TRACE(_T("CComServerDoc::ConnectServer : Failed to create socket server\n"));
+
+ m_dataCommunicator.Close();
+ bSuccess = FALSE;
+ }
+ return bSuccess;
+ }
+
+BOOL CCommunicatorDoc::SendServer(COXCommMsg* pCommMsg)
+ {
+ BOOL bSuccess = FALSE;
+ TRY
+ {
+ if (m_dataCommunicator.GetOutStream() != NULL)
+ {
+ pCommMsg->Serialize(*m_dataCommunicator.GetOutStream());
+ m_dataCommunicator.GetOutStream()->Flush();
+ bSuccess = TRUE;
+ }
+ }
+ END_TRY
+ return bSuccess;
+ }
+
+void CCommunicatorDoc::OnReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pCommunicator, int nErrorCode)
+ {
+ POSITION pos = GetFirstViewPosition();
+ if (pos != NULL)
+ GetNextView(pos);
+ if (pos == NULL)
+ // At most one view is attached to this doc, which cannot be a Spy view
+ OnReceiveDirect(hClient, pCommunicator, nErrorCode);
+ else
+ // More than one view is attached to this doc,
+ // at least one of them must be Spy view
+ OnReceiveHex(hClient, pCommunicator, nErrorCode);
+ }
+
+void CCommunicatorDoc::OnReceiveDirect(HCLIENT_COMMUNICATOR hClient,
+ COXCommunicator* pCommunicator, int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nErrorCode);
+
+ if (pCommunicator->GetMaxReadable() == 0)
+ // Ignore no data
+ return;
+
+ CArchive* pInStream = pCommunicator->GetInStream();
+
+ CHintData hintData;
+ COXCommMsg commMsg;
+
+ BOOL bVariantSuccess = FALSE;
+
+ // Read the data directly in a variant array
+ TRY
+ {
+ commMsg.Serialize(*pInStream);
+ bVariantSuccess = TRUE;
+ }
+ CATCH(CFileException, e)
+ {
+ TRACE(_T("CComServerDoc::OnClientReceive : Catching CFileException\n"));
+ }
+ AND_CATCH(CArchiveException, e)
+ {
+ TRACE(_T("CComServerDoc::OnClientReceive : Catching CArchiveException\n"));
+ }
+ END_CATCH
+
+ hintData.m_hClient = hClient;
+ hintData.m_pData = NULL;
+ hintData.m_nDataLength = 0;
+ if (bVariantSuccess)
+ hintData.m_pCommMsg = &commMsg;
+ UpdateAllViews(NULL, NotifyAddData, &hintData);
+ }
+
+void CCommunicatorDoc::OnReceiveHex(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pCommunicator, int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nErrorCode);
+
+ if (pCommunicator->GetMaxReadable() == 0)
+ // Ignore no data
+ return;
+
+ CArchive* pInStream = pCommunicator->GetInStream();
+
+ CHintData hintData;
+ UINT nDataLength = 0;
+ BYTE* pData = NULL;
+ COXCommMsg commMsg;
+
+ BOOL bDataSuccess = FALSE;
+ BOOL bVariantSuccess = FALSE;
+
+ // First read into memory block
+ CMemFile memFile;
+ TRY
+ {
+ unsigned char pc[2];;
+ pc[1] = '\0';
+ do
+ {
+ do
+ {
+ pInStream->Read(pc, 1);
+ memFile.Write(pc, 1);
+ } while (!pInStream->IsBufferEmpty());
+ } while(pCommunicator->GetMaxReadable() != 0);
+ nDataLength = memFile.GetLength();
+ pData = memFile.Detach();
+ bDataSuccess = TRUE;
+ }
+ CATCH(CFileException, e)
+ {
+ TRACE(_T("CComServerDoc::OnReceive : Catching CFileException\n"));
+ if (pData == NULL)
+ {
+ nDataLength = memFile.GetLength();
+ pData = memFile.Detach();
+ }
+ }
+ AND_CATCH(CArchiveException, e)
+ {
+ TRACE(_T("CComServerDoc::OnReceive : Catching CArchiveException\n"));
+ if (pData == NULL)
+ {
+ nDataLength = memFile.GetLength();
+ pData = memFile.Detach();
+ }
+ }
+ END_CATCH
+
+ // Now reread the data in a variant array
+ TRY
+ {
+ memFile.Attach(pData, nDataLength);
+ CArchive inStream(&memFile, CArchive::load);
+ commMsg.Serialize(inStream);
+ memFile.Detach();
+ bVariantSuccess = TRUE;
+ }
+ CATCH(CFileException, e)
+ {
+ TRACE(_T("CComServerDoc::OnClientReceive : Catching CFileException\n"));
+ memFile.Detach();
+ }
+ AND_CATCH(CArchiveException, e)
+ {
+ TRACE(_T("CComServerDoc::OnClientReceive : Catching CArchiveException\n"));
+ memFile.Detach();
+ }
+ END_CATCH
+
+ hintData.m_hClient = hClient;
+ if (bDataSuccess)
+ {
+ hintData.m_pData = pData;
+ hintData.m_nDataLength = nDataLength;
+ }
+ if (bVariantSuccess)
+ hintData.m_pCommMsg = &commMsg;
+ UpdateAllViews(NULL, NotifyAddData, &hintData);
+
+ // Clean up memory
+ free(pData);
+ }
+
+void CCommunicatorDoc::OnClientCreate(HCLIENT_COMMUNICATOR hClient,
+ COXCommunicator* pClientCommunicator)
+ {
+ CHintData hintData;
+ hintData.m_hClient = hClient;
+ pClientCommunicator->GetPeerName(hintData.m_sClientAddress, hintData.m_nClientPort);
+ UpdateAllViews(NULL, NotifyAddClient, &hintData);
+ }
+
+void CCommunicatorDoc::OnClientReceive(HCLIENT_COMMUNICATOR hClient,
+ COXCommunicator* pClientCommunicator,
+ DWORD nSize, int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nSize);
+ OnReceive(hClient, pClientCommunicator, nErrorCode);
+ }
+
+void CCommunicatorDoc::OnClientClose(HCLIENT_COMMUNICATOR hClient,
+ COXCommunicator* pClientCommunicator,
+ int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nErrorCode);
+ UNREFERENCED_PARAMETER(pClientCommunicator);
+ CHintData hintData;
+ hintData.m_hClient = hClient;
+ UpdateAllViews(NULL, NotifyRemoveClient, &hintData);
+ }
+
+void CCommunicatorDoc::OnServerReceive(DWORD nSize, int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nSize);
+ OnReceive(0, &m_dataCommunicator, nErrorCode);
+ }
+
+void CCommunicatorDoc::OnServerClose(int nErrorCode)
+ {
+ UNREFERENCED_PARAMETER(nErrorCode);
+ }
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorDoc serialization
+
+void CCommunicatorDoc::Serialize(CArchive& ar)
+ {
+ if (ar.IsStoring())
+ {
+ // TODO: add storing code here
+ }
+ else
+ {
+ // TODO: add loading code here
+ }
+ }
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorDoc diagnostics
+
+#ifdef _DEBUG
+void CCommunicatorDoc::AssertValid() const
+ {
+ CDocument::AssertValid();
+ }
+
+void CCommunicatorDoc::Dump(CDumpContext& dc) const
+ {
+ CDocument::Dump(dc);
+ }
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorDoc commands
+
+void CCommunicatorDoc::OnSpy()
+ {
+ COleDateTime oleDate;
+ SYSTEMTIME t;
+ t.wYear = 1996;
+ t.wMonth = 10;
+ t.wDay = 6;
+ t.wHour = 16;
+ t.wMinute = 53;
+ t.wSecond = 24;
+
+ oleDate = t;
+
+
+ CFrameWnd* pHexFrame = NULL;
+ pHexFrame = ((CCommunicatorApp*)AfxGetApp())->m_pHexDocTemplate->CreateNewFrame(this, NULL);
+ pHexFrame->InitialUpdateFrame(this, TRUE);
+ }
+
+void CCommunicatorDoc::OnCancel()
+ {
+ m_dataCommunicator.CancelAllBlockingCalls();
+ }
+
+BOOL CCommunicatorDoc::IsModified()
+ {
+ // Never ask to save the doc
+ return FALSE;
+ }
\ No newline at end of file
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.h
new file mode 100644
index 0000000..bdb300c
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorDoc.h
@@ -0,0 +1,118 @@
+// CommunicatorDoc.h : interface of the CCommunicatorDoc class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "OXDataCommunicator.h"
+
+class COXCommMsg;
+
+class CCommunicatorDoc : public CDocument
+{
+protected: // create from serialization only
+ CCommunicatorDoc();
+ DECLARE_DYNCREATE(CCommunicatorDoc)
+
+// Attributes
+public:
+
+// Operations
+public:
+ CString GetLocalAddress() const;
+ UINT GetLocalPort() const;
+ BOOL IsOpen();
+ BOOL IsListening();
+ BOOL IsBlocking();
+ void CancelBlocking();
+
+ BOOL Listen(long nServerPort);
+ void Shutdown();
+ void DisconnectClient(HCLIENT_COMMUNICATOR hClient);
+ BOOL Send(HCLIENT_COMMUNICATOR hClient, COXCommMsg* pCommMsg);
+ BOOL ConnectServer(CString sRemoteAddress, int nRemotePort, int nLocalPort);
+ BOOL SendServer(COXCommMsg* pCommMsg);
+
+ void OnReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pCommunicator, int nErrorCode);
+ void OnReceiveDirect(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pCommunicator, int nErrorCode);
+ void OnReceiveHex(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pCommunicator, int nErrorCode);
+
+ void OnClientCreate(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator);
+ void OnClientReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, DWORD nSize, int nErrorCode);
+ void OnClientClose(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, int nErrorCode);
+ void OnServerReceive(DWORD nSize, int nErrorCode);
+ void OnServerClose(int nErrorCode);
+
+ enum
+ {
+ NotifyAddClient = 1,
+ NotifyRemoveClient = 2,
+ NotifyRemoveAllClients =3,
+ NotifyAddData = 4
+ };
+
+ class CHintData : public CObject
+ {
+ public:
+ HCLIENT_COMMUNICATOR m_hClient;
+ CString m_sClientAddress;
+ UINT m_nClientPort;
+ COXCommMsg* m_pCommMsg;
+ BYTE* m_pData;
+ UINT m_nDataLength;
+ CHintData()
+ :
+ m_hClient(0),
+ m_sClientAddress(""),
+ m_nClientPort(0),
+ m_pCommMsg(NULL),
+ m_pData(NULL),
+ m_nDataLength(0)
+ {
+ }
+ };
+
+
+ // Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CCommunicatorDoc)
+ public:
+ virtual BOOL OnNewDocument();
+ virtual void Serialize(CArchive& ar);
+ //}}AFX_VIRTUAL
+
+ virtual BOOL IsModified();
+
+protected:
+ CString m_sLocalAddress;
+ COXDataCommunicator m_dataCommunicator;
+ CWnd* m_pCancelWnd;
+ UINT m_nTimeOut;
+
+
+// Implementation
+public:
+ virtual ~CCommunicatorDoc();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CCommunicatorDoc)
+ afx_msg void OnSpy();
+ afx_msg void OnCancel();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+ // Generated OLE dispatch map functions
+ //{{AFX_DISPATCH(CCommunicatorDoc)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ // DO NOT EDIT what you see in these blocks of generated code !
+ //}}AFX_DISPATCH
+ DECLARE_DISPATCH_MAP()
+ DECLARE_INTERFACE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorInfo.rtf b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorInfo.rtf
new file mode 100644
index 0000000..1caed0f
Binary files /dev/null and b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorInfo.rtf differ
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.cpp
new file mode 100644
index 0000000..37c84fa
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.cpp
@@ -0,0 +1,503 @@
+// CommunicatorView.cpp : implementation of the CCommunicatorView class
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+
+#include "CommunicatorDoc.h"
+#include "CommunicatorView.h"
+#include "SendDataDlg.h"
+#include "OXBlob.h"
+
+#include // for OnIdleUpdateCmdUI
+#include // For mutex support
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorView
+
+#pragma data_seg(".sdata")
+// Store the usage count of this application so that multiple instances will
+// cascade nicely on the screen
+LONG nUsageCount = 0;
+#pragma data_seg()
+
+
+IMPLEMENT_DYNCREATE(CCommunicatorView, CFormView)
+
+BEGIN_MESSAGE_MAP(CCommunicatorView, CFormView)
+ //{{AFX_MSG_MAP(CCommunicatorView)
+ ON_BN_CLICKED(IDC_CONNECT_SERVER, OnConnectServer)
+ ON_BN_CLICKED(IDC_DISCONNECT_CLIENT, OnDisconnectClient)
+ ON_BN_CLICKED(IDC_DISCONNECT_SERVER, OnDisconnectServer)
+ ON_BN_CLICKED(IDC_LISTEN, OnListen)
+ ON_BN_CLICKED(IDC_SEND_CLIENT, OnSendClient)
+ ON_BN_CLICKED(IDC_SEND_SERVER, OnSendServer)
+ ON_BN_CLICKED(IDC_SHUTDOWN, OnShutdown)
+ ON_MESSAGE_VOID(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorView construction/destruction
+
+CCommunicatorView::CCommunicatorView()
+ : CFormView(CCommunicatorView::IDD)
+ {
+ //{{AFX_DATA_INIT(CCommunicatorView)
+ m_sLocalAddress = _T("");
+ m_nLocalPort = 1000;
+ m_sRemoteAddress = _T("");
+ m_nRemotePort = 1000;
+ //}}AFX_DATA_INIT
+ // TODO: add construction code here
+
+ }
+
+CCommunicatorView::~CCommunicatorView()
+ {
+ }
+
+void CCommunicatorView::DoDataExchange(CDataExchange* pDX)
+ {
+ CFormView::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CCommunicatorView)
+ DDX_Control(pDX, IDC_CANCEL, m_wndCancel);
+ DDX_Control(pDX, IDC_LOCAL_PORT_LABEL, m_wndLocalPortLabel);
+ DDX_Control(pDX, IDC_SERVER_GROUP, m_wndServerGroup);
+ DDX_Control(pDX, IDC_REMOTE_ADDRESS_LABEL, m_wndRemoteAddressLabel);
+ DDX_Control(pDX, IDC_REMOTE_PORT_LABEL, m_wndRemotePortLabel);
+ DDX_Control(pDX, IDC_LOCAL_ADDRESS_LABEL, m_wndLocalAddressLabel);
+ DDX_Control(pDX, IDC_CLIENT_GROUP, m_wndClientGroup);
+ DDX_Control(pDX, IDC_CLIENT_ADDRESSES_LABEL, m_wndClientAddressLabel);
+ DDX_Control(pDX, IDC_SEND_SERVER, m_wndSendServer);
+ DDX_Control(pDX, IDC_DISCONNECT_SERVER, m_wndDisconnectServer);
+ DDX_Control(pDX, IDC_CONNECT_SERVER, m_wndConnectServer);
+ DDX_Control(pDX, IDC_REMOTE_PORT, m_wndRemotePort);
+ DDX_Control(pDX, IDC_REMOTE_ADDRESS, m_wndRemoteAddress);
+ DDX_Control(pDX, IDC_DISCONNECT_CLIENT, m_wndDisconnectClient);
+ DDX_Control(pDX, IDC_SEND_CLIENT, m_wndSendClient);
+ DDX_Control(pDX, IDC_SHUTDOWN, m_wndShutdown);
+ DDX_Control(pDX, IDC_LISTEN, m_wndListen);
+ DDX_Control(pDX, IDC_LOCAL_PORT, m_wndLocalPort);
+ DDX_Control(pDX, IDC_LOCAL_ADDRESS, m_wndLocalAddress);
+ DDX_Control(pDX, IDC_CLIENT_ADDRESSES, m_wndClientAddresses);
+ DDX_Control(pDX, IDC_RECEIVED_DATA, m_wndReceivedData);
+ DDX_Text(pDX, IDC_LOCAL_ADDRESS, m_sLocalAddress);
+ DDX_Text(pDX, IDC_LOCAL_PORT, m_nLocalPort);
+ DDX_Text(pDX, IDC_REMOTE_ADDRESS, m_sRemoteAddress);
+ DDX_Text(pDX, IDC_REMOTE_PORT, m_nRemotePort);
+ //}}AFX_DATA_MAP
+ }
+
+BOOL CCommunicatorView::PreCreateWindow(CREATESTRUCT& cs)
+ {
+ // TODO: Modify the Window class or styles here by modifying
+ // the CREATESTRUCT cs
+
+ return CFormView::PreCreateWindow(cs);
+ }
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorView diagnostics
+
+#ifdef _DEBUG
+void CCommunicatorView::AssertValid() const
+ {
+ CFormView::AssertValid();
+ }
+
+void CCommunicatorView::Dump(CDumpContext& dc) const
+ {
+ CFormView::Dump(dc);
+ }
+
+CCommunicatorDoc* CCommunicatorView::GetDocument() // non-debug version is inline
+ {
+ ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCommunicatorDoc)));
+ return (CCommunicatorDoc*)m_pDocument;
+ }
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommunicatorView message handlers
+
+void CCommunicatorView::OnConnectServer()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnConnectServer : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ UpdateData(TRUE);
+ // If remote address is not filled out, try a local connection
+ if (m_sRemoteAddress.IsEmpty())
+ {
+ m_sRemoteAddress = GetDocument()->GetLocalAddress();
+ UpdateData(FALSE);
+ }
+ // Do not use the specified local port, let winsockets pick one
+ if (!GetDocument()->ConnectServer(m_sRemoteAddress, m_nRemotePort, 0))
+ AfxMessageBox(IDS_FAILED_CONNECT, MB_ICONEXCLAMATION);
+ m_nLocalPort = GetDocument()->GetLocalPort();
+ UpdateData(FALSE);
+ }
+
+void CCommunicatorView::OnDisconnectClient()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnDisconnectClient : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ UINT nSelCount = m_wndClientAddresses.GetSelCount();
+ if (0 < nSelCount)
+ {
+ int index;
+ int* rgSels = new int[nSelCount];
+ m_wndClientAddresses.GetSelItems(nSelCount, rgSels);
+ for (index = (int)nSelCount - 1; 0 <= index; index--)
+ GetDocument()->DisconnectClient(m_wndClientAddresses.GetItemData(rgSels[index]));
+ delete rgSels;
+ }
+ }
+
+void CCommunicatorView::OnDisconnectServer()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnDisconnectServer : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ GetDocument()->Shutdown();
+ }
+
+void CCommunicatorView::OnListen()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnListen : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ UpdateData(TRUE);
+ if (!GetDocument()->Listen(m_nLocalPort))
+ AfxMessageBox(IDS_FAILED_LISTEN, MB_ICONEXCLAMATION);
+ }
+
+void CCommunicatorView::OnSendClient()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnSendClient : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ COXCommMsg* pCommMsg = new COXCommMsg;
+
+ CSendDataDlg dlg(pCommMsg);
+ if (dlg.DoModal() == IDOK)
+ {
+ UINT nSelCount = m_wndClientAddresses.GetSelCount();
+ if (0 < nSelCount)
+ {
+ int index;
+ int* rgSels = new int[nSelCount];
+ m_wndClientAddresses.GetSelItems(nSelCount, rgSels);
+ for (index = 0; index < (int)nSelCount; index++)
+ GetDocument()->Send(m_wndClientAddresses.GetItemData(rgSels[index]), pCommMsg);
+ delete rgSels;
+ }
+ }
+ delete pCommMsg;
+ }
+
+void CCommunicatorView::OnSendServer()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnSendServer : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ COXCommMsg* pCommMsg = new COXCommMsg;
+
+ CSendDataDlg dlg(pCommMsg);
+ if (dlg.DoModal() == IDOK)
+ GetDocument()->SendServer(pCommMsg);
+
+ delete pCommMsg;
+ }
+
+void CCommunicatorView::OnShutdown()
+ {
+ if (GetDocument()->IsBlocking())
+ {
+ TRACE(_T("CCommunicatorView::OnShutdown : Communicator is still blocking\n"));
+ MessageBeep(0xFFFF);
+ return;
+ }
+
+ GetDocument()->Shutdown();
+ }
+
+void CCommunicatorView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
+ {
+ UNREFERENCED_PARAMETER(pSender);
+ CCommunicatorDoc::CHintData* pHintData = (CCommunicatorDoc::CHintData*)pHint;
+ CString sText;
+ int index;
+ switch(lHint)
+ {
+ case CCommunicatorDoc::NotifyAddClient:
+ // Add the client address to the list
+ sText.Format(_T("%i. %s (%i)"), pHintData->m_hClient,
+ (LPCTSTR)pHintData->m_sClientAddress, pHintData->m_nClientPort);
+
+ index = m_wndClientAddresses.AddString(sText);
+ m_wndClientAddresses.SetItemData(index, pHintData->m_hClient);
+ // If nothing is selected, select this item
+ if (m_wndClientAddresses.GetSelCount() == 0)
+ m_wndClientAddresses.SetSel(index);
+ break;
+ case CCommunicatorDoc::NotifyRemoveClient:
+ // Remove the client address from the list
+ for (index = 0; index < m_wndClientAddresses.GetCount(); index++)
+ {
+ if ((int)m_wndClientAddresses.GetItemData(index) == pHintData->m_hClient)
+ m_wndClientAddresses.DeleteString(index);
+ }
+ // If nothing is selected, select the first one
+ if (m_wndClientAddresses.GetSelCount() == 0)
+ m_wndClientAddresses.SetSel(0);
+ break;
+ case CCommunicatorDoc::NotifyRemoveAllClients:
+ // Remove all the client address from the list
+ m_wndClientAddresses.ResetContent();
+ break;
+ case CCommunicatorDoc::NotifyAddData:
+ // Show the received data
+ ShowData(pHintData);
+ break;
+ default:
+ break;
+ }
+ }
+
+void CCommunicatorView::ShowData(CCommunicatorDoc::CHintData* pHintData)
+ {
+ CString sText;
+ CString sValue;
+ if (pHintData->m_pCommMsg == NULL)
+ {
+ if (pHintData->m_nDataLength != 0)
+ sText.Format(_T("%i. (length = %i)\r\n"),
+ pHintData->m_hClient, pHintData->m_nDataLength);
+ else
+ sText.Format(_T("%i. (length = unknown)\r\n"),
+ pHintData->m_hClient);
+ AddText(sText);
+ return;
+ }
+
+ sText.Format(_T("%i. Array of size %i\r\n"),
+ pHintData->m_hClient, pHintData->m_pCommMsg->GetSize());
+ AddText(sText);
+
+ COXVariant variant;
+ UINT nOleType;
+ UINT nType;
+ for (int index = 0; index < pHintData->m_pCommMsg->GetSize(); index++)
+ {
+ // Convert variant to string to visualize
+ variant = pHintData->m_pCommMsg->GetAt(index);
+ nOleType = V_VT(&variant);
+ for (nType = 0;
+ (nType < COXCommMsg::m_nArgumentTypesCount) && (nOleType != (UINT)COXCommMsg::m_types[nType]);
+ nType++)
+ ;
+ // ... Must have found the type
+ ASSERT(nType < COXCommMsg::m_nArgumentTypesCount);
+
+ sValue.Empty();
+ TRY
+ {
+ if (nOleType != COXCommMsg::ATBlob)
+ {
+ if (V_VT(&variant) == COXCommMsg::ATError)
+ // ... Variant is a union, just change the type
+ // oleVariant.lVal= oleVariant.scode ;
+ V_VT(&variant) = COXCommMsg::ATI4;
+ variant.ChangeType(COXCommMsg::ATStr);
+ sValue = V_BSTR(&variant);
+ }
+ else
+ {
+ ASSERT(nOleType == COXCommMsg::ATBlob);
+ CString sTempPath;
+ CString sTempFileName;
+ COXBlob blob;
+ VERIFY(::GetTempPath(_MAX_PATH, sTempPath.GetBuffer(_MAX_PATH)) != 0);
+ sTempPath.ReleaseBuffer();
+ VERIFY(::GetTempFileName(sTempPath, _T("BLB"), 0,
+ sTempFileName.GetBuffer(_MAX_PATH)) != 0);
+ sTempFileName.ReleaseBuffer();
+ blob = variant;
+ blob.WriteRaw(sTempFileName);
+ sValue.Format(_T(" (stored as %s)"), blob.GetSize(), sTempFileName);
+ }
+ }
+ END_TRY
+ sText.Format(_T("\t%i. (%s) %s\r\n"),
+ index + 1,
+ (LPCTSTR)COXCommMsg::m_typeNames[nType],
+ (LPCTSTR)sValue);
+ AddText(sText);
+ }
+ }
+
+void CCommunicatorView::AddText(LPCTSTR pszText)
+ {
+ LONG nWindowTextLength;
+ nWindowTextLength = m_wndReceivedData.GetWindowTextLength();
+ m_wndReceivedData.SetSel(nWindowTextLength, nWindowTextLength);
+ m_wndReceivedData.ReplaceSel(pszText);
+ }
+
+void CCommunicatorView::OnInitialUpdate()
+ {
+ CFormView::OnInitialUpdate();
+
+ // Show local server name
+ m_sLocalAddress = GetDocument()->GetLocalAddress();
+ UpdateData(FALSE);
+
+ // Fit frame around view
+ ResizeParentToFit(FALSE);
+
+ // Fit mainframe around frame, do this only once
+ static bMainFrameResized = FALSE;
+ if (!bMainFrameResized)
+ {
+ bMainFrameResized = TRUE;
+
+ // Get the size of frame and main frame
+ CRect frameRect;
+ CRect mainFrameRect;
+ CRect mainFrameClientRect;
+ GetParentFrame()->GetWindowRect(frameRect);
+ AfxGetMainWnd()->GetWindowRect(mainFrameRect);
+ AfxGetMainWnd()->GetClientRect(mainFrameClientRect);
+
+ // Resize the mainframe so that this view frame will completely fill the client area
+ mainFrameRect.right += frameRect.Width() - mainFrameClientRect.Width();
+ mainFrameRect.bottom += frameRect.Height() - mainFrameClientRect.Height();
+
+ // Take other windows into account that also populate the main frames client area
+ CWnd* pChild;
+ CRect childRect;
+ pChild = AfxGetMainWnd()->GetWindow(GW_CHILD);
+ while (pChild != NULL)
+ {
+ // ... Skip the MDI frame window
+ if (pChild != GetParentFrame()->GetParent())
+ {
+ pChild->GetWindowRect(childRect);
+ // Statusbar and buttonbar take up the entire width (or height)
+ // Use the smallest of the two
+ if (childRect.Height() < childRect.Width())
+ mainFrameRect.bottom += childRect.Height();
+ else
+ mainFrameRect.right += childRect.Width();
+ }
+ pChild = pChild->GetWindow(GW_HWNDNEXT);
+ }
+
+ // Position multiple instance next to each other
+ CMutex mutex(FALSE, _T("COMMUNICATOR_MOVE"));
+ // ... Lock the mutex, destructor will unlock
+ CSingleLock lock(&mutex, TRUE);
+ nUsageCount++;
+
+ // If at most two instances are running
+ if (nUsageCount <= 2)
+ {
+ // Put main frame in top left corner (0,0)
+ mainFrameRect.right -= mainFrameRect.left;
+ mainFrameRect.bottom -= mainFrameRect.top;
+ mainFrameRect.left = 0;
+ mainFrameRect.top = 0;
+
+ // Position it next to the other instance (if it exists)
+ mainFrameRect.left = mainFrameRect.right * (nUsageCount - 1);
+ mainFrameRect.right = mainFrameRect.right * nUsageCount;
+ }
+
+ AfxGetMainWnd()->MoveWindow(mainFrameRect);
+ }
+ }
+
+void CCommunicatorView::OnIdleUpdateCmdUI()
+ {
+ BOOL bClientSelected = (0 < m_wndClientAddresses.GetSelCount());
+ BOOL bOpen = GetDocument()->IsOpen();
+ BOOL bServer = FALSE;
+ BOOL bClient = FALSE;
+ if (bOpen)
+ {
+ bServer = GetDocument()->IsListening();
+ bClient = !bServer;
+ }
+
+ // Conditionally disable controls
+ // Server
+ m_wndServerGroup. EnableWindow(!bOpen || bServer);
+ m_wndLocalAddressLabel. EnableWindow(!bOpen);
+ m_wndLocalAddress. EnableWindow(!bOpen);
+ m_wndLocalPortLabel. EnableWindow(!bOpen);
+ m_wndLocalPort. EnableWindow(!bOpen);
+ m_wndListen. EnableWindow(!bOpen);
+ m_wndShutdown. EnableWindow(bServer);
+ m_wndSendClient. EnableWindow(bServer && bClientSelected);
+ m_wndDisconnectClient. EnableWindow(bServer && bClientSelected);
+ m_wndClientAddressLabel.EnableWindow(bServer);
+ m_wndClientAddresses. EnableWindow(bServer);
+
+ // Client
+ m_wndClientGroup. EnableWindow(!bOpen || bClient);
+ m_wndRemoteAddressLabel.EnableWindow(!bOpen);
+ m_wndRemoteAddress. EnableWindow(!bOpen);
+ m_wndRemotePortLabel. EnableWindow(!bOpen);
+ m_wndRemotePort. EnableWindow(!bOpen);
+ m_wndConnectServer. EnableWindow(!bOpen);
+ m_wndSendServer. EnableWindow(bClient);
+ m_wndDisconnectServer. EnableWindow(bClient);
+
+ // Global
+ m_wndCancel. EnableWindow(bOpen);
+ }
+
+void CCommunicatorView::PostNcDestroy()
+ {
+ // Relase this instance count
+ CMutex mutex(FALSE, _T("COMMUNICATOR_MOVE"));
+ // ... Lock the mutex, destructor will unlock
+ CSingleLock lock(&mutex, TRUE);
+ nUsageCount--;
+
+ CFormView::PostNcDestroy();
+ }
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.h
new file mode 100644
index 0000000..c916081
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/CommunicatorView.h
@@ -0,0 +1,94 @@
+// CommunicatorView.h : interface of the CCommunicatorView class
+//
+
+/////////////////////////////////////////////////////////////////////////////
+
+class CCommunicatorView : public CFormView
+{
+protected: // create from serialization only
+ CCommunicatorView();
+ DECLARE_DYNCREATE(CCommunicatorView)
+
+public:
+ //{{AFX_DATA(CCommunicatorView)
+ enum { IDD = IDD_COMMUNICATOR_FORM };
+ CButton m_wndCancel;
+ CStatic m_wndLocalPortLabel;
+ CButton m_wndServerGroup;
+ CStatic m_wndRemoteAddressLabel;
+ CStatic m_wndRemotePortLabel;
+ CStatic m_wndLocalAddressLabel;
+ CButton m_wndClientGroup;
+ CStatic m_wndClientAddressLabel;
+ CButton m_wndSendServer;
+ CButton m_wndDisconnectServer;
+ CButton m_wndConnectServer;
+ CEdit m_wndRemotePort;
+ CEdit m_wndRemoteAddress;
+ CButton m_wndDisconnectClient;
+ CButton m_wndSendClient;
+ CButton m_wndShutdown;
+ CButton m_wndListen;
+ CEdit m_wndLocalPort;
+ CEdit m_wndLocalAddress;
+ CListBox m_wndClientAddresses;
+ CEdit m_wndReceivedData;
+ CString m_sLocalAddress;
+ int m_nLocalPort;
+ CString m_sRemoteAddress;
+ int m_nRemotePort;
+ //}}AFX_DATA
+
+// Attributes
+public:
+ CCommunicatorDoc* GetDocument();
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CCommunicatorView)
+ public:
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ virtual void OnInitialUpdate();
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
+ virtual void PostNcDestroy();
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CCommunicatorView();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+ void ShowData(CCommunicatorDoc::CHintData* pHintData);
+ void AddText(LPCTSTR pszText);
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CCommunicatorView)
+ afx_msg void OnConnectServer();
+ afx_msg void OnDisconnectClient();
+ afx_msg void OnDisconnectServer();
+ afx_msg void OnListen();
+ afx_msg void OnSendClient();
+ afx_msg void OnSendServer();
+ afx_msg void OnShutdown();
+ afx_msg void OnIdleUpdateCmdUI();
+ afx_msg void OnCancel();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+#ifndef _DEBUG // debug version in CommunicatorView.cpp
+inline CCommunicatorDoc* CCommunicatorView::GetDocument()
+ { return (CCommunicatorDoc*)m_pDocument; }
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.cpp
new file mode 100644
index 0000000..d1ad445
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.cpp
@@ -0,0 +1,153 @@
+// HexView.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+#include "CommunicatorDoc.h"
+#include "HexView.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CHexView
+
+IMPLEMENT_DYNCREATE(CHexView, CEditView)
+
+CHexView::CHexView()
+ {
+ }
+
+CHexView::~CHexView()
+ {
+ }
+
+
+BEGIN_MESSAGE_MAP(CHexView, CEditView)
+ //{{AFX_MSG_MAP(CHexView)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CHexView diagnostics
+
+#ifdef _DEBUG
+void CHexView::AssertValid() const
+ {
+ CEditView::AssertValid();
+ }
+
+void CHexView::Dump(CDumpContext& dc) const
+ {
+ CEditView::Dump(dc);
+ }
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CHexView message handlers
+
+void CHexView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
+ {
+ UNREFERENCED_PARAMETER(pSender);
+ CCommunicatorDoc::CHintData* pHintData = (CCommunicatorDoc::CHintData*)pHint;
+ CString sText;
+
+ if (lHint == CCommunicatorDoc::NotifyAddData)
+ {
+ sText.Format(_T("%i. Data length = 0x%X (%i)\r\n"),
+ pHintData->m_hClient, pHintData->m_nDataLength, pHintData->m_nDataLength);
+ AddText(sText);
+
+ // Show the received data
+ if (pHintData->m_pData == NULL)
+ {
+ sText = _T("\t\r\n");
+ AddText(sText);
+ return;
+ }
+
+ BYTE* pData = pHintData->m_pData;
+ UINT nMaxIndex = pHintData->m_nDataLength;
+ UINT nIndex = 0;
+ CString sRaw;
+ CString sHex;
+ CString sHexTemp;
+ while (nIndex < nMaxIndex)
+ {
+ // Split in two parts (of 8 bytes) seperated by a space
+ sRaw.Empty();
+ sHex.Empty();
+
+ // ... Add offset
+ sRaw.Format(_T("%4.4X "), nIndex);
+
+ for (int nLoop = 0; nLoop < 2; nLoop++)
+ {
+ // Calculate 8 bytes
+ UINT nPartIndex = 0;
+ while (nPartIndex < 8 && nIndex < nMaxIndex)
+ {
+ if (isprint(pData[nIndex]))
+ sRaw += (char)pData[nIndex];
+ else
+ sRaw += _T('.');
+ sHexTemp.Format(_T("%2.2X "), pData[nIndex]);
+ sHex += sHexTemp;
+ nPartIndex++;
+ nIndex++;
+ }
+
+ sRaw += _T(' ');
+ sHex += _T(' ');
+ }
+
+ // Show the text
+ sText.Format(_T("%-24.24s|%s\r\n"), sRaw, sHex);
+ AddText(sText);
+ }
+ AddText(_T("\r\n"));
+ }
+ }
+
+void CHexView::AddText(LPCTSTR pszText)
+ {
+ LONG nWindowTextLength;
+ nWindowTextLength = GetEditCtrl().GetWindowTextLength();
+ GetEditCtrl().SetSel(nWindowTextLength, nWindowTextLength);
+ GetEditCtrl().ReplaceSel(pszText);
+ }
+
+
+BOOL CHexView::PreCreateWindow(CREATESTRUCT& cs)
+ {
+ BOOL bRet = CEditView::PreCreateWindow(cs);
+ cs.style |= ES_READONLY;
+ return bRet;
+ }
+
+void CHexView::OnInitialUpdate()
+ {
+ CEditView::OnInitialUpdate();
+
+ // Create a fixed size font
+ m_font.CreateFont( 0, // nHeight
+ 0, // nWidth
+ 0, // nEscapement
+ 0, // nOrientation
+ FW_DONTCARE, // nWeight
+ FALSE, // bItalic
+ FALSE, // bUnderline
+ 0, // cStrikeOut
+ DEFAULT_CHARSET, // nCharSet
+ OUT_DEFAULT_PRECIS, // nOutPrecision
+ CLIP_DEFAULT_PRECIS, // nClipPrecision
+ DEFAULT_QUALITY, // nQuality
+ FIXED_PITCH, // nPitchAndFamily
+ NULL); // lpszFacename
+
+ GetEditCtrl().SetFont(&m_font, FALSE);
+ }
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.h
new file mode 100644
index 0000000..df0a2b5
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/HexView.h
@@ -0,0 +1,48 @@
+// HexView.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CHexView view
+
+class CHexView : public CEditView
+{
+protected:
+ CHexView(); // protected constructor used by dynamic creation
+ DECLARE_DYNCREATE(CHexView)
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CHexView)
+ public:
+ virtual void OnInitialUpdate();
+ protected:
+ virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CFont m_font;
+
+ void AddText(LPCTSTR pszText);
+ virtual ~CHexView();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+ // Generated message map functions
+protected:
+ //{{AFX_MSG(CHexView)
+ // NOTE - the ClassWizard will add and remove member functions here.
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.cpp
new file mode 100644
index 0000000..fbacc89
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.cpp
@@ -0,0 +1,128 @@
+// MainFrm.cpp : implementation of the CMainFrame class
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+#include "CommunicatorDoc.h"
+
+#include "MainFrm.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame
+
+IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
+
+BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
+ //{{AFX_MSG_MAP(CMainFrame)
+ ON_WM_CREATE()
+ ON_WM_CLOSE()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+static UINT indicators[] =
+{
+ ID_SEPARATOR, // status line indicator
+ ID_INDICATOR_CAPS,
+ ID_INDICATOR_NUM,
+ ID_INDICATOR_SCRL,
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame construction/destruction
+
+CMainFrame::CMainFrame()
+{
+ // TODO: add member initialization code here
+
+}
+
+CMainFrame::~CMainFrame()
+{
+}
+
+int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
+ return -1;
+ return 0;
+}
+
+BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+ // TODO: Modify the Window class or styles here by modifying
+ // the CREATESTRUCT cs
+// cs.style &= ~WS_MAXIMIZEBOX;
+ cs.style |= WS_MAXIMIZE;
+
+ cs.style &= ~WS_MINIMIZEBOX;
+
+ return CMDIFrameWnd::PreCreateWindow(cs);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame diagnostics
+
+#ifdef _DEBUG
+void CMainFrame::AssertValid() const
+{
+ CMDIFrameWnd::AssertValid();
+}
+
+void CMainFrame::Dump(CDumpContext& dc) const
+{
+ CMDIFrameWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame message handlers
+
+void CMainFrame::OnClose()
+ {
+ // Check whether there are documents that are still blocking
+ // (and thus have started a second message loop)
+ BOOL bBlocking = FALSE;
+
+ POSITION pos;
+ CDocTemplate* pDocTemplate;
+ CCommunicatorDoc* pComDoc;
+
+ // Get the one (and only) document template
+ pos = AfxGetApp()->GetFirstDocTemplatePosition();
+ // ... Should have at least one template
+ ASSERT(pos != 0);
+ pDocTemplate = AfxGetApp()->GetNextDocTemplate(pos);
+ ASSERT(pDocTemplate != 0);
+ // ... Should have exactly one template
+ ASSERT(pos == 0);
+
+ // Iterate all the documents
+ pos = pDocTemplate->GetFirstDocPosition();
+ while (pos != NULL)
+ {
+ pComDoc = (CCommunicatorDoc*)pDocTemplate->GetNextDoc(pos);
+ ASSERT(pComDoc != 0);
+ ASSERT(pComDoc->IsKindOf(RUNTIME_CLASS(CCommunicatorDoc)));
+ if (pComDoc->IsBlocking())
+ {
+ bBlocking = TRUE;
+ pComDoc->CancelBlocking();
+ }
+ }
+
+ // If blocking abort close and repost message
+ if (bBlocking)
+ {
+ TRACE(_T("CMainFrame::OnClose : Detected communicators that are still blocking, cancelling blocking and reposting WM_CLOSE\n"));
+ PostMessage(WM_CLOSE);
+ }
+ else
+ CMDIFrameWnd::OnClose();
+ }
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.h
new file mode 100644
index 0000000..92bf6f9
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/MainFrm.h
@@ -0,0 +1,44 @@
+// MainFrm.h : interface of the CMainFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+class CMainFrame : public CMDIFrameWnd
+{
+ DECLARE_DYNAMIC(CMainFrame)
+public:
+ CMainFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CMainFrame)
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ //}}AFX_VIRTUAL
+
+// Implementation
+public:
+ virtual ~CMainFrame();
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected: // control bar embedded members
+ CStatusBar m_wndStatusBar;
+ CToolBar m_wndToolBar;
+
+// Generated message map functions
+protected:
+ //{{AFX_MSG(CMainFrame)
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg void OnClose();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.cpp
new file mode 100644
index 0000000..0756524
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.cpp
@@ -0,0 +1,87 @@
+// ==========================================================================
+// Class Implementation : COXDataCommunicator
+// ==========================================================================
+
+// Source file : OXDataCommunicator.cpp
+
+//----------------- Dundas Software ----------------------------------------
+//========================================================================
+
+// //////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "OXDataCommunicator.h"
+#include "CommunicatorDoc.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char BASED_CODE THIS_FILE[] = __FILE__;
+#endif
+
+IMPLEMENT_DYNAMIC(COXDataCommunicator, COXCommunicator)
+
+/////////////////////////////////////////////////////////////////////////////
+// Definition of static members
+
+// Data members -------------------------------------------------------------
+// protected:
+
+// private:
+
+// Member functions ---------------------------------------------------------
+// public:
+COXDataCommunicator::COXDataCommunicator(CCommunicatorDoc* pCommunicatorDoc, UINT nStreamBufferSize /* = 4096 */)
+ :
+ COXCommunicator(nStreamBufferSize),
+ m_pCommunicatorDoc(pCommunicatorDoc)
+ {
+ ASSERT_VALID(this);
+ ASSERT(pCommunicatorDoc != NULL);
+ }
+
+void COXDataCommunicator::OnClientCreate(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator)
+ {
+ m_pCommunicatorDoc->OnClientCreate(hClient, pClientCommunicator);
+ }
+
+void COXDataCommunicator::OnClientReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, DWORD nSize, int nErrorCode)
+ {
+ m_pCommunicatorDoc->OnClientReceive(hClient, pClientCommunicator, nSize, nErrorCode);
+ }
+
+void COXDataCommunicator::OnClientClose(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, int nErrorCode)
+ {
+ m_pCommunicatorDoc->OnClientClose(hClient, pClientCommunicator, nErrorCode);
+ }
+
+void COXDataCommunicator::OnServerReceive(DWORD nSize, int nErrorCode)
+ {
+ m_pCommunicatorDoc->OnServerReceive(nSize, nErrorCode);
+ }
+
+void COXDataCommunicator::OnServerClose(int nErrorCode)
+ {
+ m_pCommunicatorDoc->OnServerClose(nErrorCode);
+ }
+
+#ifdef _DEBUG
+void COXDataCommunicator::AssertValid() const
+ {
+ COXCommunicator::AssertValid();
+ }
+
+void COXDataCommunicator::Dump(CDumpContext& dc) const
+ {
+ COXCommunicator::Dump(dc);
+ }
+#endif //_DEBUG
+
+COXDataCommunicator::~COXDataCommunicator()
+ {
+ }
+
+// protected:
+
+// private:
+
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.h
new file mode 100644
index 0000000..a5d6988
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/OXDataCommunicator.h
@@ -0,0 +1,102 @@
+// ==========================================================================
+// Class Specification : COXDataCommunicator
+// ==========================================================================
+
+// Header file : OXDataCommunicator.h
+
+//----------------- Dundas Software ----------------------------------------
+//========================================================================
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Properties:
+// NO Abstract class (does not have any objects)
+// YES Derived from COXCommunicator
+
+// NO Is a Cwnd.
+// NO Two stage creation (constructor & Create())
+// NO Has a message map
+// NO Needs a resource (template)
+
+// NO Persistent objects (saveable on disk)
+// NO Uses exceptions
+
+// //////////////////////////////////////////////////////////////////////////
+
+// Desciption :
+
+// Remark:
+
+// Prerequisites (necessary conditions):
+
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __OXDATACOMMUNICATOR_H__
+#define __OXDATACOMMUNICATOR_H__
+
+#include "OXCommunicator.h"
+
+class CCommunicatorDoc;
+
+class COXDataCommunicator : public COXCommunicator
+{
+DECLARE_DYNAMIC(COXDataCommunicator)
+
+// Data members -------------------------------------------------------------
+public:
+
+protected:
+ CCommunicatorDoc* m_pCommunicatorDoc;
+
+private:
+
+// Member functions ---------------------------------------------------------
+public:
+
+ COXDataCommunicator(CCommunicatorDoc* pCommunicatorDoc, UINT nStreamBufferSize = 4096);
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Constructs the object
+
+ virtual void OnClientCreate(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator);
+ virtual void OnClientReceive(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, DWORD nSize, int nErrorCode);
+ virtual void OnClientClose(HCLIENT_COMMUNICATOR hClient, COXCommunicator* pClientCommunicator, int nErrorCode);
+
+ virtual void OnServerReceive(DWORD nSize, int nErrorCode);
+ virtual void OnServerClose(int nErrorCode);
+
+#ifdef _DEBUG
+ virtual void AssertValid() const;
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : AssertValid performs a validity check on this object
+ // by checking its internal state.
+ // In the Debug version of the library, AssertValid may assert and
+ // thus terminate the program.
+
+ virtual void Dump(CDumpContext& dc) const;
+ // --- In : dc : The diagnostic dump context for dumping, usually afxDump.
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Dumps the contents of the object to a CDumpContext object.
+ // It provides diagnostic services for yourself and
+ // other users of your class.
+ // Note The Dump function does not print a newline character
+ // at the end of its output.
+#endif
+
+ virtual ~COXDataCommunicator();
+ // --- In :
+ // --- Out :
+ // --- Returns :
+ // --- Effect : Destructor of the object
+
+protected:
+
+private:
+};
+
+#endif // __OXDATACOMMUNICATOR_H__
+// ==========================================================================
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/SendDataDlg.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/SendDataDlg.h
new file mode 100644
index 0000000..5a5e19d
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/SendDataDlg.h
@@ -0,0 +1,42 @@
+// SendDataDlg.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CSendDataDlg dialog
+
+#include "OXCommMsg.h"
+
+class CSendDataDlg : public CDialog
+{
+// Construction
+public:
+ CSendDataDlg(COXCommMsg* pCommMsg, CWnd* pParent = NULL); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CSendDataDlg)
+ enum { IDD = IDD_SEND_DATA };
+ CButton m_wndBrowse;
+ CListBox m_wndList;
+ CString m_sValue;
+ int m_nType;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CSendDataDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ COXCommMsg* m_pCommMsg;
+
+ // Generated message map functions
+ //{{AFX_MSG(CSendDataDlg)
+ afx_msg void OnAdd();
+ afx_msg void OnBrowse();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.cpp
new file mode 100644
index 0000000..6dd5774
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.cpp
@@ -0,0 +1,6 @@
+// stdafx.cpp : source file that includes just the standard includes
+// Communicator.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.h
new file mode 100644
index 0000000..518dcc6
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/StdAfx.h
@@ -0,0 +1,17 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+
+#include // MFC core and standard components
+#include // MFC extensions
+#include // MFC OLE automation classes
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include // MFC support for Windows 95 Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include // MFC socket extensions
+
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.ico b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.ico
new file mode 100644
index 0000000..7eef0bc
Binary files /dev/null and b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.ico differ
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.rc2 b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.rc2
new file mode 100644
index 0000000..3e20138
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Communicator.rc2
@@ -0,0 +1,13 @@
+//
+// COMMUNICATOR.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/CommunicatorDoc.ico b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/CommunicatorDoc.ico
new file mode 100644
index 0000000..2a1f1ae
Binary files /dev/null and b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/CommunicatorDoc.ico differ
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Toolbar.bmp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Toolbar.bmp
new file mode 100644
index 0000000..d501723
Binary files /dev/null and b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/res/Toolbar.bmp differ
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/resource.h b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/resource.h
new file mode 100644
index 0000000..13ee706
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/resource.h
@@ -0,0 +1,66 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Communicator.rc
+//
+#define IDD_ABOUTBOX 100
+#define IDP_OLE_INIT_FAILED 100
+#define IDD_COMMUNICATOR_FORM 101
+#define IDP_SOCKETS_INIT_FAILED 104
+#define IDR_MAINFRAME 128
+#define IDR_COMMTYPE 129
+#define IDD_SEND_DATA 130
+#define IDS_INVALID_VALUE 130
+#define IDS_FAILED_LISTEN 131
+#define IDS_FAILED_CONNECT 132
+#define IDC_LOCAL_ADDRESS 1000
+#define IDC_LOCAL_PORT 1001
+#define IDC_CLIENT_ADDRESSES 1002
+#define IDC_SEND_CLIENT 1003
+#define IDC_DISCONNECT_CLIENT 1004
+#define IDC_RECEIVED_DATA 1005
+#define IDC_LISTEN 1006
+#define IDC_CANCEL 1007
+#define IDC_SHUTDOWN 1008
+#define IDC_EMPTY 1009
+#define IDC_LOCAL_ADDRESS_LABEL 1009
+#define IDC_NULL 1010
+#define IDC_LOCAL_PORT_LABEL 1010
+#define IDC_BOOL 1011
+#define IDC_CLIENT_ADDRESSES_LABEL 1011
+#define IDC_UI1 1012
+#define IDC_REMOTE_PORT 1012
+#define IDC_I2 1013
+#define IDC_CONNECT_SERVER 1013
+#define IDC_I4 1014
+#define IDC_DISCONNECT_SERVER 1014
+#define IDC_CY 1015
+#define IDC_SEND_SERVER 1015
+#define IDC_R4 1016
+#define IDC_REMOTE_ADDRESS 1016
+#define IDC_R8 1017
+#define IDC_SPY 1017
+#define IDC_BSTR 1018
+#define IDC_REMOTE_ADDRESS_LABEL 1018
+#define IDC_DATE 1019
+#define IDC_REMOTE_PORT_LABEL 1019
+#define IDC_ERROR 1020
+#define IDC_SERVER_GROUP 1020
+#define IDC_VALUE 1021
+#define IDC_CLIENT_GROUP 1021
+#define IDC_ADD 1022
+#define IDC_LIST 1023
+#define IDC_BINARY 1024
+#define IDC_BROWSE 1025
+#define ID_DESCRIPTION_FILE 61216
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_3D_CONTROLS 1
+#define _APS_NEXT_RESOURCE_VALUE 132
+#define _APS_NEXT_COMMAND_VALUE 32772
+#define _APS_NEXT_CONTROL_VALUE 1022
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/senddatadlg.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/senddatadlg.cpp
new file mode 100644
index 0000000..7699015
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/Communicator/senddatadlg.cpp
@@ -0,0 +1,142 @@
+// SendDataDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Communicator.h"
+#include "SendDataDlg.h"
+#include "OXBlob.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CSendDataDlg dialog
+
+
+CSendDataDlg::CSendDataDlg(COXCommMsg* pCommMsg, CWnd* pParent /*=NULL*/)
+ :
+ CDialog(CSendDataDlg::IDD, pParent),
+ m_pCommMsg(pCommMsg)
+ {
+ //{{AFX_DATA_INIT(CSendDataDlg)
+ m_sValue = _T("");
+ m_nType = 9;
+ //}}AFX_DATA_INIT
+ }
+
+
+void CSendDataDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CSendDataDlg)
+ DDX_Control(pDX, IDC_BROWSE, m_wndBrowse);
+ DDX_Control(pDX, IDC_LIST, m_wndList);
+ DDX_Text(pDX, IDC_VALUE, m_sValue);
+ DDX_Radio(pDX, IDC_EMPTY, m_nType);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CSendDataDlg, CDialog)
+ //{{AFX_MSG_MAP(CSendDataDlg)
+ ON_BN_CLICKED(IDC_ADD, OnAdd)
+ ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CSendDataDlg message handlers
+
+void CSendDataDlg::OnAdd()
+ {
+ UINT nOleType = 0;
+ COXVariant oleVariant;
+ BOOL bSuccess = FALSE;
+ CString sValue;
+
+ UpdateData(TRUE);
+ ASSERT((0 <= m_nType) && (m_nType < COXCommMsg::m_nArgumentTypesCount));
+ nOleType = COXCommMsg::m_types[m_nType];
+
+ // Assign as string and then let OLE convert it
+ oleVariant = m_sValue;
+ long nFileLength = 0;
+ TRY
+ {
+ if (nOleType == COXCommMsg::ATBlob)
+ {
+ COXBlob blob;
+ bSuccess = blob.ReadRaw(m_sValue);
+ nFileLength = blob.GetSize();
+ oleVariant = blob;
+ }
+ else if (nOleType != COXCommMsg::ATError)
+ {
+ oleVariant.ChangeType((VARTYPE)nOleType);
+ bSuccess = TRUE;
+ }
+ else
+ {
+ // Conversions to and from VT_ERROR is not available from OLE
+ // Use a VT_I4 instead
+ oleVariant.ChangeType(COXCommMsg::ATI4);
+ // ... Variant is a union, just change the type
+ // oleVariant.scode = oleVariant.lVal;
+ V_VT(&oleVariant) = (VARTYPE)nOleType;
+ bSuccess = TRUE;
+ }
+ }
+ END_TRY
+
+ if (bSuccess)
+ {
+ m_pCommMsg->Add(oleVariant);
+ // Convert back to string to visualize
+ CString sText;
+ TRY
+ {
+ if (nOleType == COXCommMsg::ATBlob)
+ sText.Format(_T(""), nFileLength);
+ else
+ {
+ if (V_VT(&oleVariant) == COXCommMsg::ATError)
+ // ... Variant is a union, just change the type
+ // oleVariant.lVal= oleVariant.scode ;
+ V_VT(&oleVariant) = COXCommMsg::ATI4;
+ oleVariant.ChangeType(COXCommMsg::ATStr);
+ sText = V_BSTR(&oleVariant);
+ }
+ }
+ END_TRY
+ sValue.Format(_T("%i. (%s) %s"),
+ m_wndList.GetCount() + 1,
+ (LPCTSTR)COXCommMsg::m_typeNames[m_nType],
+ (LPCTSTR)sText);
+ m_wndList.AddString(sValue);
+ m_wndList.SetTopIndex(m_wndList.GetCount() - 1);
+ }
+ else
+ {
+ AfxMessageBox(IDS_INVALID_VALUE, MB_ICONEXCLAMATION);
+ }
+ }
+
+void CSendDataDlg::OnBrowse()
+ {
+ UpdateData(TRUE);
+ static TCHAR szFilter[] = _T("All Files (*.*) | *.* ||");
+ CFileDialog fileDlg(TRUE, NULL, _T("*.*"), NULL, szFilter);
+
+ if (fileDlg.DoModal() == IDOK)
+ {
+ m_sValue = fileDlg.GetPathName();
+ // ... Set to Blob type by default
+ m_nType = 12;
+ UpdateData(FALSE);
+ }
+
+ }
+
diff --git a/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/MailSend/CgiHandler.cpp b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/MailSend/CgiHandler.cpp
new file mode 100644
index 0000000..2d11e20
--- /dev/null
+++ b/UltimateToolbox93_samples/Ultimate Toolbox/archive/samples/MailSend/CgiHandler.cpp
@@ -0,0 +1,162 @@
+// CgiHandler.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "CgiHandler.h"
+#include "CgiToOleDrv.h"
+#include "MailEngine.h"
+#include "XString.h"
+
+#define MR_PROFILE _T("Profile")
+#define MR_PASSWORD _T("Password")
+#define MR_TO _T("To")
+#define MR_SUBJECT _T("Subject")
+#define MR_CONTENT _T("Content")
+#define MR_ATTCOUNT _T("AttCount")
+#define MR_ATTACHMENT _T("Attachment")
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCgiHandler
+
+IMPLEMENT_DYNCREATE(CCgiHandler, COXOwnThreadCmdTarget)
+
+CCgiHandler::CCgiHandler()
+{
+ EnableAutomation();
+ EnableOwnThread();
+
+ AfxOleLockApp();
+}
+
+CCgiHandler::~CCgiHandler()
+{
+ // To terminate the application when all objects created with
+ // with OLE automation, the destructor calls AfxOleUnlockApp.
+
+ AfxOleUnlockApp();
+}
+
+
+void CCgiHandler::OnFinalRelease()
+{
+ // When the last reference for an automation object is released
+ // OnFinalRelease is called. The base class will automatically
+ // deletes the object. Add additional cleanup required for your
+ // object before calling the base class.
+
+ COXOwnThreadCmdTarget::OnFinalRelease();
+}
+
+
+BEGIN_MESSAGE_MAP(CCgiHandler, COXOwnThreadCmdTarget)
+ //{{AFX_MSG_MAP(CCgiHandler)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+BEGIN_DISPATCH_MAP(CCgiHandler, COXOwnThreadCmdTarget)
+ //{{AFX_DISPATCH_MAP(CCgiHandler)
+ DISP_FUNCTION(CCgiHandler, "OnGet", OnGet, VT_EMPTY, VTS_DISPATCH VTS_BSTR)
+ DISP_FUNCTION(CCgiHandler, "OnPost", OnPost, VT_EMPTY, VTS_DISPATCH VTS_BSTR VTS_BSTR)
+ //}}AFX_DISPATCH_MAP
+END_DISPATCH_MAP()
+
+// Note: we add support for IID_ICgiHandler to support typesafe binding
+// from VBA. This IID must match the GUID that is attached to the
+// dispinterface in the .ODL file.
+
+// {48452B96-D40F-11CF-AA2E-00AA00489A36}
+static const IID IID_ICgiHandler =
+{ 0x48452b96, 0xd40f, 0x11cf, { 0xaa, 0x2e, 0x0, 0xaa, 0x0, 0x48, 0x9a, 0x36 } };
+
+BEGIN_INTERFACE_MAP(CCgiHandler, CCmdTarget)
+ INTERFACE_PART(CCgiHandler, IID_ICgiHandler, Dispatch)
+END_INTERFACE_MAP()
+
+// {48452B97-D40F-11CF-AA2E-00AA00489A36}
+IMPLEMENT_OLECREATE(CCgiHandler, "OXSENDMAIL.CGIHANDLER", 0x48452b97, 0xd40f, 0x11cf, 0xaa, 0x2e, 0x0, 0xaa, 0x0, 0x48, 0x9a, 0x36)
+
+/////////////////////////////////////////////////////////////////////////////
+// CCgiHandler message handlers
+
+#include "MailEngine.h"
+
+void CCgiHandler::OnGet(LPDISPATCH pCgiObj, LPCTSTR sCommand)
+{
+ UNUSED(sCommand);
+ CCgiDispatchDrv cgiObj;
+
+ cgiObj.AttachDispatch(pCgiObj, FALSE);
+ cgiObj.SetOutput(_T("\n\n"));
+ cgiObj.SetOutput(_T("CGI Get Method is not supported !!
\n"));
+ cgiObj.SetOutput(_T("\n\n"));
+}
+
+
+void CCgiHandler::OnPost(LPDISPATCH pCgiObj, LPCTSTR sInputType, LPCTSTR sInputBuffer)
+{
+ UNUSED(sInputType);
+ UNUSED(sInputBuffer);
+
+ CCgiDispatchDrv cgiObj;
+ CString sProfile;
+ CString sPassword;
+ CString sTo;
+ CString sSubject;
+ CString sContent;
+ COXString sAttCount;
+ int nAttCount;
+ CStringArray sAttachments;
+ short nLastError;
+ CString sOutputString;
+ COleVariant sInputPar;
+
+ cgiObj.AttachDispatch(pCgiObj, FALSE);
+
+ sInputPar = MR_PROFILE;
+ sProfile = cgiObj.GetInput(sInputPar);
+ sInputPar = MR_PASSWORD;
+ sPassword = cgiObj.GetInput(sInputPar);
+ sInputPar = MR_TO;
+ sTo = cgiObj.GetInput(sInputPar);
+ sInputPar = MR_SUBJECT;
+ sSubject = cgiObj.GetInput(sInputPar);
+ sInputPar = MR_CONTENT;
+ sContent = cgiObj.GetInput(sInputPar);
+ sInputPar = MR_ATTCOUNT;
+ sAttCount = cgiObj.GetInput(sInputPar);
+ nAttCount = sAttCount.GetInt();
+ sInputPar = MR_ATTACHMENT;
+ for (int i=0 ; i"));
+
+ BOOL bResult = theMailEngine.Send(
+ sProfile,
+ sPassword,
+ sTo,
+ sSubject,
+ sContent,
+ sAttachments,
+ nLastError);
+
+ if (bResult)
+ {
+ sOutputString.Format(_T("Mail sent successfully !!
\n"));
+ }
+ else
+ {
+ sOutputString.Format(_T("Mail failed !!
\n"));
+ }
+ cgiObj.SetOutput(sOutputString);
+
+ cgiObj.SetOutput(_T("