[ActiveLock-Development] CVS: activelock/examples/mfc activelock2.cpp,NONE,1.1 activelock2.h,NONE,1.
Brought to you by:
ialkan
Update of /cvsroot/activelock/activelock/examples/mfc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29555 Added Files: activelock2.cpp activelock2.h LeftView.cpp LeftView.h MainFrm.cpp MainFrm.h MFCSample.cpp MFCSample.dsp MFCSample.dsw MFCSample.h MFCSample.odl MFCSample.rc MFCSample.reg MFCSampleDoc.cpp MFCSampleDoc.h MFCSampleView.cpp MFCSampleView.h ReadMe.txt Resource.h StdAfx.cpp StdAfx.h Log Message: Batch commit for 2.0.5--see individual module change logs for details --- NEW FILE: activelock2.cpp --- // Machine generated IDispatch wrapper class(es) created with ClassWizard #include "stdafx.h" #include "activelock2.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // _IActiveLock properties ///////////////////////////////////////////////////////////////////////////// // _IActiveLock operations void _IActiveLock::SetLockType(long nNewValue) { static BYTE parms[] = VTS_I4; InvokeHelper(0x6803000a, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, nNewValue); } long _IActiveLock::GetLockType() { long result; InvokeHelper(0x6803000a, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); return result; } void _IActiveLock::SetSoftwareName(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030009, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _IActiveLock::GetSoftwareName() { CString result; InvokeHelper(0x68030009, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } void _IActiveLock::SetSoftwareCode(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030008, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } void _IActiveLock::SetSoftwareVersion(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030007, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _IActiveLock::GetSoftwareVersion() { CString result; InvokeHelper(0x68030007, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } void _IActiveLock::SetKeyStoreType(long nNewValue) { static BYTE parms[] = VTS_I4; InvokeHelper(0x68030006, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, nNewValue); } void _IActiveLock::SetKeyStorePath(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030005, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _IActiveLock::GetInstallationCode(LPCTSTR User) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030004, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, parms, User); return result; } void _IActiveLock::SetAutoRegisterKeyPath(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030012, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _IActiveLock::LockCode(LPDISPATCH* Lic) { CString result; static BYTE parms[] = VTS_PDISPATCH; InvokeHelper(0x6003000b, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, Lic); return result; } void _IActiveLock::Register(LPCTSTR LibKey) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x6003000c, DISPATCH_METHOD, VT_EMPTY, NULL, parms, LibKey); } CString _IActiveLock::Transfer(LPCTSTR InstallCode) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x6003000d, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, InstallCode); return result; } void _IActiveLock::Init() { InvokeHelper(0x6003000e, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); } void _IActiveLock::Acquire() { InvokeHelper(0x6003000f, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); } void _IActiveLock::Release() { InvokeHelper(0x60030010, DISPATCH_METHOD, VT_EMPTY, NULL, NULL); } LPDISPATCH _IActiveLock::GetEventNotifier() { LPDISPATCH result; InvokeHelper(0x68030003, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result, NULL); return result; } long _IActiveLock::GetUsedDays() { long result; InvokeHelper(0x68030002, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); return result; } CString _IActiveLock::GetRegisteredDate() { CString result; InvokeHelper(0x68030001, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _IActiveLock::GetRegisteredUser() { CString result; InvokeHelper(0x68030011, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _IActiveLock::GetExpirationDate() { CString result; InvokeHelper(0x68030000, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } ///////////////////////////////////////////////////////////////////////////// // _Globals properties ///////////////////////////////////////////////////////////////////////////// // _Globals operations LPDISPATCH _Globals::NewInstance() { LPDISPATCH result; InvokeHelper(0x60030000, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, NULL); return result; } LPDISPATCH _Globals::CreateProductLicense(LPCTSTR name, LPCTSTR Ver, LPCTSTR Code, long Flags, long LicType, LPCTSTR Licensee, LPCTSTR Expiration, LPCTSTR LicKey, LPCTSTR RegisteredDate, LPCTSTR Hash1, short MaxUsers) { LPDISPATCH result; static BYTE parms[] = VTS_BSTR VTS_BSTR VTS_BSTR VTS_I4 VTS_I4 VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_I2; InvokeHelper(0x60030001, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, name, Ver, Code, Flags, LicType, Licensee, Expiration, LicKey, RegisteredDate, Hash1, MaxUsers); return result; } CString _Globals::TrimNulls(LPCTSTR str) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x60030004, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, str); return result; } CString _Globals::MD5Hash(LPCTSTR str) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x60030005, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, str); return result; } CString _Globals::Base64Encode(LPCTSTR str) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x60030006, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, str); return result; } CString _Globals::Base64Decode(LPCTSTR strEncoded) { CString result; static BYTE parms[] = VTS_BSTR; InvokeHelper(0x60030007, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, strEncoded); return result; } CString _Globals::RSASign(LPCTSTR strPub, LPCTSTR strPriv, LPCTSTR strdata) { CString result; static BYTE parms[] = VTS_BSTR VTS_BSTR VTS_BSTR; InvokeHelper(0x60030008, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms, strPub, strPriv, strdata); return result; } long _Globals::RSAVerify(LPCTSTR strPub, LPCTSTR strdata, LPCTSTR strSig) { long result; static BYTE parms[] = VTS_BSTR VTS_BSTR VTS_BSTR; InvokeHelper(0x60030009, DISPATCH_METHOD, VT_I4, (void*)&result, parms, strPub, strdata, strSig); return result; } ///////////////////////////////////////////////////////////////////////////// // _ProductLicense properties ///////////////////////////////////////////////////////////////////////////// // _ProductLicense operations void _ProductLicense::SetLicenseType(long* newValue) { static BYTE parms[] = VTS_PI4; InvokeHelper(0x68030013, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue); } long _ProductLicense::GetLicenseType() { long result; InvokeHelper(0x68030013, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); return result; } CString _ProductLicense::GetProductName() { CString result; InvokeHelper(0x68030012, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::GetProductVer() { CString result; InvokeHelper(0x68030011, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } void _ProductLicense::SetProductKey(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x68030010, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _ProductLicense::GetProductKey() { CString result; InvokeHelper(0x68030010, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::GetLicenseClass() { CString result; InvokeHelper(0x6803000f, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } void _ProductLicense::SetLicensee(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x6803000e, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _ProductLicense::GetLicensee() { CString result; InvokeHelper(0x6803000e, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } void _ProductLicense::SetLicenseKey(LPCTSTR lpszNewValue) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x6803000d, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, lpszNewValue); } CString _ProductLicense::GetLicenseKey() { CString result; InvokeHelper(0x6803000d, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::GetExpiration() { CString result; InvokeHelper(0x6803000c, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::GetRegisteredDate() { CString result; InvokeHelper(0x6803000b, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } long _ProductLicense::GetMaxCount() { long result; InvokeHelper(0x6803000a, DISPATCH_PROPERTYGET, VT_I4, (void*)&result, NULL); return result; } CString _ProductLicense::GetLastUsed() { CString result; InvokeHelper(0x68030009, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::GetHash1() { CString result; InvokeHelper(0x68030008, DISPATCH_PROPERTYGET, VT_BSTR, (void*)&result, NULL); return result; } CString _ProductLicense::ToString() { CString result; InvokeHelper(0x60030014, DISPATCH_METHOD, VT_BSTR, (void*)&result, NULL); return result; } void _ProductLicense::Load(LPCTSTR strLic) { static BYTE parms[] = VTS_BSTR; InvokeHelper(0x60030015, DISPATCH_METHOD, VT_EMPTY, NULL, parms, strLic); } void _ProductLicense::Save(BSTR* strOut) { static BYTE parms[] = VTS_PBSTR; InvokeHelper(0x60030016, DISPATCH_METHOD, VT_EMPTY, NULL, parms, strOut); } ///////////////////////////////////////////////////////////////////////////// // _ActiveLockEventNotifier properties ///////////////////////////////////////////////////////////////////////////// // _ActiveLockEventNotifier operations ///////////////////////////////////////////////////////////////////////////// // __ActiveLockEventNotifier properties ///////////////////////////////////////////////////////////////////////////// // __ActiveLockEventNotifier operations void __ActiveLockEventNotifier::ValidateValue(BSTR* Value) { static BYTE parms[] = VTS_PBSTR; InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Value); } --- NEW FILE: activelock2.h --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ // Machine generated IDispatch wrapper class(es) created with ClassWizard ///////////////////////////////////////////////////////////////////////////// // _IActiveLock wrapper class class _IActiveLock : public COleDispatchDriver { public: _IActiveLock() {} // Calls COleDispatchDriver default constructor _IActiveLock(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} _IActiveLock(const _IActiveLock& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: void SetLockType(long nNewValue); long GetLockType(); void SetSoftwareName(LPCTSTR lpszNewValue); CString GetSoftwareName(); void SetSoftwareCode(LPCTSTR lpszNewValue); void SetSoftwareVersion(LPCTSTR lpszNewValue); CString GetSoftwareVersion(); void SetKeyStoreType(long nNewValue); void SetKeyStorePath(LPCTSTR lpszNewValue); CString GetInstallationCode(LPCTSTR User); void SetAutoRegisterKeyPath(LPCTSTR lpszNewValue); CString LockCode(LPDISPATCH* Lic); void Register(LPCTSTR LibKey); CString Transfer(LPCTSTR InstallCode); void Init(); void Acquire(); void Release(); LPDISPATCH GetEventNotifier(); long GetUsedDays(); CString GetRegisteredDate(); CString GetRegisteredUser(); CString GetExpirationDate(); }; ///////////////////////////////////////////////////////////////////////////// // _Globals wrapper class class _Globals : public COleDispatchDriver { public: _Globals() {} // Calls COleDispatchDriver default constructor _Globals(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} _Globals(const _Globals& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: LPDISPATCH NewInstance(); LPDISPATCH CreateProductLicense(LPCTSTR name, LPCTSTR Ver, LPCTSTR Code, long Flags, long LicType, LPCTSTR Licensee, LPCTSTR Expiration, LPCTSTR LicKey, LPCTSTR RegisteredDate, LPCTSTR Hash1, short MaxUsers); CString TrimNulls(LPCTSTR str); CString MD5Hash(LPCTSTR str); CString Base64Encode(LPCTSTR str); CString Base64Decode(LPCTSTR strEncoded); CString RSASign(LPCTSTR strPub, LPCTSTR strPriv, LPCTSTR strdata); long RSAVerify(LPCTSTR strPub, LPCTSTR strdata, LPCTSTR strSig); }; ///////////////////////////////////////////////////////////////////////////// // _ProductLicense wrapper class class _ProductLicense : public COleDispatchDriver { public: _ProductLicense() {} // Calls COleDispatchDriver default constructor _ProductLicense(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} _ProductLicense(const _ProductLicense& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: void SetLicenseType(long* newValue); long GetLicenseType(); CString GetProductName(); CString GetProductVer(); void SetProductKey(LPCTSTR lpszNewValue); CString GetProductKey(); CString GetLicenseClass(); void SetLicensee(LPCTSTR lpszNewValue); CString GetLicensee(); void SetLicenseKey(LPCTSTR lpszNewValue); CString GetLicenseKey(); CString GetExpiration(); CString GetRegisteredDate(); long GetMaxCount(); CString GetLastUsed(); CString GetHash1(); CString ToString(); void Load(LPCTSTR strLic); void Save(BSTR* strOut); }; ///////////////////////////////////////////////////////////////////////////// // _ActiveLockEventNotifier wrapper class class _ActiveLockEventNotifier : public COleDispatchDriver { public: _ActiveLockEventNotifier() {} // Calls COleDispatchDriver default constructor _ActiveLockEventNotifier(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} _ActiveLockEventNotifier(const _ActiveLockEventNotifier& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: }; ///////////////////////////////////////////////////////////////////////////// // __ActiveLockEventNotifier wrapper class class __ActiveLockEventNotifier : public COleDispatchDriver { public: __ActiveLockEventNotifier() {} // Calls COleDispatchDriver default constructor __ActiveLockEventNotifier(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {} __ActiveLockEventNotifier(const __ActiveLockEventNotifier& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} // Attributes public: // Operations public: void ValidateValue(BSTR* Value); }; --- NEW FILE: LeftView.cpp --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * LeftView.cpp : implementation of the CLeftView class */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ #include "stdafx.h" #include "MFCSample.h" #include "MFCSampleDoc.h" #include "LeftView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CLeftView IMPLEMENT_DYNCREATE(CLeftView, CTreeView) BEGIN_MESSAGE_MAP(CLeftView, CTreeView) //{{AFX_MSG_MAP(CLeftView) // 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 printing commands ON_COMMAND(ID_FILE_PRINT, CTreeView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CTreeView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CTreeView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CLeftView construction/destruction CLeftView::CLeftView() { // TODO: add construction code here } CLeftView::~CLeftView() { } BOOL CLeftView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CTreeView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CLeftView drawing void CLeftView::OnDraw(CDC* pDC) { CMFCSampleDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CLeftView printing BOOL CLeftView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CLeftView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CLeftView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } void CLeftView::OnInitialUpdate() { CTreeView::OnInitialUpdate(); // TODO: You may populate your TreeView with items by directly accessing // its tree control through a call to GetTreeCtrl(). } ///////////////////////////////////////////////////////////////////////////// // CLeftView diagnostics #ifdef _DEBUG void CLeftView::AssertValid() const { CTreeView::AssertValid(); } void CLeftView::Dump(CDumpContext& dc) const { CTreeView::Dump(dc); } CMFCSampleDoc* CLeftView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCSampleDoc))); return (CMFCSampleDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CLeftView message handlers --- NEW FILE: LeftView.h --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ // LeftView.h : interface of the CLeftView class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_LEFTVIEW_H__DDEDD8C6_C35B_4816_9720_A2E5C8F511BB__INCLUDED_) #define AFX_LEFTVIEW_H__DDEDD8C6_C35B_4816_9720_A2E5C8F511BB__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CMFCSampleDoc; class CLeftView : public CTreeView { protected: // create from serialization only CLeftView(); DECLARE_DYNCREATE(CLeftView) // Attributes public: CMFCSampleDoc* GetDocument(); // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CLeftView) public: virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnInitialUpdate(); // called first time after construct //}}AFX_VIRTUAL // Implementation public: virtual ~CLeftView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: //{{AFX_MSG(CLeftView) // 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() }; #ifndef _DEBUG // debug version in LeftView.cpp inline CMFCSampleDoc* CLeftView::GetDocument() { return (CMFCSampleDoc*)m_pDocument; } #endif ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_LEFTVIEW_H__DDEDD8C6_C35B_4816_9720_A2E5C8F511BB__INCLUDED_) --- NEW FILE: MainFrm.cpp --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * MainFrm.cpp : implementation of the CMainFrame class */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ #include "stdafx.h" #include "MFCSample.h" #include "MainFrm.h" #include "LeftView.h" #include "MFCSampleView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code ! ON_WM_CREATE() //}}AFX_MSG_MAP ON_UPDATE_COMMAND_UI_RANGE(AFX_ID_VIEW_MINIMUM, AFX_ID_VIEW_MAXIMUM, OnUpdateViewStyles) ON_COMMAND_RANGE(AFX_ID_VIEW_MINIMUM, AFX_ID_VIEW_MAXIMUM, OnViewStyle) 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 (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; // fail to create } if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } // TODO: Delete these three lines if you don't want the toolbar to // be dockable m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); return 0; } BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { // create splitter window if (!m_wndSplitter.CreateStatic(this, 1, 2)) return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(100, 100), pContext) || !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CMFCSampleView), CSize(100, 100), pContext)) { m_wndSplitter.DestroyWindow(); return FALSE; } return TRUE; } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlers CMFCSampleView* CMainFrame::GetRightPane() { CWnd* pWnd = m_wndSplitter.GetPane(0, 1); CMFCSampleView* pView = DYNAMIC_DOWNCAST(CMFCSampleView, pWnd); return pView; } void CMainFrame::OnUpdateViewStyles(CCmdUI* pCmdUI) { // TODO: customize or extend this code to handle choices on the // View menu. CMFCSampleView* pView = GetRightPane(); // if the right-hand pane hasn't been created or isn't a view, // disable commands in our range if (pView == NULL) pCmdUI->Enable(FALSE); else { DWORD dwStyle = pView->GetStyle() & LVS_TYPEMASK; // if the command is ID_VIEW_LINEUP, only enable command // when we're in LVS_ICON or LVS_SMALLICON mode if (pCmdUI->m_nID == ID_VIEW_LINEUP) { if (dwStyle == LVS_ICON || dwStyle == LVS_SMALLICON) pCmdUI->Enable(); else pCmdUI->Enable(FALSE); } else { // otherwise, use dots to reflect the style of the view pCmdUI->Enable(); BOOL bChecked = FALSE; switch (pCmdUI->m_nID) { case ID_VIEW_DETAILS: bChecked = (dwStyle == LVS_REPORT); break; case ID_VIEW_SMALLICON: bChecked = (dwStyle == LVS_SMALLICON); break; case ID_VIEW_LARGEICON: bChecked = (dwStyle == LVS_ICON); break; case ID_VIEW_LIST: bChecked = (dwStyle == LVS_LIST); break; default: bChecked = FALSE; break; } pCmdUI->SetRadio(bChecked ? 1 : 0); } } } void CMainFrame::OnViewStyle(UINT nCommandID) { // TODO: customize or extend this code to handle choices on the // View menu. CMFCSampleView* pView = GetRightPane(); // if the right-hand pane has been created and is a CMFCSampleView, // process the menu commands... if (pView != NULL) { DWORD dwStyle = -1; switch (nCommandID) { case ID_VIEW_LINEUP: { // ask the list control to snap to grid CListCtrl& refListCtrl = pView->GetListCtrl(); refListCtrl.Arrange(LVA_SNAPTOGRID); } break; // other commands change the style on the list control case ID_VIEW_DETAILS: dwStyle = LVS_REPORT; break; case ID_VIEW_SMALLICON: dwStyle = LVS_SMALLICON; break; case ID_VIEW_LARGEICON: dwStyle = LVS_ICON; break; case ID_VIEW_LIST: dwStyle = LVS_LIST; break; } // change the style; window will repaint automatically if (dwStyle != -1) pView->ModifyStyle(LVS_TYPEMASK, dwStyle); } } --- NEW FILE: MainFrm.h --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ // MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MAINFRM_H__9EE8E3EE_C575_43F2_A1D0_7383E048BF02__INCLUDED_) #define AFX_MAINFRM_H__9EE8E3EE_C575_43F2_A1D0_7383E048BF02__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CMFCSampleView; class CMainFrame : public CFrameWnd { protected: // create from serialization only CMainFrame(); DECLARE_DYNCREATE(CMainFrame) // Attributes protected: CSplitterWnd m_wndSplitter; public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainFrame) public: virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); virtual BOOL PreCreateWindow(CREATESTRUCT& cs); //}}AFX_VIRTUAL // Implementation public: virtual ~CMainFrame(); CMFCSampleView* GetRightPane(); #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); // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG afx_msg void OnUpdateViewStyles(CCmdUI* pCmdUI); afx_msg void OnViewStyle(UINT nCommandID); DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MAINFRM_H__9EE8E3EE_C575_43F2_A1D0_7383E048BF02__INCLUDED_) --- NEW FILE: MFCSample.cpp --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * Sample MFC Application. */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ #include "stdafx.h" #include "MFCSample.h" #include "MainFrm.h" #include "MFCSampleDoc.h" #include "LeftView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMFCSampleApp BEGIN_MESSAGE_MAP(CMFCSampleApp, CWinApp) //{{AFX_MSG_MAP(CMFCSampleApp) 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) // Standard print setup command ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMFCSampleApp construction CMFCSampleApp::CMFCSampleApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// // The one and only CMFCSampleApp object CMFCSampleApp theApp; // This identifier was generated to be statistically unique for your app. // You may change it if you prefer to choose a specific identifier. // {7800A88E-6BCD-4BF7-B830-C8B3002AADC7} static const CLSID clsid = { 0x7800a88e, 0x6bcd, 0x4bf7, { 0xb8, 0x30, 0xc8, 0xb3, 0x0, 0x2a, 0xad, 0xc7 } }; ///////////////////////////////////////////////////////////////////////////// // CMFCSampleApp initialization BOOL CMFCSampleApp::InitInstance() { // Initialize OLE libraries if (!AfxOleInit()) { AfxMessageBox(IDP_OLE_INIT_FAILED); return FALSE; } AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // TODO: You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T("Local AppWizard-Generated Applications")); 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. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMFCSampleDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CLeftView)); AddDocTemplate(pDocTemplate); // 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, TRUE); // Note: SDI applications register server objects only if /Embedding // or /Automation is present on the command line. // 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) { // Register all OLE server (factories) as running. This enables the // OLE libraries to create objects from other applications. COleTemplateServer::RegisterAll(); // 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 one and only window has been initialized, so show and update it. m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); // ActiveLock initialization _Globals* alGlobals; // Obtain IActiveLock Instance alGlobals = new _Globals(); alGlobals->CreateDispatch(_T("ActiveLock2.Globals")); m_ActiveLock = alGlobals->NewInstance(); // Initialize ActiveLock properties m_ActiveLock.SetSoftwareName(_T("TestApp")); m_ActiveLock.SetSoftwareVersion(_T("1.0")); m_ActiveLock.SetSoftwareCode(_T("AAAAB3NzaC1yc2EAAAABJQAAAIB8/B2KWoai2WSGTRPcgmMoczeXpd8nv0Y4r1sJ1wV3vH21q4rTpEYuBiD4HFOpkbNBSRdpBHJGWec7jUi8ISV0pM6i2KznjhCms5CEtYHRybbiYvRXleGzFsAAP817PLN3JYo3WkErT2ofR5RCkfhmx060BT8waPoqnn3AB7sZ0Q==")); m_ActiveLock.SetLockType(0); // lockToNone try { m_ActiveLock.SetKeyStoreType(1); // alsFile m_ActiveLock.SetKeyStorePath(_T("c:\\al.lic")); // This could raise an error if al.lic doesn't exist m_ActiveLock.SetAutoRegisterKeyPath(_T("c:\\testapp.alb")); m_ActiveLock.Init(); // Initialize the instance m_ActiveLock.Acquire(); // Check to see if we have a valid license } catch (CException* ce) { ce->ReportError(); m_ActiveLock = NULL; alGlobals = NULL; return FALSE; } catch (...) { AfxMessageBox("I don't know what happened, but it crashed. Have a nice day!"); return FALSE; } return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialog Data //{{AFX_DATA(CAboutDlg) enum { IDD = IDD_ABOUTBOX }; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAboutDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: //{{AFX_MSG(CAboutDlg) // No message handlers //}}AFX_MSG DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAboutDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) //{{AFX_MSG_MAP(CAboutDlg) // No message handlers //}}AFX_MSG_MAP END_MESSAGE_MAP() // App command to run the dialog void CMFCSampleApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); } ///////////////////////////////////////////////////////////////////////////// // CMFCSampleApp message handlers --- NEW FILE: MFCSample.dsp --- # Microsoft Developer Studio Project File - Name="MFCSample" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=MFCSample - Win32 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 "MFCSample.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 "MFCSample.mak" CFG="MFCSample - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "MFCSample - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "MFCSample - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "MFCSample - 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 6 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x1009 /d "NDEBUG" /d "_AFXDLL" # ADD RSC /l 0x1009 /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 # ADD LINK32 /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "MFCSample - 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 Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x1009 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0x1009 /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 /pdbtype:sept # ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "MFCSample - Win32 Release" # Name "MFCSample - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\activelock2.cpp # End Source File # Begin Source File SOURCE=.\LeftView.cpp # End Source File # Begin Source File SOURCE=.\MainFrm.cpp # End Source File # Begin Source File SOURCE=.\MFCSample.cpp # End Source File # Begin Source File SOURCE=.\MFCSample.odl # End Source File # Begin Source File SOURCE=.\MFCSample.rc # End Source File # Begin Source File SOURCE=.\MFCSampleDoc.cpp # End Source File # Begin Source File SOURCE=.\MFCSampleView.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" # Begin Source File SOURCE=.\activelock2.h # End Source File # Begin Source File SOURCE=.\LeftView.h # End Source File # Begin Source File SOURCE=.\MainFrm.h # End Source File # Begin Source File SOURCE=.\MFCSample.h # End Source File # Begin Source File SOURCE=.\MFCSampleDoc.h # End Source File # Begin Source File SOURCE=.\MFCSampleView.h # End Source File # Begin Source File SOURCE=.\Resource.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;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\res\MFCSample.ico # End Source File # Begin Source File SOURCE=.\res\MFCSample.rc2 # End Source File # Begin Source File SOURCE=.\res\MFCSampleDoc.ico # End Source File # Begin Source File SOURCE=.\res\Toolbar.bmp # End Source File # End Group # Begin Source File SOURCE=.\MFCSample.reg # End Source File # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project --- NEW FILE: MFCSample.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "MFCSample"=.\MFCSample.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: MFCSample.h --- /** * ActiveLock 2 * Copyright 2004 The ActiveLock Software Group (ASG) * Portions Copyright by Simon Tatham and the PuTTY project. * * All material is the property of the contributing authors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * [o] Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * [o] Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /********************************************************************************************** * Change Log * ========== * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- * 04/11/04 th2tran Created * ***********************************************************************************************/ // MFCSample.h : main header file for the MFCSAMPLE application // #if !defined(AFX_MFCSAMPLE_H__96D514BA_5632_4EAB_B077_BF8616FB909A__INCLUDED_) #define AFX_MFCSAMPLE_H__96D514BA_5632_4EAB_B077_BF8616FB909A__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" // main symbols #include "activelock2.h" // ActiveLock object model ///////////////////////////////////////////////////////////////////////////// // CMFCSampleApp: // See MFCSample.cpp for the implementation of this class // class CMFCSampleApp : public CWinApp { public: CMFCSampleApp(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMFCSampleApp) public: virtual BOOL InitInstance(); //}}AFX_VIRTUAL // Implementation COleTemplateServer m_server; _IActiveLock m_ActiveLock; // Server object for document creation //{{AFX_MSG(CMFCSampleApp) 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() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MFCSAMPLE_H__96D514BA_5632_4EAB_B077_BF8616FB909A__INCLUDED_) --- NEW FILE: MFCSample.odl --- // MFCSample.odl : type library source for MFCSample.exe // This file will be processed by the MIDL compiler to produce the // type library (MFCSample.tlb). [ uuid(772F8E2A-126C-438A-B757-AD4D0372BA4B), version(1.0) ] library MFCSample { importlib("stdole32.tlb"); importlib("stdole2.tlb"); // Primary dispatch interface for CMFCSampleDoc [ uuid(DA41DF8A-D079-4E0F-B89D-952995E7118F) ] dispinterface IMFCSample { properties: // NOTE - ClassWizard will maintain property information here. // Use extreme caution when editing this section. //{{AFX_ODL_PROP(CMFCSampleDoc) //}}AFX_ODL_PROP methods: // NOTE - ClassWizard will maintain method information here. // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CMFCSampleDoc) //}}AFX_ODL_METHOD }; // Class information for CMFCSampleDoc [ uuid(7800A88E-6BCD-4BF7-B830-C8B3002AADC7) ] coclass Document { [default] dispinterface IMFCSample; }; //{{AFX_APPEND_ODL}} //}}AFX_APPEND_ODL}} }; --- NEW FILE: MFCSample.rc --- //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_MAINFRAME ICON DISCARDABLE "res\\MFCSample.ico" IDR_MFCSAMTYPE ICON DISCARDABLE "res\\MFCSampleDoc.ico" ///////////////////////////////////////////////////////////////////////////// // // Bitmap // IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp" ///////////////////////////////////////////////////////////////////////////// // // Toolbar // IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15 BEGIN BUTTON ID_FILE_NEW BUTTON ID_FILE_OPEN BUTTON ID_FILE_SAVE SEPARATOR BUTTON ID_EDIT_CUT BUTTON ID_EDIT_COPY BUTTON ID_EDIT_PASTE SEPARATOR BUTTON ID_FILE_PRINT SEPARATOR BUTTON ID_VIEW_LARGEICON BUTTON ID_VIEW_SMALLICON BUTTON ID_VIEW_LIST BUTTON ID_VIEW_DETAILS SEPARATOR BUTTON ID_APP_ABOUT END ///////////////////////////////////////////////////////////////////////////// // // Menu // IDR_MAINFRAME MENU PRELOAD DISCARDABLE BEGIN POPUP "&File" BEGIN MENUITEM "&New\tCtrl+N", ID_FILE_NEW MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE MENUITEM "Save &As...", ID_FILE_SAVE_AS MENUITEM SEPARATOR MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP MENUITEM SEPARATOR MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED MENUITEM SEPARATOR MENUITEM "E&xit", ID_APP_EXIT END POPUP "&Edit" BEGIN MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO MENUITEM SEPARATOR MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE END POPUP "&View" BEGIN MENUITEM "&Toolbar", ID_VIEW_TOOLBAR MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR END POPUP "&Help" BEGIN MENUITEM "&About MFCSample...", ID_APP_ABOUT END END ///////////////////////////////////////////////////////////////////////////// // // Accelerator // IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE BEGIN "N", ID_FILE_NEW, VIRTKEY, CONTROL "O", ID_FILE_OPEN, VIRTKEY, CONTROL "S", ID_FILE_SAVE, VIRTKEY, CONTROL "P", ID_FILE_PRINT, VIRTKEY, CONTROL "Z", ID_EDIT_UNDO, VIRTKEY, CONTROL "X", ID_EDIT_CUT, VIRTKEY, CONTROL "C", ID_EDIT_COPY, VIRTKEY, CONTROL "V", ID_EDIT_PASTE, VIRTKEY, CONTROL VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT VK_F6, ID_NEXT_PANE, VIRTKEY VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT END ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About MFCSample" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 LTEXT "MFCSample Version 1.0",IDC_STATIC,40,10,119,8, SS_NOPREFIX LTEXT "Copyright (C) 2004",IDC_STATIC,40,25,119,8 DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP 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" ... [truncated message content] |