Main Page

Solitaire Pack Documentation

Generated on Wed May 8 12:38:44 2002 for Solitaire Pack by doxygen 1.2.15


3dshatter.cpp File Reference

#include "stdafx.h"
#include <bmws_3dshatter.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


3dshatter.cpp Source File

3dshatter.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // 3dshatter.cpp
00004 //    Includes component source files related to displaying the 3D shatter.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_3dshatter.cpp>
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


AboutDlg.cpp File Reference

#include "stdafx.h"
#include "AboutDlg.h"
#include <bmws_error.h>
#include <bmws_window.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Variables

HINSTANCE | g_hInst
COLORREF | g_colorHlink
CTSTR g_lpszUserName

Variable Documentation

COLORREF g_colorHlink

Definition at line 26 of file AboutDlg.cpp.

Referenced by CMainWindow::Create(), CAboutDlg::DlgProc(), CMainWindow::OnCommand(), and CMainWindow::PresentUpdate().

HINSTANCE g_hInst

Definition at line 25 of file AboutDlg.cpp.

Referenced by CAboutDlg::CAboutDlg().

CTSTR g_lpszUserName

Definition at line 27 of file AboutDlg.cpp.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


AboutDlg.cpp Source File

AboutDlg.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // AboutDlg.cpp
00004 //    Class to encapsulate the About box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "AboutDlg.h"
00014 #include <bmws_error.h>
00015 #include <bmws_window.h>
00016 //#include <bmws_helpmgr.h>
00017 #include "resource.h"
00018 #include "..\SolpckLC\resource.h"
00019 //#include "..\..\help\solpack\popupid.h"
00020
00021
00022 //----------------------------------------------------------------------------
00023 // Global and external variables
00024 //----------------------------------------------------------------------------
00025 extern HINSTANCE g_hInst;        // Application instance handle
00026 extern COLORREF g_colorHlink;    // Color of hyperlinks
00027 extern CTSTR g_lpszUserName;     // Registered user name
00028 //extern CHelpMgr *g_pHelp;         // Help manager object
00029
00030
00031 //----------------------------------------------------------------------------
00032 // About box context help IDs
00033 //----------------------------------------------------------------------------
00034 /*DWORD CAboutDlg::s_adwPopupHelp[] =
00035 {
00036    IDC_ABOUT_BMWSURL,            IDH_ABOUT_BMWSURL,
00037    IDC_ABOUT_REGISTER,           IDH_ABOUT_REGISTER,
00038    IDC_ABOUT_REG,                IDH_ABOUT_REGUSER,
00039    IDOK,                         IDH_ABOUT_OK,
00040    0,                            0
00041 };*/
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CAboutDlg constructor
00047 //
00048 // Parameters:       None.
00049 //
00050 //----------------------------------------------------------------------------
00051 CAboutDlg::CAboutDlg() : CDlg(IDD_ABOUTBOX)
00052 {
00053    // Loads the icon
00054    m_hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_SOLPACK), IMAGE_ICON, 48, 48,
00055       LR_DEFAULTCOLOR);
00056 }
00057
00058
00059 //----------------------------------------------------------------------------
00060 //
00061 // CAboutDlg destructor
00062 //
00063 //----------------------------------------------------------------------------
00064 CAboutDlg::~CAboutDlg()
00065 {
00066    DestroyIcon(m_hIcon);
00067 }
00068
00069
00070 //----------------------------------------------------------------------------
00071 //
00072 // DlgProc function
00073 //    Function that handles messages to the about box.
00074 //
00075 // Parameters:
00076 //    uMsg:          Message identifer.
00077 //    wParam:        Message-specific parameter.
00078 //    lParam:        Message-specific parameter.
00079 //
00080 // Returns:          TRUE if the message was handled, otherwise FALSE.
00081 //
00082 //----------------------------------------------------------------------------
00083 INT_PTR CAboutDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
00084 {
00085    // Filter out HlinkWindow messages
00086    LRESULT lResult;
00087    if(m_pHlinkWndMgr)
00088    {
00089       DWORD dwReturn = m_pHlinkWndMgr->PreprocessMsg(m_hwndDlg, uMsg, wParam, lParam, &lResult);
00090       if(dwReturn == HLINK_PPM_RETURNDIRECT)
00091          return lResult;
00092       if(dwReturn == HLINK_PPM_RETURNNORMAL)
00093       {
00094          SetWindowLong(m_hwndDlg, DWL_MSGRESULT, lResult);
00095          return TRUE;
00096       }
00097    }
00098
00099    switch(uMsg)
00100    {
00101       // Called when the dialog box is created
00102       case WM_INITDIALOG:
00103       {
00104          // Set the Solitaire Pack icon in place
00105          SendDlgItemMessage(m_hwndDlg, IDC_ABOUT_SOLPACKICON, STM_SETIMAGE, (WPARAM)IMAGE_ICON,
00106             (LPARAM)m_hIcon);
00107
00108          // Add the hyperlink for Bot Productions's web site
00109          CTSTR lpszBMWSUrl(m_hwndDlg, IDC_ABOUT_BMWSURL);
00110          m_pHlinkWndMgr = new CHlinkWindowMgr(1, g_colorHlink);
00111          ENSUREALLOC(m_pHlinkWndMgr);
00112          m_pHlinkWndMgr->AddWnd(GetDlgItem(m_hwndDlg, IDC_ABOUT_BMWSURL), lpszBMWSUrl);
00113
00114          // Set user name, or unregistered message
00115          CTSTR lpszReg;
00116          if(g_lpszUserName)
00117          {
00118             lpszReg.Format(CTSTR(m_hwndDlg, IDC_ABOUT_REG), g_lpszUserName);
00119             ShowWindow(GetDlgItem(m_hwndDlg, IDC_ABOUT_REGISTER), SW_HIDE);
00120          } else
00121             lpszReg.Assign(IDS_UNREGISTERED);
00122          SetDlgItemText(m_hwndDlg, IDC_ABOUT_REG, lpszReg);
00123       } return TRUE;
00124
00125       // Called when a button is clicked
00126       case WM_COMMAND:
00127          if((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL) ||
00128             (LOWORD(wParam) == IDC_ABOUT_REGISTER))
00129          {
00130             EndDialog(m_hwndDlg, LOWORD(wParam));
00131             return 0;
00132          }
00133          break;
00134
00135       case WM_HELP:
00136       case WM_CONTEXTMENU:
00137          //g_pHelp->DialogCSHelp(m_hwndDlg, uMsg, wParam, lParam, CTSTR(), s_adwPopupHelp);
00138          break;
00139    }
00140    return FALSE;
00141 }
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


AboutDlg.h File Reference

#include <bmws_dlg.h>
#include <bmws_hlink.h>

Go to the source code of this file.

Compounds

class | CAboutDlg

Defines

#define | AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Definition at line 10 of file AboutDlg.h.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


AboutDlg.h Source File

AboutDlg.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // AboutDlg.h
00004 //    Class to encapsulate the About box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
00010 #define AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_dlg.h>
00021 #include <bmws_hlink.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CAboutDlg class
00027 //    Encapsulates the About box. Displays program name, icon, version,
00028 //    copyright, link to Bot Productions's web site, registered user name or
00029 //    register button.
00030 //
00031 //----------------------------------------------------------------------------
00032 class CAboutDlg : public CDlg
00033 {
00034 public:
00035    CAboutDlg();
00036    ~CAboutDlg();
00037
00038    INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00039
00040 // static DWORD s_adwPopupHelp[];      // Context-sensitive help identifiers
00041
00042 protected:
00043    HICON m_hIcon;                      // Solpack icon to display
00044    CHlinkWindowMgrPtr m_pHlinkWndMgr;  // Hyperlink window manager
00045 };
00046
00047
00048 #endif // !defined(AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


Action.cpp File Reference

#include "stdafx.h"
#include "Action.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


Action.cpp Source File

Action.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Action.cpp
00004 //    Base class to encapsulate an undoable action. Some simple actions, such
00005 //    as flipping over a card, are stored in CAction objects themselves. Other
00006 //    more complicated actions are stored in classes derived from CAction.
00007 //
00008 //----------------------------------------------------------------------------
00009
00010
00011 //----------------------------------------------------------------------------
00012 // Includes
00013 //----------------------------------------------------------------------------
00014 #include "stdafx.h"
00015 #include "Action.h"
00016
00017
00018 #ifdef BMWS_TRACKMEMALLOC
00019
00020 //----------------------------------------------------------------------------
00021 // CAction object tracking
00022 //----------------------------------------------------------------------------
00023 int CAction::m_scTotalCreated = 0;
00024 int CAction::m_scTotalDeleted = 0;
00025 int CAction::m_scMax = 0;
00026
00027 #endif
00028
00029
00030 //----------------------------------------------------------------------------
00031 //
00032 // CAction constructor
00033 //
00034 // Parameters:
00035 //    pSite:         Interface of the object that handles the action.
00036 //    dwType:        A value specifying what type of action this is.
00037 //    dwData:        Data specific to the type.
00038 //
00039 //----------------------------------------------------------------------------
00040 CAction::CAction(IActionSite *pSite, DWORD dwType, DWORD dwData)
00041 {
00042    // Set initial values for member variables
00043    m_pSite = pSite;
00044    m_dwType = dwType;
00045    m_dwData = dwData;
00046    m_pNext = NULL;
00047    m_pPrev = NULL;
00048    ODS("CAction constructor");
00049
00050 #ifdef BMWS_TRACKMEMALLOC
00051    m_scTotalCreated++;
00052    if(m_scTotalCreated - m_scTotalDeleted > m_scMax)
00053       m_scMax = (m_scTotalCreated - m_scTotalDeleted);
00054 #endif
00055 }
00056
00057
00058 //----------------------------------------------------------------------------
00059 //
00060 // CAction destructor
00061 //
00062 //----------------------------------------------------------------------------
00063 CAction::~CAction()
00064 {
00065    ODS("CAction destructor");
00066 #ifdef BMWS_TRACKMEMALLOC
00067    m_scTotalDeleted++;
00068 #endif
00069 }
00070
00071
00072 //----------------------------------------------------------------------------
00073 //
00074 // Undo function
00075 //    Undoes the action.
00076 //
00077 // Parameters:       None.
00078 //
00079 // Returns:          None.
00080 //
00081 //----------------------------------------------------------------------------
00082 void CAction::Undo()
00083 {
00084    // Tell the owner object to undo this action
00085    m_pSite->UndoAction(this);
00086 }
00087
00088
00089 //----------------------------------------------------------------------------
00090 //
00091 // Redo function
00092 //    Redoes the action.
00093 //
00094 // Parameters:       None.
00095 //
00096 // Returns:          None.
00097 //
00098 //----------------------------------------------------------------------------
00099 void CAction::Redo()
00100 {
00101    // Tell the owner object to redo this action
00102    m_pSite->DoAction(this);
00103 }
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


Action.h File Reference

#include "..\SolpackTLB\Solpack.h"
#include <bmws_string.h>
#include <bmws_array.h>
#include <bmws_ptr.h>

Go to the source code of this file.

Compounds

class | CAction
class | IActionSite

Defines

#define | AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Action.h.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


Action.h Source File

Action.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Action.h
00004 //    Base class to encapsulate an undoable action.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\Solpack.h"
00021 #include <bmws_string.h>
00022 #include <bmws_array.h>
00023 #include <bmws_ptr.h>
00024
00025
00026 //----------------------------------------------------------------------------
00027 // Forward Declaration
00028 //----------------------------------------------------------------------------
00029 class CAction;
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // IActionSite abstract class
00035 //    Enables an object to process an action object.
00036 //
00037 //----------------------------------------------------------------------------
00038 class IActionSite
00039 {
00040 public:
00041    virtual void DoAction(CAction *pAction) = 0;
00042    virtual void UndoAction(CAction *pAction) = 0;
00043 };
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // CAction class
00049 //    Encapsulates an undoable action.
00050 //
00051 //----------------------------------------------------------------------------
00052 class CAction
00053 {
00054 public:
00055    CAction(IActionSite *pSite, DWORD dwType, DWORD dwData);
00056    virtual ~CAction();
00057
00058    void Undo();
00059    void Redo();
00060
00061    CAction *m_pPrev;       // Previous action in list
00062    CAction *m_pNext;       // Next action in list
00063
00064    DWORD m_dwType;         // Type of action
00065    DWORD m_dwData;         // Data for action
00066
00067    // Used to track the number of actions created and deleted
00068 #ifdef BMWS_TRACKMEMALLOC
00069    static int m_scTotalCreated;
00070    static int m_scTotalDeleted;
00071    static int m_scMax;
00072 #endif
00073
00074 protected:
00075    IActionSite *m_pSite;   // Owner object interface (card, pile, engine, etc)
00076 };
00077
00078
00079 #endif // !defined(AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


bmws_3dshatter.cpp File Reference

#include <bmws_3dshatter.h>
#include <bmws_error.h>
#include <dxtmsft3.h>
#include "_dxtmsft.h"
#include "danim_i2.c"

Go to the source code of this file.

Variables

COOMExcep * g_pOOMExcep
const CLSID | CLSID_CrShatter
const IID | IID_ICrShatter
const IID | IID_IDXTRedirect

Variable Documentation

const CLSID CLSID_CrShatter

Initial value:

   {0x63500ae2,0x0858,0x11D2,{0x8c,0xe4,0x00,0xC0,0x4F,0x8e,0xcb,0x10}}

Definition at line 27 of file bmws_3dshatter.cpp.

COOMExcep* g_pOOMExcep

Definition at line 26 of file bmws_3dshatter.cpp.

const IID IID_ICrShatter

Initial value:

   {0x63500AE1,0x0858,0x11D2,{0x8C,0xE4,0x00,0xC0,0x4F,0x8E,0xCB,0x10}}

Definition at line 29 of file bmws_3dshatter.cpp.

const IID IID_IDXTRedirect

Initial value:

   {0x02F5140B,0x626F,0x4019,{0x9C,0x9E,0x2D,0xAA,0x1E,0x93,0xE8,0xFC}}

Definition at line 31 of file bmws_3dshatter.cpp.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


bmws_3dshatter.cpp Source File

bmws_3dshatter.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_3dshatter.cpp
00004 //    Class to assist in displaying a DirectX Media 3D Shatter transform.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_3dshatter.h>
00013 #include <bmws_error.h>
00014 #include <dxtmsft3.h>
00015 #include "_dxtmsft.h"
00016 #include "danim_i2.c"
00017 #ifdef BMWS_3DSHATTER_ELEMENT
00018 #include "mmefxe.h"
00019 #include "mmefxe_i.c"
00020 #endif
00021
00022
00023 //----------------------------------------------------------------------------
00024 // Global and external variables
00025 //----------------------------------------------------------------------------
00026 extern COOMExcep *g_pOOMExcep;   // Out of memory exception object
00027 const CLSID CLSID_CrShatter =
00028    {0x63500ae2,0x0858,0x11D2,{0x8c,0xe4,0x00,0xC0,0x4F,0x8e,0xcb,0x10}};
00029 const IID IID_ICrShatter =
00030    {0x63500AE1,0x0858,0x11D2,{0x8C,0xE4,0x00,0xC0,0x4F,0x8E,0xCB,0x10}};
00031 const IID IID_IDXTRedirect =
00032    {0x02F5140B,0x626F,0x4019,{0x9C,0x9E,0x2D,0xAA,0x1E,0x93,0xE8,0xFC}};
00033 //const IID DIID__IDAViewerControlEvents =
00034    //{0x3584F274,0x61EA,0x11D2,{0x8B,0xD9,0x00,0xC0,0x4F,0xC2,0xF5,0x1D}};
00035 //const IID IID_IDA3ViewerControl =
00036    //{0x09509866,0x79AA,0x11D2,{0x8B,0xF5,0x00,0xC0,0x4F,0xC2,0xF5,0x1D}};
00037 //const IID IID_IDA3Statics =
00038 // {0x6E0B5FC4,0x4D1E,0x11D2,{0xAA,0x53,0x00,0xC0,0x4F,0xC2,0xF6,0x0F}};
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // C3DShatter constructor
00044 //
00045 // Parameters:
00046 //    pHH:           HTML Helper object to use.
00047 //    uidDAVC:       String resource identifier of the DirectAnimation
00048 //                   control's ID.
00049 //
00050 //----------------------------------------------------------------------------
00051 C3DShatter::C3DShatter(CHTMLHelper *pHH, UINT uidDAVC)
00052 {
00053    m_bAnimating = FALSE;
00054    m_uidDAVC = uidDAVC;
00055    m_pHH = pHH;
00056    m_pDAVCEvent = NULL;
00057
00058    CPtr<IHTMLObjectElement, &IID_IHTMLObjectElement> spObjEl(TRUE, m_pHH->GetNamedEl(uidDAVC,
00059       IID_IHTMLObjectElement));
00060    CPtr<IDispatch, &IID_IDispatch> spDispObj;
00061    if(SUCCEEDED(spObjEl->get_object(&spDispObj)))
00062    {
00063       m_spDAVC.Assign(spDispObj);
00064    }
00065    CPtr<IUnknown, &IID_IUnknown> spUnkDAVC = spObjEl;
00066    m_pDAVCEvent = new CEventSink((IEventSinkSite*)this, 0, spUnkDAVC,
00067       DIID__IDAViewerControlEvents);
00068    ENSUREALLOC(m_pDAVCEvent);
00069
00070    m_uidElement = (UINT)-1;
00071 }
00072
00073
00074 //----------------------------------------------------------------------------
00075 //
00076 // C3DShatter destructor
00077 //
00078 //----------------------------------------------------------------------------
00079 C3DShatter::~C3DShatter()
00080 {
00081    if(m_pDAVCEvent)
00082       m_pDAVCEvent->Disconnect();
00083    m_pDAVCEvent = NULL;
00084 }
00085
00086
00087 //----------------------------------------------------------------------------
00088 //
00089 // DoAnimation function
00090 //    Creates, starts, and displays the 3D Shatter.
00091 //
00092 // Parameters:
00093 //    uidElement:    String resource identifier of the element to shatter.
00094 //    bstrImg:       Path to the image to use in the shatter, if uidElement is
00095 //                   -1.
00096 //    cx:            Width, in pixels, of the image.
00097 //    cy:            Height, in pixels, of the image.
00098 //    bstrBkColor:   #AARRGGBB formatted string for the shatter background.
00099 //    dHold1:        Length, in seconds, to display the normal image.
00100 //    dForward:      Length, in seconds, of the forward shatter.
00101 //    dHold2:        Length, in seconds, to display the fully shattered image.
00102 //    dBack:         Length, in seconds, of the backward unshatter.
00103 //
00104 // Returns:
00105 //    One of the DoAnimation errors, or ANIM_3DSHATTER_OK if successful.
00106 //
00107 //----------------------------------------------------------------------------
00108 DWORD C3DShatter::DoAnimation(UINT uidElement, CBSTR& bstrImg, int cx, int cy,
00109                               CBSTR& bstrBkColor, double dHold1, double dForward,
00110                               double dHold2, double dBack)
00111 {
00112    if(!m_spDAVC)
00113       return ANIM_3DSHATTER_NODAVC;
00114
00115    if(m_bAnimating)
00116       EndAnimation();
00117
00118    DWORD dwResult = ANIM_3DSHATTER_OTHER;
00119    m_bAnimating = TRUE;
00120 #ifdef BMWS_3DSHATTER_ELEMENT
00121    IDispRedirectEffect *pRedirectEffect = NULL;
00122    IDXTRedirect *pRedirect = NULL;
00123 #endif
00124    VARIANT vOut, vImg;
00125    VariantInit(&vOut);
00126    VariantInit(&vImg);
00127
00128    try
00129    {
00130       CPtr<IDAStatics, &IID_IDAStatics> m;
00131       CHECKHRCOM(m_spDAVC->get_MeterLibrary(&m));
00132       CPtr<IDA2Statics, &IID_IDA2Statics> m2 = m;
00133       CPtr<IDA3Statics, &IID_IDA3Statics> m3 = m;
00134
00135       CPtr<IDANumber, &IID_IDANumber> spPixel;
00136       CHECKHRCOM(m->get_Pixel(&spPixel));
00137       double dPixel;
00138       CHECKHRCOM(spPixel->Extract(&dPixel));
00139
00140       CPtr<IDAGeometry, &IID_IDAGeometry> pEmptyGeo;
00141       CHECKHRCOM(m->get_EmptyGeometry(&pEmptyGeo));
00142       CPtr<IDABehavior, &IID_IDABehavior> pEmptyGeoBehavior = pEmptyGeo;
00143       CPtr<IDABehavior, &IID_IDABehavior> pSWGeo;
00144       CHECKHRCOM(m->ModifiableBehavior(pEmptyGeo, &pSWGeo));
00145
00146       CPtr<IDAImage, &IID_IDAImage> pEmptyImage;
00147       CHECKHRCOM(m->get_EmptyImage(&pEmptyImage));
00148       CPtr<IDABehavior, &IID_IDABehavior> pEmptyImageBehavior = pEmptyImage;
00149       CPtr<IDABehavior, &IID_IDABehavior> pSWImg;
00150       CHECKHRCOM(m->ModifiableBehavior(pEmptyImageBehavior, &pSWImg));
00151
00152       CPtr<IDAImage, &IID_IDAImage> pRawImg;
00153       m_uidElement = uidElement;
00154       if(uidElement == (UINT)-1)
00155       {
00156          CHECKHRCOM(m->ImportImage(bstrImg, &pRawImg));
00157       } else
00158       {
00159 #ifdef BMWS_3DSHATTER_ELEMENT
00160          CPtr<IHTMLElement, &IID_IHTMLElement> spEl(TRUE, m_pHH->GetNamedEl(uidElement,
00161             IID_IHTMLElement));
00162          CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00163          CHECKHRCOM(spEl->get_style(&spStyle));
00164          CHECKHRCOM(spStyle->put_filter(CBSTR(TEXT("redirect"))));
00165          CPtr<IHTMLFiltersCollection, &IID_IHTMLFiltersCollection> spFilters;
00166          CHECKHRCOM(spEl->get_filters(&spFilters));
00167          VARIANT vInd;
00168          vInd.vt = VT_UINT;
00169          vInd.lVal = 0;
00170          VariantInit(&vOut);
00171          CHECKHRCOM(spFilters->item(&vInd, &vOut));
00172          if(vOut.vt != VT_DISPATCH)
00173             THROW(new CCOMExcep(E_FAIL));
00174          if(SUCCEEDED(vOut.pdispVal->QueryInterface(IID_IDispRedirectEffect,
00175             (LPVOID*)&pRedirectEffect)))
00176          {
00177             CHECKHRCOM(pRedirectEffect->ElementImage(&vImg));
00178             SAFERELEASE(pRedirectEffect);
00179          } else if(SUCCEEDED(vOut.pdispVal->QueryInterface(IID_IDXTRedirect,
00180             (LPVOID*)&pRedirect)))
00181          {
00182             CHECKHRCOM(pRedirect->ElementImage(&vImg));
00183             SAFERELEASE(pRedirect);
00184          } else
00185          {
00186             DISPID dispid;
00187             OLECHAR *lpwszMember = L"ElementImage";
00188             CHECKHRCOM(vOut.pdispVal->GetIDsOfNames(IID_NULL, &lpwszMember, 1,
00189                LOCALE_SYSTEM_DEFAULT, &dispid));
00190             DISPPARAMS dp = { NULL, NULL, 0, 0 };
00191             VariantInit(&vImg);
00192             CHECKHRCOM(vOut.pdispVal->Invoke(dispid, IID_NULL, GetUserDefaultLCID(),
00193                DISPATCH_METHOD, &dp, &vImg, NULL, NULL));
00194          }
00195          if(vImg.vt != VT_DISPATCH)
00196             THROW(new CCOMExcep(E_FAIL));
00197          pRawImg.Assign(vImg.pdispVal);
00198          VariantClear(&vImg);
00199          VariantClear(&vOut);
00200 #endif
00201       }
00202       CPtr<IDABehavior, &IID_IDABehavior> pRawImgBehavior = pRawImg;
00203
00204       dwResult = ANIM_3DSHATTER_NOTRANSFORM;
00205
00206       CPtr<IUnknown, &IID_IUnknown> xf;
00207       CHECKHRCOM(CoCreateInstance(CLSID_CrShatter, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown,
00208          (LPVOID*)&xf));
00209
00210       CPtr<ICrShatter, &IID_ICrShatter> xfShatter = xf;
00211
00212       dwResult = ANIM_3DSHATTER_OTHER;
00213
00214       CHECKHRCOM(xfShatter->put_depth(0.5));
00215       if(bstrBkColor)
00216          CHECKHRCOM(xfShatter->put_backColor(bstrBkColor));
00217       CHECKHRCOM(xfShatter->put_evacuateX(1));
00218       CHECKHRCOM(xfShatter->put_evacuateY(1));
00219       CHECKHRCOM(xfShatter->put_evacuateZ(1));
00220       CHECKHRCOM(xfShatter->put_evacuateDeltaX(0));
00221       CHECKHRCOM(xfShatter->put_evacuateDeltaY(0));
00222       CHECKHRCOM(xfShatter->put_evacuateDeltaZ(0));
00223
00224       CPtr<IDANumber, &IID_IDANumber> pDANumber;
00225       CHECKHRCOM(m->DANumber(0, &pDANumber));
00226       CPtr<IDABehavior, &IID_IDABehavior> pHoldTime;
00227       CHECKHRCOM(pDANumber->Duration(dHold1, &pHoldTime));
00228       CPtr<IDANumber, &IID_IDANumber> pDANumber2;
00229       CHECKHRCOM(m->DANumber(1, &pDANumber2));
00230       CPtr<IDABehavior, &IID_IDABehavior> pHoldTime2;
00231       CHECKHRCOM(pDANumber2->Duration(dHold2, &pHoldTime2));
00232       CPtr<IDANumber, &IID_IDANumber> pForward;
00233       CPtr<IDANumber, &IID_IDANumber> pBack;
00234       CHECKHRCOM(m->Interpolate(0, 1, dForward, &pForward));
00235       CHECKHRCOM(m->Interpolate(1, 0, dBack, &pBack));
00236       CPtr<IDABehavior, &IID_IDABehavior> pForwardBehavior = pForward;
00237       CPtr<IDABehavior, &IID_IDABehavior> pBackBehavior = pBack;
00238
00239       CPtr<IDABehavior, &IID_IDABehavior> pFinalSequence;
00240       IDABehavior* aBvrs[4];
00241       aBvrs[0] = pHoldTime;
00242       aBvrs[1] = pForwardBehavior;
00243       aBvrs[2] = pHoldTime2;
00244       aBvrs[3] = pBackBehavior;
00245
00246       CHECKHRCOM(m3->SequenceArrayEx(4, aBvrs, &pFinalSequence));
00247
00248       CPtr<IDABehavior, &IID_IDABehavior> pEvaluator;
00249       CHECKHRCOM(pFinalSequence->RepeatForever(&pEvaluator));
00250       CPtr<IDANumber, &IID_IDANumber> pEvaluatorNumber = pEvaluator;
00251
00252       CPtr<IDADXTransformResult, &IID_IDADXTransformResult> pResult;
00253       CHECKHRCOM(m2->ApplyDXTransformEx(xf, 1, &pRawImgBehavior, pEvaluatorNumber, &pResult));
00254       CPtr<IDABehavior, &IID_IDABehavior> pRealGeo;
00255       CHECKHRCOM(pResult->get_OutputBvr(&pRealGeo));
00256       CPtr<IDAGeometry, &IID_IDAGeometry> pRealGeoGeometry = pRealGeo;
00257
00258       CPtr<IDATransform3, &IID_IDATransform3> pRealTransScale;
00259       CHECKHRCOM(m->Scale3(cx*.5*dPixel, cy*.5*dPixel, 0.1, &pRealTransScale));
00260
00261       CPtr<IDAGeometry, &IID_IDAGeometry> pRealGeoGeometry2;
00262       CHECKHRCOM(pRealGeoGeometry->Transform(pRealTransScale, &pRealGeoGeometry2));
00263       CPtr<IDABehavior, &IID_IDABehavior> pRealGeo2 = pRealGeoGeometry2;
00264
00265       CHECKHRCOM(pSWGeo->SwitchTo(pRealGeo2));
00266
00267       CPtr<IDACamera, &IID_IDACamera> pCamera;
00268       CHECKHRCOM(m->PerspectiveCamera(0.12, 0.066, &pCamera));
00269       CPtr<IDAGeometry, &IID_IDAGeometry> pAmbientLight;
00270       CHECKHRCOM(m->get_AmbientLight(&pAmbientLight));
00271       CPtr<IDAGeometry, &IID_IDAGeometry> pDirectionalLight;
00272       CHECKHRCOM(m->get_DirectionalLight(&pDirectionalLight));
00273       CPtr<IDAVector3, &IID_IDAVector3> pXVector3;
00274       CHECKHRCOM(m->get_XVector3(&pXVector3));
00275       CPtr<IDATransform3, &IID_IDATransform3> pXRotTrans;
00276       CHECKHRCOM(m->Rotate3Degrees(pXVector3, 90, &pXRotTrans));
00277       CPtr<IDAGeometry, &IID_IDAGeometry> pTransDirLightGeometry;
00278       CHECKHRCOM(pDirectionalLight->Transform(pXRotTrans, &pTransDirLightGeometry));
00279       CPtr<IDAGeometry, &IID_IDAGeometry> pLight;
00280       CHECKHRCOM(m->UnionGeometry(pAmbientLight, pTransDirLightGeometry, &pLight));
00281       CPtr<IDAGeometry, &IID_IDAGeometry> pSWGeoGeometry = pSWGeo;
00282       CPtr<IDAGeometry, &IID_IDAGeometry> pLightAndGeo;
00283       CHECKHRCOM(m->UnionGeometry(pSWGeoGeometry, pLight, &pLightAndGeo));
00284
00285       CPtr<IDAImage, &IID_IDAImage> pFinalImg;
00286       CHECKHRCOM(pLightAndGeo->Render(pCamera, &pFinalImg));
00287       CPtr<IDABehavior, &IID_IDABehavior> pFinalImgBehavior = pFinalImg;
00288       CHECKHRCOM(pSWImg->SwitchTo(pFinalImgBehavior));
00289       CPtr<IDAImage, &IID_IDAImage> pSWImgImage = pSWImg;
00290
00291       CHECKHRCOM(m_spDAVC->put_Image(pSWImgImage));
00292       dwResult = ANIM_3DSHATTER_OK;
00293    }
00294    catch(CCOMExcep *pCOMExcep)
00295    {
00296       VariantClear(&vOut);
00297       VariantClear(&vImg);
00298 #ifdef BMWS_3DSHATTER_ELEMENT
00299       SAFERELEASE(pRedirectEffect);
00300       SAFERELEASE(pRedirect);
00301 #endif
00302       CHECKCOMOOM(pCOMExcep);
00303       pCOMExcep->Delete();
00304       EndAnimation();
00305       return dwResult;
00306    }
00307
00308    m_spDAVC->Start();
00309    m_pHH->ShowElementEx(m_uidDAVC, TRUE);
00310    return dwResult;
00311 }
00312
00313
00314 //----------------------------------------------------------------------------
00315 //
00316 // EndAnimation function
00317 //    Ends and hides the 3D Shatter.
00318 //
00319 // Parameters:       None.
00320 //
00321 // Returns:          None.
00322 //
00323 //----------------------------------------------------------------------------
00324 void C3DShatter::EndAnimation()
00325 {
00326    if(!m_bAnimating)
00327       return;
00328    if(m_spDAVC)
00329    {
00330       if(m_uidElement != (UINT)-1)
00331       {
00332          CPtr<IHTMLElement, &IID_IHTMLElement> spEl(TRUE, m_pHH->GetNamedEl(m_uidElement,
00333             IID_IHTMLElement));
00334          CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00335          CHECKHRCOM(spEl->get_style(&spStyle));
00336          CHECKHRCOM(spStyle->put_filter(CBSTR()));
00337       }
00338       CPtr<IDA3ViewerControl, &IID_IDA3ViewerControl> spDAVC3 = m_spDAVC;
00339       spDAVC3->Stop();
00340    }
00341    m_pHH->ShowElementEx(m_uidDAVC, FALSE);
00342    m_bAnimating = FALSE;
00343 }
00344
00345
00346 //----------------------------------------------------------------------------
00347 //
00348 // IsAnimating function
00349 //    Retrieves the current animation state.
00350 //
00351 // Parameters:       None.
00352 //
00353 // Returns:          TRUE if animation is currently running, else FALSE.
00354 //
00355 //----------------------------------------------------------------------------
00356 BOOL C3DShatter::IsAnimating()
00357 {
00358    return m_bAnimating;
00359 }
00360
00361
00362 //----------------------------------------------------------------------------
00363 //
00364 // IEventSinkSite::EventSink method
00365 //    Handles all events from the DAViewerControl event sink.
00366 //
00367 // Parameters:
00368 //    lParam:        Optional site-specific parameter. (Not used)
00369 //    dispid:        The identifier of the event.
00370 //    pdispparams:   Pointer to any parameters associated with the event.
00371 //
00372 // Returns:          S_OK in all cases.
00373 //
00374 //----------------------------------------------------------------------------
00375 HRESULT C3DShatter::EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS *pdispparams)
00376 {
00377    if(dispid == 0x00001005)
00378       EndAnimation();
00379    return S_OK;
00380 }
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


bmws_3dshatter.h File Reference

#include <bmws_string.h>
#include <bmws_ptr.h>
#include <bmws_htmlhelpers.h>
#include <bmws_eventsink.h>
#include <danim.h>

Go to the source code of this file.

Compounds

class | C3DShatter

Defines

#define | AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
#define | ANIM_3DSHATTER_OK 0
#define | ANIM_3DSHATTER_NOTRANSFORM 1
#define | ANIM_3DSHATTER_NODAVC 2
#define | ANIM_3DSHATTER_OTHER 3

Define Documentation

#define AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_3dshatter.h.

#define ANIM_3DSHATTER_NODAVC 2

Definition at line 27 of file bmws_3dshatter.h.

Referenced by C3DShatter::DoAnimation().

#define ANIM_3DSHATTER_NOTRANSFORM 1

Definition at line 26 of file bmws_3dshatter.h.

Referenced by C3DShatter::DoAnimation().

#define ANIM_3DSHATTER_OK 0

Definition at line 25 of file bmws_3dshatter.h.

Referenced by C3DShatter::DoAnimation().

#define ANIM_3DSHATTER_OTHER 3

Definition at line 28 of file bmws_3dshatter.h.

Referenced by C3DShatter::DoAnimation().

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


bmws_3dshatter.h Source File

bmws_3dshatter.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_3dshatter.h
00004 //    Class to assist in displaying a DirectX Media 3D Shatter transform.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012 //----------------------------------------------------------------------------
00013 // Includes
00014 //----------------------------------------------------------------------------
00015 #include <bmws_string.h>
00016 #include <bmws_ptr.h>
00017 #include <bmws_htmlhelpers.h>
00018 #include <bmws_eventsink.h>
00019 #include <danim.h>
00020
00021
00022 //----------------------------------------------------------------------------
00023 // DoAnimation return values
00024 //----------------------------------------------------------------------------
00025 #define ANIM_3DSHATTER_OK           0
00026 #define ANIM_3DSHATTER_NOTRANSFORM  1
00027 #define ANIM_3DSHATTER_NODAVC       2
00028 #define ANIM_3DSHATTER_OTHER        3
00029
00030
00031 //----------------------------------------------------------------------------
00032 //
00033 // C3DShatter class
00034 //    Assists in displaying a DirectX Media 3D Shatter transform.
00035 //
00036 //----------------------------------------------------------------------------
00037 class C3DShatter : public IEventSinkSite
00038 {
00039 public:
00040    C3DShatter(CHTMLHelper *pHH, UINT uidDAVC);
00041    virtual ~C3DShatter();
00042
00043    DWORD DoAnimation(UINT uidElement, CBSTR& bstrImg, int cx, int cy, CBSTR& bstrBkColor,
00044       double dHold1 = 3.0, double dForward = 5.0, double dHold2 = 1.0, double dBack = 5.0);
00045    void EndAnimation();
00046    BOOL IsAnimating();
00047
00048    // IEventSinkSite method
00049    HRESULT EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams);
00050
00051 protected:
00052    CHTMLHelper *m_pHH;        // HTML Helper object to use
00053    CEventSink *m_pDAVCEvent;  // Event sink for DAControl events
00054    CPtr<IDAViewerControl, &IID_IDAViewerControl> m_spDAVC;  // DAControl interface pointer
00055    UINT m_uidDAVC;            // String resource ID of the DAControl's ID
00056    BOOL m_bAnimating;         // Whether the animation is currently running
00057    UINT m_uidElement;         // String resource identifier of the element to shatter
00058 };
00059
00060
00061 #endif // !defined(AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:46 2002 for Solitaire Pack by doxygen 1.2.15


bmws_array.h File Reference

#include <new.h>

Go to the source code of this file.

Compounds

class | CArray
class | CPtrArray

Defines

#define | AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Functions

template<class T> void | ConstructElements (T *pElements, int nCount)
template<class T> void | DestructElements (T *pElements, int nCount)
template<class T> void | CopyElements (T *pDest, const T *pSrc, int nCount)

Define Documentation

#define AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_array.h.

Function Documentation

void ConstructElements | ( | T * | pElements,
 |  | int | nCount
 | ) |

Definition at line 523 of file bmws_array.h.

References _ASSERT.

00524 {
00525    _ASSERT((nCount == 0) || (pElements != NULL));
00526
00527    // first do bit-wise zero initialization
00528    ZeroMemory(pElements, nCount * sizeof(T));
00529
00530    // then call the constructor(s)
00531    for (; nCount--; pElements++)
00532       new((void*)pElements) T;
00533 }

void CopyElements | ( | T * | pDest,
 |  | const T * | pSrc,
 |  | int | nCount
 | ) |

Definition at line 571 of file bmws_array.h.

References _ASSERT.

00572 {
00573    _ASSERT((nCount == 0) || (pSrc != NULL));
00574    _ASSERT((nCount == 0) || (pDest != NULL));
00575
00576    // default is element-copy using assignment
00577    while(nCount--)
00578       *pDest++ = *pSrc++;
00579 }

void DestructElements | ( | T * | pElements,
 |  | int | nCount
 | ) |

Definition at line 548 of file bmws_array.h.

References _ASSERT.

00549 {
00550    _ASSERT((nCount == 0) || (pElements != NULL));
00551
00552    // call the destructor(s)
00553    for (; nCount--; pElements++)
00554       pElements->~T();
00555 }

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


bmws_array.h Source File

bmws_array.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_array.h
00004 //    Classes to encapsulate arrays.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <new.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CArray template class
00022 //    Encapsulates arrays.
00023 //
00024 // Template parameters:
00025 //    T:             The type of objects stored in the array.
00026 //    TA:            The reference type of objects stored in the array.
00027 //
00028 //----------------------------------------------------------------------------
00029 template <class T, class TA> class CArray
00030 {
00031 public:
00032    CArray();
00033    CArray(T* a, int nCount);
00034    virtual ~CArray();
00035
00036
00037    //-------------------------------------------------------------------------
00038    //
00039    // GetSize function
00040    //    Gets the number of elements in this array.
00041    //
00042    // Parameters:    None.
00043    //
00044    // Returns:       The number of elements in the array.
00045    //
00046    //-------------------------------------------------------------------------
00047    int GetSize() const
00048    {
00049       return m_nSize;
00050    }
00051
00052
00053    //-------------------------------------------------------------------------
00054    //
00055    // RemoveAll function
00056    //    Removes all the elements from this array.
00057    //
00058    // Parameters:    None.
00059    //
00060    // Returns:       None.
00061    //
00062    //-------------------------------------------------------------------------
00063    void RemoveAll()
00064    {
00065       SetSize(0, -1);
00066    }
00067
00068
00069    //-------------------------------------------------------------------------
00070    //
00071    // GetAt function
00072    //    Returns the value at a given index.
00073    //
00074    // Parameters:
00075    //    nIndex:     Zero-based index of the item to retrieve.
00076    //
00077    // Returns:       The item at the specified index.
00078    //
00079    //-------------------------------------------------------------------------
00080    T GetAt(int nIndex) const
00081    {
00082       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00083       return m_pData[nIndex];
00084    }
00085
00086
00087    //-------------------------------------------------------------------------
00088    //
00089    // ElementAt function
00090    //    Returns a reference to the value at a given index.
00091    //
00092    // Parameters:
00093    //    nIndex:     Zero-based index of the item to retrieve.
00094    //
00095    // Returns:       The item at the specified index.
00096    //
00097    //-------------------------------------------------------------------------
00098    T& ElementAt(int nIndex)
00099    {
00100       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00101       return m_pData[nIndex];
00102    }
00103
00104
00105    //-------------------------------------------------------------------------
00106    //
00107    // SetAt function
00108    //    Sets the value for a given index; array not allowed to grow.
00109    //
00110    // Parameters:
00111    //    nIndex:     Zero-based index of the item to set.
00112    //    newElement: Item to insert at this index.
00113    //
00114    // Returns:       None.
00115    //
00116    //-------------------------------------------------------------------------
00117    virtual void SetAt(int nIndex, TA newElement)
00118    {
00119       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00120       T* pElement = &m_pData[nIndex];
00121       if(pElement)
00122          pElement->~T();
00123       m_pData[nIndex] = newElement;
00124    }
00125
00126
00127    //-------------------------------------------------------------------------
00128    //
00129    // GetData functions
00130    //    Provides direct access to the data array.
00131    //
00132    // Parameters:    None.
00133    //
00134    // Returns:       The array that holds items (may be NULL).
00135    //
00136    //-------------------------------------------------------------------------
00137    const T* GetData() const
00138    {
00139       return (const T*)m_pData;
00140    }
00141
00142    T* GetData()
00143    {
00144       return (T*)m_pData;
00145    }
00146
00147
00148    //-------------------------------------------------------------------------
00149    //
00150    // Add function
00151    //    Adds an element to the end of the array; grows array if necessary.
00152    //
00153    // Parameters:
00154    //    newElement: Item to insert at this index.
00155    //
00156    // Returns:       The index of the inserted item.
00157    //
00158    //-------------------------------------------------------------------------
00159    int Add(TA newElement)
00160    {
00161       int nIndex = m_nSize;
00162       SetAtGrow(nIndex, newElement);
00163       return nIndex;
00164    }
00165
00166
00167    //-------------------------------------------------------------------------
00168    //
00169    // [] operators
00170    //
00171    // Parameters:
00172    //    nIndex:     Zero-based index of the item to retrieve.
00173    //
00174    // Returns:       The item at the specified index.
00175    //
00176    //-------------------------------------------------------------------------
00177    T operator[](int nIndex) const
00178    {
00179       return GetAt(nIndex);
00180    }
00181
00182    T& operator[](int nIndex)
00183    {
00184       return ElementAt(nIndex);
00185    }
00186
00187
00188    void InsertAt(int nIndex, TA newElement, int nCount = 1);
00189    void InsertAt(int nIndex, CArray* pNewArray);
00190    virtual void RemoveAt(int nIndex, int nCount = 1);
00191    void SetSize(int nNewSize, int nGrowBy = -1);
00192    void SetAtGrow(int nIndex, TA newElement);
00193    int Append(const CArray& src);
00194    void Copy(const CArray& src);
00195
00196 protected:
00197    T* m_pData;       // Array of data
00198    int m_nSize;      // Number of elements (upperBound - 1)
00199    int m_nMaxSize;   // Max allocated
00200    int m_nGrowBy;    // Grow amount
00201 };
00202
00203
00204 //----------------------------------------------------------------------------
00205 //
00206 // CArray constructor
00207 //
00208 // Parameters:    None.
00209 //
00210 //----------------------------------------------------------------------------
00211 template <class T, class TA> CArray<T, TA>::CArray()
00212 {
00213    m_pData = NULL;
00214    m_nSize = m_nMaxSize = m_nGrowBy = 0;
00215 }
00216
00217
00218 //----------------------------------------------------------------------------
00219 //
00220 // CArray constructor
00221 //
00222 // Parameters:
00223 //    a:             Pointer to first item of an array of the objects.
00224 //    nCount:        Number of items in array a.
00225 //
00226 //----------------------------------------------------------------------------
00227 template <class T, class TA> CArray<T, TA>::CArray(T* a, int nCount)
00228 {
00229    m_pData = NULL;
00230    m_nSize = m_nMaxSize = m_nGrowBy = 0;
00231    SetSize(nCount);
00232    CopyElements<T>(m_pData, a, nCount);
00233 }
00234
00235
00236 //----------------------------------------------------------------------------
00237 //
00238 // CArray destructor
00239 //
00240 //----------------------------------------------------------------------------
00241 template <class T, class TA> CArray<T, TA>::~CArray()
00242 {
00243    if(m_pData != NULL)
00244    {
00245       RemoveAt(0, m_nSize);
00246       SAFEFREEMEMORY(m_pData);
00247    }
00248 }
00249
00250
00251 //----------------------------------------------------------------------------
00252 //
00253 // SetSize function
00254 //    Sets the number of elements to be contained in this array.
00255 //
00256 // Parameters:
00257 //    nNewSize:      The new size of the array. Must be greater than or equal
00258 //                   to zero.
00259 //    nGrowBy:       The minimum number of element slots to allocate if a size
00260 //                   increase is necessary. Defaults to -1, signifying no
00261 //                   change in grow by value.
00262 //
00263 // Returns:          None.
00264 //
00265 //----------------------------------------------------------------------------
00266 template <class T, class TA> void CArray<T, TA>::SetSize(int nNewSize, int nGrowBy)
00267 {
00268    _ASSERT(nNewSize >= 0);
00269
00270    if(nGrowBy != -1)
00271       m_nGrowBy = nGrowBy;  // set new grow by value
00272
00273    if(nNewSize == 0)
00274    {
00275       // shrink to nothing
00276       if(m_pData != NULL)
00277       {
00278          RemoveAt(0, m_nSize);
00279          SAFEFREEMEMORY(m_pData);
00280       }
00281       m_nSize = m_nMaxSize = 0;
00282    }
00283    else if(m_pData == NULL)
00284    {
00285       // create one with exact size
00286       m_pData = (T*)SAFEALLOCMEMORY(nNewSize * sizeof(T));
00287       ConstructElements<T>(m_pData, nNewSize);
00288       m_nSize = m_nMaxSize = nNewSize;
00289    }
00290    else if (nNewSize <= m_nMaxSize)
00291    {
00292       // it fits
00293       if(nNewSize > m_nSize)
00294       {
00295          // initialize the new elements
00296          ConstructElements<T>(&m_pData[m_nSize], nNewSize-m_nSize);
00297       }
00298       else if (m_nSize > nNewSize)
00299       {
00300          // destroy the old elements
00301          RemoveAt(nNewSize, m_nSize - nNewSize);
00302       }
00303       m_nSize = nNewSize;
00304    }
00305    else
00306    {
00307       // otherwise, grow array
00308       int nGrowBy = m_nGrowBy;
00309       if(nGrowBy == 0)
00310       {
00311          // heuristically determine growth when nGrowBy == 0
00312          //  (this avoids heap fragmentation in many situations)
00313          nGrowBy = m_nSize / 8;
00314          nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
00315       }
00316       int nNewMax;
00317       if (nNewSize < m_nMaxSize + nGrowBy)
00318          nNewMax = m_nMaxSize + nGrowBy;  // granularity
00319       else
00320          nNewMax = nNewSize;  // no slush
00321
00322       _ASSERT(nNewMax >= m_nMaxSize); // no wrap around
00323       T* pNewData = (T*)SAFEALLOCMEMORY(nNewMax * sizeof(T));
00324       // copy new data from old
00325       CopyMemory(pNewData, m_pData, m_nSize * sizeof(T));
00326
00327       // construct remaining elements
00328       _ASSERT(nNewSize > m_nSize);
00329       ConstructElements<T>(&pNewData[m_nSize], nNewSize-m_nSize);
00330
00331       // get rid of old stuff (note: no destructors called)
00332       SAFEFREEMEMORY(m_pData);
00333       m_pData = pNewData;
00334       m_nSize = nNewSize;
00335       m_nMaxSize = nNewMax;
00336    }
00337 }
00338
00339
00340 //----------------------------------------------------------------------------
00341 //
00342 // Append function
00343 //    Appends another array to this array; grows this array if necessary.
00344 //
00345 // Parameters:
00346 //    src:           Array containing elements to be appended to this array.
00347 //
00348 // Returns:          The index of the first appended element.
00349 //
00350 //----------------------------------------------------------------------------
00351 template <class T, class TA> int CArray<T, TA>::Append(const CArray& src)
00352 {
00353    _ASSERT(this != &src);   // cannot append to itself
00354
00355    int nOldSize = m_nSize;
00356    SetSize(m_nSize + src.m_nSize);
00357    CopyElements<T>(m_pData + nOldSize, src.m_pData, src.m_nSize);
00358    return nOldSize;
00359 }
00360
00361
00362 //----------------------------------------------------------------------------
00363 //
00364 // Copy function
00365 //    Copies another array to this array; grows this array if necessary.
00366 //
00367 // Parameters:
00368 //    src:           Array containing elements to be copied to this array.
00369 //
00370 // Returns:          None.
00371 //
00372 //----------------------------------------------------------------------------
00373 template <class T, class TA> void CArray<T, TA>::Copy(const CArray& src)
00374 {
00375    _ASSERT(this != &src);   // cannot append to itself
00376
00377    SetSize(src.m_nSize);
00378    CopyElements<T>(m_pData, src.m_pData, src.m_nSize);
00379 }
00380
00381
00382 //----------------------------------------------------------------------------
00383 //
00384 // SetAtGrow function
00385 //    Sets the value for a given index; grows this array if necessary.
00386 //
00387 // Parameters:
00388 //    nIndex:     An integer index that is greater than or equal to 0.
00389 //    newElement: The element to be added to this array; can be NULL.
00390 //
00391 // Returns:       None.
00392 //
00393 //----------------------------------------------------------------------------
00394 template <class T, class TA> void CArray<T, TA>::SetAtGrow(int nIndex, TA newElement)
00395 {
00396    _ASSERT(nIndex >= 0);
00397
00398    if(nIndex >= m_nSize)
00399       SetSize(nIndex+1, -1);
00400    SetAt(nIndex, newElement);
00401 }
00402
00403
00404 //----------------------------------------------------------------------------
00405 //
00406 // InsertAt function
00407 //    Inserts an element at a specified index.
00408 //
00409 // Parameters:
00410 //    nIndex:     An integer index that is greater than or equal to 0.
00411 //    newElement: The element to be placed in this array.
00412 //    nCount:     The number of times this element should be inserted
00413 //                (defaults to 1).
00414 //
00415 // Returns:       None.
00416 //
00417 //----------------------------------------------------------------------------
00418 template <class T, class TA> void CArray<T, TA>::InsertAt(int nIndex, TA newElement, int nCount)
00419 {
00420    _ASSERT(nIndex >= 0);    // will expand to meet need
00421    _ASSERT(nCount > 0);     // zero or negative size not allowed
00422
00423    if(nIndex >= m_nSize)
00424    {
00425       // adding after the end of the array
00426       SetSize(nIndex + nCount, -1);   // grow so nIndex is valid
00427    } else
00428    {
00429       // inserting in the middle of the array
00430       int nOldSize = m_nSize;
00431       SetSize(m_nSize + nCount, -1);  // grow it to new size
00432       // destroy intial data before copying over it
00433       //RemoveAt(nOldSize, nCount);
00434       // shift old data up to fill gap
00435       MoveMemory(&m_pData[nIndex+nCount], &m_pData[nIndex], (nOldSize-nIndex) * sizeof(T));
00436
00437       // re-init slots we copied from
00438       ConstructElements<T>(&m_pData[nIndex], nCount);
00439    }
00440
00441    // insert new value in the gap
00442    _ASSERT(nIndex + nCount <= m_nSize);
00443    while(nCount--)
00444       m_pData[nIndex++] = newElement;
00445 }
00446
00447
00448 //----------------------------------------------------------------------------
00449 //
00450 // InsertAt function
00451 //    Inserts an entire array into this array, starting at a specified index.
00452 //
00453 // Parameters:
00454 //    nIndex:     An integer index that is greater than or equal to 0.
00455 //    pNewArray:  Pointer to the array to insert.
00456 //
00457 // Returns:       None.
00458 //
00459 //----------------------------------------------------------------------------
00460 template <class T, class TA> void CArray<T, TA>::InsertAt(int nIndex, CArray* pNewArray)
00461 {
00462    _ASSERT(pNewArray != NULL);
00463    _ASSERT(nIndex >= 0);
00464
00465    if(pNewArray->GetSize() > 0)
00466    {
00467       int nOldSize = m_nSize;
00468       int nCount = pNewArray->GetSize();
00469       SetSize(m_nSize + nCount, -1);
00470       // shift old data up to fill gap
00471       MoveMemory(&m_pData[nIndex+nCount], &m_pData[nIndex], (nOldSize-nIndex) * sizeof(T));
00472       // re-init slots we copied from
00473       ConstructElements<T>(&m_pData[nIndex], nCount);
00474       //InsertAt(nIndex, pNewArray->GetAt(0), pNewArray->GetSize());
00475       for(int i = 0; i < pNewArray->GetSize(); i++)
00476          SetAt(nIndex + i, pNewArray->GetAt(i));
00477    }
00478 }
00479
00480
00481 //----------------------------------------------------------------------------
00482 //
00483 // RemoveAt function
00484 //    Removes an element at a specific index, adjusting successive elements.
00485 //
00486 // Parameters:
00487 //    nIndex:     Zero-based index of where to start removing.
00488 //    nCount:     The number of elements to remove.
00489 //
00490 // Returns:       None.
00491 //
00492 //----------------------------------------------------------------------------
00493 template <class T, class TA> void CArray<T, TA>::RemoveAt(int nIndex, int nCount)
00494 {
00495    _ASSERT(nIndex >= 0);
00496    _ASSERT(nCount >= 0);
00497    _ASSERT((nIndex + nCount) <= m_nSize);
00498
00499    // just remove a range
00500    int nMoveCount = m_nSize - (nIndex + nCount);
00501    int nCount2 = nCount;
00502    T* pElements = &m_pData[nIndex];
00503    for (; nCount2--; pElements++)
00504       pElements->~T();
00505    if(nMoveCount)
00506       MoveMemory(&m_pData[nIndex], &m_pData[nIndex + nCount], nMoveCount * sizeof(T));
00507    m_nSize -= nCount;
00508 }
00509
00510
00511 //----------------------------------------------------------------------------
00512 //
00513 // ConstructElements function
00514 //    Calls the constructor of one or more element(s) of type T.
00515 //
00516 // Parameters:
00517 //    pElements:  Pointer to the elements.
00518 //    nCount:     Number of elements to be constructed.
00519 //
00520 // Returns:       None.
00521 //
00522 //----------------------------------------------------------------------------
00523 template <class T> void ConstructElements(T* pElements, int nCount)
00524 {
00525    _ASSERT((nCount == 0) || (pElements != NULL));
00526
00527    // first do bit-wise zero initialization
00528    ZeroMemory(pElements, nCount * sizeof(T));
00529
00530    // then call the constructor(s)
00531    for (; nCount--; pElements++)
00532       new((void*)pElements) T;
00533 }
00534
00535
00536 //----------------------------------------------------------------------------
00537 //
00538 // DestructElements function
00539 //    Calls the destructor of one or more element(s) of type T.
00540 //
00541 // Parameters:
00542 //    pElements:  Pointer to the elements.
00543 //    nCount:     Number of elements to be constructed.
00544 //
00545 // Returns:       None.
00546 //
00547 //----------------------------------------------------------------------------
00548 template <class T> void DestructElements(T* pElements, int nCount)
00549 {
00550    _ASSERT((nCount == 0) || (pElements != NULL));
00551
00552    // call the destructor(s)
00553    for (; nCount--; pElements++)
00554       pElements->~T();
00555 }
00556
00557
00558 //----------------------------------------------------------------------------
00559 //
00560 // CopyElements function
00561 //    Copies one or more elements from one place to another.
00562 //
00563 // Parameters:
00564 //    pDest:      Pointer to the destination in which to copy elements.
00565 //    pSrc:       Pointer to the source of the elements to be copied.
00566 //    nCount:     Number of elements to be copied.
00567 //
00568 // Returns:       None.
00569 //
00570 //----------------------------------------------------------------------------
00571 template <class T> void CopyElements(T* pDest, const T* pSrc, int nCount)
00572 {
00573    _ASSERT((nCount == 0) || (pSrc != NULL));
00574    _ASSERT((nCount == 0) || (pDest != NULL));
00575
00576    // default is element-copy using assignment
00577    while(nCount--)
00578       *pDest++ = *pSrc++;
00579 }
00580
00581
00582 //----------------------------------------------------------------------------
00583 //
00584 // CPtrArray template class
00585 //    Encapsulates arrays of pointers to objects.
00586 //
00587 // Template parameters:
00588 //    TP:            The type of objects stored in the array.
00589 //    TPA:           The reference type of objects stored in the array.
00590 //
00591 //----------------------------------------------------------------------------
00592 template <class TP, class TPA> class CPtrArray : public CArray<TP, TPA>
00593 {
00594 public:
00595
00596    //-------------------------------------------------------------------------
00597    //
00598    // CPtrArray constructor
00599    //
00600    // Parameters:    None.
00601    //
00602    //-------------------------------------------------------------------------
00603    CPtrArray() : CArray<TP, TPA>()
00604    {
00605       m_bRelease = FALSE;
00606    }
00607
00608
00609    //-------------------------------------------------------------------------
00610    //
00611    // CPtrArray constructor
00612    //
00613    // Parameters:
00614    //    a:          Pointer to first item of an array of the objects.
00615    //    nCount:     Number of items in array a.
00616    //
00617    //-------------------------------------------------------------------------
00618    CPtrArray(TP* a, int nCount) : CArray(a, nCount)
00619    {
00620       m_bRelease = FALSE;
00621    }
00622
00623
00624    virtual ~CPtrArray();
00625
00626
00627    //-------------------------------------------------------------------------
00628    //
00629    // SetRelease function
00630    //    Sets whether the array should call Release instead of delete.
00631    //
00632    // Parameters:
00633    //    bRelease:   TRUE to call Release, FALSE to call delete.
00634    //
00635    // Returns:       None.
00636    //
00637    //-------------------------------------------------------------------------
00638    void SetRelease(BOOL bRelease)
00639    {
00640       m_bRelease = bRelease;
00641    }
00642
00643
00644    //-------------------------------------------------------------------------
00645    //
00646    // SetAt function
00647    //    Sets the element at a specific index.
00648    //
00649    // Parameters:
00650    //    nIndex:     Zero-based index of the item to set.
00651    //    newElement: Item to insert at this index.
00652    //
00653    // Returns:       None.
00654    //
00655    //-------------------------------------------------------------------------
00656    virtual void SetAt(int nIndex, TPA newElement)
00657    {
00658       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00659       if(m_pData[nIndex])
00660       {
00661          if(m_bRelease)
00662             ((IUnknown*)((TP)m_pData[nIndex]))->Release();
00663          else
00664             delete (TP)m_pData[nIndex];
00665       }
00666       CArray<TP, TPA>::SetAt(nIndex, newElement);
00667    }
00668
00669    virtual void RemoveAt(int nIndex, int nCount = 1);
00670
00671 protected:
00672    BOOL m_bRelease;
00673 };
00674
00675
00676 //----------------------------------------------------------------------------
00677 //
00678 // CPtrArray destructor
00679 //
00680 //----------------------------------------------------------------------------
00681 template <class TP, class TPA> CPtrArray<TP, TPA>::~CPtrArray()
00682 {
00683    if(m_pData != NULL)
00684    {
00685       RemoveAt(0, m_nSize);
00686       SAFEFREEMEMORY(m_pData);
00687    }
00688 }
00689
00690
00691 //----------------------------------------------------------------------------
00692 //
00693 // RemoveAt function
00694 //    Removes an element at a specific index, adjusting successive elements.
00695 //
00696 // Parameters:
00697 //    nIndex:     Zero-based index of where to start removing.
00698 //    nCount:     The number of elements to remove.
00699 //
00700 // Returns:       None.
00701 //
00702 //----------------------------------------------------------------------------
00703 template <class TP, class TPA> void CPtrArray<TP, TPA>::RemoveAt(int nIndex, int nCount)
00704 {
00705    _ASSERT(nIndex >= 0);
00706    _ASSERT(nCount >= 0);
00707    _ASSERT((nIndex + nCount) <= m_nSize);
00708
00709    // just remove a range
00710    int nMoveCount = m_nSize - (nIndex + nCount);
00711    int nCount2 = nCount;
00712    TP* pElements = &m_pData[nIndex];
00713    for (; nCount2--; pElements++)
00714       if(*pElements)
00715       {
00716          if(m_bRelease)
00717             ((IUnknown*)(*pElements))->Release();
00718          else
00719             delete *pElements;
00720       }
00721    if(nMoveCount)
00722       MoveMemory(&m_pData[nIndex], &m_pData[nIndex + nCount], nMoveCount * sizeof(TP));
00723    m_nSize -= nCount;
00724 }
00725
00726
00727 #endif // !defined(AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:46 2002 for Solitaire Pack by doxygen 1.2.15


bmws_base64.cpp File Reference

#include <bmws_common.h>
#include <bmws_base64.h>
#include <bmws_error.h>

Go to the source code of this file.

Functions

int | cvt_ascii (unsigned char ch)
LPSTR | Base64ToBinary (LPSTR buf, UINT cBytes, UINT *plenOut)
LPSTR | BinaryToBase64 (LPSTR buf, UINT cBytes, UINT *plenOut)

Variables

COOMExcep * g_pOOMExcep
char | g_aBase64Alphabet []

Function Documentation

LPSTR Base64ToBinary | ( | LPSTR | buf,
 |  | UINT | cBytes,
 |  | UINT * | plenOut
 | ) |

Definition at line 65 of file bmws_base64.cpp.

References cvt_ascii(), ENSUREALLOC, SAFEALLOCMEMORY, SAFEFREEMEMORY, and THROW.

Referenced by CCompoundXMLDocument::SpewFile().

00066 {
00067    if(!buf || !plenOut)
00068       return NULL;
00069
00070    int quit = 0;
00071    int decode_state = 0;
00072    int i, shift;
00073    unsigned long accum = 0, value;
00074    unsigned char blivit;
00075    int iOut = 0;
00076
00077    for(i = 0; (buf[i] != '\0') && (decode_state >= 0); i++)
00078    {
00079       if(buf[i] == 0x0d || buf[i] == 0x0a)
00080          continue;
00081
00082       if ( ( (buf[i] >= 'A') && (buf[i] <= 'Z') ) ||
00083            ( (buf[i] >= 'a') && (buf[i] <= 'z') ) ||
00084            ( (buf[i] >= '0') && (buf[i] <= '9') ) ||
00085            (buf[i] == '+') ||
00086            (buf[i] == '/') ||
00087            (buf[i] == '=') )
00088       {
00089          decode_state = 1;
00090       }
00091       else
00092       {
00093          decode_state = -2;
00094       }
00095    }
00096
00097    if(decode_state <= 0)
00098       return NULL;
00099
00100    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * sizeof(char));
00101    ENSUREALLOC(bufOut2);
00102
00103    shift = 0;
00104    for(i = 0; (buf[i] != '\0'); i++)
00105    {
00106       if(buf[i] == 0x0d || buf[i] == 0x0a)
00107          continue;
00108       value = cvt_ascii(buf[i]);
00109
00110       if(value < 64)
00111       {
00112          accum <<= 6;
00113          shift += 6;
00114          accum |= value;
00115          if(shift >= 8)
00116          {
00117             shift -= 8;
00118             value = accum >> shift;
00119             blivit = (unsigned char)LOBYTE(LOWORD(value)) & 0xFF;
00120             bufOut2[iOut] = blivit;
00121             iOut++;
00122          }
00123       }
00124       else
00125       {
00126          quit = 1;
00127          break;
00128       }
00129    }
00130
00131    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY(iOut * sizeof(char));
00132    if(!bufOut)
00133    {
00134       SAFEFREEMEMORY(bufOut2);
00135       THROW(g_pOOMExcep);
00136    }
00137
00138    *plenOut = iOut;
00139    CopyMemory(bufOut, bufOut2, iOut);
00140
00141    SAFEFREEMEMORY(bufOut2);
00142
00143    return bufOut;
00144 }

LPSTR BinaryToBase64 | ( | LPSTR | buf,
 |  | UINT | cBytes,
 |  | UINT * | plenOut
 | ) |

Definition at line 162 of file bmws_base64.cpp.

References ENSUREALLOC, g_aBase64Alphabet, SAFEALLOCMEMORY, SAFEFREEMEMORY, and THROW.

Referenced by CCompoundXMLDocument::AddFile().

00163 {
00164    if(!buf || !plenOut)
00165       return NULL;
00166
00167    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * 2 * sizeof(char));
00168    ENSUREALLOC(bufOut2);
00169
00170    int index, shift, save_shift;
00171    unsigned long accum, value;
00172    shift = 0;
00173    accum = 0;
00174    index = 0;
00175    int rawIndex = 0;
00176    UINT iCur = 0;
00177    int quit = 0;
00178    unsigned char blivit;
00179
00180    while((iCur < cBytes) || (shift != 0))
00181    {
00182       if((iCur < cBytes) && (quit == 0))
00183       {
00184          blivit = buf[iCur];
00185          iCur++;
00186       }
00187       else
00188       {
00189          quit = 1;
00190          save_shift = shift;
00191          blivit = 0;
00192       }
00193
00194       if((quit == 0) || (shift != 0))
00195       {
00196          value = (unsigned long)blivit;
00197          accum <<= 8;
00198          shift += 8;
00199          accum |= value;
00200       }
00201
00202       while(shift >= 6)
00203       {
00204          shift -= 6;
00205          value = (accum >> shift) & 0x3Fl;
00206          blivit = g_aBase64Alphabet[value];
00207
00208          bufOut2[index++] = blivit;
00209          rawIndex++;
00210          if(rawIndex % 60 == 0)
00211          {
00212             bufOut2[index++] = '\n';
00213          }
00214
00215          if(quit != 0)
00216          {
00217             shift = 0;
00218          }
00219       }
00220    }
00221
00222    if(save_shift == 2)
00223    {
00224       bufOut2[index++] = '=';
00225       bufOut2[index++] = '=';
00226    }
00227    else if(save_shift == 4)
00228    {
00229       bufOut2[index++] = '=';
00230    }
00231
00232    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY((index + 1) * sizeof(char));
00233    if(!bufOut)
00234    {
00235       SAFEFREEMEMORY(bufOut2);
00236       THROW(g_pOOMExcep);
00237    }
00238
00239    *plenOut = index;
00240    CopyMemory(bufOut, bufOut2, index);
00241    bufOut[index] = 0;
00242
00243    SAFEFREEMEMORY(bufOut2);
00244
00245    return bufOut;
00246 }

int cvt_ascii ( unsigned char ch )

Definition at line 36 of file bmws_base64.cpp.

Referenced by Base64ToBinary().

00037 {
00038    if      ( (ch >= 'A') && (ch <= 'Z') ) return (int)(ch - 'A');
00039    else if ( (ch >= 'a') && (ch <= 'z') )
00040         return 26 + (int)(ch - 'a');
00041    else if ( (ch >= '0') && (ch <= '9' ) )
00042         return 52 + (int)(ch - '0');
00043    else if ( ch == '+' ) return 62;
00044    else if ( ch == '/' ) return 63;
00045    else if ( ch == '=' ) return -2;
00046    else                     return -1;
00047 }

Variable Documentation

char g_aBase64Alphabet[]

Initial value:

   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Definition at line 21 of file bmws_base64.cpp.

Referenced by BinaryToBase64().

COOMExcep* g_pOOMExcep

Definition at line 20 of file bmws_base64.cpp.

Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


bmws_base64.cpp Source File

bmws_base64.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_base64.cpp
00004 //    Functions to convert between binary and Base64 encoding.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_base64.h>
00014 #include <bmws_error.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Global variables
00019 //----------------------------------------------------------------------------
00020 extern COOMExcep *g_pOOMExcep;   // Out of memory exception object
00021 char g_aBase64Alphabet[] =       // Array of Base64 characters
00022    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // cvt_ascii function
00028 //    Returns the Base64 array index of a character.
00029 //
00030 // Parameters:
00031 //    ch:            Character to convert.
00032 //
00033 // Returns:          The index of the character in the alphabet array.
00034 //
00035 //----------------------------------------------------------------------------
00036 int cvt_ascii(unsigned char ch)
00037 {
00038    if      ( (ch >= 'A') && (ch <= 'Z') ) return (int)(ch - 'A');
00039    else if ( (ch >= 'a') && (ch <= 'z') )
00040         return 26 + (int)(ch - 'a');
00041    else if ( (ch >= '0') && (ch <= '9' ) )
00042         return 52 + (int)(ch - '0');
00043    else if ( ch == '+' ) return 62;
00044    else if ( ch == '/' ) return 63;
00045    else if ( ch == '=' ) return -2;
00046    else                     return -1;
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // Base64ToBinary function
00053 //    Converts a chunk of Base64 encoded characters into ASCII (Base256).
00054 //
00055 // Parameters:
00056 //    buf:           Array of characters to convert.
00057 //    cBytes:        Count of bytes (characters) in the chunk.
00058 //    plenOut:       Pointer to hold the converted chunk length.
00059 //
00060 // Returns:
00061 //    Pointer to the chunk of ASCII/binary encoded characters, to be released
00062 //    by the caller, or NULL if an error occurred.
00063 //
00064 //----------------------------------------------------------------------------
00065 LPSTR Base64ToBinary(LPSTR buf, UINT cBytes, UINT* plenOut)
00066 {
00067    if(!buf || !plenOut)
00068       return NULL;
00069
00070    int quit = 0;
00071    int decode_state = 0;
00072    int i, shift;
00073    unsigned long accum = 0, value;
00074    unsigned char blivit;
00075    int iOut = 0;
00076
00077    for(i = 0; (buf[i] != '\0') && (decode_state >= 0); i++)
00078    {
00079       if(buf[i] == 0x0d || buf[i] == 0x0a)
00080          continue;
00081
00082       if ( ( (buf[i] >= 'A') && (buf[i] <= 'Z') ) ||
00083            ( (buf[i] >= 'a') && (buf[i] <= 'z') ) ||
00084            ( (buf[i] >= '0') && (buf[i] <= '9') ) ||
00085            (buf[i] == '+') ||
00086            (buf[i] == '/') ||
00087            (buf[i] == '=') )
00088       {
00089          decode_state = 1;
00090       }
00091       else
00092       {
00093          decode_state = -2;
00094       }
00095    }
00096
00097    if(decode_state <= 0)
00098       return NULL;
00099
00100    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * sizeof(char));
00101    ENSUREALLOC(bufOut2);
00102
00103    shift = 0;
00104    for(i = 0; (buf[i] != '\0'); i++)
00105    {
00106       if(buf[i] == 0x0d || buf[i] == 0x0a)
00107          continue;
00108       value = cvt_ascii(buf[i]);
00109
00110       if(value < 64)
00111       {
00112          accum <<= 6;
00113          shift += 6;
00114          accum |= value;
00115          if(shift >= 8)
00116          {
00117             shift -= 8;
00118             value = accum >> shift;
00119             blivit = (unsigned char)LOBYTE(LOWORD(value)) & 0xFF;
00120             bufOut2[iOut] = blivit;
00121             iOut++;
00122          }
00123       }
00124       else
00125       {
00126          quit = 1;
00127          break;
00128       }
00129    }
00130
00131    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY(iOut * sizeof(char));
00132    if(!bufOut)
00133    {
00134       SAFEFREEMEMORY(bufOut2);
00135       THROW(g_pOOMExcep);
00136    }
00137
00138    *plenOut = iOut;
00139    CopyMemory(bufOut, bufOut2, iOut);
00140
00141    SAFEFREEMEMORY(bufOut2);
00142
00143    return bufOut;
00144 }
00145
00146
00147 //----------------------------------------------------------------------------
00148 //
00149 // Base64ToBinary function
00150 //    Converts a chunk of Base64 encoded characters into ASCII (Base256).
00151 //
00152 // Parameters:
00153 //    pv:            Pointer to the Base64 chunk.
00154 //    cBytes:        Count of bytes (characters) in the chunk.
00155 //    plenOut:       Pointer to hold the decoded chunk length.
00156 //
00157 // Returns:
00158 //    Pointer to the chunk of ASCII/binary encoded characters, to be released
00159 //    by the caller, or NULL if an error occurred.
00160 //
00161 //----------------------------------------------------------------------------
00162 LPSTR BinaryToBase64(LPSTR buf, UINT cBytes, UINT* plenOut)
00163 {
00164    if(!buf || !plenOut)
00165       return NULL;
00166
00167    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * 2 * sizeof(char));
00168    ENSUREALLOC(bufOut2);
00169
00170    int index, shift, save_shift;
00171    unsigned long accum, value;
00172    shift = 0;
00173    accum = 0;
00174    index = 0;
00175    int rawIndex = 0;
00176    UINT iCur = 0;
00177    int quit = 0;
00178    unsigned char blivit;
00179
00180    while((iCur < cBytes) || (shift != 0))
00181    {
00182       if((iCur < cBytes) && (quit == 0))
00183       {
00184          blivit = buf[iCur];
00185          iCur++;
00186       }
00187       else
00188       {
00189          quit = 1;
00190          save_shift = shift;
00191          blivit = 0;
00192       }
00193
00194       if((quit == 0) || (shift != 0))
00195       {
00196          value = (unsigned long)blivit;
00197          accum <<= 8;
00198          shift += 8;
00199          accum |= value;
00200       }
00201
00202       while(shift >= 6)
00203       {
00204          shift -= 6;
00205          value = (accum >> shift) & 0x3Fl;
00206          blivit = g_aBase64Alphabet[value];
00207
00208          bufOut2[index++] = blivit;
00209          rawIndex++;
00210          if(rawIndex % 60 == 0)
00211          {
00212             bufOut2[index++] = '\n';
00213          }
00214
00215          if(quit != 0)
00216          {
00217             shift = 0;
00218          }
00219       }
00220    }
00221
00222    if(save_shift == 2)
00223    {
00224       bufOut2[index++] = '=';
00225       bufOut2[index++] = '=';
00226    }
00227    else if(save_shift == 4)
00228    {
00229       bufOut2[index++] = '=';
00230    }
00231
00232    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY((index + 1) * sizeof(char));
00233    if(!bufOut)
00234    {
00235       SAFEFREEMEMORY(bufOut2);
00236       THROW(g_pOOMExcep);
00237    }
00238
00239    *plenOut = index;
00240    CopyMemory(bufOut, bufOut2, index);
00241    bufOut[index] = 0;
00242
00243    SAFEFREEMEMORY(bufOut2);
00244
00245    return bufOut;
00246 }
Generated on Wed May 8 12:38:46 2002 for Solitaire Pack by doxygen 1.2.15


bmws_base64.h File Reference

Go to the source code of this file.

Defines

#define | AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

LPSTR | Base64ToBinary (LPSTR buf, UINT cBytes, UINT *plenOut)
LPSTR | BinaryToBase64 (LPSTR buf, UINT cBytes, UINT *plenOut)

Define Documentation

#define AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_base64.h.

Function Documentation

LPSTR Base64ToBinary | ( | LPSTR | buf,
 |  | UINT | cBytes,
 |  | UINT * | plenOut
 | ) |

Definition at line 65 of file bmws_base64.cpp.

References cvt_ascii(), ENSUREALLOC, SAFEALLOCMEMORY, SAFEFREEMEMORY, and THROW.

Referenced by CCompoundXMLDocument::SpewFile().

00066 {
00067    if(!buf || !plenOut)
00068       return NULL;
00069
00070    int quit = 0;
00071    int decode_state = 0;
00072    int i, shift;
00073    unsigned long accum = 0, value;
00074    unsigned char blivit;
00075    int iOut = 0;
00076
00077    for(i = 0; (buf[i] != '\0') && (decode_state >= 0); i++)
00078    {
00079       if(buf[i] == 0x0d || buf[i] == 0x0a)
00080          continue;
00081
00082       if ( ( (buf[i] >= 'A') && (buf[i] <= 'Z') ) ||
00083            ( (buf[i] >= 'a') && (buf[i] <= 'z') ) ||
00084            ( (buf[i] >= '0') && (buf[i] <= '9') ) ||
00085            (buf[i] == '+') ||
00086            (buf[i] == '/') ||
00087            (buf[i] == '=') )
00088       {
00089          decode_state = 1;
00090       }
00091       else
00092       {
00093          decode_state = -2;
00094       }
00095    }
00096
00097    if(decode_state <= 0)
00098       return NULL;
00099
00100    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * sizeof(char));
00101    ENSUREALLOC(bufOut2);
00102
00103    shift = 0;
00104    for(i = 0; (buf[i] != '\0'); i++)
00105    {
00106       if(buf[i] == 0x0d || buf[i] == 0x0a)
00107          continue;
00108       value = cvt_ascii(buf[i]);
00109
00110       if(value < 64)
00111       {
00112          accum <<= 6;
00113          shift += 6;
00114          accum |= value;
00115          if(shift >= 8)
00116          {
00117             shift -= 8;
00118             value = accum >> shift;
00119             blivit = (unsigned char)LOBYTE(LOWORD(value)) & 0xFF;
00120             bufOut2[iOut] = blivit;
00121             iOut++;
00122          }
00123       }
00124       else
00125       {
00126          quit = 1;
00127          break;
00128       }
00129    }
00130
00131    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY(iOut * sizeof(char));
00132    if(!bufOut)
00133    {
00134       SAFEFREEMEMORY(bufOut2);
00135       THROW(g_pOOMExcep);
00136    }
00137
00138    *plenOut = iOut;
00139    CopyMemory(bufOut, bufOut2, iOut);
00140
00141    SAFEFREEMEMORY(bufOut2);
00142
00143    return bufOut;
00144 }

LPSTR BinaryToBase64 | ( | LPSTR | buf,
 |  | UINT | cBytes,
 |  | UINT * | plenOut
 | ) |

Definition at line 162 of file bmws_base64.cpp.

References ENSUREALLOC, g_aBase64Alphabet, SAFEALLOCMEMORY, SAFEFREEMEMORY, and THROW.

Referenced by CCompoundXMLDocument::AddFile().

00163 {
00164    if(!buf || !plenOut)
00165       return NULL;
00166
00167    LPSTR bufOut2 = (LPSTR)SAFEALLOCMEMORY(cBytes * 2 * sizeof(char));
00168    ENSUREALLOC(bufOut2);
00169
00170    int index, shift, save_shift;
00171    unsigned long accum, value;
00172    shift = 0;
00173    accum = 0;
00174    index = 0;
00175    int rawIndex = 0;
00176    UINT iCur = 0;
00177    int quit = 0;
00178    unsigned char blivit;
00179
00180    while((iCur < cBytes) || (shift != 0))
00181    {
00182       if((iCur < cBytes) && (quit == 0))
00183       {
00184          blivit = buf[iCur];
00185          iCur++;
00186       }
00187       else
00188       {
00189          quit = 1;
00190          save_shift = shift;
00191          blivit = 0;
00192       }
00193
00194       if((quit == 0) || (shift != 0))
00195       {
00196          value = (unsigned long)blivit;
00197          accum <<= 8;
00198          shift += 8;
00199          accum |= value;
00200       }
00201
00202       while(shift >= 6)
00203       {
00204          shift -= 6;
00205          value = (accum >> shift) & 0x3Fl;
00206          blivit = g_aBase64Alphabet[value];
00207
00208          bufOut2[index++] = blivit;
00209          rawIndex++;
00210          if(rawIndex % 60 == 0)
00211          {
00212             bufOut2[index++] = '\n';
00213          }
00214
00215          if(quit != 0)
00216          {
00217             shift = 0;
00218          }
00219       }
00220    }
00221
00222    if(save_shift == 2)
00223    {
00224       bufOut2[index++] = '=';
00225       bufOut2[index++] = '=';
00226    }
00227    else if(save_shift == 4)
00228    {
00229       bufOut2[index++] = '=';
00230    }
00231
00232    LPSTR bufOut = (LPSTR)SAFEALLOCMEMORY((index + 1) * sizeof(char));
00233    if(!bufOut)
00234    {
00235       SAFEFREEMEMORY(bufOut2);
00236       THROW(g_pOOMExcep);
00237    }
00238
00239    *plenOut = index;
00240    CopyMemory(bufOut, bufOut2, index);
00241    bufOut[index] = 0;
00242
00243    SAFEFREEMEMORY(bufOut2);
00244
00245    return bufOut;
00246 }

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_base64.h Source File

bmws_base64.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_base64.h
00004 //    Functions to convert between binary and Base64 encoding.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // BMWS_Base64 API functions
00015 //----------------------------------------------------------------------------
00016 LPSTR Base64ToBinary(LPSTR buf, UINT cBytes, UINT* plenOut);
00017 LPSTR BinaryToBase64(LPSTR buf, UINT cBytes, UINT* plenOut);
00018
00019
00020 #endif // !defined(AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:46 2002 for Solitaire Pack by doxygen 1.2.15


bmws_boolarray.h File Reference

#include <bmws_array.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef CArray< BOOL, BOOL > | CBOOLArray

Define Documentation

#define AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_boolarray.h.

Typedef Documentation

typedef CArray<BOOL, BOOL> CBOOLArray

Definition at line 19 of file bmws_boolarray.h.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_boolarray.h Source File

bmws_boolarray.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_boolarray.h
00004 //    Definition of BOOL array type.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_array.h>
00017
00018
00019 typedef CArray<BOOL, BOOL> CBOOLArray;
00020
00021
00022 #endif // !defined(AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:46 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer.cpp File Reference

#include <bmws_common.h>
#include <bmws_browsercontainer.h>
#include <bmws_browsercontainer_res_lc.h>
#include <bmws_error.h>
#include <exdisp.h>
#include <mshtml.h>

Go to the source code of this file.

Defines

#define | BCINTERNALERR(i)

Variables

HWND | g_hWnd
COOMExcep * g_pOOMExcep

Define Documentation

#define BCINTERNALERR ( i )

Value:

{ HandleError(g_hWnd, IDS_BMWS_BROWSERCONTAINER_E_INTERNAL, \
   IDS_BMWS_REMEDY_RESTART, i, 0, ERROR_ERRORINS_INT); }

Definition at line 30 of file bmws_browsercontainer.cpp.

Referenced by CBrowserContainer::Uninit().

Variable Documentation

HWND g_hWnd

Definition at line 23 of file bmws_browsercontainer.cpp.

COOMExcep* g_pOOMExcep

Definition at line 24 of file bmws_browsercontainer.cpp.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer.cpp Source File

bmws_browsercontainer.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_browsercontainer.cpp
00004 //    Class to encapsulate embedding the WebBrowser object in an application.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_browsercontainer.h>
00014 #include <bmws_browsercontainer_res_lc.h>
00015 #include <bmws_error.h>
00016 #include <exdisp.h>
00017 #include <mshtml.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // External variables
00022 //----------------------------------------------------------------------------
00023 extern HWND g_hWnd;
00024 extern COOMExcep *g_pOOMExcep;
00025
00026
00027 //----------------------------------------------------------------------------
00028 // Browser Container exception macros
00029 //----------------------------------------------------------------------------
00030 #define BCINTERNALERR(i) { HandleError(g_hWnd, IDS_BMWS_BROWSERCONTAINER_E_INTERNAL, \
00031    IDS_BMWS_REMEDY_RESTART, i, 0, ERROR_ERRORINS_INT); }
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CBrowserContainer constructor
00037 //
00038 // Parameters:
00039 //    bNoBorder:     TRUE if the 3D border should be supressed, else FALSE.
00040 //    bScroll:       TRUE to enable document-level scrolling. Defaults to
00041 //                   FALSE.
00042 //
00043 //----------------------------------------------------------------------------
00044 CBrowserContainer::CBrowserContainer(BOOL bNoBorder, BOOL bScroll)
00045 {
00046    SetRectEmpty(&m_rect);
00047    m_bNoBorder = bNoBorder;
00048    m_bScroll = bScroll;
00049    m_hWnd = NULL;
00050    m_bInPlaceActive = FALSE;
00051    m_pEvent = NULL;
00052 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00053    m_pDispSite = NULL;
00054 #endif
00055 }
00056
00057
00058 //----------------------------------------------------------------------------
00059 //
00060 // INDUnknown::NDQueryInterface method
00061 //    Returns pointers to supported interfaces.
00062 //
00063 // Parameters:
00064 //    riid:          [in] Identifier of the interface being requested.
00065 //    ppvObject:     [out] Address of pointer variable that receives the
00066 //                   interface pointer requested in riid.
00067 //
00068 // Returns:          A standard COM success or error value.
00069 //
00070 //----------------------------------------------------------------------------
00071 STDMETHODIMP CBrowserContainer::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00072 {
00073    if(!ppvObject)
00074       return E_POINTER;
00075
00076 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00077    if(IsEqualIID(riid, IID_IDispatch))
00078       *ppvObject = (IDispatch*)this;
00079    else
00080 #endif
00081    if(IsEqualIID(riid, IID_IDocHostUIHandler))
00082       *ppvObject = (IDocHostUIHandler*)this;
00083    else if(IsEqualIID(riid, IID_IOleClientSite))
00084       *ppvObject = (IOleClientSite*)this;
00085    else if (IsEqualIID(riid, IID_IOleInPlaceSite))
00086       *ppvObject = (IOleInPlaceSite*)this;
00087    else if (IsEqualIID(riid, IID_IOleWindow))
00088       *ppvObject = (IOleWindow*)this;
00089    else
00090       return CUnkBase::NDQueryInterface(riid, ppvObject);
00091
00092    AddRef();
00093    return S_OK;
00094 }
00095
00096
00097 //----------------------------------------------------------------------------
00098 //
00099 // IOleClientSite::SaveObject method
00100 //    Saves the object associated with the client site.
00101 //
00102 // Parameters:       None.
00103 //
00104 // Returns:          E_NOTIMPL in all cases.
00105 //
00106 //----------------------------------------------------------------------------
00107 STDMETHODIMP CBrowserContainer::SaveObject()
00108 {
00109    return E_NOTIMPL;
00110 }
00111
00112
00113 //----------------------------------------------------------------------------
00114 //
00115 // IOleClientSite::GetMoniker method
00116 //    Returns a moniker to an object's client site.
00117 //
00118 // Parameters:
00119 //    dwAssign:         [in] Specifies whether to get a moniker only if one
00120 //                      already exists, force assignment of a moniker, create
00121 //                      a temporary moniker, or remove a moniker that has been
00122 //                      assigned.
00123 //    dwWhichMoniker:   [in] DWORD that specifies whether to return the
00124 //                      container's moniker, the object's moniker relative to
00125 //                      the container, or the object's full moniker.
00126 //    ppmk:             [out] Address of IMoniker* pointer variable that
00127 //                      receives the interface pointer to the moniker for the
00128 //                      object's client site.
00129 //
00130 // Returns:             E_NOTIMPL in all cases.
00131 //
00132 //----------------------------------------------------------------------------
00133 STDMETHODIMP CBrowserContainer::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER *ppmk)
00134 {
00135    return E_NOTIMPL;
00136 }
00137
00138
00139 //----------------------------------------------------------------------------
00140 //
00141 // IOleClientSite::GetContainer method
00142 //    Returns a pointer to the container's IOleContainer interface.
00143 //
00144 // Parameters:
00145 //    ppContainer:   [out] Address of IOleContainer* pointer variable that
00146 //                   receives the interface pointer to the container object.
00147 //
00148 // Returns:          E_NOTIMPL in all cases.
00149 //
00150 //----------------------------------------------------------------------------
00151 STDMETHODIMP CBrowserContainer::GetContainer(LPOLECONTAINER *ppContainer)
00152 {
00153    return E_NOTIMPL;
00154 }
00155
00156
00157 //----------------------------------------------------------------------------
00158 //
00159 // IOleClientSite::ShowObject method
00160 //    Tells the container to position the object so it is visible to the user.
00161 //
00162 // Parameters:       None.
00163 //
00164 // Returns:          E_NOTIMPL in all cases.
00165 //
00166 //----------------------------------------------------------------------------
00167 STDMETHODIMP CBrowserContainer::ShowObject()
00168 {
00169    return E_NOTIMPL;
00170 }
00171
00172
00173 //----------------------------------------------------------------------------
00174 //
00175 // IOleClientSite::OnShowWindow method
00176 //    Notifies a container when an embedded object's window is about to become
00177 //    visible or invisible.
00178 //
00179 // Parameters:
00180 //    fShow:         [in] Value that indicates whether an object's window is
00181 //                   open (TRUE) or closed (FALSE).
00182 //
00183 // Returns:          E_NOTIMPL in all cases.
00184 //
00185 //----------------------------------------------------------------------------
00186 STDMETHODIMP CBrowserContainer::OnShowWindow(BOOL fShow)
00187 {
00188    return E_NOTIMPL;
00189 }
00190
00191
00192 //----------------------------------------------------------------------------
00193 //
00194 // IOleClientSite::RequestNewObjectLayout method
00195 //    Asks container to allocate more or less space for displaying an embedded
00196 //    object.
00197 //
00198 // Parameters:       None.
00199 //
00200 // Returns:          E_NOTIMPL in all cases.
00201 //
00202 //----------------------------------------------------------------------------
00203 STDMETHODIMP CBrowserContainer::RequestNewObjectLayout()
00204 {
00205    return E_NOTIMPL;
00206 }
00207
00208
00209 //----------------------------------------------------------------------------
00210 //
00211 // IOleWindow::GetWindow method
00212 //    Returns the window handle to one of the windows participating in
00213 //    in-place activation.
00214 //
00215 // Parameters:
00216 //    phwnd:         [out] Pointer to where to return the window handle.
00217 //
00218 // Returns:          A standard COM success or error value.
00219 //
00220 //----------------------------------------------------------------------------
00221 STDMETHODIMP CBrowserContainer::GetWindow(HWND *phwnd)
00222 {
00223    if(!phwnd)
00224       return E_POINTER;
00225
00226    if(!IsWindow(m_hWnd))
00227       return S_FALSE;
00228
00229    *phwnd = m_hWnd;
00230    return S_OK;
00231 }
00232
00233
00234 //----------------------------------------------------------------------------
00235 //
00236 // IOleWindow::ContextSensitiveHelp method
00237 //    Determines whether context-sensitive help mode should be entered during
00238 //    an in-place activation session.
00239 //
00240 // Parameters:
00241 //    fEnterMode:    [in] TRUE if help mode should be entered; FALSE if it
00242 //                   should be exited.
00243 //
00244 // Returns:          E_NOTIMPL in all cases.
00245 //
00246 //----------------------------------------------------------------------------
00247 STDMETHODIMP CBrowserContainer::ContextSensitiveHelp(BOOL fEnterMode)
00248 {
00249    return E_NOTIMPL;
00250 }
00251
00252
00253 //----------------------------------------------------------------------------
00254 //
00255 // IOleInPlaceSite::CanInPlaceActivate method
00256 //    Determines whether or not the container can activate the object in
00257 //    place.
00258 //
00259 // Parameters:       None.
00260 //
00261 // Returns:          S_OK in all cases.
00262 //
00263 //----------------------------------------------------------------------------
00264 STDMETHODIMP CBrowserContainer::CanInPlaceActivate()
00265 {
00266    return S_OK;
00267 }
00268
00269
00270 //----------------------------------------------------------------------------
00271 //
00272 // IOleInPlaceSite::OnInPlaceActivate method
00273 //    Notifies the container that one of its objects is being activated in
00274 //    place.
00275 //
00276 // Parameters:       None.
00277 //
00278 // Returns:          S_OK in all cases.
00279 //
00280 //----------------------------------------------------------------------------
00281 STDMETHODIMP CBrowserContainer::OnInPlaceActivate()
00282 {
00283    m_bInPlaceActive = TRUE;
00284    return S_OK;
00285 }
00286
00287
00288 //----------------------------------------------------------------------------
00289 //
00290 // IOleInPlaceSite::OnUIActivate method
00291 //    Notifies the container that the object is about to be activated in place
00292 //    and that the object is going to replace the container's main menu with
00293 //    an in-place composite menu.
00294 //
00295 // Parameters:       None.
00296 //
00297 // Returns:          E_NOTIMPL in all cases.
00298 //
00299 //----------------------------------------------------------------------------
00300 STDMETHODIMP CBrowserContainer::OnUIActivate()
00301 {
00302    return E_NOTIMPL;
00303 }
00304
00305
00306 //----------------------------------------------------------------------------
00307 //
00308 // IOleInPlaceSite::GetWindowContext method
00309 //    Enables the in-place object to retrieve the window interfaces that form
00310 //    the window object hierarchy, and the position in the parent window where
00311 //    the object's in-place activation window should be placed.
00312 //
00313 // Parameters:
00314 //    ppFrame:       [out] Address of IOleInPlaceFrame* pointer variable that
00315 //                   receives the interface pointer to the frame.
00316 //    ppDoc:         [out] Address of IOleInPlaceUIWindow* pointer variable
00317 //                   that receives the interface pointer to the document
00318 //                   window.
00319 //    lprcPosRect:   [out] Pointer to the rectangle containing the position of
00320 //                   the in-place object in the client coordinates of its
00321 //                   parent window.
00322 //    lprcClipRect:  [out] Pointer to the outer rectangle containing the
00323 //                   in-place object's position rectangle (PosRect). This
00324 //                   rectangle is relative to the client area of the object's
00325 //                   parent window.
00326 //    lpFrameInfo:   [out] Pointer to an OLEINPLACEFRAMEINFO structure the
00327 //                   container is to fill in with appropriate data.
00328 //
00329 // Returns:          S_OK in all cases.
00330 //
00331 //----------------------------------------------------------------------------
00332 STDMETHODIMP CBrowserContainer::GetWindowContext(IOleInPlaceFrame **ppFrame,
00333                                                  IOleInPlaceUIWindow** ppDoc, LPRECT lprcPosRect,
00334                                                  LPRECT lprcClipRect,
00335                                                  LPOLEINPLACEFRAMEINFO lpFrameInfo)
00336 {
00337    if(!ppFrame || !ppDoc || !lprcPosRect || !lprcClipRect)
00338       return E_POINTER;
00339
00340    *ppFrame = NULL;
00341    *ppDoc = NULL;
00342
00343    GetClientRect(m_hWnd, lprcPosRect);
00344    GetClientRect(m_hWnd, lprcClipRect);
00345
00346    return S_OK;
00347 }
00348
00349
00350 //----------------------------------------------------------------------------
00351 //
00352 // IOleInPlaceSite::Scroll method
00353 //    Tells the container to scroll the view of the object by a specified
00354 //    number of pixels.
00355 //
00356 // Parameters:
00357 //    scrollExtent:  [in] Number of pixels by which to scroll in the X and Y
00358 //                   directions.
00359 //
00360 // Returns:          E_NOTIMPL in all cases.
00361 //
00362 //----------------------------------------------------------------------------
00363 STDMETHODIMP CBrowserContainer::Scroll(SIZE scrollExtent)
00364 {
00365    return E_NOTIMPL;
00366 }
00367
00368
00369 //----------------------------------------------------------------------------
00370 //
00371 // IOleInPlaceSite::OnUIDeactivate method
00372 //    Notifies the container on deactivation that it should reinstall its user
00373 //    interface and take focus, and whether or not the object has an undoable
00374 //    state.
00375 //
00376 // Parameters:
00377 //    fUndoable:     [in] Specifies whether the object can undo changes. TRUE
00378 //                   if the object can undo, FALSE if it cannot.
00379 //
00380 // Returns:          E_NOTIMPL in all cases.
00381 //
00382 //----------------------------------------------------------------------------
00383 STDMETHODIMP CBrowserContainer::OnUIDeactivate(BOOL fUndoable)
00384 {
00385    return E_NOTIMPL;
00386 }
00387
00388
00389 //----------------------------------------------------------------------------
00390 //
00391 // IOleInPlaceSite::OnInPlaceDeactivate method
00392 //    Notifies the container that the object is no longer active in place.
00393 //
00394 // Parameters:       None.
00395 //
00396 // Returns:          S_OK in all cases.
00397 //
00398 //----------------------------------------------------------------------------
00399 STDMETHODIMP CBrowserContainer::OnInPlaceDeactivate()
00400 {
00401    m_bInPlaceActive = FALSE;
00402    return S_OK;
00403 }
00404
00405
00406 //----------------------------------------------------------------------------
00407 //
00408 // IOleInPlaceSite::DiscardUndoState method
00409 //    Tells the container that the object no longer has any undo state and
00410 //    that the container should not call IOleInPlaceObject::ReActivateAndUndo.
00411 //
00412 // Parameters:       None.
00413 //
00414 // Returns:          E_NOTIMPL in all cases.
00415 //
00416 //----------------------------------------------------------------------------
00417 STDMETHODIMP CBrowserContainer::DiscardUndoState()
00418 {
00419    return E_NOTIMPL;
00420 }
00421
00422
00423 //----------------------------------------------------------------------------
00424 //
00425 // IOleInPlaceSite::DeactivateAndUndo method
00426 //    Causes the container to end the in-place session, deactivate the object,
00427 //    and revert to its own saved undo state.
00428 //
00429 // Parameters:       None.
00430 //
00431 // Returns:          E_NOTIMPL in all cases.
00432 //
00433 //----------------------------------------------------------------------------
00434 STDMETHODIMP CBrowserContainer::DeactivateAndUndo()
00435 {
00436    return E_NOTIMPL;
00437 }
00438
00439
00440 //----------------------------------------------------------------------------
00441 //
00442 // IOleInPlaceSite::OnPosRectChange method
00443 //    Indicates the object's extents have changed.
00444 //
00445 // Parameters:
00446 //    lprcPosRect:   [in] Pointer to the rectangle containing the position of
00447 //                   the in-place object in the client coordinates of its
00448 //                   parent window.
00449 //
00450 // Returns:          E_NOTIMPL in all cases.
00451 //
00452 //----------------------------------------------------------------------------
00453 STDMETHODIMP CBrowserContainer::OnPosRectChange(LPCRECT lprcPosRect)
00454 {
00455    return E_NOTIMPL;
00456 }
00457
00458
00459 //----------------------------------------------------------------------------
00460 //
00461 // IDocHostUIHandler::ShowContextMenu method
00462 //    Called from MSHTML to display a context menu. By default, enables the
00463 //    browser's default context menu only for text edit elements.
00464 //
00465 // Parameters:
00466 //    dwID:          Identifier of the context menu to be displayed.
00467 //    ppt:           POINT structure containing the screen coordinates for the
00468 //                   menu.
00469 //    pcmdtReserved: Address of an IOleCommandTarget interface used to query
00470 //                   command status and execute commands on this object.
00471 //    pdispReserved: Address of an IDispatch interface of the object at the
00472 //                   screen coordinates specified in ppt. This allows a host
00473 //                   to differentiate particular objects to provide more
00474 //                   specific context.
00475 //
00476 // Returns:          A standard COM success or error value.
00477 //
00478 //----------------------------------------------------------------------------
00479 STDMETHODIMP CBrowserContainer::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved,
00480                                                 IDispatch *pdispReserved)
00481 {
00482    IHTMLInputTextElement *pEl = NULL;
00483    if(pdispReserved && SUCCEEDED(pdispReserved->QueryInterface(IID_IHTMLInputTextElement,
00484       (LPVOID*)&pEl)))
00485    {
00486       SAFERELEASE(pEl);
00487       return S_FALSE;
00488    }
00489    return S_OK;
00490 }
00491
00492
00493 //----------------------------------------------------------------------------
00494 //
00495 // IDocHostUIHandler::GetHostInfo method
00496 //    Retrieves the UI capabilities of the MSHTML host.
00497 //
00498 // Parameters:
00499 //    pInfo:         Address of a DOCHOSTUIINFO structure that receives the
00500 //                   host's UI capabilities.
00501 //
00502 // Returns:          A standard COM success or error value.
00503 //
00504 //----------------------------------------------------------------------------
00505 STDMETHODIMP CBrowserContainer::GetHostInfo(DOCHOSTUIINFO *pInfo)
00506 {
00507    if(!pInfo)
00508       return E_POINTER;
00509
00510    pInfo->cbSize = sizeof(DOCHOSTUIINFO);
00511    pInfo->dwFlags = DOCHOSTUIFLAG_DIALOG | (m_bScroll ? 0 : DOCHOSTUIFLAG_SCROLL_NO) |
00512       (m_bNoBorder ? DOCHOSTUIFLAG_NO3DBORDER : 0);
00513    pInfo->dwDoubleClick = 0;
00514
00515    return S_OK;
00516 }
00517
00518
00519 //----------------------------------------------------------------------------
00520 //
00521 // IDocHostUIHandler::ShowUI method
00522 //    Allows the host to replace the MSHTML menus and toolbars.
00523 //
00524 // Parameters:
00525 //    dwID:             DOCHOSTUITYPE value that indicates the type of user
00526 //                      interface.
00527 //    pActiveObject:    Address of an IOleInPlaceActiveObject interface for
00528 //                      the active object.
00529 //    pCommandTarget:   Address of an IOleCommandTarget interface for the
00530 //                      object.
00531 //    pFrame:           Address of an IOleInPlaceFrame interface for the
00532 //                      object. Menus and toolbars must use this parameter.
00533 //    pDoc:             Address of an IOleInPlaceUIWindow interface for the
00534 //                      object. Toolbars must use this parameter.
00535 //
00536 // Returns:             E_NOTIMPL in all cases.
00537 //
00538 //----------------------------------------------------------------------------
00539 STDMETHODIMP CBrowserContainer::ShowUI(DWORD dwID, IOleInPlaceActiveObject *pActiveObject,
00540                                        IOleCommandTarget *pCommandTarget,
00541                                        IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
00542 {
00543    return E_NOTIMPL;
00544 }
00545
00546
00547 //----------------------------------------------------------------------------
00548 //
00549 // IDocHostUIHandler::HideUI method
00550 //    Called when MSHTML removes its menus and toolbars.
00551 //
00552 // Parameters:       None.
00553 //
00554 // Returns:          E_NOTIMPL in all cases.
00555 //
00556 //----------------------------------------------------------------------------
00557 STDMETHODIMP CBrowserContainer::HideUI()
00558 {
00559    return E_NOTIMPL;
00560 }
00561
00562
00563 //----------------------------------------------------------------------------
00564 //
00565 // IDocHostUIHandler::UpdateUI method
00566 //    Notifies the host that the command state has changed.
00567 //
00568 // Parameters:       None.
00569 //
00570 // Returns:          E_NOTIMPL in all cases.
00571 //
00572 //----------------------------------------------------------------------------
00573 STDMETHODIMP CBrowserContainer::UpdateUI()
00574 {
00575    return E_NOTIMPL;
00576 }
00577
00578
00579 //----------------------------------------------------------------------------
00580 //
00581 // IDocHostUIHandler::EnableModeless method
00582 //    Called from the MSHTML implementation of IOleInPlaceActiveObject::
00583 //    EnableModeless. Also called when MSHTML displays modal UI.
00584 //
00585 // Parameters:
00586 //    fEnable:       Boolean value that indicates if the host's modeless
00587 //                   dialog boxes are enabled or disabled. If this value is
00588 //                   nonzero, modeless dialog boxes are enabled. If this value
00589 //                   is zero, modeless dialog boxes are disabled.
00590 //
00591 // Returns:          E_NOTIMPL in all cases.
00592 //
00593 //----------------------------------------------------------------------------
00594 STDMETHODIMP CBrowserContainer::EnableModeless(BOOL fEnable)
00595 {
00596    return E_NOTIMPL;
00597 }
00598
00599
00600 //----------------------------------------------------------------------------
00601 //
00602 // IDocHostUIHandler::OnDocWindowActivate method
00603 //    Called from the MSHTML implementation of IOleInPlaceActiveObject::
00604 //    OnDocWindowActivate.
00605 //
00606 // Parameters:
00607 //    fActivate:     Boolean value that indicates the state of the document
00608 //                   window. If this value is nonzero, the window is being
00609 //                   activated. If this value is zero, the window is being
00610 //                   deactivated.
00611 //
00612 // Returns:          E_NOTIMPL in all cases.
00613 //
00614 //----------------------------------------------------------------------------
00615 STDMETHODIMP CBrowserContainer::OnDocWindowActivate(BOOL fActivate)
00616 {
00617    return E_NOTIMPL;
00618 }
00619
00620
00621 //----------------------------------------------------------------------------
00622 //
00623 // IDocHostUIHandler::OnFrameWindowActivate method
00624 //    Called from the MSHTML implementation of IOleInPlaceActiveObject::
00625 //    OnFrameWindowActivate.
00626 //
00627 // Parameters:
00628 //    fActivate:     Boolean value that indicates the state of the container's
00629 //                   top-level frame window. If this value is nonzero, the
00630 //                   window is being activated. If this value is zero, the
00631 //                   window is being deactivated.
00632 //
00633 // Returns:          E_NOTIMPL in all cases.
00634 //
00635 //----------------------------------------------------------------------------
00636 STDMETHODIMP CBrowserContainer::OnFrameWindowActivate(BOOL fActivate)
00637 {
00638    return E_NOTIMPL;
00639 }
00640
00641
00642 //----------------------------------------------------------------------------
00643 //
00644 // IDocHostUIHandler::ResizeBorder method
00645 //    Called from the MSHTML implementation of IOleInPlaceActiveObject::
00646 //    ResizeBorder.
00647 //
00648 // Parameters:
00649 //    prcBorder:     Address of the new outer rectangle for border space.
00650 //    pUIWindow:     Address of the frame or document window whose border is
00651 //                   to be changed.
00652 //    fRameWindow:   Boolean value that is TRUE if the frame window is calling
00653 //                   ResizeBorder, or FALSE otherwise.
00654 //
00655 // Returns:          E_NOTIMPL in all cases.
00656 //
00657 //----------------------------------------------------------------------------
00658 STDMETHODIMP CBrowserContainer::ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow,
00659                                              BOOL fRameWindow)
00660 {
00661    return E_NOTIMPL;
00662 }
00663
00664
00665 //----------------------------------------------------------------------------
00666 //
00667 // IDocHostUIHandler::TranslateAccelerator method
00668 //    Called by MSHTML when IOleInPlaceActiveObject::TranslateAccelerator or
00669 //    IOleControlSite::TranslateAccelerator is called.
00670 //
00671 // Parameters:
00672 //    lpMsg:         Address of the message to be translated.
00673 //    pguidCmdGroup: Address of the command group identifier.
00674 //    nCmdID:        Unsigned long integer that specifies a command
00675 //                   identifier.
00676 //
00677 // Returns:          S_FALSE if a nCmdID is valid (to allow); S_OK if F5 or
00678 //                   Ctrl+P is being sent (to prevent), or S_FALSE by default.
00679 //
00680 //----------------------------------------------------------------------------
00681 STDMETHODIMP CBrowserContainer::TranslateAccelerator(LPMSG lpMsg, const GUID *pguidCmdGroup,
00682                                                      DWORD nCmdID)
00683 {
00684    if(lpMsg->message != WM_CHAR)
00685    {
00686       if(GetKeyState(VK_F5) < 0 && (GetKeyState(VK_CONTROL) >= 0 && GetKeyState(VK_SHIFT) >= 0 &&
00687          GetKeyState(VK_MENU) >= 0))
00688          return S_OK;
00689
00690       if((GetKeyState(VK_CONTROL) < 0 && GetKeyState(VK_MENU) >= 0 && GetKeyState(VK_SHIFT) >= 0)
00691          && (GetKeyState('P') < 0 || GetKeyState('N') < 0))
00692          return S_OK;
00693    }
00694    return S_FALSE;
00695 }
00696
00697
00698 //----------------------------------------------------------------------------
00699 //
00700 // IDocHostUIHandler::GetOptionKeyPath method
00701 //    Returns the registry key under which MSHTML stores user preferences.
00702 //
00703 // Parameters:
00704 //    pchKey:        Address of an LPOLESTR that receives the registry subkey
00705 //                   string where the host stores its default options.
00706 //    dw:            Reserved for future use. Not currently used.
00707 //
00708 // Returns:          E_NOTIMPL in all cases.
00709 //
00710 //----------------------------------------------------------------------------
00711 STDMETHODIMP CBrowserContainer::GetOptionKeyPath(LPOLESTR *pchKey, DWORD dw)
00712 {
00713    if(!pchKey)
00714       return E_POINTER;
00715
00716    *pchKey = NULL;
00717
00718    return E_NOTIMPL;
00719 }
00720
00721
00722 //----------------------------------------------------------------------------
00723 //
00724 // IDocHostUIHandler::GetDropTarget method
00725 //    Called by MSHTML when it is being used as a drop target to allow the
00726 //    host to supply an alternative IDropTarget.
00727 //
00728 // Parameters:
00729 //    pDropTarget:   Address of an IDropTarget object that MSHTML proposes to
00730 //                   use.
00731 //    ppDropTarget:  Address of the IDropTarget object that receives the
00732 //                   IDropTarget interface pointer the host wants to provide.
00733 //
00734 // Returns:          E_NOTIMPL in all cases.
00735 //
00736 //----------------------------------------------------------------------------
00737 STDMETHODIMP CBrowserContainer::GetDropTarget(IDropTarget *pDropTarget,
00738                                               IDropTarget **ppDropTarget)
00739 {
00740    return E_NOTIMPL;
00741 }
00742
00743
00744 //----------------------------------------------------------------------------
00745 //
00746 // IDocHostUIHandler::GetExternal method
00747 //    Called by MSHTML to obtain the host's IDispatch interface.
00748 //
00749 // Parameters:
00750 //    ppDispatch:    Address that receives the IDispatch interface pointer of
00751 //                   the host application. If the host exposes an automation
00752 //                   interface, it can provide a reference to MSHTML through
00753 //                   this parameter.
00754 //
00755 // Returns:          E_NOTIMPL in all cases.
00756 //
00757 //----------------------------------------------------------------------------
00758 STDMETHODIMP CBrowserContainer::GetExternal(IDispatch **ppDispatch)
00759 {
00760    if(!ppDispatch)
00761       return E_POINTER;
00762
00763 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00764    return m_spDispExternal->QueryInterface(IID_IDispatch, (LPVOID*)ppDispatch);
00765 #else
00766    *ppDispatch = NULL;
00767    return E_NOTIMPL;
00768 #endif
00769 }
00770
00771
00772 //----------------------------------------------------------------------------
00773 //
00774 // IDocHostUIHandler::TranslateUrl method
00775 //    Called by MSHTML to allow the host an opportunity to modify the URL to
00776 //    be loaded.
00777 //
00778 // Parameters:
00779 //    dwTranslate:   Reserved for future use.
00780 //    pchURLIn:      Address of a string supplied by MSHTML that represents
00781 //                   the URL to be translated.
00782 //    ppchURLOut:    Address of a string pointer that receives the address of
00783 //                   the translated URL. The host allocates the buffer using
00784 //                   the task memory allocator.
00785 //
00786 // Returns:          S_FALSE in all cases.
00787 //
00788 //----------------------------------------------------------------------------
00789 STDMETHODIMP CBrowserContainer::TranslateUrl(DWORD dwTranslate, OLECHAR *pchURLIn,
00790                                              OLECHAR **ppchURLOut)
00791 {
00792    if(!ppchURLOut)
00793       return E_POINTER;
00794
00795    *ppchURLOut = NULL;
00796
00797    return S_FALSE;
00798 }
00799
00800
00801 //----------------------------------------------------------------------------
00802 //
00803 // IDocHostUIHandler::FilterDataObject method
00804 //    Called on the host by MSHTML to allow the host to replace MSHTML's data
00805 //    object.
00806 //
00807 // Parameters:
00808 //    pDO:           Address of the IDataObject interface supplied by MSHTML.
00809 //    ppDORet:       Address that receives the IDataObject interface pointer
00810 //                   supplied by the host. The contents of this parameter
00811 //                   should always be initialized to NULL, even if the method
00812 //                   fails.
00813 //
00814 // Returns:          S_FALSE in all cases.
00815 //
00816 //----------------------------------------------------------------------------
00817 STDMETHODIMP CBrowserContainer::FilterDataObject(IDataObject *pDO, IDataObject **ppDORet)
00818 {
00819    if(!ppDORet)
00820       return E_POINTER;
00821
00822    *ppDORet = NULL;
00823
00824    return S_FALSE;
00825 }
00826
00827
00828 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00829
00830 //----------------------------------------------------------------------------
00831 //
00832 // IDispatch::GetTypeInfoCount method
00833 //    Retrieves the number of type information interfaces that an object
00834 //    provides (either 0 or 1).
00835 //
00836 // Parameters:
00837 //    pctinfo:       Points to a location that receives the number of type
00838 //                   information interfaces provided by the object.
00839 //
00840 // Returns:          E_NOTIMPL in all cases.
00841 //
00842 //----------------------------------------------------------------------------
00843 STDMETHODIMP CBrowserContainer::GetTypeInfoCount(unsigned int FAR* pctinfo)
00844 {
00845    return E_NOTIMPL;
00846 }
00847
00848
00849 //----------------------------------------------------------------------------
00850 //
00851 // IDispatch::GetTypeInfo method
00852 //    Retrieves the type information for an object, which can then be used to
00853 //    get the type information for an interface.
00854 //
00855 // Parameters:
00856 //    iTInfo:        The type information to return. Pass 0 to retrieve type
00857 //                   information for the IDispatch implementation.
00858 //    lcid:          The locale identifier for the type information.
00859 //    ppTInfo:       Receives a pointer to the requested type information
00860 //                   object.
00861 //
00862 // Returns:          E_NOTIMPL in all cases.
00863 //
00864 //----------------------------------------------------------------------------
00865 STDMETHODIMP CBrowserContainer::GetTypeInfo(unsigned int iTIinfo, LCID lcid,
00866                                             ITypeInfo FAR* FAR* ppTInfo)
00867 {
00868    return E_NOTIMPL;
00869 }
00870
00871
00872 //----------------------------------------------------------------------------
00873 //
00874 // IDispatch::GetIDsOfNames method
00875 //    Maps a single member and an optional set of argument names to a
00876 //    corresponding set of integer DISPIDs, which can be used on subsequent
00877 //    calls to IDispatch::Invoke.
00878 //
00879 // Parameters:
00880 //    riid:          Reserved for future use. Must be IID_NULL.
00881 //    rgszNames:     Passed-in array of names to be mapped.
00882 //    cNames:        Count of the names to be mapped.
00883 //    lcid:          The locale context in which to interpret the names.
00884 //    rgDispId:      Caller-allocated array, each element of which contains an
00885 //                   identifier (ID) corresponding to one of the names passed
00886 //                   in the rgszNames array. The first element represents the
00887 //                   member name. The subsequent elements represent each of
00888 //                   the member's parameters.
00889 //
00890 // Returns:          E_NOTIMPL in all cases.
00891 //
00892 //----------------------------------------------------------------------------
00893 STDMETHODIMP CBrowserContainer::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames,
00894                                               unsigned int cNames, LCID lcid,
00895                                               DISPID FAR* rgDispId)
00896 {
00897    return E_NOTIMPL;
00898 }
00899
00900
00901 //----------------------------------------------------------------------------
00902 //
00903 // IDispatch::Invoke method
00904 //    Provides access to properties and methods exposed by an object. Calls
00905 //    the host's helper function, passing DISPID and parameters.
00906 //
00907 // Parameters:
00908 //    dispIdMember:  Identifies the member.
00909 //    riid:          Reserved for future use. Must be IID_NULL.
00910 //    lcid:          The locale context in which to interpret arguments.
00911 //    wFlags:        Flags describing the context of the Invoke call.
00912 //    pDispParams:   Pointer to a structure containing an array of arguments,
00913 //                   an array of argument DISPIDs for named arguments, and
00914 //                   counts for the number of elements in the arrays.
00915 //    pVarResult:    Pointer to the location where the result is to be stored,
00916 //                   or NULL if the caller expects no result.
00917 //    pExcepInfo:    Pointer to a structure that contains exception
00918 //                   information.
00919 //    puArgErr:      The index within rgvarg of the first argument that has an
00920 //                   error.
00921 //
00922 // Returns:          S_OK in all cases.
00923 //
00924 //----------------------------------------------------------------------------
00925 STDMETHODIMP CBrowserContainer::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00926                                        DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult,
00927                                        EXCEPINFO FAR * pExcepInfo, unsigned int FAR *puArgErr)
00928 {
00929    return m_pDispSite->Invoke(dispIdMember, wFlags, pDispParams, pVarResult);
00930 }
00931
00932 #endif
00933
00934
00935 //----------------------------------------------------------------------------
00936 //
00937 // Init function
00938 //    Creates the WebBrowser object and adds it to the container. Sets up the
00939 //    event sink.
00940 //
00941 // Parameters:
00942 //    hwndParent:    Handle to the container window.
00943 //    ppWBOut:       Address to recieve the object's IWebBrowser2 interface
00944 //                   pointer.
00945 //    pSite:         Interface that handles WebBrowser events, passed to the
00946 //                   EventSink object.
00947 //    dwSinkType:    Owner type identifier passed to the EventSink object.
00948 //    pExternal:     Pointer to the object to use as the host external object.
00949 //    pDispSite:     Interface that handles dispatch events, for ambient
00950 //                   property support.
00951 //
00952 // Returns:          None.
00953 //
00954 //----------------------------------------------------------------------------
00955 void CBrowserContainer::Init(HWND hwndParent, IWebBrowser2 **ppWBOut, IEventSinkSite *pSite,
00956                              DWORD dwSinkType
00957 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00958                              , IDispatch *pExternal
00959 #endif
00960 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00961                              , IBrowserContainerSite *pDispSite
00962 #endif
00963                              )
00964 {
00965    _ASSERT(!m_hWnd);
00966    _ASSERT(hwndParent && pSite);
00967
00968    m_hWnd = hwndParent;
00969
00970 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00971    m_pDispSite = pDispSite;
00972 #endif
00973
00974    try
00975    {
00976 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00977       m_spDispExternal.Assign(pExternal);
00978 #endif
00979
00980       HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER |
00981          CLSCTX_LOCAL_SERVER, IID_IOleObject, (LPVOID*)&m_spioo);
00982       CHECKHRCOM(hr);
00983
00984       MSG msg;
00985       m_spipo.Assign(m_spioo);
00986       CHECKHRCOM(m_spioo->SetClientSite((IOleClientSite*)this));
00987       CHECKHRCOM(m_spioo->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, (IOleClientSite*)this, 0,
00988          m_hWnd, &m_rect));
00989
00990       CPtr<IUnknown, &IID_IUnknown> spUnk(m_spioo);
00991       m_pEvent = new CEventSink(pSite, dwSinkType, spUnk,
00992          DIID_DWebBrowserEvents2);
00993       ENSUREALLOC(m_pEvent);
00994
00995       if(ppWBOut)
00996          CHECKHRCOM(m_spioo->QueryInterface(IID_IWebBrowser2, (LPVOID*)ppWBOut));
00997    } catch(CCOMExcep *pCOMExcep)
00998    {
00999       pCOMExcep->Delete();
01000       THROW(new CExcepEx(IDS_BMWS_BROWSERCONTAINER_E_WBCREATE, IDS_BMWS_REMEDY_IE), CExcepEx*);
01001    }
01002 }
01003
01004
01005 //----------------------------------------------------------------------------
01006 //
01007 // Uninit function
01008 //    Cleans up the Browser Container by uninitializing the WebBrowser control
01009 //    and freeing all interfaces.
01010 //
01011 // Parameters:       None.
01012 //
01013 // Returns:          None.
01014 //
01015 //----------------------------------------------------------------------------
01016 void CBrowserContainer::Uninit()
01017 {
01018 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
01019    m_spDispExternal.Release();
01020 #endif
01021
01022    if(m_pEvent)
01023       m_pEvent->Disconnect();
01024    m_pEvent = NULL;
01025
01026    try
01027    {
01028       CHECKHRCOM(m_spipo->UIDeactivate());
01029       CHECKHRCOM(m_spipo->InPlaceDeactivate());
01030       m_spipo = NULL;
01031       CHECKHRCOM(m_spioo->Close(OLECLOSE_NOSAVE));
01032       CHECKHRCOM(m_spioo->SetClientSite(NULL));
01033       m_spioo = NULL;
01034    } catch(CCOMExcep* pE)
01035    {
01036       pE->Delete();
01037       BCINTERNALERR(20003);
01038    }
01039 }
01040
01041
01042 //----------------------------------------------------------------------------
01043 //
01044 // SetLocation function
01045 //    Updates the position of the WebBrowser object.
01046 //
01047 // Parameters:
01048 //    x:             X-coordinate of the browser.
01049 //    y:             Y-coordinate of the browser.
01050 //    width:         Width, in pixels, of the browser window.
01051 //    height:        Height, in pixels, of the browser window.
01052 //
01053 // Returns:          None.
01054 //
01055 //----------------------------------------------------------------------------
01056 void CBrowserContainer::SetLocation(int x, int y, int width, int height)
01057 {
01058    if(!m_bInPlaceActive)
01059       return;
01060
01061    m_rect.left     = x;
01062    m_rect.top      = y;
01063    m_rect.right    = width;
01064    m_rect.bottom   = height;
01065
01066    m_spipo->SetObjectRects(&m_rect, &m_rect);
01067 }
01068
01069
01070 //----------------------------------------------------------------------------
01071 //
01072 // SetVisible function
01073 //    Toggles the visibility of the WebBrowser object.
01074 //
01075 // Parameters:
01076 //    bShow:         Whether to show the object (TRUE) or hide it (FALSE).
01077 //
01078 // Returns:          None.
01079 //
01080 //----------------------------------------------------------------------------
01081 void CBrowserContainer::SetVisible(BOOL bShow)
01082 {
01083    if(bShow)
01084    {
01085       m_spioo->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01086       m_spioo->DoVerb(OLEIVERB_SHOW, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01087    } else
01088       m_spioo->DoVerb(OLEIVERB_HIDE, NULL, (IOleClientSite*)this, 0, m_hWnd, NULL);
01089 }
01090
01091
01092 //----------------------------------------------------------------------------
01093 //
01094 // SetFocus function
01095 //    Sets focus on the WebBrowser object by making it UI active.
01096 //
01097 // Parameters:       None.
01098 //
01099 // Returns:          None.
01100 //
01101 //----------------------------------------------------------------------------
01102 void CBrowserContainer::SetFocus()
01103 {
01104    m_spioo->DoVerb(OLEIVERB_UIACTIVATE, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01105 }
01106
01107
01108 //----------------------------------------------------------------------------
01109 //
01110 // TranslateKey function
01111 //    Allows the WebBrowser to translate the message.
01112 //
01113 // Parameters:
01114 //    lpMsg:         Pointer to the message to translate.
01115 //
01116 // Returns:          S_FALSE if not a keyboard message, or the result from the
01117 //                   WebBrowser.
01118 //
01119 //----------------------------------------------------------------------------
01120 HRESULT CBrowserContainer::TranslateKey(LPMSG lpmsg)
01121 {
01122    if((lpmsg->message >= WM_KEYFIRST) && (lpmsg->message <= WM_KEYLAST))
01123    {
01124       CPtr<IOleInPlaceActiveObject, &IID_IOleInPlaceActiveObject> spao(m_spioo);
01125       return spao->TranslateAccelerator(lpmsg);
01126    }
01127    return S_FALSE;
01128 }
01129
01130
01131 #ifdef BMWS_BROWSERCONTAINER_GETLOCATION
01132
01133 void CBrowserContainer::GetLocation(LPRECT lprc)
01134 {
01135    _ASSERT(lprc);
01136    CopyRect(lprc, &m_rect);
01137 }
01138
01139 #endif
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer.h File Reference

#include <bmws_unkbase.h>
#include <bmws_ptr.h>
#include <bmws_eventsink.h>
#include <oleidl.h>
#include <mshtmhst.h>
#include <exdisp.h>

Go to the source code of this file.

Compounds

class | CBrowserContainer

Defines

#define | AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_

Typedefs

typedef CPtr< IWebBrowser2,
&IID_IWebBrowser2 > 		CWebBrowser2Ptr

Define Documentation

#define AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_

Definition at line 10 of file bmws_browsercontainer.h.

Typedef Documentation

typedef CPtr<IWebBrowser2, &IID_IWebBrowser2> CWebBrowser2Ptr

Definition at line 31 of file bmws_browsercontainer.h.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer.h Source File

bmws_browsercontainer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_browsercontainer.h
00004 //    Class to encapsulate embedding the WebBrowser object in an application.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
00010 #define AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_unkbase.h>
00021 #include <bmws_ptr.h>
00022 #include <bmws_eventsink.h>
00023 #include <oleidl.h>
00024 #include <mshtmhst.h>
00025 #include <exdisp.h>
00026
00027
00028 //----------------------------------------------------------------------------
00029 // Web browser smart pointer class
00030 //----------------------------------------------------------------------------
00031 typedef CPtr<IWebBrowser2, &IID_IWebBrowser2> CWebBrowser2Ptr;
00032
00033
00034 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00035
00036 //----------------------------------------------------------------------------
00037 //
00038 // IBrowserContainerSite abstract class
00039 //    Enables the host to support ambient properties.
00040 //
00041 //----------------------------------------------------------------------------
00042 class IBrowserContainerSite
00043 {
00044 public:
00045    virtual HRESULT Invoke(DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR *pDispParams,
00046       VARIANT FAR *pVarResult) = 0;
00047 };
00048
00049 #endif
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CBrowserContainer class
00055 //    Encapsulates embedding the WebBrowser object in an application. Is often
00056 //    extended to override functionality.
00057 //
00058 //----------------------------------------------------------------------------
00059 class CBrowserContainer : public CUnkBase, public IOleClientSite, public IOleInPlaceSite,
00060                           public IDocHostUIHandler
00061 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00062                           , public IDispatch
00063 #endif
00064 {
00065 public:
00066    CBrowserContainer(BOOL bNoBorder, BOOL bScroll = FALSE);
00067
00068    DECLARE_IUNKNOWN;
00069
00070    // IOleClientSite methods
00071    STDMETHOD (SaveObject)();
00072    STDMETHOD (GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, LPMONIKER *ppmk);
00073    STDMETHOD (GetContainer)(LPOLECONTAINER *ppContainer);
00074    STDMETHOD (ShowObject)();
00075    STDMETHOD (OnShowWindow)(BOOL fShow);
00076    STDMETHOD (RequestNewObjectLayout)();
00077
00078    // IOleWindow methods
00079    STDMETHOD (GetWindow)(HWND *phwnd);
00080    STDMETHOD (ContextSensitiveHelp) (BOOL fEnterMode);
00081
00082    // IOleInPlaceSite methods
00083    STDMETHOD (CanInPlaceActivate)();
00084    STDMETHOD (OnInPlaceActivate)();
00085    STDMETHOD (OnUIActivate)();
00086    STDMETHOD (GetWindowContext)(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc,
00087       LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo);
00088    STDMETHOD (Scroll)(SIZE scrollExtent);
00089    STDMETHOD (OnUIDeactivate)(BOOL fUndoable);
00090    STDMETHOD (OnInPlaceDeactivate)();
00091    STDMETHOD (DiscardUndoState)();
00092    STDMETHOD (DeactivateAndUndo)();
00093    STDMETHOD (OnPosRectChange)(LPCRECT lprcPosRect);
00094
00095    // IDocHostUIHandler methods
00096    STDMETHOD (ShowContextMenu)(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved,
00097       IDispatch *pdispReserved);
00098    STDMETHOD (GetHostInfo)(DOCHOSTUIINFO *pInfo);
00099    STDMETHOD (ShowUI)(DWORD dwID, IOleInPlaceActiveObject *pActiveObject,
00100       IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc);
00101    STDMETHOD (HideUI)();
00102    STDMETHOD (UpdateUI)();
00103    STDMETHOD (EnableModeless)(BOOL fEnable);
00104    STDMETHOD (OnDocWindowActivate)(BOOL fActivate);
00105    STDMETHOD (OnFrameWindowActivate)(BOOL fActivate);
00106    STDMETHOD (ResizeBorder)(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow,
00107       BOOL fRameWindow);
00108    STDMETHOD (TranslateAccelerator)(LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID);
00109    STDMETHOD (GetOptionKeyPath)(LPOLESTR *pchKey, DWORD dw);
00110    STDMETHOD (GetDropTarget)(IDropTarget *pDropTarget, IDropTarget **ppDropTarget);
00111    STDMETHOD (GetExternal)(IDispatch **ppDispatch);
00112    STDMETHOD (TranslateUrl)(DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut);
00113    STDMETHOD (FilterDataObject)(IDataObject *pDO, IDataObject **ppDORet);
00114
00115 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00116    // IDispatch methods
00117    STDMETHOD (GetTypeInfoCount)(unsigned int FAR* pctinfo);
00118    STDMETHOD (GetTypeInfo)(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo);
00119    STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,  unsigned int cNames,
00120       LCID lcid,  DISPID FAR* rgDispId);
00121    STDMETHOD (Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00122       DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult, EXCEPINFO FAR * pExcepInfo,
00123       unsigned int FAR *puArgErr);
00124 #endif
00125
00126    // INDUnknown override
00127    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00128
00129    void Init(HWND hwndParent, IWebBrowser2 **ppWBOut, IEventSinkSite *pSite, DWORD dwSinkType
00130 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00131       , IDispatch *pExternal
00132 #endif
00133 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00134       , IBrowserContainerSite *pDispSite
00135 #endif
00136       );
00137    void Uninit();
00138    void SetLocation(int x, int y, int width, int height);
00139    void SetVisible(BOOL bShow);
00140    void SetFocus();
00141    HRESULT TranslateKey(LPMSG lpMsg);
00142 #ifdef BMWS_BROWSERCONTAINER_GETLOCATION
00143    void GetLocation(LPRECT lprc);
00144 #endif
00145
00146 protected:
00147    HWND m_hWnd;                                 // window handle of the container
00148    RECT m_rect;                                 // size of control
00149    BOOL m_bInPlaceActive;                       // Whether the object is in place active
00150    CEventSink *m_pEvent;                        // WebBrowser event sink
00151    CPtr<IOleObject, &IID_IOleObject> m_spioo;   // OLE object interface of contained object
00152    CPtr<IOleInPlaceObject,
00153       &IID_IOleInPlaceObject> m_spipo;          // In place object interface of contained object
00154 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00155    CDispatchPtr m_spDispExternal;               // External object
00156 #endif
00157 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00158    IBrowserContainerSite *m_pDispSite;          // Object to handle IDispatch::Invoke
00159 #endif
00160    BOOL m_bNoBorder;                            // Whether the 3D border should be supressed
00161    BOOL m_bScroll;                              // Whether scrolling should be disabled
00162 };
00163
00164
00165 #endif // !defined(AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_BROWSERCONTAINER_E_WBCREATE 18251
#define | IDS_BMWS_BROWSERCONTAINER_E_INTERNAL 18252

Define Documentation

#define IDS_BMWS_BROWSERCONTAINER_E_INTERNAL 18252

Definition at line 6 of file bmws_browsercontainer_res_lc.h.

#define IDS_BMWS_BROWSERCONTAINER_E_WBCREATE 18251

Definition at line 5 of file bmws_browsercontainer_res_lc.h.

Referenced by CBrowserContainer::Init().

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_browsercontainer_res_lc.h Source File

bmws_browsercontainer_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_browsercontainer_lc.rc
00004 //
00005 #define IDS_BMWS_BROWSERCONTAINER_E_WBCREATE 18251
00006 #define IDS_BMWS_BROWSERCONTAINER_E_INTERNAL 18252
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_choosecolor.cpp File Reference

#include <bmws_choosecolor.h>
#include <bmws_error.h>
#include <bmws_window.h>
#include <commdlg.h>

Go to the source code of this file.

Functions

UINT_PTR CALLBACK | ChooseColorDialogHook (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL | ChooseColorEx (COLORREF *pColor, HWND hwndOwner, CTSTR &lpszTitle)
void | ChooseColorReadReg (CKey &hKeyProduct, UINT uidValueName)
void | ChooseColorWriteReg (CKey &hKeyProduct, UINT uidValueName)

Variables

COLORREF | g_aCustomColors [16]

Function Documentation

UINT_PTR CALLBACK ChooseColorDialogHook | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 40 of file bmws_choosecolor.cpp.

References CHWND::CenterWindow().

Referenced by ChooseColorEx().

00041 {
00042    if(uMsg == WM_INITDIALOG)
00043    {
00044       if(lParam)
00045          SendMessage(hWnd, WM_SETTEXT, 0, ((CHOOSECOLOR*)lParam)->lCustData);
00046       CHWND::CenterWindow(hWnd);
00047    }
00048
00049    return 0;
00050 }

BOOL ChooseColorEx | ( | COLORREF * | pColor,
 |  | HWND | hwndOwner,
 |  | CTSTR & | lpszTitle
 | ) |

Definition at line 67 of file bmws_choosecolor.cpp.

References ChooseColorDialogHook(), g_aCustomColors, IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, CTSTR::m_lpsz, and THROW.

Referenced by CAppearanceDlg::DoChooseColor(), and CHTMLChooseColor::EventHandler().

00068 {
00069    BOOL bReturn = 0;
00070
00071    CHOOSECOLOR cc;
00072    ZeroMemory(&cc, sizeof(cc));
00073    cc.lStructSize = sizeof(cc);
00074    cc.hwndOwner = hwndOwner;
00075    cc.rgbResult = *pColor;
00076    cc.lpCustColors = g_aCustomColors;
00077    cc.Flags = CC_ENABLEHOOK | CC_RGBINIT | CC_FULLOPEN;
00078    cc.lpfnHook = ChooseColorDialogHook;
00079    if(lpszTitle)
00080       cc.lCustData = (LPARAM)lpszTitle.m_lpsz;
00081
00082    BOOL bOK = ChooseColor(&cc);
00083    if(bOK)
00084    {
00085       *pColor = cc.rgbResult;
00086       bReturn = TRUE;
00087    } else
00088    {
00089       if(CommDlgExtendedError() != 0)
00090          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00091       bReturn = FALSE;
00092    }
00093
00094    return bReturn;
00095 }

void ChooseColorReadReg | ( | CKey & | hKeyProduct,
 |  | UINT | uidValueName
 | ) |

Definition at line 111 of file bmws_choosecolor.cpp.

References g_aCustomColors.

Referenced by CUserPrefs::ReadRegistry().

00112 {
00113    DWORD dwTemp;
00114    DWORD dwSize = 16 * sizeof(COLORREF);
00115    RegQueryValueEx(hKeyProduct, CTSTR(uidValueName), NULL, &dwTemp, (LPBYTE)&g_aCustomColors,
00116       &dwSize);
00117 }

void ChooseColorWriteReg | ( | CKey & | hKeyProduct,
 |  | UINT | uidValueName
 | ) |

Definition at line 133 of file bmws_choosecolor.cpp.

References g_aCustomColors.

Referenced by CUserPrefs::WriteRegistry().

00134 {
00135    RegSetValueEx(hKeyProduct, CTSTR(uidValueName), 0, REG_BINARY, (LPBYTE)&g_aCustomColors,
00136       sizeof(g_aCustomColors));
00137 }

Variable Documentation

COLORREF g_aCustomColors[16]

Definition at line 22 of file bmws_choosecolor.cpp.

Referenced by ChooseColorEx(), ChooseColorReadReg(), and ChooseColorWriteReg().

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_choosecolor.cpp Source File

bmws_choosecolor.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_choosecolor.cpp
00004 //    Functions to support choosing a color from the Choose Color common
00005 //    dialog box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_choosecolor.h>
00014 #include <bmws_error.h>
00015 #include <bmws_window.h>
00016 #include <commdlg.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Global variables
00021 //----------------------------------------------------------------------------
00022 COLORREF g_aCustomColors[16]; // array of custom colors
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // ChooseColorDialogHook function
00028 //    Callback function for the Choose Color common dialog box hook, used to
00029 //    center the dialog box.
00030 //
00031 // Parameters:
00032 //    hWnd:          The window handle to the Choose Color dialog box.
00033 //    uMsg:          Message identifer.
00034 //    wParam:        Message-specific parameter.
00035 //    lParam:        Message-specific parameter.
00036 //
00037 // Returns:          0 in all cases.
00038 //
00039 //----------------------------------------------------------------------------
00040 UINT_PTR CALLBACK ChooseColorDialogHook(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00041 {
00042    if(uMsg == WM_INITDIALOG)
00043    {
00044       if(lParam)
00045          SendMessage(hWnd, WM_SETTEXT, 0, ((CHOOSECOLOR*)lParam)->lCustData);
00046       CHWND::CenterWindow(hWnd);
00047    }
00048
00049    return 0;
00050 }
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // ChooseColorEx function
00056 //    Presents the Choose Color common dialog box.
00057 //
00058 // Parameters:
00059 //    pColor:        Pointer containing the initial color, to receive the
00060 //                   user's color.
00061 //    hwndOwner:     Parent window of the dialog box.
00062 //    lpszTitle:     Title of the dialog box.
00063 //
00064 // Returns:          TRUE if a color was selected, else FALSE.
00065 //
00066 //----------------------------------------------------------------------------
00067 BOOL ChooseColorEx(COLORREF* pColor, HWND hwndOwner, CTSTR& lpszTitle)
00068 {
00069    BOOL bReturn = 0;
00070
00071    CHOOSECOLOR cc;
00072    ZeroMemory(&cc, sizeof(cc));
00073    cc.lStructSize = sizeof(cc);
00074    cc.hwndOwner = hwndOwner;
00075    cc.rgbResult = *pColor;
00076    cc.lpCustColors = g_aCustomColors;
00077    cc.Flags = CC_ENABLEHOOK | CC_RGBINIT | CC_FULLOPEN;
00078    cc.lpfnHook = ChooseColorDialogHook;
00079    if(lpszTitle)
00080       cc.lCustData = (LPARAM)lpszTitle.m_lpsz;
00081
00082    BOOL bOK = ChooseColor(&cc);
00083    if(bOK)
00084    {
00085       *pColor = cc.rgbResult;
00086       bReturn = TRUE;
00087    } else
00088    {
00089       if(CommDlgExtendedError() != 0)
00090          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00091       bReturn = FALSE;
00092    }
00093
00094    return bReturn;
00095 }
00096
00097
00098 //----------------------------------------------------------------------------
00099 //
00100 // ChooseColorReadReg function
00101 //    Reads the user's custom colors from the Registry value specified.
00102 //
00103 // Parameters:
00104 //    hKeyProduct:   The key used to store the product's user settings.
00105 //    uidValueName:  String resource identifier of the value from which to
00106 //                   read the data.
00107 //
00108 // Returns:          None.
00109 //
00110 //----------------------------------------------------------------------------
00111 void ChooseColorReadReg(CKey& hKeyProduct, UINT uidValueName)
00112 {
00113    DWORD dwTemp;
00114    DWORD dwSize = 16 * sizeof(COLORREF);
00115    RegQueryValueEx(hKeyProduct, CTSTR(uidValueName), NULL, &dwTemp, (LPBYTE)&g_aCustomColors,
00116       &dwSize);
00117 }
00118
00119
00120 //----------------------------------------------------------------------------
00121 //
00122 // ChooseColorWriteReg function
00123 //    Writes the user's custom colors into the Registry value specified.
00124 //
00125 // Parameters:
00126 //    hKeyProduct:   The key used to store the product's user settings.
00127 //    uidValueName:  String resource identifier of the value in which to store
00128 //                   the data.
00129 //
00130 // Returns:          None.
00131 //
00132 //----------------------------------------------------------------------------
00133 void ChooseColorWriteReg(CKey& hKeyProduct, UINT uidValueName)
00134 {
00135    RegSetValueEx(hKeyProduct, CTSTR(uidValueName), 0, REG_BINARY, (LPBYTE)&g_aCustomColors,
00136       sizeof(g_aCustomColors));
00137 }
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_choosecolor.h File Reference

#include <commdlg.h>
#include <bmws_key.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

BOOL | ChooseColorEx (COLORREF *pColor, HWND hwndOwner, CTSTR &lpszTitle)
void | ChooseColorReadReg (CKey &hKeyProduct, UINT uidValueName)
void | ChooseColorWriteReg (CKey &hKeyProduct, UINT uidValueName)

Define Documentation

#define AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 11 of file bmws_choosecolor.h.

Function Documentation

BOOL ChooseColorEx | ( | COLORREF * | pColor,
 |  | HWND | hwndOwner,
 |  | CTSTR & | lpszTitle
 | ) |

Definition at line 67 of file bmws_choosecolor.cpp.

References ChooseColorDialogHook(), g_aCustomColors, IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, CTSTR::m_lpsz, and THROW.

Referenced by CAppearanceDlg::DoChooseColor(), and CHTMLChooseColor::EventHandler().

00068 {
00069    BOOL bReturn = 0;
00070
00071    CHOOSECOLOR cc;
00072    ZeroMemory(&cc, sizeof(cc));
00073    cc.lStructSize = sizeof(cc);
00074    cc.hwndOwner = hwndOwner;
00075    cc.rgbResult = *pColor;
00076    cc.lpCustColors = g_aCustomColors;
00077    cc.Flags = CC_ENABLEHOOK | CC_RGBINIT | CC_FULLOPEN;
00078    cc.lpfnHook = ChooseColorDialogHook;
00079    if(lpszTitle)
00080       cc.lCustData = (LPARAM)lpszTitle.m_lpsz;
00081
00082    BOOL bOK = ChooseColor(&cc);
00083    if(bOK)
00084    {
00085       *pColor = cc.rgbResult;
00086       bReturn = TRUE;
00087    } else
00088    {
00089       if(CommDlgExtendedError() != 0)
00090          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00091       bReturn = FALSE;
00092    }
00093
00094    return bReturn;
00095 }

void ChooseColorReadReg | ( | CKey & | hKeyProduct,
 |  | UINT | uidValueName
 | ) |

Definition at line 111 of file bmws_choosecolor.cpp.

References g_aCustomColors.

Referenced by CUserPrefs::ReadRegistry().

00112 {
00113    DWORD dwTemp;
00114    DWORD dwSize = 16 * sizeof(COLORREF);
00115    RegQueryValueEx(hKeyProduct, CTSTR(uidValueName), NULL, &dwTemp, (LPBYTE)&g_aCustomColors,
00116       &dwSize);
00117 }

void ChooseColorWriteReg | ( | CKey & | hKeyProduct,
 |  | UINT | uidValueName
 | ) |

Definition at line 133 of file bmws_choosecolor.cpp.

References g_aCustomColors.

Referenced by CUserPrefs::WriteRegistry().

00134 {
00135    RegSetValueEx(hKeyProduct, CTSTR(uidValueName), 0, REG_BINARY, (LPBYTE)&g_aCustomColors,
00136       sizeof(g_aCustomColors));
00137 }

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_choosecolor.h Source File

bmws_choosecolor.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_choosecolor.h
00004 //    Functions to support choosing a color from the Choose Color common
00005 //    dialog box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00011 #define AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <commdlg.h>
00018 #include <bmws_key.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 // BMWS_ChooseColor API functions
00023 //----------------------------------------------------------------------------
00024 BOOL ChooseColorEx(COLORREF* pColor, HWND hwndOwner, CTSTR& lpszTitle);
00025 void ChooseColorReadReg(CKey& hKeyProduct, UINT uidValueName);
00026 void ChooseColorWriteReg(CKey& hKeyProduct, UINT uidValueName);
00027
00028
00029 #endif // !defined(AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cleardir.cpp File Reference

#include <bmws_cleardir.h>

Go to the source code of this file.

Functions

void ClearDirectory (CTSTR &lpszPath)

Function Documentation

void ClearDirectory ( CTSTR & lpszPath )

Definition at line 28 of file bmws_cleardir.cpp.

00029 {
00030    CTSTR lpszSearch(TRUE, lstrlen(lpszPath) + 16);
00031    lstrcpy(lpszSearch, lpszPath);
00032    lstrcat(lpszSearch, TEXT("\\*.*"));
00033
00034    WIN32_FIND_DATA wfd;
00035    ZeroMemory(&wfd, sizeof(wfd));
00036    HANDLE hFind = FindFirstFile(lpszSearch, &wfd);
00037    BOOL bValid = (hFind != INVALID_HANDLE_VALUE);
00038    while(bValid)
00039    {
00040       if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00041       {
00042          if((lstrcmp(wfd.cFileName, TEXT("..")) != 0) &&
00043             (lstrcmp(wfd.cFileName, TEXT(".")) != 0))
00044          {
00045             CTSTR lpszRecurPath(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00046             wsprintf(lpszRecurPath, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00047             ClearDirectory(lpszRecurPath);
00048             RemoveDirectory(lpszRecurPath);
00049          }
00050       } else
00051       {
00052          CTSTR lpszFile(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00053          wsprintf(lpszFile, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00054          DeleteFile(lpszFile);
00055       }
00056       bValid = FindNextFile(hFind, &wfd);
00057    }
00058    if(hFind != INVALID_HANDLE_VALUE)
00059       FindClose(hFind);
00060 }

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cleardir.cpp Source File

bmws_cleardir.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_cleardir.cpp
00004 //    Function to recursively clear a directory of all subdirectories and
00005 //    files.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_cleardir.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // ClearDirectory function
00019 //    Clears a directory of all its contents, including all subdirectories and
00020 //    files. Calls itself recursively on subdirectories.
00021 //
00022 // Parameters:
00023 //    lpszPath:      Path of the subdirectory to clear.
00024 //
00025 // Returns:          None.
00026 //
00027 //----------------------------------------------------------------------------
00028 void ClearDirectory(CTSTR& lpszPath)
00029 {
00030    CTSTR lpszSearch(TRUE, lstrlen(lpszPath) + 16);
00031    lstrcpy(lpszSearch, lpszPath);
00032    lstrcat(lpszSearch, TEXT("\\*.*"));
00033
00034    WIN32_FIND_DATA wfd;
00035    ZeroMemory(&wfd, sizeof(wfd));
00036    HANDLE hFind = FindFirstFile(lpszSearch, &wfd);
00037    BOOL bValid = (hFind != INVALID_HANDLE_VALUE);
00038    while(bValid)
00039    {
00040       if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00041       {
00042          if((lstrcmp(wfd.cFileName, TEXT("..")) != 0) &&
00043             (lstrcmp(wfd.cFileName, TEXT(".")) != 0))
00044          {
00045             CTSTR lpszRecurPath(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00046             wsprintf(lpszRecurPath, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00047             ClearDirectory(lpszRecurPath);
00048             RemoveDirectory(lpszRecurPath);
00049          }
00050       } else
00051       {
00052          CTSTR lpszFile(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00053          wsprintf(lpszFile, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00054          DeleteFile(lpszFile);
00055       }
00056       bValid = FindNextFile(hFind, &wfd);
00057    }
00058    if(hFind != INVALID_HANDLE_VALUE)
00059       FindClose(hFind);
00060 }
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cleardir.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

void | ClearDirectory (CTSTR &lpszPath)

Define Documentation

#define AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 11 of file bmws_cleardir.h.

Function Documentation

void ClearDirectory ( CTSTR & lpszPath )

Definition at line 28 of file bmws_cleardir.cpp.

00029 {
00030    CTSTR lpszSearch(TRUE, lstrlen(lpszPath) + 16);
00031    lstrcpy(lpszSearch, lpszPath);
00032    lstrcat(lpszSearch, TEXT("\\*.*"));
00033
00034    WIN32_FIND_DATA wfd;
00035    ZeroMemory(&wfd, sizeof(wfd));
00036    HANDLE hFind = FindFirstFile(lpszSearch, &wfd);
00037    BOOL bValid = (hFind != INVALID_HANDLE_VALUE);
00038    while(bValid)
00039    {
00040       if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00041       {
00042          if((lstrcmp(wfd.cFileName, TEXT("..")) != 0) &&
00043             (lstrcmp(wfd.cFileName, TEXT(".")) != 0))
00044          {
00045             CTSTR lpszRecurPath(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00046             wsprintf(lpszRecurPath, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00047             ClearDirectory(lpszRecurPath);
00048             RemoveDirectory(lpszRecurPath);
00049          }
00050       } else
00051       {
00052          CTSTR lpszFile(TRUE, lstrlen(lpszPath) + lstrlen(wfd.cFileName) + 8);
00053          wsprintf(lpszFile, TEXT("%s\\%s"), lpszPath, wfd.cFileName);
00054          DeleteFile(lpszFile);
00055       }
00056       bValid = FindNextFile(hFind, &wfd);
00057    }
00058    if(hFind != INVALID_HANDLE_VALUE)
00059       FindClose(hFind);
00060 }

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cleardir.h Source File

bmws_cleardir.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_cleardir.h
00004 //    Function to recursively clear a directory of all subdirectories and
00005 //    files.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00011 #define AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <bmws_string.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // BMWS_ClearDir API functions
00022 //----------------------------------------------------------------------------
00023 void ClearDirectory(CTSTR& lpszPath);
00024
00025
00026 #endif // !defined(AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:47 2002 for Solitaire Pack by doxygen 1.2.15


bmws_common.h File Reference

Go to the source code of this file.

Defines

#define | AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#define | _ASSERT(expr) ((void)0)
#define | SAFEALLOCMEMORY(u) (CoTaskMemAlloc(u))
#define | SAFEFREEMEMORY(p) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}
#define | ODS(t) ((void)0)
#define | ODS2(t) ((void)0)
#define | NOTRACK_SAFEFREEMEMORY(p) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}
#define | SAFEALLOC(u) ((LPTSTR)SAFEALLOCMEMORY(sizeof(TCHAR) * (u)))
#define | SAFEALLOCW(u) ((LPWSTR)SAFEALLOCMEMORY(sizeof(WCHAR) * (u)))
#define | SAFERELEASE(p) {if (p) {(p)->Release(); p = NULL;}}
#define | SAFEFREESTRING(b) {if (b) {SysFreeString(b); b = NULL;}}
#define | SAFEDELETE(p) {if (p) {delete p; p = NULL;}}
#define | CHECKPTR(p) if(!(p)) return E_POINTER;
#define | ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))

Define Documentation

#define _ASSERT ( expr ) ((void)0)

Definition at line 29 of file bmws_common.h.

Referenced by CCompoundXMLDocument::AddFile(), CXMLElement::AltGetAttr(), CXMLElement::AltNumChildOf(), CXMLElement::AltSetVTAttr(), CArray::Append(), CGameMenuItem::CGameMenuItem(), CHlinkWindow::CHlinkWindow(), CMainWindow::CMainWindow(), ConstructElements(), CArray::Copy(), CopyElements(), CScriptFn::Create(), CGameBase::CreateDeck(), CGameSpider::DealCard(), DestructElements(), CArray< CFragmentAdd *, CFragmentAdd * >::ElementAt(), CGameCommandMgr::EnableGameCommand(), CGameCommandMgr::EventHandler(), CBSTR::Format(), CTSTR::Format(), CFragment::FragToPile(), CArray< CFragmentAdd *, CFragmentAdd * >::GetAt(), CGameBase::GetCardFromData(), CGameBase::GetLongFromData(), CGameBase::GetMetrics(), GetRegDWORDValue(), CEngine::HandlePileClicked(), CEngine::HandleTryDrop(), CGameBase::IncrScore(), CGameMenu::Init(), CGameCommandMgr::Init(), CBrowserContainer::Init(), CCard::InitCard(), CEngine::InitEngine(), CFragment::InitFragment(), CPile::InitPile(), CArray::InsertAt(), CGameLaBelleLucie::IsCardPlayable(), CXMLDocument::LoadFromFile(), CEngine::MouseMove(), CEngine::MouseUp(), CPointer< CStatusBar >::operator *(), CPointer< CStatusBar >::operator->(), CEngine::PlayGame(), CGameBase::PutCardInData(), CGameBase::PutLongInData(), CPtrArray::RemoveAt(), CArray::RemoveAt(), CXMLDocument::SaveToFile(), CMainWindow::SBUpdateTasks(), CPtrArray< CFragmentAdd *, CFragmentAdd * >::SetAt(), CArray< CFragmentAdd *, CFragmentAdd * >::SetAt(), CArray::SetAtGrow(), CHTMLRadioGroup::SetChecked(), CEngineObj::SetEventHandlers(), CCard::SetPile(), CUserPrefs::SetSite(), CArray::SetSize(), CXMLElement::SetText(), and CPile::TransferCards().

#define AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_common.h.

#define ARRAYSIZE ( a ) (sizeof(a) / sizeof((a)[0]))

Definition at line 51 of file bmws_common.h.

Referenced by CCPSounds::CCPSounds(), CreateResURL(), HandleError(), InitErrorHandler(), CGameLib::InitGameLib(), InitModule(), OFNDialogHook(), RegisterTLB(), CSolpackApp::Run(), CCPSounds::Save(), and SetErrorInserts().

#define CHECKPTR ( p ) if(!(p)) return E_POINTER;

Definition at line 49 of file bmws_common.h.

#define NOTRACK_SAFEFREEMEMORY ( p ) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}

Definition at line 41 of file bmws_common.h.

Referenced by GUIDToString().

#define ODS ( t ) ((void)0)

Definition at line 37 of file bmws_common.h.

Referenced by CTurn::AddAction(), CAction::CAction(), CCard::CCard(), CDeck::CDeck(), CEngine::CEngine(), CFragment::CFragment(), CGameBase::CGameBase(), CGameData::CGameData(), CGameInfo::CGameInfo(), CGameLaBelleLucie::CGameLaBelleLucie(), CGameLib::CGameLib(), CGameSpider::CGameSpider(), CHTMLHelper::CHTMLHelper(), CPile::CPile(), CScriptFn::CScriptFn(), CTurn::CTurn(), CUndoMgr::CUndoMgr(), DllMain(), CCard::InitCard(), CDeck::InitDeck(), CEngine::InitEngine(), CFragment::InitFragment(), CGameData::InitGameData(), CPile::InitPile(), CEngine::MouseMove(), CEngine::PlayGame(), CUndoMgr::PushNewTurn(), CUndoMgr::Redo(), CLibMgr::RegLibrary(), CCard::SetPile(), CUndoMgr::Undo(), CAction::~CAction(), CCard::~CCard(), CDeck::~CDeck(), CEngine::~CEngine(), CFragment::~CFragment(), CGameBase::~CGameBase(), CGameData::~CGameData(), CGameInfo::~CGameInfo(), CGameLaBelleLucie::~CGameLaBelleLucie(), CGameLib::~CGameLib(), CGameSpider::~CGameSpider(), CPile::~CPile(), CTurn::~CTurn(), and CUndoMgr::~CUndoMgr().

#define ODS2 ( t ) ((void)0)

Definition at line 38 of file bmws_common.h.

Referenced by DllMain(), CEngine::SetMouseState(), and CEngine::SetState().

#define SAFEALLOC ( u ) ((LPTSTR)SAFEALLOCMEMORY(sizeof(TCHAR) * (u)))

Definition at line 42 of file bmws_common.h.

Referenced by CTSTR::Alloc(), CTSTR::Assign(), MultiOFN(), and OFNDialogHook().

#define SAFEALLOCMEMORY ( u ) (CoTaskMemAlloc(u))

Definition at line 31 of file bmws_common.h.

Referenced by CCompoundXMLDocument::AddFile(), Base64ToBinary(), BinaryToBase64(), and CArray::SetSize().

#define SAFEALLOCW ( u ) ((LPWSTR)SAFEALLOCMEMORY(sizeof(WCHAR) * (u)))

Definition at line 43 of file bmws_common.h.

Referenced by CBSTR::Assign().

#define SAFEDELETE ( p ) {if (p) {delete p; p = NULL;}}

Definition at line 48 of file bmws_common.h.

Referenced by CFragment::CancelAdditions(), CheckForUpdate(), CleanupCheckForUpdate(), CUndoMgr::Clear(), CUndoMgr::ClearWorkingTurn(), CMainWindow::OnDestroy(), CHelpPane::OnDestroyPane(), CUndoMgr::RecordAction(), CSolpackApp::Run(), CEngine::Uninit(), CFragment::~CFragment(), CHelpPane::~CHelpPane(), CRegDlgInfo::~CRegDlgInfo(), CStatusBar::~CStatusBar(), CTurn::~CTurn(), and CUserPrefs::~CUserPrefs().

#define SAFEFREEMEMORY ( p ) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}

Definition at line 32 of file bmws_common.h.

Referenced by CCompoundXMLDocument::AddFile(), CTSTR::Alloc(), CBSTR::Assign(), CTSTR::Assign(), CTSTR::AssignW(), Base64ToBinary(), BinaryToBase64(), CTSTR::CopyString(), MultiOFN(), OFNDialogHook(), CArray::SetSize(), CCompoundXMLDocument::SpewFile(), CArray::~CArray(), CPtrArray::~CPtrArray(), and CTSTR::~CTSTR().

#define SAFEFREESTRING ( b ) {if (b) {SysFreeString(b); b = NULL;}}

Definition at line 46 of file bmws_common.h.

Referenced by CBSTR::Assign(), CBSTR::AssignW(), CBSTR::CopyString(), and CBSTR::~CBSTR().

#define SAFERELEASE ( p ) {if (p) {(p)->Release(); p = NULL;}}

Definition at line 44 of file bmws_common.h.

Referenced by CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Assign(), CEventSink::CEventSink(), CScriptFn::Create(), CEventSink::Disconnect(), DllMain(), DllRegisterServer(), DllUnregisterServer(), C3DShatter::DoAnimation(), CEventSink::GetConnectionPoint(), CDispBase::Init(), CMainWindow::OnDestroy(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator=(), CSolpackApp::Register(), RegisterTLB(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Release(), CSolpackApp::Run(), CEngine::Uninit(), CSolpackApp::Unregister(), CDispBase::~CDispBase(), CGameBase::~CGameBase(), and CPile::~CPile().

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_common.h Source File

bmws_common.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_common.h
00004 //    Macros and functions used commonly in Bot Productions applications.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 #ifdef _DEBUG
00014    #include <crtdbg.h>
00015    #ifdef BMWS_TRACKMEMALLOC
00016       #include <bmws_trackmemalloc.h>
00017       #define SAFEALLOCMEMORY(u) (BMWSMemAlloc(u))
00018       #define SAFEFREEMEMORY(p) {if (p) {BMWSMemFree((LPVOID)p); p = NULL;}}
00019    #elif !defined(BMWS_NOOLE)
00020       #define SAFEALLOCMEMORY(u) (CoTaskMemAlloc(u))
00021       #define SAFEFREEMEMORY(p) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}
00022    #else
00023       #define SAFEALLOCMEMORY(u) ((LPVOID)new BYTE[u])
00024       #define SAFEFREEMEMORY(p) {if (p) {BYTE* _bmwsd = (BYTE*)p; delete[] _bmwsd; p = NULL;}}
00025    #endif
00026    #define ODS(t) { OutputDebugString(TEXT(t)); OutputDebugString(TEXT("\n")); }
00027    #define ODS2(t) OutputDebugString(t)
00028 #else
00029    #define _ASSERT(expr) ((void)0)
00030    #ifndef BMWS_NOOLE
00031       #define SAFEALLOCMEMORY(u) (CoTaskMemAlloc(u))
00032       #define SAFEFREEMEMORY(p) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}
00033    #else
00034       #define SAFEALLOCMEMORY(u) ((LPVOID)new BYTE[u])
00035       #define SAFEFREEMEMORY(p) {if (p) {BYTE* _bmwsd = (BYTE*)p; delete[] _bmwsd; p = NULL;}}
00036    #endif
00037    #define ODS(t) ((void)0)
00038    #define ODS2(t) ((void)0)
00039 #endif
00040
00041 #define NOTRACK_SAFEFREEMEMORY(p) {if (p) {CoTaskMemFree((LPVOID)p); p = NULL;}}
00042 #define SAFEALLOC(u) ((LPTSTR)SAFEALLOCMEMORY(sizeof(TCHAR) * (u)))
00043 #define SAFEALLOCW(u) ((LPWSTR)SAFEALLOCMEMORY(sizeof(WCHAR) * (u)))
00044 #define SAFERELEASE(p) {if (p) {(p)->Release(); p = NULL;}}
00045 #ifndef BMWS_NOOLE
00046    #define SAFEFREESTRING(b) {if (b) {SysFreeString(b); b = NULL;}}
00047 #endif
00048 #define SAFEDELETE(p) {if (p) {delete p; p = NULL;}}
00049 #define CHECKPTR(p) if(!(p)) return E_POINTER;
00050
00051 #define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
00052
00053
00054 #endif // !defined(AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml.cpp File Reference

#include <bmws_compound_xml.h>
#include <bmws_base64.h>
#include <bmws_compound_xml_res.h>
#include <bmws_compound_xml_res_lc.h>
#include <bmws_xml_res_lc.h>
#include <shlwapi.h>

Go to the source code of this file.

Defines

#define | COMPOUNDXMLINTERNALEXCEP(i)
#define | COMPOUND_XML_MAXFILESIZE 524288

Variables

HWND | g_hWnd
COOMExcep * g_pOOMExcep

Define Documentation

#define COMPOUND_XML_MAXFILESIZE 524288

Definition at line 38 of file bmws_compound_xml.cpp.

Referenced by CCompoundXMLDocument::AddFile().

#define COMPOUNDXMLINTERNALEXCEP ( i )

Value:

{ THROW(new CExcepEx(IDS_BMWS_COMPOUND_XML_E_INTERNAL, \
   IDS_BMWS_REMEDY_CONTACTBMWS, i, 0, ERROR_ERRORINS_INT)); }

Definition at line 31 of file bmws_compound_xml.cpp.

Variable Documentation

HWND g_hWnd

Definition at line 24 of file bmws_compound_xml.cpp.

COOMExcep* g_pOOMExcep

Definition at line 25 of file bmws_compound_xml.cpp.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml.cpp Source File

bmws_compound_xml.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_compound_xml.cpp
00004 //    Class to support compound XML documents, in which files are embedded
00005 //    into the XML using Base64 encoding.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_compound_xml.h>
00014 #include <bmws_base64.h>
00015 #include <bmws_compound_xml_res.h>
00016 #include <bmws_compound_xml_res_lc.h>
00017 #include <bmws_xml_res_lc.h>
00018 #include <shlwapi.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 // Global and external variables
00023 //----------------------------------------------------------------------------
00024 extern HWND g_hWnd;              // Main window handle
00025 extern COOMExcep *g_pOOMExcep;   // Out of memory exception object
00026
00027
00028 //----------------------------------------------------------------------------
00029 // Compound XML exception macros
00030 //----------------------------------------------------------------------------
00031 #define COMPOUNDXMLINTERNALEXCEP(i) { THROW(new CExcepEx(IDS_BMWS_COMPOUND_XML_E_INTERNAL, \
00032    IDS_BMWS_REMEDY_CONTACTBMWS, i, 0, ERROR_ERRORINS_INT)); }
00033
00034
00035 //----------------------------------------------------------------------------
00036 // Maximum size, in bytes, of an embedded file
00037 //----------------------------------------------------------------------------
00038 #define COMPOUND_XML_MAXFILESIZE 524288
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // CCompoundXMLDocument constructor
00044 //
00045 // Parameters:
00046 //    pCompoundSite: Interface of the caller.
00047 //    lpszSpewPath:  Path to the folder where the files should be put.
00048 //
00049 //----------------------------------------------------------------------------
00050 CCompoundXMLDocument::CCompoundXMLDocument(ICompoundXMLDocumentSite *pCompoundSite,
00051                                            CTSTR& lpszSpewPath)
00052 {
00053    m_bCompoundValid = FALSE;
00054    m_cFiles = 0;
00055    m_abFilesSpewed.SetSize(0);
00056    m_alpszFileNames.SetSize(0);
00057    m_pFilesEl = NULL;
00058    m_pCompoundSite = pCompoundSite;
00059    m_lpszSpewPath = lpszSpewPath;
00060    InitXMLDocument((IXMLDocumentSite*)this);
00061 }
00062
00063
00064 //----------------------------------------------------------------------------
00065 //
00066 // CCompoundXMLDocument destructor
00067 //
00068 //----------------------------------------------------------------------------
00069 CCompoundXMLDocument::~CCompoundXMLDocument()
00070 {
00071    CleanupFiles();
00072 }
00073
00074
00075 //----------------------------------------------------------------------------
00076 //
00077 // XMLDone function
00078 //    Called when the XML document has been fully loaded. Sets up the array of
00079 //    filenames.
00080 //
00081 // Parameters:
00082 //    pDoc:          The main XML document.
00083 //    lParam:        Pointer to the Compound XML document object.
00084 //
00085 // Returns:          None.
00086 //
00087 //----------------------------------------------------------------------------
00088 void CCompoundXMLDocument::XMLDone(CXMLDocument *pDoc)
00089 {
00090    m_bCompoundValid = FALSE;
00091    m_cFiles = 0;
00092
00093    try
00094    {
00095       CXMLElementPtr pRootEl = GetRootElement();
00096
00097       m_cFiles = 0;
00098       m_pFilesEl = pRootEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILES, 0, CHILDOF_NULLIFNOTFOUND);
00099       if(!m_pFilesEl)
00100       {
00101          if(m_pCompoundSite)
00102             m_pCompoundSite->XMLDone(pDoc);
00103          return;
00104       }
00105       long cFileEls = m_pFilesEl->NumChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE);
00106       if(cFileEls > 0)
00107       {
00108          m_alpszFileNames.SetSize(cFileEls);
00109          m_bCompoundValid = TRUE;
00110          for(long l = 0; l < cFileEls && m_bCompoundValid; l++, m_cFiles++)
00111          {
00112             m_bCompoundValid = FALSE;
00113             CXMLElementPtr pFileEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l);
00114             CBSTR bstrName = pFileEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_NAME, CBSTR());
00115             if(bstrName)
00116             {
00117                CTSTR lpszTemp(bstrName);
00118                if(PathIsFileSpec(lpszTemp))
00119                   m_alpszFileNames.SetAt(l, lpszTemp);
00120                m_bCompoundValid = TRUE;
00121             }
00122          }
00123       }
00124       m_bCompoundValid = TRUE;
00125    }
00126    catch(CExcep *pE)
00127    {
00128       pE->Report();
00129       pE->Delete();
00130    }
00131
00132    if(m_pCompoundSite)
00133       m_pCompoundSite->XMLDone(pDoc);
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // SpewFiles function
00140 //    Extracts and converts data files from the document.
00141 //
00142 // Parameters:       None.
00143 //
00144 // Returns:          A standard COM success or error value.
00145 //
00146 //----------------------------------------------------------------------------
00147 HRESULT CCompoundXMLDocument::SpewFiles()
00148 {
00149    if((m_abFilesSpewed.GetSize() > 0) || !m_pFilesEl)
00150       return E_FAIL;
00151    if((m_cFiles == 0) || (m_alpszFileNames.GetSize() == 0))
00152       return S_FALSE;
00153
00154    m_abFilesSpewed.SetSize(m_cFiles);
00155    BOOL bOkay = TRUE;
00156    for(long l = 0; l < m_cFiles; l++)
00157    {
00158       bOkay &= SpewFile(l);
00159    }
00160    return (bOkay ? S_OK : E_FAIL);
00161 }
00162
00163
00164 //----------------------------------------------------------------------------
00165 //
00166 // CleanupFiles function
00167 //    Deletes data files that were extracted.
00168 //
00169 // Parameters:       None.
00170 //
00171 // Returns:          None.
00172 //
00173 //----------------------------------------------------------------------------
00174 void CCompoundXMLDocument::CleanupFiles()
00175 {
00176    if(m_abFilesSpewed.GetSize() == 0)
00177       return;
00178    for(long l = 0; l < m_cFiles; l++)
00179    {
00180       if(m_abFilesSpewed[l])
00181       {
00182          CTSTR lpszData;
00183          CXMLElementPtr pEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l,
00184             CHILDOF_NULLIFNOTFOUND);
00185          if(pEl)
00186          {
00187             CBSTR bstrData = pEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR());
00188             lpszData = (BSTR)bstrData;
00189          }
00190          if(m_pCompoundSite->DelCallback(l, m_alpszFileNames[l], lpszData))
00191          {
00192             int iLen = lstrlen(m_alpszFileNames[l]) + lstrlen(m_lpszSpewPath) + 2;
00193             CTSTR lpszTotal(TRUE, iLen);
00194             lstrcpy(lpszTotal, m_lpszSpewPath);
00195             PathAppend(lpszTotal, m_alpszFileNames[l]);
00196             DeleteFile(lpszTotal);
00197             m_abFilesSpewed.SetAt(l, FALSE);
00198          }
00199       }
00200    }
00201 }
00202
00203
00204 //----------------------------------------------------------------------------
00205 //
00206 // AddFile function
00207 //    Encodes and adds a specific file to the XML document.
00208 //
00209 // Parameters:
00210 //    lpszFile:      Path to the file to add, or the file contents.
00211 //    lpszName:      File name to use inside the XML document.
00212 //    lpszData:      Optional string for the DATA attribute.
00213 //    dwFlags:       Flags indicating whether the path or contents were
00214 //                   passed, and whether to spew the new file.
00215 //    lpszNewName:   String to receive the new internal name, if it was
00216 //                   changed.
00217 //
00218 // Returns:          A standard COM success or error value.
00219 //
00220 //----------------------------------------------------------------------------
00221 HRESULT CCompoundXMLDocument::AddFile(CTSTR& lpszFile, CTSTR& lpszName, CTSTR& lpszData,
00222                                       DWORD dwFlags, CTSTR& lpszNewName)
00223 {
00224    if(!m_pFilesEl)
00225    {
00226       m_pFilesEl = CXMLElementPtr(GetRootElement())->AddChild(IDS_BMWS_COMPOUND_XML_EL_FILES,
00227          -1);
00228    }
00229    if(!m_pFilesEl)
00230       return E_FAIL;
00231    _ASSERT(lpszFile && lpszName);
00232    if(!PathIsFileSpec(lpszName))
00233       return E_INVALIDARG;
00234
00235    if(FileExists(lpszName))
00236    {
00237       if(dwFlags & BMWS_COMPOUND_XML_RENAME)
00238       {
00239          CTSTR lpszFormatter(IDS_BMWS_COMPOUND_XML_RENFORMAT);
00240          CTSTR lpszExt(PathFindExtension(lpszName));
00241          PathRemoveExtension(lpszName);
00242          BOOL bExists = TRUE;
00243          int iCount = 2;
00244          while(bExists && (iCount < 1024))
00245          {
00246             lpszNewName.Alloc(lstrlen(lpszFormatter) + lstrlen(lpszName) + lstrlen(lpszExt) + 8);
00247             wsprintf(lpszNewName, lpszFormatter, lpszName, iCount, lpszExt);
00248             bExists = FileExists(lpszNewName);
00249             iCount++;
00250          }
00251          lpszName = lpszNewName;
00252       } else
00253          return E_ABORT;
00254    }
00255
00256    LPSTR lpszContents = NULL;
00257    UINT iLen = 0;
00258    if(dwFlags & BMWS_COMPOUND_XML_CONTENTS)
00259    {
00260       #ifdef UNICODE
00261          iLen = lstrlen(lpszFile);
00262          lpszContents = SAFEALLOCMEMORY((iLen + 1) * sizeof(CHAR));
00263          ENSUREALLOC(lpszContents);
00264          LocalToANSI(lpszContents, lpszFile, iLen);
00265       #else
00266          lpszContents = (LPSTR)lpszFile;
00267          iLen = lstrlenA(lpszContents);
00268       #endif
00269    } else
00270    {
00271       CHandle hFile(CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
00272          FILE_ATTRIBUTE_NORMAL, NULL), CloseHandle);
00273       if(hFile == INVALID_HANDLE_VALUE)
00274          return E_NOINTERFACE;
00275
00276       DWORD dwSize = GetFileSize(hFile, NULL);
00277       if(dwSize > COMPOUND_XML_MAXFILESIZE)
00278          return E_UNEXPECTED;
00279
00280       LPSTR lpszBuf = (LPSTR)SAFEALLOCMEMORY(dwSize * sizeof(char));
00281       ENSUREALLOC(lpszBuf);
00282
00283       DWORD dwTotal = 0;
00284       DWORD dwBytesRead;
00285       char buff[4096];
00286       do
00287       {
00288          if(ReadFile(hFile, buff, 4096, &dwBytesRead, NULL))
00289          {
00290             CopyMemory(lpszBuf+dwTotal, buff, dwBytesRead);
00291             dwTotal += dwBytesRead;
00292          } else
00293             return E_NOINTERFACE;
00294       } while(dwBytesRead == 4096);
00295       lpszContents = lpszBuf;
00296       iLen = dwTotal;
00297    }
00298
00299    UINT iLenOut = 0;
00300    LPSTR lpszEncodedContents = NULL;
00301    CExcep *pThrowE = NULL;
00302    try
00303    {
00304       lpszEncodedContents = BinaryToBase64(lpszContents, iLen, &iLenOut);
00305       CXMLElementPtr pFileEl = m_pFilesEl->AddChild(IDS_BMWS_COMPOUND_XML_EL_FILE, -1);
00306       pFileEl->SetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_NAME, CBSTR(lpszName));
00307       if(lpszData)
00308          pFileEl->SetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR(lpszData));
00309       #ifdef UNICODE
00310          CTSTR lpszLocalEncoded;
00311          lpszLocalEncoded.Assign(lpszEncodedContents);
00312          pFileEl->SetText(CBSTR(lpszLocalEncoded));
00313       #else
00314          pFileEl->SetText(CBSTR(lpszEncodedContents));
00315       #endif
00316
00317       m_alpszFileNames.Add(lpszName);
00318       m_abFilesSpewed.Add(FALSE);
00319       if(dwFlags & BMWS_COMPOUND_XML_SPEW)
00320       {
00321          if(SpewFile(m_cFiles))
00322             m_cFiles++;
00323       } else
00324          m_cFiles++;
00325    }
00326    catch(CExcep *pE)
00327    {
00328       pThrowE = pE;
00329    }
00330
00331    SAFEFREEMEMORY(lpszEncodedContents);
00332    if(!(dwFlags & BMWS_COMPOUND_XML_CONTENTS))
00333       SAFEFREEMEMORY(lpszContents);
00334    #ifdef UNICODE
00335       SAFEFREEMEMORY(lspzContents);
00336    #endif
00337
00338    if(pThrowE)
00339       throw pThrowE;
00340
00341    return S_OK;
00342 }
00343
00344
00345 //----------------------------------------------------------------------------
00346 //
00347 // RemoveFile function
00348 //    Removes the specified file from the XML document.
00349 //
00350 // Parameters:
00351 //    lpszName:      Name of the file to delete.
00352 //    bCleanup:      Whether the file should be deleted, if it was spewed.
00353 //
00354 // Returns:          A standard COM success or error value.
00355 //
00356 //----------------------------------------------------------------------------
00357 HRESULT CCompoundXMLDocument::RemoveFile(CTSTR& lpszName, BOOL bCleanup)
00358 {
00359    if(!m_pFilesEl)
00360       return E_FAIL;
00361    if(!lpszName || !PathIsFileSpec(lpszName))
00362       return E_INVALIDARG;
00363
00364    long lIndex = GetFileIndex(lpszName);
00365    if(lIndex == -1)
00366       return E_INVALIDARG;
00367
00368    HRESULT hr = E_FAIL;
00369
00370    m_pFilesEl->DeleteChild(IDS_BMWS_COMPOUND_XML_EL_FILE, lIndex);
00371    if(bCleanup)
00372    {
00373       int iLen = lstrlen(m_alpszFileNames[lIndex]) + lstrlen(m_lpszSpewPath) + 2;
00374       CTSTR lpszTotal(TRUE, iLen);
00375       lstrcpy(lpszTotal, m_lpszSpewPath);
00376       PathAppend(lpszTotal, m_alpszFileNames[lIndex]);
00377       DeleteFile(lpszTotal);
00378    }
00379    m_alpszFileNames.RemoveAt(lIndex);
00380    m_abFilesSpewed.RemoveAt(lIndex);
00381    m_cFiles--;
00382
00383    return S_OK;
00384 }
00385
00386
00387 //----------------------------------------------------------------------------
00388 //
00389 // FileExists function
00390 //    Determines whether a file is embedded in the document.
00391 //
00392 // Parameters:
00393 //    lpszName:      File name to look for.
00394 //
00395 // Returns:          Whether or not the file exists in the document.
00396 //
00397 //----------------------------------------------------------------------------
00398 BOOL CCompoundXMLDocument::FileExists(CTSTR& lpszName)
00399 {
00400    return (GetFileIndex(lpszName) != -1);
00401 }
00402
00403
00404 //----------------------------------------------------------------------------
00405 //
00406 // GetNumFiles function
00407 //    Retrieves the number of compound files in the document.
00408 //
00409 // Parameters:       None.
00410 //
00411 // Returns:          The number of compound files.
00412 //
00413 //----------------------------------------------------------------------------
00414 UINT CCompoundXMLDocument::GetNumFiles()
00415 {
00416    return m_cFiles;
00417 }
00418
00419
00420 //----------------------------------------------------------------------------
00421 //
00422 // GetFileName function
00423 //    Retrieves the path of a specified file.
00424 //
00425 // Parameters:
00426 //    iFile:         Zero-based index of the file.
00427 //
00428 // Returns:          The file name string.
00429 //
00430 //----------------------------------------------------------------------------
00431 CTSTR CCompoundXMLDocument::GetFileName(UINT iFile)
00432 {
00433    if(iFile < (UINT)m_cFiles)
00434       return m_alpszFileNames[iFile];
00435    return CTSTR();
00436 }
00437
00438
00439 //----------------------------------------------------------------------------
00440 //
00441 // SpewFile function
00442 //    Extracts and converts an individual data file from the document.
00443 //
00444 // Parameters:
00445 //    l:             Zero-based index of the file to spew.
00446 //
00447 // Returns:          Whether or not the function succeeded.
00448 //
00449 //----------------------------------------------------------------------------
00450 BOOL CCompoundXMLDocument::SpewFile(long l)
00451 {
00452    m_abFilesSpewed.SetAt(l, FALSE);
00453    if(!m_lpszSpewPath || !m_alpszFileNames[l])
00454       return FALSE;
00455
00456    BOOL bReturn = FALSE;
00457
00458    LPSTR lpszDecodedContents = NULL;
00459
00460    try
00461    {
00462       CXMLElementPtr pFileEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l);
00463       CBSTR bstrData = pFileEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR());
00464       CBSTR bstrContents = pFileEl->GetText(CBSTR());
00465       if(!bstrContents)
00466          return FALSE;
00467       CTSTR lpszContents(bstrContents);
00468       CTSTR lpszData(bstrData);
00469       BOOL bSpew = TRUE;
00470       if(m_pCompoundSite)
00471          bSpew = m_pCompoundSite->SpewCallback(l, m_alpszFileNames[l], lpszData, lpszContents);
00472       if(bSpew && lpszContents)
00473       {
00474          int iLen = lstrlen(m_alpszFileNames[l]) + lstrlen(m_lpszSpewPath) + 2;
00475          CTSTR lpszTotal(TRUE, iLen);
00476          lstrcpy(lpszTotal, m_lpszSpewPath);
00477          PathAppend(lpszTotal, m_alpszFileNames[l]);
00478          UINT uiLen = lstrlen(lpszContents);
00479          UINT iLenOut;
00480          #ifdef UNICODE
00481             THIS CODE IS NOT UNICODE COMPATIBLE
00482 /*          LPSTR lpszANSIContents = SAFEALLOCMEMORY((uiLen + 1) * sizeof(CHAR));
00483             ENSUREALLOC(lpszANSIContents);
00484             LocalToANSI(lpszANSIContents, lpszContents, uiLen);
00485             lpszDecodedContents = Base64ToBinary(lpszANSIContents, uiLen, &iLenOut);
00486             SAFEFREEMEMORY(lpszANSIContents);*/
00487          #else
00488             lpszDecodedContents = Base64ToBinary(lpszContents, uiLen, &iLenOut);
00489          #endif
00490          CHandle hFile(CreateFile(lpszTotal, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
00491             FILE_ATTRIBUTE_NORMAL, NULL), CloseHandle);
00492          if(hFile != INVALID_HANDLE_VALUE)
00493          {
00494             DWORD dwWritten = 0;
00495             if(WriteFile(hFile, (LPCVOID)lpszDecodedContents, iLenOut, &dwWritten, NULL))
00496             {
00497                bReturn = TRUE;
00498             } else
00499             {
00500                CWinExcep(GetLastError(), IDS_BMWS_REMEDY_RESTART, FALSE).Report();
00501                bReturn = FALSE;
00502             }
00503             m_abFilesSpewed.SetAt(l, bReturn);
00504          } else
00505          {
00506             CWinExcep(GetLastError(), IDS_BMWS_REMEDY_RESTART, FALSE).Report();
00507          }
00508          SAFEFREEMEMORY(lpszDecodedContents);
00509       }
00510    }
00511    catch(CExcep *pE)
00512    {
00513       SAFEFREEMEMORY(lpszDecodedContents);
00514       throw pE;
00515    }
00516    return bReturn;
00517 }
00518
00519
00520 //----------------------------------------------------------------------------
00521 //
00522 // GetFileIndex function
00523 //    Returns the index of the FILE element representing the specified file.
00524 //
00525 // Parameters:
00526 //    lpszFile:      File name to look for.
00527 //
00528 // Returns:          The index of the file's XML element.
00529 //
00530 //----------------------------------------------------------------------------
00531 long CCompoundXMLDocument::GetFileIndex(CTSTR& lpszFile)
00532 {
00533    if(!lpszFile || (m_cFiles == 0) || !PathIsFileSpec(lpszFile))
00534       return -1;
00535
00536    for(long l = 0; l < m_cFiles; l++)
00537    {
00538       if(m_alpszFileNames[l])
00539          if(lstrcmpi(lpszFile, m_alpszFileNames[l]) == 0)
00540             return l;
00541    }
00542    return -1;
00543 }
00544
00545
00546 //----------------------------------------------------------------------------
00547 //
00548 // IsValidCompoundXML function
00549 //    Returns whether the document is a valid compound XML document.
00550 //
00551 // Parameters:       None.
00552 //
00553 // Returns:          TRUE if the document is compound XML, else FALSE.
00554 //
00555 //----------------------------------------------------------------------------
00556 BOOL CCompoundXMLDocument::IsValidCompoundXML()
00557 {
00558    return m_bCompoundValid;
00559 }
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml.h File Reference

#include <bmws_xml.h>
#include <bmws_error.h>
#include <bmws_stringarray.h>
#include <bmws_boolarray.h>

Go to the source code of this file.

Compounds

class | CCompoundXMLDocument
class | ICompoundXMLDocumentSite

Defines

#define | AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
#define | BMWS_COMPOUND_XML_SPEW 0x00000001
#define | BMWS_COMPOUND_XML_CONTENTS 0x00000002
#define | BMWS_COMPOUND_XML_RENAME 0x00000004

Typedefs

typedef CPointer< CCompoundXMLDocument > | CCompoundXMLDocumentPtr

Define Documentation

#define AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 11 of file bmws_compound_xml.h.

#define BMWS_COMPOUND_XML_CONTENTS 0x00000002

Definition at line 46 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument::AddFile().

#define BMWS_COMPOUND_XML_RENAME 0x00000004

Definition at line 47 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument::AddFile().

#define BMWS_COMPOUND_XML_SPEW 0x00000001

Definition at line 45 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument::AddFile().

Typedef Documentation

typedef CPointer<CCompoundXMLDocument> CCompoundXMLDocumentPtr

Definition at line 90 of file bmws_compound_xml.h.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml.h Source File

bmws_compound_xml.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_compound_xml.h
00004 //    Class to support compound XML documents, in which files are embedded
00005 //    into the XML using Base64 encoding.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00011 #define AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include <bmws_xml.h>
00022 #include <bmws_error.h>
00023 #include <bmws_stringarray.h>
00024 #include <bmws_boolarray.h>
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // ICompoundXMLDocumentSite abstract class
00030 //    Enables communication from a compound XML document to its creator.
00031 //
00032 //----------------------------------------------------------------------------
00033 class ICompoundXMLDocumentSite : public IXMLDocumentSite
00034 {
00035 public:
00036    virtual BOOL SpewCallback(long lIndex, CTSTR& lpszFileName, CTSTR& lpszData,
00037       LPTSTR lpszContents) = 0;
00038    virtual BOOL DelCallback(long lIndex, CTSTR& lpszFileName, CTSTR& lpszData) = 0;
00039 };
00040
00041
00042 //----------------------------------------------------------------------------
00043 // Spew flags
00044 //----------------------------------------------------------------------------
00045 #define BMWS_COMPOUND_XML_SPEW      0x00000001
00046 #define BMWS_COMPOUND_XML_CONTENTS  0x00000002
00047 #define BMWS_COMPOUND_XML_RENAME    0x00000004
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // CCompoundXMLDocument class
00053 //    Extends the BMWS XML Document object to support adding, removing, and
00054 //    extraction of files to and from the XML document.
00055 //
00056 //----------------------------------------------------------------------------
00057 class CCompoundXMLDocument : public CXMLDocument, public IXMLDocumentSite
00058 {
00059 public:
00060    CCompoundXMLDocument(ICompoundXMLDocumentSite *pCompoundSite, CTSTR& lpszSpewPath);
00061    virtual ~CCompoundXMLDocument();
00062
00063    HRESULT SpewFiles();
00064    void CleanupFiles();
00065    HRESULT AddFile(CTSTR& lpszFile, CTSTR& lpszName, CTSTR& lpszData, DWORD dwFlags,
00066       CTSTR& lpszNewName);
00067    HRESULT RemoveFile(CTSTR& lpszName, BOOL bCleanup);
00068    BOOL FileExists(CTSTR& lpszName);
00069
00070    UINT GetNumFiles();
00071    CTSTR GetFileName(UINT iFile);
00072    BOOL IsValidCompoundXML();
00073    long GetFileIndex(CTSTR& lpszFile);
00074
00075    // IXMLDocumentSite method
00076    virtual void XMLDone(CXMLDocument *pDoc);
00077
00078 private:
00079    BOOL SpewFile(long l);
00080
00081    ICompoundXMLDocumentSite *m_pCompoundSite;   // Interface of the caller
00082    CBOOLArray m_abFilesSpewed;   // Array of whether files were spewed
00083    CTSTRArray m_alpszFileNames;  // Array of the file names
00084    CTSTR m_lpszSpewPath;         // Path to which files are spewed
00085    long m_cFiles;                // Number of embedded files
00086    CXMLElementPtr m_pFilesEl;    // Pointer to the FILES element object
00087    BOOL m_bCompoundValid;        // Whether the compound XML document is valid
00088 };
00089
00090 typedef CPointer<CCompoundXMLDocument> CCompoundXMLDocumentPtr;
00091
00092
00093 #endif // !defined(AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_COMPOUND_XML_EL_FILES 8551
#define | IDS_BMWS_COMPOUND_XML_EL_FILE 8552
#define | IDS_BMWS_COMPOUND_XML_ATTR_NAME 8553
#define | IDS_BMWS_COMPOUND_XML_ATTR_DATA 8554
#define | IDS_BMWS_COMPOUND_XML_RENFORMAT 8555

Define Documentation

#define IDS_BMWS_COMPOUND_XML_ATTR_DATA 8554

Definition at line 8 of file bmws_compound_xml_res.h.

Referenced by CCompoundXMLDocument::AddFile(), CCompoundXMLDocument::CleanupFiles(), and CCompoundXMLDocument::SpewFile().

#define IDS_BMWS_COMPOUND_XML_ATTR_NAME 8553

Definition at line 7 of file bmws_compound_xml_res.h.

Referenced by CCompoundXMLDocument::AddFile(), and CCompoundXMLDocument::XMLDone().

#define IDS_BMWS_COMPOUND_XML_EL_FILE 8552

Definition at line 6 of file bmws_compound_xml_res.h.

Referenced by CCompoundXMLDocument::AddFile(), CCompoundXMLDocument::CleanupFiles(), CCompoundXMLDocument::RemoveFile(), CCompoundXMLDocument::SpewFile(), and CCompoundXMLDocument::XMLDone().

#define IDS_BMWS_COMPOUND_XML_EL_FILES 8551

Definition at line 5 of file bmws_compound_xml_res.h.

Referenced by CCompoundXMLDocument::AddFile(), and CCompoundXMLDocument::XMLDone().

#define IDS_BMWS_COMPOUND_XML_RENFORMAT 8555

Definition at line 9 of file bmws_compound_xml_res.h.

Referenced by CCompoundXMLDocument::AddFile().

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml_res.h Source File

bmws_compound_xml_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_compound_xml.rc
00004 //
00005 #define IDS_BMWS_COMPOUND_XML_EL_FILES  8551
00006 #define IDS_BMWS_COMPOUND_XML_EL_FILE   8552
00007 #define IDS_BMWS_COMPOUND_XML_ATTR_NAME 8553
00008 #define IDS_BMWS_COMPOUND_XML_ATTR_DATA 8554
00009 #define IDS_BMWS_COMPOUND_XML_RENFORMAT 8555
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NEXT_RESOURCE_VALUE        101
00016 #define _APS_NEXT_COMMAND_VALUE         40001
00017 #define _APS_NEXT_CONTROL_VALUE         1000
00018 #define _APS_NEXT_SYMED_VALUE           101
00019 #endif
00020 #endif
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_COMPOUND_XML_E_INTERNAL 18551
#define | IDS_BMWS_COMPOUND_XML_R_DIFFERENTFILE 18552

Define Documentation

#define IDS_BMWS_COMPOUND_XML_E_INTERNAL 18551

Definition at line 5 of file bmws_compound_xml_res_lc.h.

#define IDS_BMWS_COMPOUND_XML_R_DIFFERENTFILE 18552

Definition at line 6 of file bmws_compound_xml_res_lc.h.

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_compound_xml_res_lc.h Source File

bmws_compound_xml_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_compound_xml_lc.rc
00004 //
00005 #define IDS_BMWS_COMPOUND_XML_E_INTERNAL 18551
00006 #define IDS_BMWS_COMPOUND_XML_R_DIFFERENTFILE 18552
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver.cpp File Reference

#include <bmws_common.h>
#include <bmws_comserver.h>
#include <bmws_error.h>
#include <bmws_string.h>
#include <bmws_registry.h>
#include <shlwapi.h>
#include <bmws_comserver_res.h>

Go to the source code of this file.

Functions

HRESULT | GUIDToString (REFGUID rguid, CTSTR &lpsz)
HRESULT | RegisterComponent (HMODULE hModule, REFCLSID rclsid, UINT uidStrBase, REFGUID rlibid, UINT uidDescHolder, UINT uidProgIDHolder, UINT uidProgIDVIHolder, UINT uidDescRoot, UINT uidProgIDRoot)
HRESULT | UnregisterComponent (REFCLSID rclsid, UINT uidStrBase, UINT uidProgIDHolder, UINT uidProgIDVIHolder, UINT uidProgIDRoot)
STDMETHODIMP_ (DWORD) CFactory

Variables

HINSTANCE | g_hInst
long | g_cActiveComponents
CFactoryData g_aFactoryData []
int | g_cFactoryDataEntries

Function Documentation

HRESULT GUIDToString | ( | REFGUID | rguid,
 |  | CTSTR & | lpsz
 | ) |

Definition at line 44 of file bmws_comserver.cpp.

References CTSTR::AssignW(), and NOTRACK_SAFEFREEMEMORY.

Referenced by RegisterComponent(), and UnregisterComponent().

00045 {
00046    LPOLESTR lpwszGUID = NULL;
00047    HRESULT hr = StringFromCLSID(rguid, &lpwszGUID);
00048    if(FAILED(hr))
00049       return hr;
00050    if(!lpwszGUID)
00051       return E_FAIL;
00052
00053    try
00054    {
00055       lpsz.AssignW(lpwszGUID);
00056    }
00057    catch(CExcep *pE)
00058    {
00059       NOTRACK_SAFEFREEMEMORY(lpwszGUID);
00060       throw pE;
00061    }
00062
00063    NOTRACK_SAFEFREEMEMORY(lpwszGUID);
00064    return S_OK;
00065 }

HRESULT RegisterComponent | ( | HMODULE | hModule,
 |  | REFCLSID | rclsid,
 |  | UINT | uidStrBase,
 |  | REFGUID | rlibid,
 |  | UINT | uidDescHolder,
 |  | UINT | uidProgIDHolder,
 |  | UINT | uidProgIDVIHolder,
 |  | UINT | uidDescRoot,
 |  | UINT | uidProgIDRoot
 | ) |

Definition at line 93 of file bmws_comserver.cpp.

References GUIDToString(), IDS_BMWS_COM_APARTMENT, IDS_BMWS_COM_CLSID, IDS_BMWS_COM_CLSIDROOT, IDS_BMWS_COM_CURVER, IDS_BMWS_COM_INPROC, IDS_BMWS_COM_PROGID, IDS_BMWS_COM_PROGIDVI, IDS_BMWS_COM_THREADINGMODEL, IDS_BMWS_COM_TYPELIBROOT, and CTSTR::Len().

Referenced by CFactory::RegisterAll().

00096 {
00097    try
00098    {
00099       CTSTR lpszModule(TRUE, MAX_PATH);
00100       if(GetModuleFileName(hModule, lpszModule, MAX_PATH) == 0)
00101          return E_FAIL;
00102
00103       CKey hKey;
00104       if(RegOpenKeyEx(HKEY_CLASSES_ROOT, NULL, 0, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
00105          return E_FAIL;
00106
00107       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00108       CTSTR lpszCLSIDText(IDS_BMWS_COM_CLSID, 32, TRUE);
00109       CTSTR lpszFriendlyHolder(uidDescHolder, 64, TRUE);
00110       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00111       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00112
00113       CTSTR lpszCLSID;
00114       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00115       if(FAILED(hr))
00116          return hr;
00117
00118       CTSTR lpszLIBID;
00119       hr = GUIDToString(rlibid, lpszLIBID);
00120       if(FAILED(hr))
00121          return hr;
00122
00123       // Build the key CLSID\\{...}
00124       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00125       lstrcpy(lpszKey, lpszCLSIDRoot);
00126       lstrcat(lpszKey, lpszCLSID);
00127
00128       // Add the CLSID to the registry.
00129       CTSTR lpszFriendlyIndiv(uidDescRoot + uidStrBase, 64, TRUE);
00130       CTSTR lpszFriendlyName(TRUE, lpszFriendlyHolder.Len() + lpszFriendlyIndiv.Len() + 1);
00131       wsprintf(lpszFriendlyName, lpszFriendlyHolder, lpszFriendlyIndiv);
00132       SetRegKeyAndValue(hKey, lpszKey, CTSTR(), lpszFriendlyName);
00133
00134       // Add the server filename subkey under the CLSID key.
00135       {
00136          CTSTR lpszSubkey(IDS_BMWS_COM_INPROC, 32, TRUE);
00137          CKey hKeyTemp;
00138          CTSTR lpszKeyBuf(TRUE, lpszKey.Len() + lpszSubkey.Len() + 8);
00139          lstrcpy(lpszKeyBuf, lpszKey);
00140          if(lpszSubkey)
00141          {
00142             lstrcat(lpszKeyBuf, TEXT("\\"));
00143             lstrcat(lpszKeyBuf, lpszSubkey);
00144          }
00145          if(RegCreateKeyEx(hKey, lpszKeyBuf, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00146             NULL, &hKeyTemp, NULL) == ERROR_SUCCESS)
00147          {
00148             RegSetValueEx(hKeyTemp, NULL, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszModule,
00149                lpszModule.Len()+1);
00150             CTSTR lpszApt(IDS_BMWS_COM_APARTMENT, 32, TRUE);
00151             RegSetValueEx(hKeyTemp, CTSTR(IDS_BMWS_COM_THREADINGMODEL, 32, TRUE), 0, REG_SZ,
00152                (LPBYTE)(LPTSTR)lpszApt, lpszApt.Len()+1);
00153          }
00154       }
00155
00156       // Add the ProgID subkey under the CLSID key.
00157       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00158       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00159       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00160       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGID, 32, TRUE), lpszProgIDName);
00161
00162       // Add the version-independent ProgID subkey under CLSID key.
00163       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00164       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00165       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGIDVI, 32, TRUE), lpszProgIDVIName);
00166
00167       // Add the Type Library ID subkey under the CLSID key.
00168       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_TYPELIBROOT, 16, TRUE), lpszLIBID);
00169
00170       // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
00171       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(), lpszFriendlyName);
00172       SetRegKeyAndValue(hKey, lpszProgIDVIName, lpszCLSIDText, lpszCLSID);
00173       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(IDS_BMWS_COM_CURVER, 32, TRUE),
00174          lpszProgIDName);
00175
00176       // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
00177       SetRegKeyAndValue(hKey, lpszProgIDName, CTSTR(), lpszFriendlyName);
00178       SetRegKeyAndValue(hKey, lpszProgIDName, lpszCLSIDText, lpszCLSID);
00179    }
00180    catch(CExcep *pE)
00181    {
00182       pE->Report();
00183       pE->Delete();
00184       return E_FAIL;
00185    }
00186
00187    return S_OK;
00188 }

STDMETHODIMP_ ( DWORD )

Definition at line 303 of file bmws_comserver.cpp.

00304 {
00305    return InterlockedIncrement(&m_cRef);
00306 }

HRESULT UnregisterComponent | ( | REFCLSID | rclsid,
 |  | UINT | uidStrBase,
 |  | UINT | uidProgIDHolder,
 |  | UINT | uidProgIDVIHolder,
 |  | UINT | uidProgIDRoot
 | ) |

Definition at line 211 of file bmws_comserver.cpp.

References GUIDToString(), IDS_BMWS_COM_CLSIDROOT, and CTSTR::Len().

Referenced by CFactory::UnregisterAll().

00213 {
00214    try
00215    {
00216       CTSTR lpszCLSID;
00217       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00218       if(FAILED(hr))
00219          return hr;
00220
00221       // Build the key CLSID\\{...}
00222       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00223       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00224       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00225
00226       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00227       lstrcpy(lpszKey, lpszCLSIDRoot);
00228       lstrcat(lpszKey, lpszCLSID);
00229
00230       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00231       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00232       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00233
00234       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00235       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00236
00237       SHDeleteKey(HKEY_CLASSES_ROOT, lpszKey);
00238       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDName);
00239       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDVIName);
00240       // Delete all related keys.
00241       // Delete the CLSID Key - CLSID\{...}
00242       /*LONG lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szKey);
00243       //assert((lResult == ERROR_SUCCESS) ||
00244       //      (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00245
00246       // Delete the version-independent ProgID Key.
00247       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDVIName);
00248       //assert((lResult == ERROR_SUCCESS) ||
00249       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00250
00251       // Delete the ProgID key.
00252       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDName);
00253       //assert((lResult == ERROR_SUCCESS) ||
00254       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00255    }
00256    catch(CExcep *pE)
00257    {
00258       pE->Report();
00259       pE->Delete();
00260       return E_FAIL;
00261    }
00262
00263    return S_OK;
00264 }

Variable Documentation

CFactoryData g_aFactoryData[]

Definition at line 27 of file bmws_comserver.cpp.

long g_cActiveComponents

Definition at line 26 of file bmws_comserver.cpp.

Referenced by CFactory::CanUnloadNow().

int g_cFactoryDataEntries

Definition at line 28 of file bmws_comserver.cpp.

Referenced by DllRegisterServer(), DllUnregisterServer(), CFactory::GetClassObject(), CFactory::RegisterAll(), and CFactory::UnregisterAll().

HINSTANCE g_hInst

Definition at line 25 of file bmws_comserver.cpp.

Referenced by CFactory::RegisterAll().

Generated on Wed May 8 12:39:14 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver.cpp Source File

bmws_comserver.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_comserver.cpp
00004 //    Functions to implement a COM server. Class to encapsulate a COM class
00005 //    factory.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_common.h>
00014 #include <bmws_comserver.h>
00015 #include <bmws_error.h>
00016 #include <bmws_string.h>
00017 #include <bmws_registry.h>
00018 #include <shlwapi.h>
00019 #include <bmws_comserver_res.h>
00020
00021
00022 //----------------------------------------------------------------------------
00023 // External and static variables
00024 //----------------------------------------------------------------------------
00025 extern HINSTANCE g_hInst;           // Application instance handle
00026 extern long g_cActiveComponents;    // Number of active module components
00027 extern CFactoryData g_aFactoryData[];  // Data for this module's classes
00028 extern int g_cFactoryDataEntries;      // Number of classes in this module
00029 LONG CFactory::s_cServerLocks = 0;  // Count of locks
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // GUIDToString function
00035 //    Converts a GUID to a local string.
00036 //
00037 // Parameters:
00038 //    rguid:         GUID to convert.
00039 //    lpsz:          String in which to place the GUID string.
00040 //
00041 // Returns:          A standard COM success or error value.
00042 //
00043 //----------------------------------------------------------------------------
00044 HRESULT GUIDToString(REFGUID rguid, CTSTR& lpsz)
00045 {
00046    LPOLESTR lpwszGUID = NULL;
00047    HRESULT hr = StringFromCLSID(rguid, &lpwszGUID);
00048    if(FAILED(hr))
00049       return hr;
00050    if(!lpwszGUID)
00051       return E_FAIL;
00052
00053    try
00054    {
00055       lpsz.AssignW(lpwszGUID);
00056    }
00057    catch(CExcep *pE)
00058    {
00059       NOTRACK_SAFEFREEMEMORY(lpwszGUID);
00060       throw pE;
00061    }
00062
00063    NOTRACK_SAFEFREEMEMORY(lpwszGUID);
00064    return S_OK;
00065 }
00066
00067
00068 //----------------------------------------------------------------------------
00069 //
00070 // RegisterComponent function
00071 //    Registers a component in the registry.
00072 //
00073 // Parameters:
00074 //    hModule:             Module handle, to get the file name.
00075 //    rclsid:              CLSID of the object.
00076 //    uidStrBase:          Integer to add to the root values.
00077 //    rlibid:              LIBID of the object's type library.
00078 //    uidDescHolder:       String resource identifier of the friendly name
00079 //                         format string.
00080 //    uidProgIDHolder:     String resource identifier of the ProgID format
00081 //                         string.
00082 //    uidProgIDVIHolder:   String resource identifier of the version-
00083 //                         independent ProgID format string.
00084 //    uidDescRoot:         Integer to add to uidStrBase to get the string
00085 //                         resource identifier to insert into uidDescHolder.
00086 //    uidProgIDRoot:       Integer to add to uidStrBase to get the string
00087 //                         resource identifier to insert into the ProgID
00088 //                         strings.
00089 //
00090 // Returns:                A standard COM success or error value.
00091 //
00092 //----------------------------------------------------------------------------
00093 HRESULT RegisterComponent(HMODULE hModule, REFCLSID rclsid, UINT uidStrBase, REFGUID rlibid,
00094                           UINT uidDescHolder, UINT uidProgIDHolder, UINT uidProgIDVIHolder,
00095                           UINT uidDescRoot, UINT uidProgIDRoot)
00096 {
00097    try
00098    {
00099       CTSTR lpszModule(TRUE, MAX_PATH);
00100       if(GetModuleFileName(hModule, lpszModule, MAX_PATH) == 0)
00101          return E_FAIL;
00102
00103       CKey hKey;
00104       if(RegOpenKeyEx(HKEY_CLASSES_ROOT, NULL, 0, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
00105          return E_FAIL;
00106
00107       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00108       CTSTR lpszCLSIDText(IDS_BMWS_COM_CLSID, 32, TRUE);
00109       CTSTR lpszFriendlyHolder(uidDescHolder, 64, TRUE);
00110       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00111       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00112
00113       CTSTR lpszCLSID;
00114       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00115       if(FAILED(hr))
00116          return hr;
00117
00118       CTSTR lpszLIBID;
00119       hr = GUIDToString(rlibid, lpszLIBID);
00120       if(FAILED(hr))
00121          return hr;
00122
00123       // Build the key CLSID\\{...}
00124       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00125       lstrcpy(lpszKey, lpszCLSIDRoot);
00126       lstrcat(lpszKey, lpszCLSID);
00127
00128       // Add the CLSID to the registry.
00129       CTSTR lpszFriendlyIndiv(uidDescRoot + uidStrBase, 64, TRUE);
00130       CTSTR lpszFriendlyName(TRUE, lpszFriendlyHolder.Len() + lpszFriendlyIndiv.Len() + 1);
00131       wsprintf(lpszFriendlyName, lpszFriendlyHolder, lpszFriendlyIndiv);
00132       SetRegKeyAndValue(hKey, lpszKey, CTSTR(), lpszFriendlyName);
00133
00134       // Add the server filename subkey under the CLSID key.
00135       {
00136          CTSTR lpszSubkey(IDS_BMWS_COM_INPROC, 32, TRUE);
00137          CKey hKeyTemp;
00138          CTSTR lpszKeyBuf(TRUE, lpszKey.Len() + lpszSubkey.Len() + 8);
00139          lstrcpy(lpszKeyBuf, lpszKey);
00140          if(lpszSubkey)
00141          {
00142             lstrcat(lpszKeyBuf, TEXT("\\"));
00143             lstrcat(lpszKeyBuf, lpszSubkey);
00144          }
00145          if(RegCreateKeyEx(hKey, lpszKeyBuf, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00146             NULL, &hKeyTemp, NULL) == ERROR_SUCCESS)
00147          {
00148             RegSetValueEx(hKeyTemp, NULL, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszModule,
00149                lpszModule.Len()+1);
00150             CTSTR lpszApt(IDS_BMWS_COM_APARTMENT, 32, TRUE);
00151             RegSetValueEx(hKeyTemp, CTSTR(IDS_BMWS_COM_THREADINGMODEL, 32, TRUE), 0, REG_SZ,
00152                (LPBYTE)(LPTSTR)lpszApt, lpszApt.Len()+1);
00153          }
00154       }
00155
00156       // Add the ProgID subkey under the CLSID key.
00157       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00158       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00159       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00160       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGID, 32, TRUE), lpszProgIDName);
00161
00162       // Add the version-independent ProgID subkey under CLSID key.
00163       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00164       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00165       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGIDVI, 32, TRUE), lpszProgIDVIName);
00166
00167       // Add the Type Library ID subkey under the CLSID key.
00168       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_TYPELIBROOT, 16, TRUE), lpszLIBID);
00169
00170       // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
00171       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(), lpszFriendlyName);
00172       SetRegKeyAndValue(hKey, lpszProgIDVIName, lpszCLSIDText, lpszCLSID);
00173       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(IDS_BMWS_COM_CURVER, 32, TRUE),
00174          lpszProgIDName);
00175
00176       // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
00177       SetRegKeyAndValue(hKey, lpszProgIDName, CTSTR(), lpszFriendlyName);
00178       SetRegKeyAndValue(hKey, lpszProgIDName, lpszCLSIDText, lpszCLSID);
00179    }
00180    catch(CExcep *pE)
00181    {
00182       pE->Report();
00183       pE->Delete();
00184       return E_FAIL;
00185    }
00186
00187    return S_OK;
00188 }
00189
00190
00191 //----------------------------------------------------------------------------
00192 //
00193 // UnregisterComponent function
00194 //    Removes a component from the registry.
00195 //    TODO: Only remove entries that were created
00196 //
00197 // Parameters:
00198 //    rclsid:              CLSID of the object.
00199 //    uidStrBase:          Integer to add to the root values.
00200 //    uidProgIDHolder:     String resource identifier of the ProgID format
00201 //                         string.
00202 //    uidProgIDVIHolder:   String resource identifier of the version-
00203 //                         independent ProgID format string.
00204 //    uidProgIDRoot:       Integer to add to uidStrBase to get the string
00205 //                         resource identifier to insert into the ProgID
00206 //                         strings.
00207 //
00208 // Returns:                A standard COM success or error value.
00209 //
00210 //----------------------------------------------------------------------------
00211 HRESULT UnregisterComponent(REFCLSID rclsid, UINT uidStrBase, UINT uidProgIDHolder,
00212                             UINT uidProgIDVIHolder, UINT uidProgIDRoot)
00213 {
00214    try
00215    {
00216       CTSTR lpszCLSID;
00217       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00218       if(FAILED(hr))
00219          return hr;
00220
00221       // Build the key CLSID\\{...}
00222       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00223       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00224       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00225
00226       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00227       lstrcpy(lpszKey, lpszCLSIDRoot);
00228       lstrcat(lpszKey, lpszCLSID);
00229
00230       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00231       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00232       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00233
00234       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00235       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00236
00237       SHDeleteKey(HKEY_CLASSES_ROOT, lpszKey);
00238       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDName);
00239       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDVIName);
00240       // Delete all related keys.
00241       // Delete the CLSID Key - CLSID\{...}
00242       /*LONG lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szKey);
00243       //assert((lResult == ERROR_SUCCESS) ||
00244       //      (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00245
00246       // Delete the version-independent ProgID Key.
00247       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDVIName);
00248       //assert((lResult == ERROR_SUCCESS) ||
00249       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00250
00251       // Delete the ProgID key.
00252       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDName);
00253       //assert((lResult == ERROR_SUCCESS) ||
00254       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00255    }
00256    catch(CExcep *pE)
00257    {
00258       pE->Report();
00259       pE->Delete();
00260       return E_FAIL;
00261    }
00262
00263    return S_OK;
00264 }
00265
00266
00267 //----------------------------------------------------------------------------
00268 //
00269 // CFactory constructor
00270 //
00271 // Parameters:
00272 //    pFactoryData:  Array of COM object data for all supported COM objects.
00273 //
00274 //----------------------------------------------------------------------------
00275 CFactory::CFactory(const LPFACTORYDATA pFactoryData) :
00276    m_pFactoryData(pFactoryData)
00277 {
00278    m_cRef = 1;
00279 }
00280
00281
00282 //----------------------------------------------------------------------------
00283 // IUnknown::QueryInterface method
00284 //----------------------------------------------------------------------------
00285 STDMETHODIMP CFactory::QueryInterface(REFIID riid, LPVOID *ppvObject)
00286 {
00287    *ppvObject = NULL;
00288
00289    if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory))
00290    {
00291       *ppvObject = this;
00292       (*(LPUNKNOWN*)ppvObject)->AddRef();
00293       return S_OK;
00294    }
00295
00296    return E_NOINTERFACE;
00297 }
00298
00299
00300 //----------------------------------------------------------------------------
00301 // IUnknown::AddRef method
00302 //----------------------------------------------------------------------------
00303 STDMETHODIMP_(DWORD) CFactory::AddRef()
00304 {
00305    return InterlockedIncrement(&m_cRef);
00306 }
00307
00308
00309 //----------------------------------------------------------------------------
00310 // IUnknown::Release method
00311 //----------------------------------------------------------------------------
00312 STDMETHODIMP_(DWORD) CFactory::Release()
00313 {
00314    if(InterlockedDecrement(&m_cRef) == 0)
00315    {
00316       delete this;
00317       return 0;
00318    }
00319    return m_cRef;
00320 }
00321
00322
00323 //----------------------------------------------------------------------------
00324 // IClassFactory::CreateInstance method
00325 //----------------------------------------------------------------------------
00326 STDMETHODIMP CFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
00327 {
00328    if(pUnkOuter != NULL)
00329       return CLASS_E_NOAGGREGATION;
00330
00331    IUnknown *pUnk = NULL;
00332    HRESULT hr = E_FAIL;
00333
00334    ITypeLib *pTypeLib = NULL;
00335    if(m_pFactoryData->m_pLIBID)
00336    {
00337       HRESULT hr = LoadRegTypeLib(*m_pFactoryData->m_pLIBID, m_pFactoryData->m_wTypeLibVerMajor,
00338          m_pFactoryData->m_wTypeLibVerMinor, 0x00, &pTypeLib);
00339       if(FAILED(hr))
00340          return hr;
00341    }
00342    hr = m_pFactoryData->CreateInstance(&pUnk, pTypeLib);
00343    if(SUCCEEDED(hr))
00344    {
00345       hr = pUnk->QueryInterface(riid, ppvObject);
00346       pUnk->Release();
00347    }
00348
00349    SAFERELEASE(pTypeLib);
00350
00351    return hr;
00352 }
00353
00354
00355 //----------------------------------------------------------------------------
00356 // IClassFactory::LockServer method
00357 //----------------------------------------------------------------------------
00358 STDMETHODIMP CFactory::LockServer(BOOL fLock)
00359 {
00360    if(fLock)
00361       InterlockedIncrement(&m_cRef);
00362    else
00363       InterlockedDecrement(&m_cRef);
00364
00365    return S_OK;
00366 }
00367
00368
00369 //----------------------------------------------------------------------------
00370 //
00371 // GetClassObject function
00372 //    Creates a CFactory object for a specified object CLSID.
00373 //
00374 // Parameters:
00375 //    rclsid:        CLSID of the object to make a factory for.
00376 //    riid:          Interface of the object to retrieve.
00377 //    ppv:           Pointer to receive the the interface pointer.
00378 //
00379 // Returns:          A standard COM success or error value.
00380 //
00381 //----------------------------------------------------------------------------
00382 HRESULT CFactory::GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
00383 {
00384    if(!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00385       return E_NOINTERFACE;
00386
00387    for(int i = 0; i < g_cFactoryDataEntries; i++)
00388    {
00389       const LPFACTORYDATA pData = &g_aFactoryData[i];
00390       if(IsEqualCLSID(*pData->m_pCLSID, rclsid))
00391       {
00392          *ppv = (LPUNKNOWN) new CFactory(pData);
00393          if(*ppv == NULL)
00394             return E_OUTOFMEMORY;
00395          return S_OK;
00396       }
00397    }
00398
00399    return CLASS_E_CLASSNOTAVAILABLE;
00400 }
00401
00402
00403 //----------------------------------------------------------------------------
00404 //
00405 // CanUnloadNow function
00406 //    Checks to see if this module can be safely unloaded.
00407 //
00408 // Parameters:       None.
00409 //
00410 // Returns:          S_OK if it can, or S_FALSE if it cannot.
00411 //
00412 //----------------------------------------------------------------------------
00413 HRESULT CFactory::CanUnloadNow()
00414 {
00415    return (g_cActiveComponents || IsLocked()) ? S_FALSE : S_OK;
00416 }
00417
00418
00419 //----------------------------------------------------------------------------
00420 //
00421 // RegisterAll function
00422 //    Registers all globally-defined components in the registry.
00423 //
00424 // Parameters:       None.
00425 //
00426 // Returns:          A standard COM success or error value.
00427 //
00428 //----------------------------------------------------------------------------
00429 HRESULT CFactory::RegisterAll()
00430 {
00431    for(int i = 0; i < g_cFactoryDataEntries; i++)
00432    {
00433       RegisterComponent(g_hInst, *(g_aFactoryData[i].m_pCLSID), g_aFactoryData[i].uidStrBase,
00434          *(g_aFactoryData[i].m_pLIBID), g_aFactoryData[i].uidDescHolder,
00435          g_aFactoryData[i].uidProgIDHolder, g_aFactoryData[i].uidProgIDVIHolder,
00436          g_aFactoryData[i].uidDescRoot, g_aFactoryData[i].uidProgIDRoot);
00437    }
00438    return S_OK;
00439 }
00440
00441
00442 //----------------------------------------------------------------------------
00443 //
00444 // UnregisterAll function
00445 //    Unregisters all globally-defined components from the registry.
00446 //
00447 // Parameters:       None.
00448 //
00449 // Returns:          A standard COM success or error value.
00450 //
00451 //----------------------------------------------------------------------------
00452 HRESULT CFactory::UnregisterAll()
00453 {
00454    for(int i = 0; i < g_cFactoryDataEntries; i++)
00455    {
00456       UnregisterComponent(*(g_aFactoryData[i].m_pCLSID), g_aFactoryData[i].uidStrBase,
00457          g_aFactoryData[i].uidProgIDHolder, g_aFactoryData[i].uidProgIDVIHolder,
00458          g_aFactoryData[i].uidProgIDRoot);
00459    }
00460    return S_OK;
00461 }
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver.h File Reference

Go to the source code of this file.

Compounds

class | CFactory
class | CFactoryData

Defines

#define | AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef HRESULT(* | FPCREATEINSTANCE )(IUnknown **, ITypeLib *)
typedef CFactoryData * | LPFACTORYDATA

Functions

HRESULT | RegisterComponent (HMODULE hModule, REFCLSID rclsid, UINT uidStrBase, REFGUID rlibid, UINT uidDescHolder, UINT uidProgIDHolder, UINT uidProgIDVIHolder, UINT uidDescRoot, UINT uidProgIDRoot)
HRESULT | UnregisterComponent (REFCLSID rclsid, UINT uidStrBase, UINT uidProgIDHolder, UINT uidProgIDVIHolder, UINT uidProgIDRoot)

Define Documentation

#define AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_comserver.h.

Typedef Documentation

typedef HRESULT(* FPCREATEINSTANCE)(IUnknown**, ITypeLib*)

Definition at line 19 of file bmws_comserver.h.

typedef CFactoryData* LPFACTORYDATA

Definition at line 45 of file bmws_comserver.h.

Function Documentation

HRESULT RegisterComponent | ( | HMODULE | hModule,
 |  | REFCLSID | rclsid,
 |  | UINT | uidStrBase,
 |  | REFGUID | rlibid,
 |  | UINT | uidDescHolder,
 |  | UINT | uidProgIDHolder,
 |  | UINT | uidProgIDVIHolder,
 |  | UINT | uidDescRoot,
 |  | UINT | uidProgIDRoot
 | ) |

Definition at line 93 of file bmws_comserver.cpp.

References GUIDToString(), IDS_BMWS_COM_APARTMENT, IDS_BMWS_COM_CLSID, IDS_BMWS_COM_CLSIDROOT, IDS_BMWS_COM_CURVER, IDS_BMWS_COM_INPROC, IDS_BMWS_COM_PROGID, IDS_BMWS_COM_PROGIDVI, IDS_BMWS_COM_THREADINGMODEL, IDS_BMWS_COM_TYPELIBROOT, and CTSTR::Len().

Referenced by CFactory::RegisterAll().

00096 {
00097    try
00098    {
00099       CTSTR lpszModule(TRUE, MAX_PATH);
00100       if(GetModuleFileName(hModule, lpszModule, MAX_PATH) == 0)
00101          return E_FAIL;
00102
00103       CKey hKey;
00104       if(RegOpenKeyEx(HKEY_CLASSES_ROOT, NULL, 0, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
00105          return E_FAIL;
00106
00107       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00108       CTSTR lpszCLSIDText(IDS_BMWS_COM_CLSID, 32, TRUE);
00109       CTSTR lpszFriendlyHolder(uidDescHolder, 64, TRUE);
00110       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00111       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00112
00113       CTSTR lpszCLSID;
00114       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00115       if(FAILED(hr))
00116          return hr;
00117
00118       CTSTR lpszLIBID;
00119       hr = GUIDToString(rlibid, lpszLIBID);
00120       if(FAILED(hr))
00121          return hr;
00122
00123       // Build the key CLSID\\{...}
00124       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00125       lstrcpy(lpszKey, lpszCLSIDRoot);
00126       lstrcat(lpszKey, lpszCLSID);
00127
00128       // Add the CLSID to the registry.
00129       CTSTR lpszFriendlyIndiv(uidDescRoot + uidStrBase, 64, TRUE);
00130       CTSTR lpszFriendlyName(TRUE, lpszFriendlyHolder.Len() + lpszFriendlyIndiv.Len() + 1);
00131       wsprintf(lpszFriendlyName, lpszFriendlyHolder, lpszFriendlyIndiv);
00132       SetRegKeyAndValue(hKey, lpszKey, CTSTR(), lpszFriendlyName);
00133
00134       // Add the server filename subkey under the CLSID key.
00135       {
00136          CTSTR lpszSubkey(IDS_BMWS_COM_INPROC, 32, TRUE);
00137          CKey hKeyTemp;
00138          CTSTR lpszKeyBuf(TRUE, lpszKey.Len() + lpszSubkey.Len() + 8);
00139          lstrcpy(lpszKeyBuf, lpszKey);
00140          if(lpszSubkey)
00141          {
00142             lstrcat(lpszKeyBuf, TEXT("\\"));
00143             lstrcat(lpszKeyBuf, lpszSubkey);
00144          }
00145          if(RegCreateKeyEx(hKey, lpszKeyBuf, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
00146             NULL, &hKeyTemp, NULL) == ERROR_SUCCESS)
00147          {
00148             RegSetValueEx(hKeyTemp, NULL, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszModule,
00149                lpszModule.Len()+1);
00150             CTSTR lpszApt(IDS_BMWS_COM_APARTMENT, 32, TRUE);
00151             RegSetValueEx(hKeyTemp, CTSTR(IDS_BMWS_COM_THREADINGMODEL, 32, TRUE), 0, REG_SZ,
00152                (LPBYTE)(LPTSTR)lpszApt, lpszApt.Len()+1);
00153          }
00154       }
00155
00156       // Add the ProgID subkey under the CLSID key.
00157       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00158       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00159       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00160       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGID, 32, TRUE), lpszProgIDName);
00161
00162       // Add the version-independent ProgID subkey under CLSID key.
00163       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00164       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00165       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_PROGIDVI, 32, TRUE), lpszProgIDVIName);
00166
00167       // Add the Type Library ID subkey under the CLSID key.
00168       SetRegKeyAndValue(hKey, lpszKey, CTSTR(IDS_BMWS_COM_TYPELIBROOT, 16, TRUE), lpszLIBID);
00169
00170       // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
00171       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(), lpszFriendlyName);
00172       SetRegKeyAndValue(hKey, lpszProgIDVIName, lpszCLSIDText, lpszCLSID);
00173       SetRegKeyAndValue(hKey, lpszProgIDVIName, CTSTR(IDS_BMWS_COM_CURVER, 32, TRUE),
00174          lpszProgIDName);
00175
00176       // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
00177       SetRegKeyAndValue(hKey, lpszProgIDName, CTSTR(), lpszFriendlyName);
00178       SetRegKeyAndValue(hKey, lpszProgIDName, lpszCLSIDText, lpszCLSID);
00179    }
00180    catch(CExcep *pE)
00181    {
00182       pE->Report();
00183       pE->Delete();
00184       return E_FAIL;
00185    }
00186
00187    return S_OK;
00188 }

HRESULT UnregisterComponent | ( | REFCLSID | rclsid,
 |  | UINT | uidStrBase,
 |  | UINT | uidProgIDHolder,
 |  | UINT | uidProgIDVIHolder,
 |  | UINT | uidProgIDRoot
 | ) |

Definition at line 211 of file bmws_comserver.cpp.

References GUIDToString(), IDS_BMWS_COM_CLSIDROOT, and CTSTR::Len().

Referenced by CFactory::UnregisterAll().

00213 {
00214    try
00215    {
00216       CTSTR lpszCLSID;
00217       HRESULT hr = GUIDToString(rclsid, lpszCLSID);
00218       if(FAILED(hr))
00219          return hr;
00220
00221       // Build the key CLSID\\{...}
00222       CTSTR lpszCLSIDRoot(IDS_BMWS_COM_CLSIDROOT, 16, TRUE);
00223       CTSTR lpszProgIDHolder(uidProgIDHolder, 64, TRUE);
00224       CTSTR lpszProgIDVIHolder(uidProgIDVIHolder, 64, TRUE);
00225
00226       CTSTR lpszKey(TRUE, lpszCLSIDRoot.Len() + lpszCLSID.Len() + 1);
00227       lstrcpy(lpszKey, lpszCLSIDRoot);
00228       lstrcat(lpszKey, lpszCLSID);
00229
00230       CTSTR lpszProgIDIndiv(uidProgIDRoot + uidStrBase, 64, TRUE);
00231       CTSTR lpszProgIDName(TRUE, lpszProgIDHolder.Len() + lpszProgIDIndiv.Len() + 1);
00232       wsprintf(lpszProgIDName, lpszProgIDHolder, lpszProgIDIndiv);
00233
00234       CTSTR lpszProgIDVIName(TRUE, lpszProgIDVIHolder.Len() + lpszProgIDIndiv.Len() + 1);
00235       wsprintf(lpszProgIDVIName, lpszProgIDVIHolder, lpszProgIDIndiv);
00236
00237       SHDeleteKey(HKEY_CLASSES_ROOT, lpszKey);
00238       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDName);
00239       SHDeleteKey(HKEY_CLASSES_ROOT, lpszProgIDVIName);
00240       // Delete all related keys.
00241       // Delete the CLSID Key - CLSID\{...}
00242       /*LONG lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szKey);
00243       //assert((lResult == ERROR_SUCCESS) ||
00244       //      (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00245
00246       // Delete the version-independent ProgID Key.
00247       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDVIName);
00248       //assert((lResult == ERROR_SUCCESS) ||
00249       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00250
00251       // Delete the ProgID key.
00252       /*lResult =*/ //RecursiveDeleteKey(HKEY_CLASSES_ROOT, szProgIDName);
00253       //assert((lResult == ERROR_SUCCESS) ||
00254       //       (lResult == ERROR_FILE_NOT_FOUND)); // Subkey may not exist.
00255    }
00256    catch(CExcep *pE)
00257    {
00258       pE->Report();
00259       pE->Delete();
00260       return E_FAIL;
00261    }
00262
00263    return S_OK;
00264 }

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver.h Source File

bmws_comserver.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_comserver.h
00004 //    Functions to implement a COM server.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 class CFactoryData;           // Forward definition
00014
00015
00016 //----------------------------------------------------------------------------
00017 // FPCREATEINSTANCE function type
00018 //----------------------------------------------------------------------------
00019 typedef HRESULT (*FPCREATEINSTANCE)(IUnknown**, ITypeLib*);
00020
00021
00022 //----------------------------------------------------------------------------
00023 //
00024 // CFactoryData class
00025 //    Contains information specific to a single COM object supported by this
00026 //    module.
00027 //
00028 //----------------------------------------------------------------------------
00029 class CFactoryData
00030 {
00031 public:
00032    const CLSID *m_pCLSID;              // Component's Class ID
00033    FPCREATEINSTANCE CreateInstance;    // Function to create it
00034    UINT uidStrBase;                    // Base from which strings are loaded
00035    const GUID *m_pLIBID;               // Component's type library ID
00036    UINT uidDescHolder;                 // String to hold the class description
00037    UINT uidProgIDHolder;               // String to hold the ProgID
00038    UINT uidProgIDVIHolder;             // String to hold the version-independent ProgID
00039    UINT uidDescRoot;                   // Description string
00040    UINT uidProgIDRoot;                 // ProgID string
00041    WORD m_wTypeLibVerMajor;            // Type library major version
00042    WORD m_wTypeLibVerMinor;            // Type library minor version
00043 };
00044
00045 typedef CFactoryData *LPFACTORYDATA;
00046
00047
00048 //----------------------------------------------------------------------------
00049 //
00050 // CFactory class
00051 //    Encapsulates a COM class factory.
00052 //
00053 //----------------------------------------------------------------------------
00054 class CFactory : public IClassFactory
00055 {
00056 public:
00057    CFactory(const LPFACTORYDATA pFactoryData);
00058
00059    // IUnknown methods
00060    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject);
00061    STDMETHOD_(DWORD, AddRef)();
00062    STDMETHOD_(DWORD, Release)();
00063
00064    // IClassFactory methods
00065    STDMETHOD (CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
00066    STDMETHOD (LockServer)(BOOL fLock);
00067
00068    static HRESULT CanUnloadNow();
00069    static HRESULT GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv);
00070    static HRESULT RegisterAll();
00071    static HRESULT UnregisterAll();
00072
00073
00074    //-------------------------------------------------------------------------
00075    //
00076    // IsLocked function
00077    //    Returns whether the DLL server has been locked.
00078    //
00079    // Parameters:    None.
00080    //
00081    // Returns:       TRUE if there are server locks, else FALSE.
00082    //
00083    //-------------------------------------------------------------------------
00084    static BOOL IsLocked()
00085    {
00086       return s_cServerLocks > 0;
00087    }
00088
00089
00090 protected:
00091    long m_cRef;                        // Object reference count
00092    const LPFACTORYDATA m_pFactoryData; // Object factory data
00093    static LONG s_cServerLocks;         // Number of locks on this module
00094 };
00095
00096
00097 //----------------------------------------------------------------------------
00098 // BMWS_COMServer API functions
00099 //----------------------------------------------------------------------------
00100 HRESULT RegisterComponent(HMODULE hModule, REFCLSID rclsid, UINT uidStrBase, REFGUID rlibid,
00101                           UINT uidDescHolder, UINT uidProgIDHolder, UINT uidProgIDVIHolder,
00102                           UINT uidDescRoot, UINT uidProgIDRoot);
00103 HRESULT UnregisterComponent(REFCLSID rclsid, UINT uidStrBase, UINT uidProgIDHolder,
00104                             UINT uidProgIDVIHolder, UINT uidProgIDRoot);
00105
00106
00107 #endif // !defined(AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_COM_CLSIDROOT 8001
#define | IDS_BMWS_COM_INPROC 8002
#define | IDS_BMWS_COM_PROGID 8003
#define | IDS_BMWS_COM_PROGIDVI 8004
#define | IDS_BMWS_COM_TYPELIBROOT 8005
#define | IDS_BMWS_COM_CLSID 8006
#define | IDS_BMWS_COM_CURVER 8007
#define | IDS_BMWS_COM_THREADINGMODEL 8008
#define | IDS_BMWS_COM_APARTMENT 8009

Define Documentation

#define IDS_BMWS_COM_APARTMENT 8009

Definition at line 13 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_CLSID 8006

Definition at line 10 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_CLSIDROOT 8001

Definition at line 5 of file bmws_comserver_res.h.

Referenced by RegisterComponent(), and UnregisterComponent().

#define IDS_BMWS_COM_CURVER 8007

Definition at line 11 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_INPROC 8002

Definition at line 6 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_PROGID 8003

Definition at line 7 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_PROGIDVI 8004

Definition at line 8 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_THREADINGMODEL 8008

Definition at line 12 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

#define IDS_BMWS_COM_TYPELIBROOT 8005

Definition at line 9 of file bmws_comserver_res.h.

Referenced by RegisterComponent().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_comserver_res.h Source File

bmws_comserver_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_comserver.rc
00004 //
00005 #define IDS_BMWS_COM_CLSIDROOT          8001
00006 #define IDS_BMWS_COM_INPROC             8002
00007 #define IDS_BMWS_COM_PROGID             8003
00008 #define IDS_BMWS_COM_PROGIDVI           8004
00009 #define IDS_BMWS_COM_TYPELIBROOT        8005
00010 #define IDS_BMWS_COM_CLSID              8006
00011 #define IDS_BMWS_COM_CURVER             8007
00012 #define IDS_BMWS_COM_THREADINGMODEL     8008
00013 #define IDS_BMWS_COM_APARTMENT          8009
00014
00015 // Next default values for new objects
00016 //
00017 #ifdef APSTUDIO_INVOKED
00018 #ifndef APSTUDIO_READONLY_SYMBOLS
00019 #define _APS_NEXT_RESOURCE_VALUE        101
00020 #define _APS_NEXT_COMMAND_VALUE         40001
00021 #define _APS_NEXT_CONTROL_VALUE         1000
00022 #define _APS_NEXT_SYMED_VALUE           101
00023 #endif
00024 #endif
Generated on Wed May 8 12:38:48 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds.cpp File Reference

#include <bmws_cpsounds.h>
#include <bmws_common.h>
#include <bmws_key.h>
#include <bmws_error.h>
#include <bmws_registry.h>
#include <bmws_singleofn.h>
#include <bmws_cpsounds_res.h>
#include <bmws_cpsounds_res_lc.h>
#include <commdlg.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <commctrl.h>
#include <mmsystem.h>

Go to the source code of this file.

Compounds

class | CCPSoundsDlg

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
TCHAR | g_szAppTitle [64]

Variable Documentation

HINSTANCE g_hInst

Definition at line 35 of file bmws_cpsounds.cpp.

Referenced by CCPSounds::CCPSounds(), CCPSoundsDlg::CPSoundsProc(), and CCPSounds::Save().

HINSTANCE g_hInstLC

Definition at line 36 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg::CCPSoundsDlg(), and CCPSounds::FillPropPage().

TCHAR g_szAppTitle[64]

Definition at line 37 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg::CPSoundsProc(), and CCPSoundsDlg::IsCBValid().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds.cpp Source File

bmws_cpsounds.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_cpsounds.cpp
00004 //    Class to encapsulate control panel-based sound events and the
00005 //    corresponding property page.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_cpsounds.h>
00014 #include <bmws_common.h>
00015 #include <bmws_key.h>
00016 #include <bmws_error.h>
00017 #include <bmws_registry.h>
00018 #include <bmws_singleofn.h>
00019 #include <bmws_cpsounds_res.h>
00020 #include <bmws_cpsounds_res_lc.h>
00021 #include <commdlg.h>
00022 #include <shellapi.h>
00023 #include <shlwapi.h>
00024 #include <commctrl.h>
00025 #include <mmsystem.h>
00026 #ifdef BMWS_CONTEXTHELP
00027    #include <bmws_helpmgr.h>
00028    #include "..\help\bmws\bmws_cpsounds_popupid.h"
00029 #endif
00030
00031
00032 //----------------------------------------------------------------------------
00033 // External and global variables
00034 //----------------------------------------------------------------------------
00035 extern HINSTANCE g_hInst;
00036 extern HINSTANCE g_hInstLC;
00037 extern TCHAR g_szAppTitle[64];
00038 #ifdef BMWS_CONTEXTHELP
00039    extern CHelpMgr *g_pHelp;
00040 #endif
00041
00042
00043 //-------------------------------------------------------------------------
00044 //
00045 // CCPSoundsDlg class
00046 //    Encapsulates the property page for setting sound events.
00047 //
00048 //-------------------------------------------------------------------------
00049 class CCPSoundsDlg
00050 {
00051 public:
00052    CCPSoundsDlg(CCPSounds *m_pCPSounds);
00053    virtual ~CCPSoundsDlg();
00054
00055    static INT_PTR CALLBACK CPSoundsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00056       LPARAM lParam);
00057
00058    friend class CCPSounds;
00059
00060 #ifdef BMWS_CONTEXTHELP
00061    static DWORD s_adwPopupHelp[];
00062 #endif
00063
00064 protected:
00065    void FillDropDown(HWND hwndDD);
00066    void AddFile(HWND hwndDD, LPTSTR lpszFileName, UINT uCount);
00067    void SetSound(UINT uIndex);
00068    void OnTreeIndex(int iIndex);
00069    BOOL IsCBValid(CTSTR& lpszPath);
00070
00071    CCPSounds *m_pCPSounds;
00072    CTSTRArray m_alpszTempFiles;
00073    CTSTRArray m_alpszDDFiles;
00074
00075    CTSTR m_lpszPopupFile;
00076    CTSTR m_lpszCBTemp;
00077    CTSTR m_lpszCurFolder;
00078    int m_iSelected;
00079    MCIDEVICEID m_mciDevID;
00080    HBITMAP m_hbmPlay;
00081    HBITMAP m_hbmStop;
00082    BOOL m_bReenable;
00083    HWND m_hDlg;
00084    BOOL m_bValidated;
00085    BOOL m_bEditChanged;
00086 };
00087
00088
00089 #ifdef BMWS_CONTEXTHELP
00090    DWORD CCPSoundsDlg::s_adwPopupHelp[] =
00091    {
00092       IDC_BMWS_CPSOUNDS_TREE,       IDH_BMWS_CPSOUNDS_TREE,
00093       IDC_BMWS_CPSOUNDS_L_TREE,     IDH_BMWS_CPSOUNDS_TREE,
00094       IDC_BMWS_CPSOUNDS_FILENAME,   IDH_BMWS_CPSOUNDS_FILENAME,
00095       IDC_BMWS_CPSOUNDS_L_FILENAME, IDH_BMWS_CPSOUNDS_FILENAME,
00096       IDC_BMWS_CPSOUNDS_BROWSE,     IDH_BMWS_CPSOUNDS_BROWSE,
00097       IDC_BMWS_CPSOUNDS_DETAILS,    IDH_BMWS_CPSOUNDS_DETAILS,
00098       IDC_BMWS_CPSOUNDS_PLAY,       IDH_BMWS_CPSOUNDS_PLAY,
00099       IDC_BMWS_CPSOUNDS_STOP,       IDH_BMWS_CPSOUNDS_STOP,
00100       IDC_BMWS_CPSOUNDS_L_PREVIEW,  IDH_BMWS_CPSOUNDS_L_PREVIEW,
00101       0,                            0
00102    };
00103 #endif
00104
00105
00106 //----------------------------------------------------------------------------
00107 //
00108 // CCPSoundsDlg constructor
00109 //
00110 //----------------------------------------------------------------------------
00111 CCPSoundsDlg::CCPSoundsDlg(CCPSounds* pCPSounds)
00112 {
00113    m_lpszPopupFile.Assign(IDS_BMWS_CPSOUNDS_POPUPFILE);
00114    m_pCPSounds = pCPSounds;
00115    m_hbmPlay = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_BMWS_CPSOUNDS_PLAY),
00116       IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
00117    m_hbmStop = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_BMWS_CPSOUNDS_STOP),
00118       IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
00119
00120    m_iSelected = -1;
00121 }
00122
00123
00124 //----------------------------------------------------------------------------
00125 //
00126 // CCPSoundsDlg destructor
00127 //
00128 //----------------------------------------------------------------------------
00129 CCPSoundsDlg::~CCPSoundsDlg()
00130 {
00131    DeleteObject(m_hbmPlay);
00132    DeleteObject(m_hbmStop);
00133 }
00134
00135
00136 //----------------------------------------------------------------------------
00137 //
00138 // CPSoundsProc function
00139 //    Callback function that handles messages to the sounds options property
00140 //    page.
00141 //
00142 // Parameters:
00143 //    hwndDlg:       The dialog box window handle.
00144 //    uMsg:          Message identifer.
00145 //    wParam:        Message-specific parameter.
00146 //    lParam:        Message-specific parameter.
00147 //
00148 // Returns:          TRUE if the message was handled, otherwise FALSE.
00149 //
00150 //----------------------------------------------------------------------------
00151 INT_PTR CALLBACK CCPSoundsDlg::CPSoundsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00152                                                        LPARAM lParam)
00153 {
00154    CCPSoundsDlg *pThis = (CCPSoundsDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00155
00156    switch(uMsg)
00157    {
00158       case WM_INITDIALOG:
00159       {
00160          pThis = (CCPSoundsDlg*)((LPPROPSHEETPAGE)lParam)->lParam;
00161          SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00162          pThis->m_hDlg = hwndDlg;
00163
00164          pThis->m_bReenable = TRUE;
00165          pThis->m_alpszTempFiles.Copy(pThis->m_pCPSounds->m_alpszSoundFiles);
00166 /*
00167          {
00168             CKey hKey;
00169             DWORD dwDisp;
00170             LONG lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE,
00171                CTSTR(IDS_BMWS_CPSOUNDS_REG_WIN), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ,
00172                NULL, &hKey, &dwDisp);
00173             if(lResult == NOERROR)
00174             {
00175                pThis-.
00176                //pThis->m_lpszCurFolder.Assign(GetRegStringValue(hKey,
00177                // IDS_BMWS_CPSOUNDS_REG_MEDIAPATH));
00178             }
00179          }*/
00180          pThis->m_lpszCurFolder.Assign(pThis->m_pCPSounds->m_lpszDefPath);
00181
00182          pThis->FillDropDown(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME));
00183
00184          SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY, BM_SETIMAGE, IMAGE_BITMAP,
00185             (LPARAM)pThis->m_hbmPlay);
00186          SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_STOP, BM_SETIMAGE, IMAGE_BITMAP,
00187             (LPARAM)pThis->m_hbmStop);
00188
00189          HIMAGELIST himl = ImageList_Create(16, 16, ILC_MASK, 2, 0);
00190
00191          if(himl)
00192          {
00193             HICON hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BMWS_CPSOUNDS_ICON),
00194                IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
00195             ImageList_AddIcon(himl, hIcon);
00196             DestroyIcon(hIcon);
00197             hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BMWS_CPSOUNDS_NULLICON),
00198                IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
00199             ImageList_AddIcon(himl, hIcon);
00200             DestroyIcon(hIcon);
00201             SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_SETIMAGELIST, TVSIL_NORMAL,
00202                (LPARAM)himl);
00203          }
00204
00205          TVITEM tvi;
00206          TVINSERTSTRUCT tvins;
00207
00208          tvins.hParent = NULL;
00209          tvins.hInsertAfter = TVI_LAST;
00210
00211          UINT cSounds = pThis->m_alpszTempFiles.GetSize();
00212
00213          for(UINT i = 0; i < cSounds; i++)
00214          {
00215             tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
00216             tvi.pszText = pThis->m_pCPSounds->m_alpszDisplays[i];
00217             tvi.cchTextMax = lstrlen(tvi.pszText);
00218             tvi.iImage = ((pThis->m_alpszTempFiles[i] && lstrlen(pThis->m_alpszTempFiles[i]) > 0)
00219                ? 0 : 1);
00220             tvi.iSelectedImage = tvi.iImage;
00221             tvi.lParam = i;
00222
00223             tvins.item = tvi;
00224
00225             SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_INSERTITEM, 0,
00226                (LPARAM)(LPTVINSERTSTRUCT) &tvins);
00227          }
00228          pThis->m_bEditChanged = FALSE;
00229          pThis->m_bValidated = FALSE;
00230
00231          EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00232       } return TRUE;
00233
00234       case MM_MCINOTIFY:
00235          if(wParam == MCI_NOTIFY_SUCCESSFUL)
00236          {
00237             mciSendCommand(lParam, MCI_CLOSE, MCI_WAIT, NULL);
00238             EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00239             if(pThis->m_bReenable && (GetFocus() == GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP)))
00240                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY));
00241             EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00242          }
00243          break;
00244
00245       case WM_COMMAND:
00246          switch(LOWORD(wParam))
00247          {
00248             case IDC_BMWS_CPSOUNDS_PLAY:
00249             {
00250                MCI_OPEN_PARMS mciOpenParms;
00251                MCI_PLAY_PARMS mciPlayParms;
00252                DWORD dwErr;
00253
00254                // Open the device by specifying the device and filename.
00255                // MCI will choose a device capable of playing the specified file.
00256                mciOpenParms.lpstrDeviceType = TEXT("waveaudio");
00257                mciOpenParms.lpstrElementName = pThis->m_alpszTempFiles[pThis->m_iSelected];
00258                if(dwErr = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,
00259                   (DWORD)(LPVOID)&mciOpenParms))
00260                {
00261                   TCHAR szErr[MAXERRORLENGTH];
00262                   if(mciGetErrorString(dwErr, szErr, MAXERRORLENGTH))
00263                      MessageBox(hwndDlg, szErr, g_szAppTitle, MB_OK | MB_ICONHAND);
00264                   return FALSE;
00265                }
00266
00267                // The device opened successfully; get the device ID.
00268                pThis->m_mciDevID = mciOpenParms.wDeviceID;
00269
00270                // Begin playback. The MM_MCINOTIFY message will be sent when
00271                // playback is complete. At this time, the window procedure closes
00272                // the device.
00273                mciPlayParms.dwCallback = (DWORD)hwndDlg;
00274                if(dwErr = mciSendCommand(pThis->m_mciDevID, MCI_PLAY, MCI_NOTIFY,
00275                   (DWORD)(LPVOID)&mciPlayParms))
00276                {
00277                   TCHAR szErr[MAXERRORLENGTH];
00278                   if(mciGetErrorString(dwErr, szErr, MAXERRORLENGTH))
00279                      MessageBox(hwndDlg, szErr, g_szAppTitle, MB_OK | MB_ICONHAND);
00280                   mciSendCommand(pThis->m_mciDevID, MCI_CLOSE, 0, NULL);
00281                   return FALSE;
00282                }
00283
00284                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00285                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), TRUE);
00286                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP));
00287             } break;
00288
00289             case IDC_BMWS_CPSOUNDS_STOP:
00290                mciSendCommand(pThis->m_mciDevID, MCI_STOP, 0, NULL);
00291                mciSendCommand(pThis->m_mciDevID, MCI_CLOSE, 0, NULL);
00292                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00293                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00294                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY));
00295                break;
00296
00297             case IDC_BMWS_CPSOUNDS_BROWSE:
00298             {
00299                CTSTR lpszTempSound;
00300                CTSTR lpszTitleHolder(IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER);
00301                CTSTR lpszTitle(TRUE,
00302                   lstrlen(pThis->m_pCPSounds->m_alpszDisplays[pThis->m_iSelected]) +
00303                   lstrlen(lpszTitleHolder) + 1);
00304                wsprintf(lpszTitle, lpszTitleHolder,
00305                   pThis->m_pCPSounds->m_alpszDisplays[pThis->m_iSelected]);
00306                if(SingleOFN(lpszTempSound, IDS_BMWS_CPSOUNDS_FILTER, NULL, hwndDlg,
00307                   OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, lpszTitle, pThis->m_lpszCurFolder,
00308                   (UINT)-1) == 1)
00309                {
00310                   pThis->m_alpszTempFiles[pThis->m_iSelected].Assign(lpszTempSound);
00311                   CTSTR lpszNewPath(pThis->m_alpszTempFiles[pThis->m_iSelected]);
00312                   PathRemoveFileSpec(lpszNewPath);
00313                   if(lstrcmpi(lpszNewPath, pThis->m_lpszCurFolder) != 0)
00314                   {
00315                      pThis->m_lpszCurFolder.Assign(lpszNewPath);
00316                      pThis->FillDropDown(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME));
00317                   }
00318                   SHFILEINFO shfi;
00319                   if(SHGetFileInfo(pThis->m_alpszTempFiles[pThis->m_iSelected], 0, &shfi,
00320                      sizeof(shfi), SHGFI_DISPLAYNAME))
00321                   {
00322                      SetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, shfi.szDisplayName);
00323                      EnableWindow(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00324                      EnableWindow(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00325                      HTREEITEM hti = TreeView_GetSelection(GetDlgItem(pThis->m_hDlg,
00326                         IDC_BMWS_CPSOUNDS_TREE));
00327                      TVITEM tvi;
00328                      tvi.hItem = hti;
00329                      tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00330
00331                      tvi.iImage = 0;
00332                      tvi.iSelectedImage = tvi.iImage;
00333
00334                      TreeView_SetItem(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00335                      ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00336                   }
00337                }
00338             } break;
00339
00340             case IDC_BMWS_CPSOUNDS_DETAILS:
00341             {
00342                SHELLEXECUTEINFO sei;
00343                ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
00344                sei.cbSize = sizeof(SHELLEXECUTEINFO);
00345                sei.hwnd = hwndDlg;
00346                sei.lpFile = pThis->m_alpszTempFiles[pThis->m_iSelected];
00347                sei.lpVerb = TEXT("properties");
00348                sei.fMask = SEE_MASK_INVOKEIDLIST;
00349                BOOL b = ShellExecuteEx(&sei);
00350             } break;
00351
00352             case IDC_BMWS_CPSOUNDS_FILENAME:
00353                switch(HIWORD(wParam))
00354                {
00355                   case CBN_SELCHANGE:
00356                      pThis->SetSound(SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME,
00357                         CB_GETCURSEL, 0, 0));
00358                      ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00359                      pThis->m_bEditChanged = FALSE;
00360                      break;
00361
00362                   case CBN_EDITCHANGE:
00363                      pThis->m_bValidated = FALSE;
00364                      pThis->m_bEditChanged = TRUE;
00365                      break;
00366
00367                   case CBN_KILLFOCUS:
00368                      if(!pThis->m_bValidated)
00369                      {
00370                         CTSTR lpszTempSound;
00371                         int iLen = GetWindowTextLength(GetDlgItem(hwndDlg,
00372                            IDC_BMWS_CPSOUNDS_FILENAME)) + 8;
00373                         lpszTempSound.Alloc(iLen);
00374                         GetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound,
00375                            iLen);
00376                         if(!pThis->IsCBValid(lpszTempSound))
00377                         {
00378                            SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_TREE));
00379                            pThis->OnTreeIndex(-1);
00380                         }
00381                      }
00382                      break;
00383                }
00384                break;
00385
00386          }
00387          break;
00388
00389       case WM_NOTIFY:
00390          switch(((LPNMHDR)lParam)->code)
00391          {
00392             case TVN_SELCHANGED:
00393                pThis->OnTreeIndex((int)((LPNMTREEVIEW)lParam)->itemNew.lParam);
00394                break;
00395
00396             case PSN_KILLACTIVE:
00397             {
00398                CTSTR lpszTempSound;
00399                int iLen = GetWindowTextLength(GetDlgItem(hwndDlg,
00400                   IDC_BMWS_CPSOUNDS_FILENAME)) + 8;
00401                lpszTempSound.Alloc(iLen);
00402                GetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound,
00403                   iLen);
00404                if(!pThis->IsCBValid(lpszTempSound))
00405                {
00406                   SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_TREE));
00407                   pThis->OnTreeIndex(-1);
00408                   SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE);
00409                } else
00410                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00411             } break;
00412
00413             case PSN_APPLY:
00414                pThis->m_pCPSounds->m_alpszSoundFiles.Copy(pThis->m_alpszTempFiles);
00415                pThis->m_pCPSounds->Save();
00416                break;
00417          }
00418          return TRUE;
00419
00420       case WM_DESTROY:
00421          mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, NULL);
00422          ImageList_Destroy((HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_GETIMAGELIST,
00423             TVSIL_NORMAL, 0));
00424          break;
00425
00426 #ifdef BMWS_CONTEXTHELP
00427       case WM_HELP:
00428       case WM_CONTEXTMENU:
00429          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, pThis->m_lpszPopupFile,
00430             pThis->s_adwPopupHelp);
00431          break;
00432 #endif
00433    }
00434
00435    return FALSE;
00436 }
00437
00438
00439 //----------------------------------------------------------------------------
00440 //
00441 // FillDropDown function
00442 //    Adds the .wav files of the "current directory" to the drop down box.
00443 //
00444 // Parameters:
00445 //    hwndDD:        Drop down box window handle.
00446 //
00447 // Returns:          None.
00448 //
00449 //----------------------------------------------------------------------------
00450 void CCPSoundsDlg::FillDropDown(HWND hwndDD)
00451 {
00452    m_alpszDDFiles.RemoveAll();
00453    m_alpszDDFiles.SetSize(1);
00454    SendMessage(hwndDD, CB_RESETCONTENT, 0, 0);
00455    SendMessage(hwndDD, CB_ADDSTRING, 0, (LPARAM)(LPTSTR)CTSTR(IDS_BMWS_CPSOUNDS_NONE));
00456    CTSTR lpszWavWildcard(IDS_BMWS_CPSOUNDS_WAVWILDCARD);
00457    CTSTR lpszTotal(TRUE, lstrlen(m_lpszCurFolder) + lstrlen(lpszWavWildcard) + 4);
00458    wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszWavWildcard);
00459    WIN32_FIND_DATA wfd;
00460    ZeroMemory(&wfd, sizeof(wfd));
00461    HANDLE hFind = FindFirstFile(lpszTotal, &wfd);
00462    if(hFind != INVALID_HANDLE_VALUE)
00463    {
00464       UINT uCount = 1;
00465       AddFile(hwndDD, wfd.cFileName, uCount);
00466       while(FindNextFile(hFind, &wfd))
00467       {
00468          uCount++;
00469          AddFile(hwndDD, wfd.cFileName, uCount);
00470       }
00471       FindClose(hFind);
00472    }
00473 }
00474
00475
00476 //----------------------------------------------------------------------------
00477 //
00478 // AddFile function
00479 //    Adds a file to the drop down box.
00480 //
00481 // Parameters:
00482 //    hwndDD:        Drop down box window handle.
00483 //    lpszFileName:  Name of the file to add (with extension).
00484 //    uIndex:        Index into the full path name array, to be associated
00485 //                   with the new item.
00486 //
00487 // Returns:          None.
00488 //
00489 //----------------------------------------------------------------------------
00490 void CCPSoundsDlg::AddFile(HWND hwndDD, LPTSTR lpszFileName, UINT uIndex)
00491 {
00492    CTSTR lpszTotal(TRUE, lstrlen(m_lpszCurFolder) + lstrlen(lpszFileName) + 4);
00493    wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszFileName);
00494    m_alpszDDFiles.Add(lpszTotal);
00495    SHFILEINFO shfi;
00496    if(SHGetFileInfo(lpszTotal, 0, &shfi, sizeof(shfi), SHGFI_DISPLAYNAME))
00497    {
00498       int iLBIndex = SendMessage(hwndDD, CB_ADDSTRING, 0, (LPARAM)shfi.szDisplayName);
00499       SendMessage(hwndDD, CB_SETITEMDATA, iLBIndex, (LPARAM)uIndex);
00500    }
00501 }
00502
00503
00504 //----------------------------------------------------------------------------
00505 //
00506 // SetSound function
00507 //    Sets the specified sound file to the event, changing the icon if
00508 //    necessary.
00509 //
00510 // Parameters:
00511 //    uIndex:        Zero-based index of the current drop-down list selection.
00512 //
00513 // Returns:          None.
00514 //
00515 //----------------------------------------------------------------------------
00516 void CCPSoundsDlg::SetSound(UINT uIndex)
00517 {
00518    if(uIndex == (UINT)-1)
00519       return;
00520    if(uIndex == 0)
00521    {
00522       if(m_alpszTempFiles[m_iSelected])
00523       {
00524          m_alpszTempFiles.SetAt(m_iSelected, CTSTR());
00525
00526          HTREEITEM hti = TreeView_GetSelection(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE));
00527          TVITEM tvi;
00528          tvi.hItem = hti;
00529          tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00530
00531          tvi.iImage = 1;
00532          tvi.iSelectedImage = tvi.iImage;
00533
00534          TreeView_SetItem(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00535
00536          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00537          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), FALSE);
00538       }
00539    } else
00540    {
00541       UINT uDDIndex = (UINT)SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME,
00542          CB_GETITEMDATA, uIndex, 0);
00543       if(!m_alpszTempFiles[m_iSelected] || lstrlen(m_alpszTempFiles[m_iSelected]) == 0)
00544       {
00545          HTREEITEM hti = TreeView_GetSelection(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE));
00546          TVITEM tvi;
00547          tvi.hItem = hti;
00548          tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00549
00550          tvi.iImage = 0;
00551          tvi.iSelectedImage = tvi.iImage;
00552
00553          TreeView_SetItem(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00554
00555          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00556          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00557       }
00558       m_alpszTempFiles.SetAt(m_iSelected, m_alpszDDFiles[uDDIndex]);
00559    }
00560 }
00561
00562
00563 //----------------------------------------------------------------------------
00564 //
00565 // OnTreeIndex function
00566 //    Responds to a new selection in the events tree. Sets the corresponding
00567 //    sound name in the drop down box.
00568 //
00569 // Parameters:
00570 //    iIndex:        Zero-based index of the new tree item. If -1, the current
00571 //                   tree item will be used.
00572 //
00573 // Returns:          None.
00574 //
00575 //----------------------------------------------------------------------------
00576 void CCPSoundsDlg::OnTreeIndex(int iIndex)
00577 {
00578    if(iIndex != -1)
00579    {
00580       int iLen = GetWindowTextLength(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME)) + 1;
00581       if(iLen > 1)
00582       {
00583          CTSTR lpszTempSound(TRUE, iLen);
00584          GetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound, iLen);
00585          IsCBValid(lpszTempSound);
00586       }
00587       m_iSelected = iIndex;
00588    }
00589    if(!m_alpszTempFiles[m_iSelected] || lstrlen(m_alpszTempFiles[m_iSelected]) == 0)
00590    {
00591       SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, CB_SETCURSEL, 0, 0);
00592       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), FALSE);
00593       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00594       m_bReenable = FALSE;
00595    } else
00596    {
00597       CTSTR lpszNewPath(m_alpszTempFiles[m_iSelected]);
00598       PathRemoveFileSpec(lpszNewPath);
00599       SHFILEINFO shfi;
00600       if(SHGetFileInfo(m_alpszTempFiles[m_iSelected], 0, &shfi, sizeof(shfi),
00601          SHGFI_DISPLAYNAME))
00602       {
00603          if(lstrcmpi(lpszNewPath, m_lpszCurFolder) == 0)
00604          {
00605             SetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, shfi.szDisplayName);
00606          } else
00607          {
00608             CTSTR lpszNewTotal(TRUE, MAX_PATH);
00609             wsprintf(lpszNewTotal, TEXT("%s\\%s"), lpszNewPath, shfi.szDisplayName);
00610             SetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszNewTotal);
00611          }
00612       }
00613       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00614       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00615       m_bReenable = TRUE;
00616    }
00617 }
00618
00619
00620 //----------------------------------------------------------------------------
00621 //
00622 // IsCBValid function
00623 //    Tests whether the specified string represents an existing file. If not,
00624 //    a message box is presented.
00625 //
00626 // Parameters:
00627 //    lpszPath:      String to test for validity.
00628 //
00629 // Returns:          TRUE if the contents are valid, else FALSE.
00630 //
00631 //----------------------------------------------------------------------------
00632 BOOL CCPSoundsDlg::IsCBValid(CTSTR& lpszPath)
00633 {
00634    m_bValidated = TRUE;
00635    if(SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, CB_GETCURSEL, 0, 0) == 0)
00636       return TRUE;
00637    CTSTR lpszTempSound(TRUE, lstrlen(lpszPath) + 8);
00638    lstrcpy(lpszTempSound, lpszPath);
00639    PathAddExtension(lpszTempSound, CTSTR(IDS_BMWS_CPSOUNDS_WAVEXT));
00640    CTSTR lpszTotal(TRUE, lstrlen(lpszTempSound) + lstrlen(m_lpszCurFolder) + 8);
00641    if(PathIsRelative(lpszTempSound))
00642    {
00643       wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszTempSound);
00644    } else
00645    {
00646       lstrcpy(lpszTotal, lpszTempSound);
00647    }
00648    CTSTR lpszTotalC(TRUE, MAX_PATH);
00649    PathCanonicalize(lpszTotalC, lpszTotal);
00650    if(!PathFileExists(lpszTotalC))
00651    {
00652       MessageBox(m_hDlg, CTSTR(IDS_BMWS_CPSOUNDS_INVALIDFILE), g_szAppTitle, MB_OK |
00653          MB_ICONHAND);
00654       return FALSE;
00655    }
00656    if(m_bEditChanged)
00657    {
00658       ::SendMessage(GetParent(m_hDlg), PSM_CHANGED, (WPARAM)m_hDlg, 0);
00659       m_bEditChanged = FALSE;
00660    }
00661    m_alpszTempFiles.SetAt(m_iSelected, lpszTotalC);
00662    return TRUE;
00663 }
00664
00665
00666 //----------------------------------------------------------------------------
00667 //
00668 // CCPSounds constructor
00669 //
00670 // Parameters:
00671 //    uidBase:       Resource identifier of the sound category GUID string.
00672 //    uidDisplay:    Resource identifier of the category display string.
00673 //    auidSounds:    Array of resource identifiers of the sound event strings,
00674 //                   to be appended to the category GUID.
00675 //    auidDisplays:  Array of resource identifiers of the event display
00676 //                   strings.
00677 //    lpszDefPath:   Default path for the dialog box dropdown.
00678 //    palpszDefs:    Array of files to assign by default.
00679 //    bRegister:     Whether to assign/retrieve values (TRUE) or delete them
00680 //                   (FALSE).
00681 //
00682 //----------------------------------------------------------------------------
00683 CCPSounds::CCPSounds(UINT uidBase, UINT uidDisplay, CUINTArray& auidSounds,
00684                      CUINTArray& auidDisplays, CTSTR& lpszDefPath,
00685                      CTSTRArray* palpszDefs, BOOL bRegister)
00686 {
00687    m_lpszDefPath.Assign(lpszDefPath);
00688    m_lpszBase.Assign(uidBase);
00689    CTSTR lpszDisplay(uidDisplay);
00690
00691    m_auidSounds.Copy(auidSounds);
00692
00693    int cSounds = auidSounds.GetSize();
00694    m_alpszDisplays.SetSize(cSounds);
00695    m_alpszSoundFiles.SetSize(cSounds);
00696
00697    int iLenBase = lstrlen(m_lpszBase);
00698    BOOL bFailed = FALSE;
00699    LONG lResult;
00700    DWORD dwDisp;
00701    TCHAR szAppEvents[64];
00702    TCHAR szSchemesApps[64];
00703    TCHAR szEventLabels[64];
00704    TCHAR szCurrent[64];
00705    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_APPEVENTS, szAppEvents, ARRAYSIZE(szAppEvents));
00706    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, szSchemesApps, ARRAYSIZE(szSchemesApps));
00707    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_EVENTLABELS, szEventLabels, ARRAYSIZE(szEventLabels));
00708    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_CURRENT, szCurrent, ARRAYSIZE(szCurrent));
00709
00710    CKey hKeyAppEvents;
00711
00712    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, szAppEvents, 0, NULL, REG_OPTION_NON_VOLATILE,
00713       KEY_READ, NULL, &hKeyAppEvents, &dwDisp);
00714    if(lResult == NOERROR)
00715    {
00716       // Initialize application label
00717       CKey hKeyApps;
00718       lResult = RegCreateKeyEx(hKeyAppEvents, szSchemesApps, 0, NULL, REG_OPTION_NON_VOLATILE,
00719             KEY_READ, NULL, &hKeyApps, &dwDisp);
00720       if(lResult == NOERROR)
00721       {
00722          CKey hKeyEventsTitle;
00723          if(bRegister)
00724          {
00725             lResult = RegCreateKeyEx(hKeyApps, m_lpszBase, 0, NULL, REG_OPTION_NON_VOLATILE,
00726                   KEY_READ, NULL, &hKeyEventsTitle, &dwDisp);
00727             if(lResult == NOERROR)
00728             {
00729                SetRegStringValue(hKeyEventsTitle, (UINT)-1, lpszDisplay);
00730
00731                // Read in individual sounds
00732                for(int i = 0; i < cSounds; i++)
00733                {
00734                   CTSTR lpszIndiv(auidSounds[i]);
00735                   CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00736
00737                   lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00738                   lstrcat(lpszCombo, lpszIndiv);
00739
00740                   CKey hKeyInd;
00741                   lResult = RegCreateKeyEx(hKeyEventsTitle, lpszCombo, 0, NULL,
00742                      REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00743                   if(lResult == NOERROR)
00744                   {
00745                      CKey hKeyCurrent;
00746                      lResult = RegCreateKeyEx(hKeyInd, szCurrent, 0, NULL, REG_OPTION_NON_VOLATILE,
00747                            KEY_READ, NULL, &hKeyCurrent, &dwDisp);
00748                      if(lResult == NOERROR)
00749                      {
00750                         CTSTR lpszTempValue = GetRegStringValue(hKeyCurrent, (UINT)-1);
00751                         if((!lpszTempValue || lstrlen(lpszTempValue) == 0) && palpszDefs)
00752                         {
00753                            lpszTempValue.Assign(palpszDefs->GetAt(i));
00754                         }
00755                         m_alpszSoundFiles.SetAt(i, lpszTempValue);
00756                      }
00757                   }
00758                }
00759             }
00760          } else
00761          {
00762             SHDeleteKey(hKeyApps, m_lpszBase);
00763          }
00764       }
00765
00766       // Initialize individual labels
00767       CKey hKeyLabels;
00768       lResult = RegCreateKeyEx(hKeyAppEvents, szEventLabels, 0, NULL, REG_OPTION_NON_VOLATILE,
00769             KEY_READ, NULL, &hKeyLabels, &dwDisp);
00770       if(lResult == NOERROR)
00771       {
00772          for(int i = 0; i < cSounds; i++)
00773          {
00774             CTSTR lpszIndiv(auidSounds[i]);
00775             CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00776
00777             lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00778             lstrcat(lpszCombo, lpszIndiv);
00779
00780             if(bRegister)
00781             {
00782                CKey hKeyInd;
00783                lResult = RegCreateKeyEx(hKeyLabels, lpszCombo, 0, NULL,
00784                   REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00785                if(lResult == NOERROR)
00786                {
00787                   m_alpszDisplays.SetAt(i, CTSTR(auidDisplays[i]));
00788                   SetRegStringValue(hKeyInd, (UINT)-1, m_alpszDisplays[i]);
00789                }
00790             } else
00791             {
00792                SHDeleteKey(hKeyLabels, lpszCombo);
00793             }
00794          }
00795
00796       }
00797    }
00798 }
00799
00800
00801 //----------------------------------------------------------------------------
00802 //
00803 // Save function
00804 //    Saves the current sound settings to the registry.
00805 //
00806 // Parameters:       None.
00807 //
00808 // Returns:          None.
00809 //
00810 //----------------------------------------------------------------------------
00811 void CCPSounds::Save()
00812 {
00813    int cSounds = m_auidSounds.GetSize();
00814
00815    int iLenBase = lstrlen(m_lpszBase);
00816    BOOL bFailed = FALSE;
00817
00818    LONG lResult;
00819    DWORD dwDisp;
00820    TCHAR szAppEvents[64];
00821    TCHAR szSchemesApps[64];
00822    TCHAR szCurrent[64];
00823    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_APPEVENTS, szAppEvents, ARRAYSIZE(szAppEvents));
00824    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, szSchemesApps, ARRAYSIZE(szSchemesApps));
00825    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_CURRENT, szCurrent, ARRAYSIZE(szCurrent));
00826
00827    CKey hKeyAppEvents;
00828
00829    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, szAppEvents, 0, NULL, REG_OPTION_NON_VOLATILE,
00830       KEY_READ, NULL, &hKeyAppEvents, &dwDisp);
00831    if(lResult == NOERROR)
00832    {
00833       CKey hKeyApps;
00834       lResult = RegCreateKeyEx(hKeyAppEvents, szSchemesApps, 0, NULL, REG_OPTION_NON_VOLATILE,
00835             KEY_READ, NULL, &hKeyApps, &dwDisp);
00836       if(lResult == NOERROR)
00837       {
00838          CKey hKeyEventsTitle;
00839          lResult = RegCreateKeyEx(hKeyApps, m_lpszBase, 0, NULL, REG_OPTION_NON_VOLATILE,
00840                KEY_READ, NULL, &hKeyEventsTitle, &dwDisp);
00841          if(lResult == NOERROR)
00842          {
00843             for(int i = 0; i < cSounds; i++)
00844             {
00845                CTSTR lpszIndiv(m_auidSounds[i]);
00846                CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00847
00848                lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00849                lstrcat(lpszCombo, lpszIndiv);
00850
00851                CKey hKeyInd;
00852                lResult = RegCreateKeyEx(hKeyEventsTitle, lpszCombo, 0, NULL,
00853                   REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00854                if(lResult == NOERROR)
00855                {
00856                   CKey hKeyCurrent;
00857                   lResult = RegCreateKeyEx(hKeyInd, szCurrent, 0, NULL, REG_OPTION_NON_VOLATILE,
00858                         KEY_READ, NULL, &hKeyCurrent, &dwDisp);
00859                   if(lResult == NOERROR)
00860                   {
00861                      SetRegStringValue(hKeyCurrent, (UINT)-1, m_alpszSoundFiles[i]);
00862                   }
00863                }
00864             }
00865
00866          }
00867       }
00868    }
00869 }
00870
00871
00872 //----------------------------------------------------------------------------
00873 //
00874 // Play function
00875 //    Plays the sound file at a specified index.
00876 //
00877 // Parameters:
00878 //    uIndex:        Zero-based index of the sound to play.
00879 //
00880 // Returns:          None.
00881 //
00882 //----------------------------------------------------------------------------
00883 void CCPSounds::Play(UINT uIndex)
00884 {
00885    if(uIndex > (UINT)m_alpszSoundFiles.GetSize())
00886       return;
00887    PlaySound(m_alpszSoundFiles[uIndex], NULL, SND_FILENAME | SND_ASYNC | SND_NODEFAULT);
00888 }
00889
00890
00891 //----------------------------------------------------------------------------
00892 //
00893 // FillPropPage function
00894 //    Fills in the Sounds property page information.
00895 //
00896 // Parameters:
00897 //    lppsp:         Property sheet information structure to fill in.
00898 //
00899 // Returns:          None.
00900 //
00901 //----------------------------------------------------------------------------
00902 void CCPSounds::FillPropPage(LPPROPSHEETPAGE lppsp)
00903 {
00904    CCPSoundsDlg *pDlg = new CCPSoundsDlg(this);
00905    ENSUREALLOC(pDlg);
00906    lppsp->dwSize = sizeof(PROPSHEETPAGE);
00907    lppsp->dwFlags = 0;
00908    lppsp->hInstance = g_hInstLC;
00909    lppsp->pszTemplate = MAKEINTRESOURCE(IDD_BMWS_CPSOUNDSDLG);
00910    lppsp->pfnDlgProc = pDlg->CPSoundsProc;
00911    lppsp->lParam = (LPARAM)pDlg;
00912 }
00913
00914
00915 //----------------------------------------------------------------------------
00916 //
00917 // CleanupPropPage function
00918 //    Deletes CPSounds dialog box object that was created in FillPropPage.
00919 //
00920 // Parameters:
00921 //    lppsp:         Property sheet information structure whose lParam field
00922 //                   points to the dialog box object to delete.
00923 //
00924 // Returns:          None.
00925 //
00926 //----------------------------------------------------------------------------
00927 void CCPSounds::CleanupPropPage(LPPROPSHEETPAGE lppsp)
00928 {
00929    if(lppsp->lParam)
00930       delete ((CCPSoundsDlg*)lppsp->lParam);
00931 }
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds.h File Reference

#include <bmws_array.h>
#include <bmws_string.h>
#include <bmws_uintarray.h>
#include <bmws_stringarray.h>
#include <prsht.h>

Go to the source code of this file.

Compounds

class | CCPSounds

Defines

#define | AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 11 of file bmws_cpsounds.h.

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds.h Source File

bmws_cpsounds.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_cpsounds.h
00004 //    Class to encapsulate control panel-based sound events and the
00005 //    corresponding property page.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00011 #define AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <bmws_array.h>
00018 #include <bmws_string.h>
00019 #include <bmws_uintarray.h>
00020 #include <bmws_stringarray.h>
00021 #include <prsht.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CCPSounds class
00027 //    Encapsulates control panel-based sound events and the corresponding
00028 //    property page.
00029 //
00030 //----------------------------------------------------------------------------
00031 class CCPSounds
00032 {
00033    friend class CCPSoundsDlg;
00034
00035 public:
00036    CCPSounds(UINT uidBase, UINT uidDisplay, CUINTArray& auidSounds, CUINTArray& auidDisplays,
00037       CTSTR& lpszDefPath, CTSTRArray *palpszDefs = NULL, BOOL bRegister = TRUE);
00038
00039    void Save();
00040    void Play(UINT uIndex);
00041    void FillPropPage(LPPROPSHEETPAGE lppsp);
00042    void CleanupPropPage(LPPROPSHEETPAGE lppsp);
00043
00044 protected:
00045    CTSTR m_lpszDefPath;
00046    CTSTR m_lpszBase;
00047    CUINTArray m_auidSounds;
00048    CTSTRArray m_alpszSoundFiles;
00049    CTSTRArray m_alpszDisplays;
00050 };
00051
00052
00053 #endif // !defined(AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds_res.h File Reference

Go to the source code of this file.

Defines

#define | IDI_BMWS_CPSOUNDS_ICON 7101
#define | IDI_BMWS_CPSOUNDS_NULLICON 7102
#define | IDS_BMWS_CPSOUNDS_APPEVENTS 8601
#define | IDS_BMWS_CPSOUNDS_EVENTLABELS 8602
#define | IDS_BMWS_CPSOUNDS_SCHEMESAPPS 8603
#define | IDS_BMWS_CPSOUNDS_CURRENT 8604
#define | IDS_BMWS_CPSOUNDS_REG_MEDIAPATH 8605
#define | IDS_BMWS_CPSOUNDS_POPUPFILE 8605
#define | IDS_BMWS_CPSOUNDS_WAVWILDCARD 8606
#define | IDS_BMWS_CPSOUNDS_REG_WIN 8607
#define | IDS_BMWS_CPSOUNDS_WAVEXT 8608

Define Documentation

#define IDI_BMWS_CPSOUNDS_ICON 7101

Definition at line 5 of file bmws_cpsounds_res.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDI_BMWS_CPSOUNDS_NULLICON 7102

Definition at line 6 of file bmws_cpsounds_res.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDS_BMWS_CPSOUNDS_APPEVENTS 8601

Definition at line 7 of file bmws_cpsounds_res.h.

Referenced by CCPSounds::CCPSounds(), and CCPSounds::Save().

#define IDS_BMWS_CPSOUNDS_CURRENT 8604

Definition at line 10 of file bmws_cpsounds_res.h.

Referenced by CCPSounds::CCPSounds(), and CCPSounds::Save().

#define IDS_BMWS_CPSOUNDS_EVENTLABELS 8602

Definition at line 8 of file bmws_cpsounds_res.h.

Referenced by CCPSounds::CCPSounds().

#define IDS_BMWS_CPSOUNDS_POPUPFILE 8605

Definition at line 12 of file bmws_cpsounds_res.h.

Referenced by CCPSoundsDlg::CCPSoundsDlg().

#define IDS_BMWS_CPSOUNDS_REG_MEDIAPATH 8605

Definition at line 11 of file bmws_cpsounds_res.h.

#define IDS_BMWS_CPSOUNDS_REG_WIN 8607

Definition at line 14 of file bmws_cpsounds_res.h.

#define IDS_BMWS_CPSOUNDS_SCHEMESAPPS 8603

Definition at line 9 of file bmws_cpsounds_res.h.

Referenced by CCPSounds::CCPSounds(), and CCPSounds::Save().

#define IDS_BMWS_CPSOUNDS_WAVEXT 8608

Definition at line 15 of file bmws_cpsounds_res.h.

Referenced by CCPSoundsDlg::IsCBValid().

#define IDS_BMWS_CPSOUNDS_WAVWILDCARD 8606

Definition at line 13 of file bmws_cpsounds_res.h.

Referenced by CCPSoundsDlg::FillDropDown().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds_res.h Source File

bmws_cpsounds_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_cpsounds.rc
00004 //
00005 #define IDI_BMWS_CPSOUNDS_ICON          7101
00006 #define IDI_BMWS_CPSOUNDS_NULLICON      7102
00007 #define IDS_BMWS_CPSOUNDS_APPEVENTS     8601
00008 #define IDS_BMWS_CPSOUNDS_EVENTLABELS   8602
00009 #define IDS_BMWS_CPSOUNDS_SCHEMESAPPS   8603
00010 #define IDS_BMWS_CPSOUNDS_CURRENT       8604
00011 #define IDS_BMWS_CPSOUNDS_REG_MEDIAPATH 8605
00012 #define IDS_BMWS_CPSOUNDS_POPUPFILE     8605
00013 #define IDS_BMWS_CPSOUNDS_WAVWILDCARD   8606
00014 #define IDS_BMWS_CPSOUNDS_REG_WIN       8607
00015 #define IDS_BMWS_CPSOUNDS_WAVEXT        8608
00016
00017 // Next default values for new objects
00018 //
00019 #ifdef APSTUDIO_INVOKED
00020 #ifndef APSTUDIO_READONLY_SYMBOLS
00021 #define _APS_NEXT_RESOURCE_VALUE        103
00022 #define _APS_NEXT_COMMAND_VALUE         40001
00023 #define _APS_NEXT_CONTROL_VALUE         1000
00024 #define _APS_NEXT_SYMED_VALUE           101
00025 #endif
00026 #endif
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDC_BMWS_CPSOUNDS_TREE 10100
#define | IDC_BMWS_CPSOUNDS_L_TREE 10101
#define | IDC_BMWS_CPSOUNDS_FILENAME 10102
#define | IDC_BMWS_CPSOUNDS_L_FILENAME 10103
#define | IDC_BMWS_CPSOUNDS_BROWSE 10104
#define | IDC_BMWS_CPSOUNDS_DETAILS 10105
#define | IDC_BMWS_CPSOUNDS_PLAY 10106
#define | IDC_BMWS_CPSOUNDS_STOP 10107
#define | IDC_BMWS_CPSOUNDS_L_PREVIEW 10108
#define | IDD_BMWS_CPSOUNDSDLG 17101
#define | IDB_BMWS_CPSOUNDS_PLAY 17101
#define | IDB_BMWS_CPSOUNDS_STOP 17102
#define | IDS_BMWS_CPSOUNDS_FILTER 18601
#define | IDS_BMWS_CPSOUNDS_NONE 18602
#define | IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER 18603
#define | IDS_BMWS_CPSOUNDS_INVALIDFILE 18604
#define | IDC_STATIC -1

Define Documentation

#define IDB_BMWS_CPSOUNDS_PLAY 17101

Definition at line 15 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CCPSoundsDlg().

#define IDB_BMWS_CPSOUNDS_STOP 17102

Definition at line 16 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CCPSoundsDlg().

#define IDC_BMWS_CPSOUNDS_BROWSE 10104

Definition at line 9 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDC_BMWS_CPSOUNDS_DETAILS 10105

Definition at line 10 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc(), CCPSoundsDlg::OnTreeIndex(), and CCPSoundsDlg::SetSound().

#define IDC_BMWS_CPSOUNDS_FILENAME 10102

Definition at line 7 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc(), CCPSoundsDlg::IsCBValid(), CCPSoundsDlg::OnTreeIndex(), and CCPSoundsDlg::SetSound().

#define IDC_BMWS_CPSOUNDS_L_FILENAME 10103

Definition at line 8 of file bmws_cpsounds_res_lc.h.

#define IDC_BMWS_CPSOUNDS_L_PREVIEW 10108

Definition at line 13 of file bmws_cpsounds_res_lc.h.

#define IDC_BMWS_CPSOUNDS_L_TREE 10101

Definition at line 6 of file bmws_cpsounds_res_lc.h.

#define IDC_BMWS_CPSOUNDS_PLAY 10106

Definition at line 11 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc(), CCPSoundsDlg::OnTreeIndex(), and CCPSoundsDlg::SetSound().

#define IDC_BMWS_CPSOUNDS_STOP 10107

Definition at line 12 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDC_BMWS_CPSOUNDS_TREE 10100

Definition at line 5 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc(), and CCPSoundsDlg::SetSound().

#define IDC_STATIC -1

Definition at line 21 of file bmws_cpsounds_res_lc.h.

#define IDD_BMWS_CPSOUNDSDLG 17101

Definition at line 14 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSounds::FillPropPage().

#define IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER 18603

Definition at line 19 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDS_BMWS_CPSOUNDS_FILTER 18601

Definition at line 17 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::CPSoundsProc().

#define IDS_BMWS_CPSOUNDS_INVALIDFILE 18604

Definition at line 20 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::IsCBValid().

#define IDS_BMWS_CPSOUNDS_NONE 18602

Definition at line 18 of file bmws_cpsounds_res_lc.h.

Referenced by CCPSoundsDlg::FillDropDown().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_cpsounds_res_lc.h Source File

bmws_cpsounds_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_cpsounds_lc.rc
00004 //
00005 #define IDC_BMWS_CPSOUNDS_TREE          10100
00006 #define IDC_BMWS_CPSOUNDS_L_TREE        10101
00007 #define IDC_BMWS_CPSOUNDS_FILENAME      10102
00008 #define IDC_BMWS_CPSOUNDS_L_FILENAME    10103
00009 #define IDC_BMWS_CPSOUNDS_BROWSE        10104
00010 #define IDC_BMWS_CPSOUNDS_DETAILS       10105
00011 #define IDC_BMWS_CPSOUNDS_PLAY          10106
00012 #define IDC_BMWS_CPSOUNDS_STOP          10107
00013 #define IDC_BMWS_CPSOUNDS_L_PREVIEW     10108
00014 #define IDD_BMWS_CPSOUNDSDLG            17101
00015 #define IDB_BMWS_CPSOUNDS_PLAY          17101
00016 #define IDB_BMWS_CPSOUNDS_STOP          17102
00017 #define IDS_BMWS_CPSOUNDS_FILTER        18601
00018 #define IDS_BMWS_CPSOUNDS_NONE          18602
00019 #define IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER 18603
00020 #define IDS_BMWS_CPSOUNDS_INVALIDFILE   18604
00021 #define IDC_STATIC                      -1
00022
00023 // Next default values for new objects
00024 //
00025 #ifdef APSTUDIO_INVOKED
00026 #ifndef APSTUDIO_READONLY_SYMBOLS
00027 #define _APS_NEXT_RESOURCE_VALUE        103
00028 #define _APS_NEXT_COMMAND_VALUE         40001
00029 #define _APS_NEXT_CONTROL_VALUE         1001
00030 #define _APS_NEXT_SYMED_VALUE           102
00031 #endif
00032 #endif
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dispbase.cpp File Reference

#include <bmws_dispbase.h>

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CDispBase

Variables

HINSTANCE | g_hInst
long | g_cActiveComponents

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 93 of file bmws_dispbase.cpp.

00094 {
00095    return InterlockedIncrement((LPLONG)&m_cRef);
00096 }

Variable Documentation

long g_cActiveComponents

Definition at line 20 of file bmws_dispbase.cpp.

Referenced by CDispBase::CDispBase(), and CDispBase::~CDispBase().

HINSTANCE g_hInst

Definition at line 19 of file bmws_dispbase.cpp.

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dispbase.cpp Source File

bmws_dispbase.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_dispbase.cpp
00004 //    Class to encapsulate IUnknown and IDispatch functionality, used as
00005 //    a base for COM object classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_dispbase.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 // External and static variables
00018 //----------------------------------------------------------------------------
00019 extern HINSTANCE g_hInst;              // Application instance handle
00020 extern long g_cActiveComponents;       // Number of active module components
00021
00022
00023 #ifdef BMWS_TRACKMEMALLOC
00024
00025 //----------------------------------------------------------------------------
00026 // DispBase object tracking
00027 //----------------------------------------------------------------------------
00028 int CDispBase::m_scTotalCreated = 0;
00029 int CDispBase::m_scTotalDeleted = 0;
00030
00031 #endif
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CDispBase constructor
00037 //
00038 // Parameters:       None.
00039 //
00040 //----------------------------------------------------------------------------
00041 CDispBase::CDispBase()
00042 {
00043    m_cRef = 0;
00044    InterlockedIncrement(&g_cActiveComponents);
00045 #ifdef BMWS_TRACKMEMALLOC
00046    m_scTotalCreated++;
00047 #endif
00048    m_pTypeInfo = NULL;
00049 }
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CDispBase destructor
00055 //
00056 //----------------------------------------------------------------------------
00057 CDispBase::~CDispBase()
00058 {
00059    InterlockedDecrement(&g_cActiveComponents);
00060 #ifdef BMWS_TRACKMEMALLOC
00061    m_scTotalDeleted++;
00062 #endif
00063    SAFERELEASE(m_pTypeInfo);
00064 }
00065
00066
00067 //----------------------------------------------------------------------------
00068 // INDUnknownAndDispatch::NDQueryInterface method
00069 //----------------------------------------------------------------------------
00070 STDMETHODIMP CDispBase::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00071 {
00072    if(IsEqualIID(riid, IID_IDispatch))
00073    {
00074       *ppvObject = (LPDISPATCH)((INDUnknownAndDispatch*)this);
00075       (*(LPUNKNOWN*)ppvObject)->AddRef();
00076       return S_OK;
00077    } else if(IsEqualIID(riid, IID_IUnknown))
00078    {
00079       *ppvObject = (LPUNKNOWN)((INDUnknownAndDispatch*)this);
00080       (*(LPUNKNOWN*)ppvObject)->AddRef();
00081       return S_OK;
00082    } else
00083    {
00084       *ppvObject = NULL;
00085       return E_NOINTERFACE;
00086    }
00087 }
00088
00089
00090 //----------------------------------------------------------------------------
00091 // INDUnknownAndDispatch::NDAddRef method
00092 //----------------------------------------------------------------------------
00093 STDMETHODIMP_(DWORD) CDispBase::NDAddRef()
00094 {
00095    return InterlockedIncrement((LPLONG)&m_cRef);
00096 }
00097
00098
00099 //----------------------------------------------------------------------------
00100 // INDUnknownAndDispatch::NDRelease method
00101 //----------------------------------------------------------------------------
00102 STDMETHODIMP_(DWORD) CDispBase::NDRelease()
00103 {
00104    if(InterlockedDecrement((LPLONG)&m_cRef) == 0)
00105    {
00106       delete this;
00107       return 0;
00108    }
00109    return m_cRef;
00110 }
00111
00112
00113 //----------------------------------------------------------------------------
00114 // INDUnknownAndDispatch::NDGetTypeInfoCount method
00115 //----------------------------------------------------------------------------
00116 STDMETHODIMP CDispBase::NDGetTypeInfoCount(UINT *pctinfo)
00117 {
00118    if(m_pTypeInfo == NULL)
00119    {
00120       *pctinfo = 0;
00121    } else
00122    {
00123       *pctinfo = 1;
00124    }
00125    return S_OK;
00126 }
00127
00128
00129 //----------------------------------------------------------------------------
00130 // INDUnknownAndDispatch::NDGetTypeInfo method
00131 //----------------------------------------------------------------------------
00132 STDMETHODIMP CDispBase::NDGetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
00133 {
00134    *ppTInfo = NULL;
00135
00136    if(iTInfo != 0)
00137       return DISP_E_BADINDEX;
00138    if(!m_pTypeInfo)
00139       return E_FAIL;
00140
00141    m_pTypeInfo->AddRef();
00142    *ppTInfo = m_pTypeInfo;
00143
00144    return S_OK;
00145 }
00146
00147
00148 //----------------------------------------------------------------------------
00149 // INDUnknownAndDispatch::NDGetIDsOfNames method
00150 //----------------------------------------------------------------------------
00151 STDMETHODIMP CDispBase::NDGetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
00152                                         DISPID *rgDispId)
00153 {
00154    if(!IsEqualIID(riid, IID_NULL))
00155       return DISP_E_UNKNOWNINTERFACE;
00156
00157    if(!m_pTypeInfo)
00158       return E_FAIL;
00159
00160    return m_pTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId);
00161 }
00162
00163
00164 //----------------------------------------------------------------------------
00165 // INDUnknownAndDispatch::NDInvoke method
00166 //----------------------------------------------------------------------------
00167 STDMETHODIMP CDispBase::NDInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00168                                  DISPPARAMS *pDispParams, VARIANT *pVarResult,
00169                                  EXCEPINFO *pExcepInfo, UINT *puArgErr)
00170 {
00171    if(!IsEqualIID(riid, IID_NULL))
00172       return DISP_E_UNKNOWNINTERFACE;
00173
00174    if(!m_pTypeInfo)
00175       return E_FAIL;
00176
00177    return m_pTypeInfo->Invoke(m_pInvokeDispatch, dispIdMember, wFlags, pDispParams, pVarResult,
00178       pExcepInfo, puArgErr);
00179 }
00180
00181
00182 //----------------------------------------------------------------------------
00183 //
00184 // Init function
00185 //    Specifies the derived class's main interface identifier and dispatch
00186 //    pointer.
00187 //
00188 // Parameters:
00189 //    pTypeLib:      Type library containing the interface
00190 //    riid:          Interface identifier of the derived class.
00191 //    pDisp:         Dispatch pointer of the derived class.
00192 //
00193 // Returns:          A standard COM success or error value.
00194 //
00195 //----------------------------------------------------------------------------
00196 HRESULT CDispBase::Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp)
00197 {
00198    if(!pDisp || !pTypeLib)
00199       return E_INVALIDARG;
00200
00201    m_pInvokeDispatch = pDisp;
00202
00203    SAFERELEASE(m_pTypeInfo);
00204    return pTypeLib->GetTypeInfoOfGuid(riid, &m_pTypeInfo);
00205 }
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dispbase.h File Reference

#include <oaidl.h>

Go to the source code of this file.

Compounds

class | CDispBase
interface | INDUnknownAndDispatch

Defines

#define | AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_
#define | DECLARE_IUNKNOWN_AND_IDISPATCH

Define Documentation

#define AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_

Definition at line 11 of file bmws_dispbase.h.

#define DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 98 of file bmws_dispbase.h.

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dispbase.h Source File

bmws_dispbase.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_dispbase.h
00004 //    Interface and class to encapsulate IUnknown and IDispatch
00005 //    functionality, used as a base for COM object classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
00011 #define AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include <oaidl.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // INDUnknownAndDispatch interface
00027 //    Combines nondelegating IUnknown and IDispatch interfaces
00028 //
00029 //----------------------------------------------------------------------------
00030 interface INDUnknownAndDispatch
00031 {
00032    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject) PURE;
00033    STDMETHOD_(ULONG, NDAddRef)() PURE;
00034    STDMETHOD_(ULONG, NDRelease)() PURE;
00035
00036    STDMETHOD (NDGetTypeInfoCount)(UINT *pctinfo) PURE;
00037    STDMETHOD (NDGetTypeInfo)(UINT uIInfo, LCID lcid, ITypeInfo **ppTInfo) PURE;
00038    STDMETHOD (NDGetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
00039       DISPID *rgDispId) PURE;
00040    STDMETHOD (NDInvoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00041       DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) PURE;
00042 };
00043
00044
00045 //----------------------------------------------------------------------------
00046 //
00047 // CDispBase class
00048 //    Provides COM object classes with easy support for dispinterfaces.
00049 //
00050 //----------------------------------------------------------------------------
00051 class CDispBase : public INDUnknownAndDispatch
00052 {
00053 public:
00054    CDispBase();
00055    virtual ~CDispBase();
00056
00057    // INDUnknown methods
00058    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00059    STDMETHOD_(ULONG, NDAddRef)();
00060    STDMETHOD_(ULONG, NDRelease)();
00061
00062    // INDDispatch methods
00063    STDMETHOD (NDGetTypeInfoCount)(UINT *pctinfo);
00064    STDMETHOD (NDGetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
00065    STDMETHOD (NDGetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid,
00066       DISPID *rgDispId);
00067    STDMETHOD (NDInvoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00068       DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
00069
00070 #ifdef BMWS_TRACKMEMALLOC
00071    static int m_scTotalCreated;
00072    static int m_scTotalDeleted;
00073 #endif
00074
00075 protected:
00076    LPUNKNOWN GetOuterUnknown() const
00077    {
00078       return (LPUNKNOWN)((INDUnknownAndDispatch*)this);
00079    }
00080
00081    LPDISPATCH GetDispatch() const
00082    {
00083       return (LPDISPATCH)((INDUnknownAndDispatch*)this);
00084    }
00085
00086    virtual HRESULT Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp);
00087
00088 private:
00089    DWORD m_cRef;                    // Object reference count
00090    LPDISPATCH m_pInvokeDispatch;    // Derived class's dispatch
00091    LPTYPEINFO m_pTypeInfo;          // Derived class's type information
00092 };
00093
00094
00095 //----------------------------------------------------------------------------
00096 // Macro, which must be used in every CDispBase-derived class declaration.
00097 //----------------------------------------------------------------------------
00098 #define DECLARE_IUNKNOWN_AND_IDISPATCH \
00099    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject)  \
00100    {  \
00101       return GetOuterUnknown()->QueryInterface(riid, ppvObject);  \
00102    }; \
00103    STDMETHOD_(ULONG, AddRef)()   \
00104    {  \
00105       return GetOuterUnknown()->AddRef(); \
00106    }; \
00107    STDMETHOD_(ULONG, Release)()  \
00108    {  \
00109       return GetOuterUnknown()->Release();   \
00110    }; \
00111    STDMETHOD (GetTypeInfoCount)(UINT *pctinfo)  \
00112    {  \
00113       return GetDispatch()->GetTypeInfoCount(pctinfo);   \
00114    }; \
00115    STDMETHOD (GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) \
00116    {  \
00117       return GetDispatch()->GetTypeInfo(iTInfo, lcid, ppTInfo);   \
00118    }; \
00119    STDMETHOD (GetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames,   \
00120       LCID lcid, DISPID *rgDispId)  \
00121    {  \
00122       return GetDispatch()->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId); \
00123    }; \
00124    STDMETHOD (Invoke)(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,  \
00125       DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)   \
00126    {  \
00127       return GetDispatch()->Invoke(dispidMember, riid, lcid, wFlags, pDispParams,   \
00128          pVarResult, pExcepInfo, puArgErr);  \
00129    };
00130
00131
00132 #endif // !defined(AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dlg.cpp File Reference

#include <bmws_dlg.h>
#include <bmws_error.h>
#include <bmws_window.h>

Go to the source code of this file.

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Variable Documentation

HINSTANCE g_hInst

Definition at line 20 of file bmws_dlg.cpp.

HINSTANCE g_hInstLC

Definition at line 21 of file bmws_dlg.cpp.

Referenced by CDlg::Run().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dlg.cpp Source File

bmws_dlg.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_dlg.cpp
00004 //    Class to encapsulate a generic dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_dlg.h>
00013 #include <bmws_error.h>
00014 #include <bmws_window.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Global and external variables
00019 //----------------------------------------------------------------------------
00020 extern HINSTANCE g_hInst;     // Application instance handle
00021 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CDlg constructor
00027 //
00028 // Parameters:
00029 //    uidDlg:        Resource identifier of the dialog box template.
00030 //
00031 //----------------------------------------------------------------------------
00032 CDlg::CDlg(UINT uidDlg)
00033 {
00034    m_uidDlg = uidDlg;
00035    m_hwndDlg = NULL;
00036 }
00037
00038
00039 //----------------------------------------------------------------------------
00040 //
00041 // Run function
00042 //    Displays the dialog box.
00043 //
00044 // Parameters:
00045 //    hWndParent:    Parent window handle for the dialog box.
00046 //
00047 // Returns:          The return value of the dialog box function.
00048 //
00049 //----------------------------------------------------------------------------
00050 int CDlg::Run(HWND hWndParent)
00051 {
00052    int i = DialogBoxParam(g_hInstLC, MAKEINTRESOURCE(m_uidDlg), hWndParent,
00053       (DLGPROC)BMWSDlgProc, (LPARAM)this);
00054    if(i == -1)
00055       THROW(new CWinExcep(GetLastError()), CWinExcep*);
00056    return i;
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 //
00062 // BMWSDlgProc function
00063 //    Callback function that handles messages to the dialog box.
00064 //
00065 // Parameters:
00066 //    hwndDlg:       The dialog box window handle.
00067 //    uMsg:          Message identifer.
00068 //    wParam:        Message-specific parameter.
00069 //    lParam:        Message-specific parameter.
00070 //
00071 // Returns:          TRUE if the message was handled, otherwise FALSE.
00072 //
00073 //----------------------------------------------------------------------------
00074 INT_PTR CALLBACK CDlg::BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
00075 {
00076    CDlg *pThis = (CDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00077
00078    try   // Windows-called code
00079    {
00080       if(uMsg == WM_INITDIALOG)
00081       {
00082          pThis = (CDlg*)lParam;
00083          SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00084          pThis->m_hwndDlg = hwndDlg;
00085
00086          CHWND::CenterWindow(hwndDlg);
00087          pThis->DlgProc(uMsg, wParam, lParam);
00088          return TRUE;
00089       }
00090       if(pThis)
00091          return pThis->DlgProc(uMsg, wParam, lParam);
00092    }
00093    catch(CExcep *pE)
00094    {
00095       pE->Report();
00096       pE->Delete();
00097       EndDialog(hwndDlg, IDCANCEL);
00098    }
00099    return FALSE;
00100 }
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dlg.h File Reference

Go to the source code of this file.

Compounds

class | CDlg

Defines

#define | AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Definition at line 10 of file bmws_dlg.h.

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dlg.h Source File

bmws_dlg.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_dlg.h
00004 //    Class to encapsulate a generic dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
00010 #define AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CDlg class
00020 //    Encapsulates a generic dialog box.
00021 //
00022 //----------------------------------------------------------------------------
00023 class CDlg
00024 {
00025 public:
00026    CDlg(UINT uidDlg);
00027    virtual ~CDlg() {}
00028
00029    int Run(HWND hWndParent);
00030    virtual INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
00031
00032    static INT_PTR CALLBACK BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
00033
00034 protected:
00035    HWND m_hwndDlg;   // Dialog window handle
00036    UINT m_uidDlg;    // Resource identifier of the dialog box template
00037 };
00038
00039
00040 #endif // !defined(AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dwordarray.h File Reference

#include <bmws_array.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef CArray< DWORD, DWORD > | CDWORDArray

Define Documentation

#define AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_dwordarray.h.

Typedef Documentation

typedef CArray<DWORD, DWORD> CDWORDArray

Definition at line 19 of file bmws_dwordarray.h.

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_dwordarray.h Source File

bmws_dwordarray.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_dwordarray.h
00004 //    Definition of to DWORD array type.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_array.h>
00017
00018
00019 typedef CArray<DWORD, DWORD> CDWORDArray;
00020
00021
00022 #endif // !defined(AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:49 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error.cpp File Reference

#include <bmws_common.h>
#include <bmws_error.h>

Go to the source code of this file.

Functions

void | InitErrorHandler ()
void | SetErrorInserts (LPTSTR lpszErrorIns, LPTSTR lpszRemedyIns)
void | HandleError (HWND hWnd, UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns, UINT_PTR uidRemedyIns, DWORD dwFlags)
void | EnsureAlloc (LPVOID p)
void | CheckHRCom (HRESULT hr)

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
TCHAR | g_szAppTitle [64]
TCHAR | g_szErrorHolder [256]
TCHAR | g_szErrorBuffer [1152]
TCHAR | g_szErrorError [512]
TCHAR | g_szErrorRemedy [384]
TCHAR | g_szErrorErrorIns [256]
TCHAR | g_szErrorRemedyIns [128]
BOOL | g_bFatalExit

Function Documentation

void CheckHRCom ( HRESULT hr )

Definition at line 207 of file bmws_error.cpp.

References THROW.

00208 {
00209    if(FAILED(hr))
00210    {
00211       if(hr == E_OUTOFMEMORY)
00212          THROW(g_pOOMExcep, COOMExcep*)
00213       else
00214          THROW(new CCOMExcep(hr), CCOMExcep*)
00215    }
00216 }

void EnsureAlloc ( LPVOID p )

Definition at line 185 of file bmws_error.cpp.

References THROW.

00186 {
00187    if(!p)
00188       THROW(g_pOOMExcep, COOMExcep*);
00189 }

void HandleError | ( | HWND | hWnd,
 |  | UINT | uidError,
 |  | UINT | uidRemedy,
 |  | UINT_PTR | uidErrorIns,
 |  | UINT_PTR | uidRemedyIns,
 |  | DWORD | dwFlags
 | ) |

Definition at line 99 of file bmws_error.cpp.

References ARRAYSIZE, ERROR_ERRORINS_INT, ERROR_ERRORINS_LPTSTR, ERROR_NOCLOSE, ERROR_REMEDYINS_INT, ERROR_REMEDYINS_LPTSTR, g_bFatalExit, g_hInstLC, g_szAppTitle, g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns, g_szErrorHolder, g_szErrorRemedy, and g_szErrorRemedyIns.

Referenced by CExcep::Report(), CExcepEx::Report(), COOMExcep::Report(), and CCOMExcep::Report().

00101 {
00102    if(g_bFatalExit)
00103       return;
00104    if(!IsWindow(hWnd))
00105 #ifdef BMWS_ERROR_DLL
00106       hWnd = GetFocus();
00107 #else
00108       hWnd = NULL;
00109 #endif
00110
00111    LoadString(g_hInstLC, uidError, g_szErrorError, ARRAYSIZE(g_szErrorError));
00112    LoadString(g_hInstLC, uidRemedy, g_szErrorRemedy, ARRAYSIZE(g_szErrorRemedy));
00113
00114    if(dwFlags & ERROR_ERRORINS_LPTSTR)
00115    {
00116       wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00117       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00118    } else if(uidErrorIns)
00119    {
00120       if(dwFlags & ERROR_ERRORINS_INT)
00121       {
00122          wsprintf(g_szErrorBuffer, g_szErrorError, (int)uidErrorIns);
00123       } else
00124       {
00125          LoadString(g_hInstLC, uidErrorIns, g_szErrorErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00126          wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00127       }
00128       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00129    }
00130
00131    if(dwFlags & ERROR_REMEDYINS_LPTSTR)
00132    {
00133       wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00134       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00135    } else if(uidRemedyIns)
00136    {
00137       if(dwFlags & ERROR_REMEDYINS_INT)
00138       {
00139          wsprintf(g_szErrorBuffer, g_szErrorRemedy, (int)uidRemedyIns);
00140       } else
00141       {
00142          LoadString(g_hInstLC, uidRemedyIns, g_szErrorRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00143          wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00144       }
00145       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00146    }
00147
00148 #ifdef _DEBUG
00149    if(dwFlags & ERROR_FIRSTCHANCE)
00150    {
00151       wsprintf(g_szErrorBuffer, g_szFirstChanceHolder, g_szErrorError, g_szErrorRemedy);
00152       if(MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_YESNO | MB_ICONHAND) == IDYES)
00153       {
00154          __asm { int 3 }
00155       }
00156    } else
00157    {
00158       wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00159       MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00160    }
00161    if(!(dwFlags & (ERROR_NOCLOSE | ERROR_FIRSTCHANCE)))
00162       g_bFatalExit = TRUE;
00163 #else
00164    wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00165    MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00166    if(!(dwFlags & ERROR_NOCLOSE))
00167       g_bFatalExit = TRUE;
00168 #endif
00169 }

void InitErrorHandler ( )

Definition at line 45 of file bmws_error.cpp.

References ARRAYSIZE, g_bFatalExit, g_hInstLC, g_szErrorHolder, and IDS_BMWS_ERROR_HOLDER.

Referenced by InitModule(), and CSolpackApp::Run().

00046 {
00047 #ifdef _DEBUG
00048    lstrcpyn(g_szFirstChanceHolder,
00049       TEXT("First-chance error:\n\n%s\n\n%s\n\nBreak to debugger?"),
00050       ARRAYSIZE(g_szFirstChanceHolder));
00051 #endif
00052    LoadString(g_hInstLC, IDS_BMWS_ERROR_HOLDER, g_szErrorHolder, ARRAYSIZE(g_szErrorHolder));
00053    g_bFatalExit = FALSE;
00054 }

void SetErrorInserts | ( | LPTSTR | lpszErrorIns,
 |  | LPTSTR | lpszRemedyIns
 | ) |

Definition at line 69 of file bmws_error.cpp.

References ARRAYSIZE, g_szErrorErrorIns, and g_szErrorRemedyIns.

Referenced by CExcepEx::CExcepEx(), and CWinExcep::CWinExcep().

00070 {
00071    if(lpszErrorIns)
00072       lstrcpyn(g_szErrorErrorIns, lpszErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00073    if(lpszRemedyIns)
00074       lstrcpyn(g_szErrorRemedyIns, lpszRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00075 }

Variable Documentation

BOOL g_bFatalExit

Definition at line 28 of file bmws_error.cpp.

Referenced by HandleError(), InitErrorHandler(), and CSolpackApp::Run().

HINSTANCE g_hInst

Definition at line 19 of file bmws_error.cpp.

HINSTANCE g_hInstLC

Definition at line 20 of file bmws_error.cpp.

Referenced by HandleError(), and InitErrorHandler().

TCHAR g_szAppTitle[64]

Definition at line 21 of file bmws_error.cpp.

Referenced by HandleError().

TCHAR g_szErrorBuffer[1152]

Definition at line 23 of file bmws_error.cpp.

Referenced by HandleError().

TCHAR g_szErrorError[512]

Definition at line 24 of file bmws_error.cpp.

Referenced by HandleError().

TCHAR g_szErrorErrorIns[256]

Definition at line 26 of file bmws_error.cpp.

Referenced by HandleError(), and SetErrorInserts().

TCHAR g_szErrorHolder[256]

Definition at line 22 of file bmws_error.cpp.

Referenced by HandleError(), and InitErrorHandler().

TCHAR g_szErrorRemedy[384]

Definition at line 25 of file bmws_error.cpp.

Referenced by HandleError().

TCHAR g_szErrorRemedyIns[128]

Definition at line 27 of file bmws_error.cpp.

Referenced by HandleError(), and SetErrorInserts().

Generated on Wed May 8 12:39:15 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error.cpp Source File

bmws_error.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_error.cpp
00004 //    Functions and classes to encapsulate error and exception handling.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_error.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 // Global and external variables
00018 //----------------------------------------------------------------------------
00019 extern HINSTANCE g_hInst;        // Application instance handle
00020 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00021 extern TCHAR g_szAppTitle[64];   // The title bar text
00022 TCHAR g_szErrorHolder[256];      // String to hold overall format string
00023 TCHAR g_szErrorBuffer[1152];     // String to hold final error message
00024 TCHAR g_szErrorError[512];       // String to hold error format string
00025 TCHAR g_szErrorRemedy[384];      // String to hold remedy format string
00026 TCHAR g_szErrorErrorIns[256];    // String to insert into error
00027 TCHAR g_szErrorRemedyIns[128];   // String to insert into remedy
00028 BOOL g_bFatalExit;               // Whether the application should shut down
00029
00030 #ifdef _DEBUG
00031 TCHAR g_szFirstChanceHolder[256];   // Holder for first-chance errors
00032 #endif
00033
00034
00035 //----------------------------------------------------------------------------
00036 //
00037 // InitErrorHandler function
00038 //    Initializes the global error strings.
00039 //
00040 // Parameters:       None.
00041 //
00042 // Returns:          None.
00043 //
00044 //----------------------------------------------------------------------------
00045 void InitErrorHandler()
00046 {
00047 #ifdef _DEBUG
00048    lstrcpyn(g_szFirstChanceHolder,
00049       TEXT("First-chance error:\n\n%s\n\n%s\n\nBreak to debugger?"),
00050       ARRAYSIZE(g_szFirstChanceHolder));
00051 #endif
00052    LoadString(g_hInstLC, IDS_BMWS_ERROR_HOLDER, g_szErrorHolder, ARRAYSIZE(g_szErrorHolder));
00053    g_bFatalExit = FALSE;
00054 }
00055
00056
00057 //----------------------------------------------------------------------------
00058 //
00059 // SetErrorInserts function
00060 //    Copies error and/or remedy strings to be used later by HandleError.
00061 //
00062 // Parameters:
00063 //    lpszErrorIns:  String to format into the error string.
00064 //    lpszRemedyIns: String to format into the remedy string.
00065 //
00066 // Returns:          None.
00067 //
00068 //----------------------------------------------------------------------------
00069 void SetErrorInserts(LPTSTR lpszErrorIns, LPTSTR lpszRemedyIns)
00070 {
00071    if(lpszErrorIns)
00072       lstrcpyn(g_szErrorErrorIns, lpszErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00073    if(lpszRemedyIns)
00074       lstrcpyn(g_szErrorRemedyIns, lpszRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00075 }
00076
00077
00078 //----------------------------------------------------------------------------
00079 //
00080 // HandleError function
00081 //    Displays a message box to the user, explaining the error and a possible
00082 //    remedy. By default, shuts down the application.
00083 //
00084 // Parameters:
00085 //    hWnd:          Parent window handle.
00086 //    uidError:      String resource identifier of the error that occurred.
00087 //    uidRemedy:     String resource identifier of what the user should do.
00088 //    uidErrorIns:   String resource identifier of what should be formatted
00089 //                   into the error string.
00090 //    uidRemedyIns:  String resource identifier of what should be formatted
00091 //                   into the remedy string.
00092 //    dwFlags:       Specifies whether the insert strings are resource
00093 //                   identifiers or existing string buffers. Also specifies
00094 //                   whether the application should not be shut down.
00095 //
00096 // Returns:          None.
00097 //
00098 //----------------------------------------------------------------------------
00099 void HandleError(HWND hWnd, UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns,
00100                  UINT_PTR uidRemedyIns, DWORD dwFlags)
00101 {
00102    if(g_bFatalExit)
00103       return;
00104    if(!IsWindow(hWnd))
00105 #ifdef BMWS_ERROR_DLL
00106       hWnd = GetFocus();
00107 #else
00108       hWnd = NULL;
00109 #endif
00110
00111    LoadString(g_hInstLC, uidError, g_szErrorError, ARRAYSIZE(g_szErrorError));
00112    LoadString(g_hInstLC, uidRemedy, g_szErrorRemedy, ARRAYSIZE(g_szErrorRemedy));
00113
00114    if(dwFlags & ERROR_ERRORINS_LPTSTR)
00115    {
00116       wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00117       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00118    } else if(uidErrorIns)
00119    {
00120       if(dwFlags & ERROR_ERRORINS_INT)
00121       {
00122          wsprintf(g_szErrorBuffer, g_szErrorError, (int)uidErrorIns);
00123       } else
00124       {
00125          LoadString(g_hInstLC, uidErrorIns, g_szErrorErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00126          wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00127       }
00128       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00129    }
00130
00131    if(dwFlags & ERROR_REMEDYINS_LPTSTR)
00132    {
00133       wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00134       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00135    } else if(uidRemedyIns)
00136    {
00137       if(dwFlags & ERROR_REMEDYINS_INT)
00138       {
00139          wsprintf(g_szErrorBuffer, g_szErrorRemedy, (int)uidRemedyIns);
00140       } else
00141       {
00142          LoadString(g_hInstLC, uidRemedyIns, g_szErrorRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00143          wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00144       }
00145       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00146    }
00147
00148 #ifdef _DEBUG
00149    if(dwFlags & ERROR_FIRSTCHANCE)
00150    {
00151       wsprintf(g_szErrorBuffer, g_szFirstChanceHolder, g_szErrorError, g_szErrorRemedy);
00152       if(MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_YESNO | MB_ICONHAND) == IDYES)
00153       {
00154          __asm { int 3 }
00155       }
00156    } else
00157    {
00158       wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00159       MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00160    }
00161    if(!(dwFlags & (ERROR_NOCLOSE | ERROR_FIRSTCHANCE)))
00162       g_bFatalExit = TRUE;
00163 #else
00164    wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00165    MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00166    if(!(dwFlags & ERROR_NOCLOSE))
00167       g_bFatalExit = TRUE;
00168 #endif
00169 }
00170
00171
00172 //----------------------------------------------------------------------------
00173 //
00174 // EnsureAlloc function
00175 //    Ensures that a pointer is non-null.
00176 //
00177 // Parameters:
00178 //    p:             The pointer to check.
00179 //
00180 // Returns:          None.
00181 //
00182 // Throws:           The out-of-memory exception object, if p is NULL.
00183 //
00184 //----------------------------------------------------------------------------
00185 void EnsureAlloc(LPVOID p)
00186 {
00187    if(!p)
00188       THROW(g_pOOMExcep, COOMExcep*);
00189 }
00190
00191
00192 //----------------------------------------------------------------------------
00193 //
00194 // CheckHRCom function
00195 //    Throws an exception based on a COM error code.
00196 //
00197 // Parameters:
00198 //    hr:            The error code to check.
00199 //
00200 // Returns:          None.
00201 //
00202 // Throws:           The out-of-memory exception object if hr is
00203 //                   E_OUTOFMEMORY, or a COM exception object if another hr is
00204 //                   another failure code.
00205 //
00206 //----------------------------------------------------------------------------
00207 void CheckHRCom(HRESULT hr)
00208 {
00209    if(FAILED(hr))
00210    {
00211       if(hr == E_OUTOFMEMORY)
00212          THROW(g_pOOMExcep, COOMExcep*)
00213       else
00214          THROW(new CCOMExcep(hr), CCOMExcep*)
00215    }
00216 }
00217
00218
00219 #ifdef BMWS_CHECKHRCOM2
00220
00221 //----------------------------------------------------------------------------
00222 //
00223 // CheckHRCom function
00224 //    Throws an exception based on a COM error code.
00225 //
00226 // Parameters:
00227 //    hr:            The error code to check.
00228 //    code:          An optional code to throw.
00229 //
00230 // Returns:          None.
00231 //
00232 // Throws:           The out-of-memory exception object if hr is
00233 //                   E_OUTOFMEMORY, or a COM exception object if another hr is
00234 //                   another failure code.
00235 //
00236 //----------------------------------------------------------------------------
00237 void CheckHRCom(HRESULT hr, int code)
00238 {
00239    if(FAILED(hr))
00240    {
00241       if(hr == E_OUTOFMEMORY)
00242          THROW(g_pOOMExcep, COOMExcep*);
00243       else
00244          THROW(new CCOMExcep2(hr, code), CCOMExcep2*);
00245    }
00246 }
00247
00248 #endif
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error.h File Reference

#include <bmws_error_res_lc.h>

Go to the source code of this file.

Compounds

class | CCOMExcep
class | CExcep
class | CExcepEx
class | COOMExcep
class | CWinExcep

Defines

#define | AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#define | ERROR_ERRORINS_LPTSTR 0x00000001
#define | ERROR_REMEDYINS_LPTSTR 0x00000002
#define | ERROR_NOCLOSE 0x00000004
#define | ERROR_ERRORINS_INT 0x00000008
#define | ERROR_REMEDYINS_INT 0x00000010
#define | CHECKHR(hr, code) { if(FAILED(hr)) { THROW(new CExcep(code), CExcep*); } }
#define | ENSUREALLOC(p) EnsureAlloc((LPVOID)p)
#define | CHECKFOROOM(hr) { if(hr == E_OUTOFMEMORY) { THROW(g_pOOMExcep, COOMExcep*); } }
#define | CHECKHRCOM(hr) CheckHRCom(hr)
#define | CHECKCOMOOM(p)
#define | RETHROWCOM(p) { (p)->Delete(); }
#define | CATCHOOM catch(COOMExcep *pE) { pE->Report(); return E_OUTOFMEMORY; }
#define | CATCHCOM catch(CCOMExcep *pE) { pE->Report(); HRESULT _hr = pE->m_hr; pE->Delete(); return _hr; }
#define | CATCHOTHER catch(CExcep *pE) { pE->Report(); pE->Delete(); return E_FAIL; }
#define | CATCHALL CATCHOOM CATCHCOM CATCHOTHER
#define | THROW(e, etype) { throw (e); }

Functions

void | InitErrorHandler ()
void | SetErrorInserts (LPTSTR lpszErrorIns, LPTSTR lpszRemedyIns)
void | HandleError (HWND hWnd, UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0)
void | EnsureAlloc (LPVOID p)
void | CheckHRCom (HRESULT hr)

Variables

HWND | g_hWnd
COOMExcep * g_pOOMExcep

Define Documentation

#define AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_error.h.

#define CATCHALL CATCHOOM CATCHCOM CATCHOTHER

Definition at line 70 of file bmws_error.h.

#define CATCHCOM catch(CCOMExcep *pE) { pE->Report(); HRESULT _hr = pE->m_hr; pE->Delete(); return _hr; }

Definition at line 68 of file bmws_error.h.

#define CATCHOOM catch(COOMExcep *pE) { pE->Report(); return E_OUTOFMEMORY; }

Definition at line 67 of file bmws_error.h.

#define CATCHOTHER catch(CExcep *pE) { pE->Report(); pE->Delete(); return E_FAIL; }

Definition at line 69 of file bmws_error.h.

#define CHECKCOMOOM ( p )

Definition at line 64 of file bmws_error.h.

Referenced by C3DShatter::DoAnimation().

#define CHECKFOROOM ( hr ) { if(hr == E_OUTOFMEMORY) { THROW(g_pOOMExcep, COOMExcep*); } }

Definition at line 57 of file bmws_error.h.

Referenced by CXMLDocument::LoadFromFile(), and CXMLDocument::SaveToFile().

#define CHECKHR | ( | hr,
 |  | code | ) | { if(FAILED(hr)) { THROW(new CExcep(code), CExcep*); } }

Definition at line 54 of file bmws_error.h.

#define CHECKHRCOM ( hr ) CheckHRCom(hr)

Definition at line 59 of file bmws_error.h.

Referenced by CXMLDocument::Abort(), CHTMLSelect::Add(), CGameCommandMgr::AddGameCommand(), CGameSpider::AdjustAfterSuccess(), CGameLaBelleLucie::AdjustSrcPile(), CXMLElement::AltAddChild(), CXMLElement::AltGetAttr(), CXMLElement::AltNumChildOf(), CXMLElement::AltSetVTAttr(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Assign(), CFragment::CancelAdditions(), CEngine::CancelDrag(), CHTMLHelper::CancelEvent(), CHTMLSelect::Changed(), CHTMLChk::Changed(), CGameSpider::CheckPile(), CHTMLChk::CHTMLChk(), CHTMLChooseColor::CHTMLChooseColor(), CHTMLEdit::CHTMLEdit(), CHTMLSelect::CHTMLSelect(), CGameCommandMgr::Clear(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::CPtr(), CMainWindow::Create(), CScriptFn::Create(), CGameBase::CreateDeck(), CHTMLHelper::CreateElement(), CXMLDocument::CreateRootElement(), CGameSpider::DealCard(), CEngine::DealGame(), CGameLaBelleLucie::DealRound(), CXMLElement::DeleteAttr(), CXMLElement::DeleteChild(), CPile::DoAction(), C3DShatter::DoAnimation(), CGameSpider::DoesCardFollow(), CGameCommand::Enable(), CHTMLLink::Enable(), CHTMLEnable::EnableHelper(), C3DShatter::EndAnimation(), CEngineObj::EventHandler(), CEngine::EventHandler(), CXMLDocument::EventHandler(), CHTMLEdit::EventHandler(), CGameMenu::FillGameInfo(), CHTMLHelper::FocusElement(), CFragment::FragToPile(), CPidl::Free(), CMainWindow::GameSelected(), CGameBase::GetCardFromData(), CHTMLChk::GetCheck(), CHTMLRadioGroup::GetChecked(), CHTMLHelper::GetEl(), CHTMLHelper::GetElTextWithEl(), CHTMLHelper::GetEvent(), CLibMgr::GetGame(), CLibMgr::GetGameInfo(), CGameBase::GetLongFromData(), CGameBase::GetMetrics(), CLibMgr::GetNumGames(), CXMLDocument::GetRootElement(), CHTMLHelper::GetRuleStyle(), CHTMLSelect::GetSelected(), CHTMLHelper::GetStyle(), CHTMLHelper::GetStyleSheet(), CXMLElement::GetTagName(), CXMLElement::GetText(), CEngine::HandleCommand(), CEngine::HandlePileClicked(), CEngine::HandleTryDrop(), CMainWindow::HTMLComplete(), CHelpPane::HTMLComplete(), CGameBase::IncrScore(), CGameMenuItem::Init(), CGameMenu::Init(), CGameCommand::Init(), CBrowserContainer::Init(), CCard::InitCard(), CFragment::InitFragment(), CPile::InitPile(), CXMLDocument::InitXMLDocument(), CGameLaBelleLucie::InternalAutoPlayCard(), CGameLaBelleLucie::IsCardPlayable(), CXMLDocument::LoadFromFile(), CEngine::MouseDown(), CEngine::MouseMove(), CEngine::MouseUp(), CFragment::MoveBy(), CHelpPane::OnCreatePane(), CFragment::PileToFrag(), CEngine::PlayGame(), CGameBase::PutCardInData(), CGameBase::PutLongInData(), CPile::ReceiveCards(), CDeck::ReclaimCards(), CLibMgr::Refresh(), CGameMenu::Refresh(), CSolpackApp::Register(), RegisterTLB(), CHTMLSelect::Remove(), CHTMLSelect::Replace(), CHTMLSelect::ResetChanged(), CHTMLChk::ResetChanged(), CSolpackApp::Run(), CGameLaBelleLucie::ScoreCard(), CPile::SetCardIndex(), CHTMLChk::SetCheck(), CHTMLRadioGroup::SetChecked(), CHTMLChooseColor::SetColor(), CHTMLHelper::SetElTextWithEl(), CEngineObj::SetEventHandlers(), CHelpPane::SetInstr(), CCard::SetPile(), CCard::SetPosition(), CHTMLSelect::SetSelected(), CXMLElement::SetStrAttr(), CXMLElement::SetText(), CHTMLHelper::ShowElement(), CEngine::StopPlayGame(), CEngine::TryCommand(), CPile::UndoAction(), CGameMenu::Uninit(), CBrowserContainer::Uninit(), CSolpackApp::Unregister(), CUserPrefs::UpdateAppearance(), CPile::UpdateBaseImg(), CPile::UpdateDims(), CCard::UpdateImg(), CMainWindow::UpdateInstr(), CGameSpider::UpdateLayout(), CGameLaBelleLucie::UpdateLayout(), CGameLaBelleLucie::UpdatePilePositions(), and CPile::UpdateTooltip().

#define ENSUREALLOC ( p ) EnsureAlloc((LPVOID)p)

Definition at line 56 of file bmws_error.h.

Referenced by CEngine::AddDeck(), CCompoundXMLDocument::AddFile(), CGameCommandMgr::AddGameCommand(), CHlinkWindowMgr::AddWnd(), CTSTR::Alloc(), CXMLElement::AltAddChild(), CXMLElement::AltChildOf(), CBSTR::Assign(), CTSTR::Assign(), CBSTR::AssignW(), Base64ToBinary(), BinaryToBase64(), C3DShatter::C3DShatter(), CheckForUpdate(), CHTMLChk::CHTMLChk(), CHTMLChooseColor::CHTMLChooseColor(), CHTMLEdit::CHTMLEdit(), CHTMLRadioGroup::CHTMLRadioGroup(), CHTMLSelect::CHTMLSelect(), CUndoMgr::ClearWorkingTurn(), CBSTR::CopyString(), CStatusBar::Create(), CScriptFn::Create(), CSolpackApp::CreateMainWindow(), CXMLDocument::CreateRootElement(), CAboutDlg::DlgProc(), CMainWindow::DoHelpPane(), CGameCommand::Enable(), CHTMLLink::Enable(), CCPSounds::FillPropPage(), CXMLDocument::GetRootElement(), CMainWindow::HTMLComplete(), CHelpPane::HTMLComplete(), CUndoMgr::Init(), CGameMenuItem::Init(), CGameMenu::Init(), CBrowserContainer::Init(), CDeck::InitDeck(), CEngine::InitEngine(), CGameLib::InitGameLib(), CXMLDocument::LoadFromFile(), CMainWindow::OnCreate(), CHelpPane::OnCreate(), CHelpPane::OnCreatePane(), CMainWindow::OptionStatusBar(), CEngine::PlayGame(), CUndoMgr::PushNewTurn(), CUndoMgr::RecordAction(), CGameMenu::Refresh(), RegistrationProc(), CSolpackApp::Run(), CEngineObj::SetEventHandlers(), and CUserPrefs::SetSite().

#define ERROR_ERRORINS_INT 0x00000008

Definition at line 44 of file bmws_error.h.

Referenced by CTSTR::Assign(), CMainWindow::Create(), HandleError(), HHInternalExcep(), CHelpPane::OnCreate(), CCOMExcep::Report(), CExcep::Report(), and CHelpPane::UpdateColors().

#define ERROR_ERRORINS_LPTSTR 0x00000001

Definition at line 41 of file bmws_error.h.

Referenced by CXMLElement::AltGetAttr(), CExcepEx::CExcepEx(), CHWND::CreateWindowEx(), CWinExcep::CWinExcep(), CHTMLHelper::GetEl(), HandleError(), and CHWND::RegisterWindowClass().

#define ERROR_NOCLOSE 0x00000004

Definition at line 43 of file bmws_error.h.

Referenced by CWinExcep::CWinExcep(), and HandleError().

#define ERROR_REMEDYINS_INT 0x00000010

Definition at line 45 of file bmws_error.h.

Referenced by HandleError().

#define ERROR_REMEDYINS_LPTSTR 0x00000002

Definition at line 42 of file bmws_error.h.

Referenced by CExcepEx::CExcepEx(), and HandleError().

#define RETHROWCOM ( p ) { (p)->Delete(); }

Definition at line 66 of file bmws_error.h.

Referenced by CXMLDocument::Abort(), CXMLElement::AltAddChild(), CXMLElement::AltGetAttr(), CXMLElement::AltNumChildOf(), CXMLElement::AltSetVTAttr(), CXMLDocument::CreateRootElement(), CXMLElement::DeleteAttr(), CXMLElement::DeleteChild(), CHTMLHelper::GetEl(), CXMLDocument::GetRootElement(), CXMLElement::GetTagName(), CXMLElement::GetText(), CXMLDocument::InitXMLDocument(), CXMLDocument::LoadFromFile(), CXMLElement::SetStrAttr(), and CXMLElement::SetText().

#define THROW | ( | e,
 |  | etype | ) | { throw (e); }

Definition at line 74 of file bmws_error.h.

Referenced by CXMLElement::AltGetAttr(), CTSTR::Assign(), Base64ToBinary(), BinaryToBase64(), CheckHRCom(), ChooseColorEx(), CMainWindow::Create(), CHWND::CreateWindowEx(), C3DShatter::DoAnimation(), CUserPrefs::DoOptions(), EnsureAlloc(), CHTMLHelper::GetEl(), CXMLDocument::GetRootElement(), CXMLElement::GetText(), HHInternalExcep(), CMainWindow::HTMLComplete(), CBrowserContainer::Init(), CXMLDocument::InitXMLDocument(), CXMLDocument::LoadFromFile(), MultiOFN(), CMainWindow::OnCreate(), CHelpPane::OnCreate(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator *(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator->(), CHWND::RegisterWindowClass(), CSolpackApp::Run(), CDlg::Run(), SingleOFN(), and CHelpPane::UpdateColors().

Function Documentation

void CheckHRCom ( HRESULT hr )

Definition at line 207 of file bmws_error.cpp.

References THROW.

00208 {
00209    if(FAILED(hr))
00210    {
00211       if(hr == E_OUTOFMEMORY)
00212          THROW(g_pOOMExcep, COOMExcep*)
00213       else
00214          THROW(new CCOMExcep(hr), CCOMExcep*)
00215    }
00216 }

void EnsureAlloc ( LPVOID p )

Definition at line 185 of file bmws_error.cpp.

References THROW.

00186 {
00187    if(!p)
00188       THROW(g_pOOMExcep, COOMExcep*);
00189 }

void HandleError | ( | HWND | hWnd,
 |  | UINT | uidError,
 |  | UINT | uidRemedy,
 |  | UINT_PTR | uidErrorIns = 0,
 |  | UINT_PTR | uidRemedyIns = 0,
 |  | DWORD | dwFlags = 0
 | ) |

Definition at line 99 of file bmws_error.cpp.

References ARRAYSIZE, ERROR_ERRORINS_INT, ERROR_ERRORINS_LPTSTR, ERROR_NOCLOSE, ERROR_REMEDYINS_INT, ERROR_REMEDYINS_LPTSTR, g_bFatalExit, g_hInstLC, g_szAppTitle, g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns, g_szErrorHolder, g_szErrorRemedy, and g_szErrorRemedyIns.

Referenced by CCOMExcep::Report(), COOMExcep::Report(), CExcepEx::Report(), and CExcep::Report().

00101 {
00102    if(g_bFatalExit)
00103       return;
00104    if(!IsWindow(hWnd))
00105 #ifdef BMWS_ERROR_DLL
00106       hWnd = GetFocus();
00107 #else
00108       hWnd = NULL;
00109 #endif
00110
00111    LoadString(g_hInstLC, uidError, g_szErrorError, ARRAYSIZE(g_szErrorError));
00112    LoadString(g_hInstLC, uidRemedy, g_szErrorRemedy, ARRAYSIZE(g_szErrorRemedy));
00113
00114    if(dwFlags & ERROR_ERRORINS_LPTSTR)
00115    {
00116       wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00117       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00118    } else if(uidErrorIns)
00119    {
00120       if(dwFlags & ERROR_ERRORINS_INT)
00121       {
00122          wsprintf(g_szErrorBuffer, g_szErrorError, (int)uidErrorIns);
00123       } else
00124       {
00125          LoadString(g_hInstLC, uidErrorIns, g_szErrorErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00126          wsprintf(g_szErrorBuffer, g_szErrorError, g_szErrorErrorIns);
00127       }
00128       lstrcpyn(g_szErrorError, g_szErrorBuffer, ARRAYSIZE(g_szErrorError));
00129    }
00130
00131    if(dwFlags & ERROR_REMEDYINS_LPTSTR)
00132    {
00133       wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00134       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00135    } else if(uidRemedyIns)
00136    {
00137       if(dwFlags & ERROR_REMEDYINS_INT)
00138       {
00139          wsprintf(g_szErrorBuffer, g_szErrorRemedy, (int)uidRemedyIns);
00140       } else
00141       {
00142          LoadString(g_hInstLC, uidRemedyIns, g_szErrorRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00143          wsprintf(g_szErrorBuffer, g_szErrorRemedy, g_szErrorRemedyIns);
00144       }
00145       lstrcpyn(g_szErrorRemedy, g_szErrorBuffer, ARRAYSIZE(g_szErrorRemedy));
00146    }
00147
00148 #ifdef _DEBUG
00149    if(dwFlags & ERROR_FIRSTCHANCE)
00150    {
00151       wsprintf(g_szErrorBuffer, g_szFirstChanceHolder, g_szErrorError, g_szErrorRemedy);
00152       if(MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_YESNO | MB_ICONHAND) == IDYES)
00153       {
00154          __asm { int 3 }
00155       }
00156    } else
00157    {
00158       wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00159       MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00160    }
00161    if(!(dwFlags & (ERROR_NOCLOSE | ERROR_FIRSTCHANCE)))
00162       g_bFatalExit = TRUE;
00163 #else
00164    wsprintf(g_szErrorBuffer, g_szErrorHolder, g_szErrorError, g_szErrorRemedy);
00165    MessageBox(hWnd, g_szErrorBuffer, g_szAppTitle, MB_OK | MB_ICONHAND);
00166    if(!(dwFlags & ERROR_NOCLOSE))
00167       g_bFatalExit = TRUE;
00168 #endif
00169 }

void InitErrorHandler ( )

Definition at line 45 of file bmws_error.cpp.

References ARRAYSIZE, g_bFatalExit, g_hInstLC, g_szErrorHolder, and IDS_BMWS_ERROR_HOLDER.

Referenced by InitModule(), and CSolpackApp::Run().

00046 {
00047 #ifdef _DEBUG
00048    lstrcpyn(g_szFirstChanceHolder,
00049       TEXT("First-chance error:\n\n%s\n\n%s\n\nBreak to debugger?"),
00050       ARRAYSIZE(g_szFirstChanceHolder));
00051 #endif
00052    LoadString(g_hInstLC, IDS_BMWS_ERROR_HOLDER, g_szErrorHolder, ARRAYSIZE(g_szErrorHolder));
00053    g_bFatalExit = FALSE;
00054 }

void SetErrorInserts | ( | LPTSTR | lpszErrorIns,
 |  | LPTSTR | lpszRemedyIns
 | ) |

Definition at line 69 of file bmws_error.cpp.

References ARRAYSIZE, g_szErrorErrorIns, and g_szErrorRemedyIns.

Referenced by CExcepEx::CExcepEx(), and CWinExcep::CWinExcep().

00070 {
00071    if(lpszErrorIns)
00072       lstrcpyn(g_szErrorErrorIns, lpszErrorIns, ARRAYSIZE(g_szErrorErrorIns));
00073    if(lpszRemedyIns)
00074       lstrcpyn(g_szErrorRemedyIns, lpszRemedyIns, ARRAYSIZE(g_szErrorRemedyIns));
00075 }

Variable Documentation

HWND g_hWnd

Definition at line 31 of file bmws_error.h.

Referenced by CCOMExcep::Report(), COOMExcep::Report(), CExcepEx::Report(), and CExcep::Report().

COOMExcep* g_pOOMExcep

Definition at line 32 of file bmws_error.h.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error.h Source File

bmws_error.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_error.h
00004 //    Functions and classes to encapsulate error and exception handling.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_error_res_lc.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Forward definition
00021 //----------------------------------------------------------------------------
00022 class COOMExcep;
00023 #ifdef _DEBUG
00024 class CExcep;
00025 #endif
00026
00027
00028 //----------------------------------------------------------------------------
00029 // External variables
00030 //----------------------------------------------------------------------------
00031 extern HWND g_hWnd;              // Main window handle
00032 extern COOMExcep *g_pOOMExcep;   // Out of memory exception object
00033 #ifdef BMWS_CHECKHRCOM2
00034 extern BOOL g_bFatalExit;        // Whether the application should shut down
00035 #endif
00036
00037
00038 //----------------------------------------------------------------------------
00039 // HandleError flags
00040 //----------------------------------------------------------------------------
00041 #define ERROR_ERRORINS_LPTSTR    0x00000001
00042 #define ERROR_REMEDYINS_LPTSTR   0x00000002
00043 #define ERROR_NOCLOSE            0x00000004
00044 #define ERROR_ERRORINS_INT       0x00000008
00045 #define ERROR_REMEDYINS_INT      0x00000010
00046 #ifdef _DEBUG
00047 #define ERROR_FIRSTCHANCE        0x80000000
00048 #endif
00049
00050
00051 //----------------------------------------------------------------------------
00052 // Error checking macros
00053 //----------------------------------------------------------------------------
00054 #define CHECKHR(hr, code) { if(FAILED(hr)) { THROW(new CExcep(code), CExcep*); } }
00055 //#define ENSUREALLOC(p)   { if(!(p)) { throw g_pOOMExcep; } }
00056 #define ENSUREALLOC(p) EnsureAlloc((LPVOID)p)
00057 #define CHECKFOROOM(hr) { if(hr == E_OUTOFMEMORY) { THROW(g_pOOMExcep, COOMExcep*); } }
00058 //#define CHECKHRCOM(hr) { HRESULT _hr = (hr); if(FAILED(_hr)) { throw new CCOMExcep(_hr); } }
00059 #define CHECKHRCOM(hr) CheckHRCom(hr)
00060 #ifdef BMWS_CHECKHRCOM2
00061 #define CHECKHRCOM2(hr,code) CheckHRCom(hr,code)
00062 #endif
00063 //#define CHECKCOMOOM(p) { if((p)->m_hr == E_OUTOFMEMORY) { (p)->Delete(); throw g_pOOMExcep; } }
00064 #define CHECKCOMOOM(p)
00065 //#define RETHROWCOM(p) { CHECKCOMOOM(p); (p)->Delete(); }
00066 #define RETHROWCOM(p) { (p)->Delete(); }
00067 #define CATCHOOM  catch(COOMExcep *pE) { pE->Report(); return E_OUTOFMEMORY; }
00068 #define CATCHCOM  catch(CCOMExcep *pE) { pE->Report(); HRESULT _hr = pE->m_hr; pE->Delete(); return _hr; }
00069 #define CATCHOTHER catch(CExcep *pE) { pE->Report(); pE->Delete(); return E_FAIL; }
00070 #define CATCHALL CATCHOOM CATCHCOM CATCHOTHER
00071 #ifdef _DEBUG
00072 #define THROW(e, etype) { etype _excep = (e); _excep->Report(TRUE); throw _excep; }
00073 #else
00074 #define THROW(e, etype) { throw (e); }
00075 #endif
00076
00077
00078 //----------------------------------------------------------------------------
00079 // BMWS_Error API functions
00080 //----------------------------------------------------------------------------
00081 void InitErrorHandler();
00082 void SetErrorInserts(LPTSTR lpszErrorIns, LPTSTR lpszRemedyIns);
00083 void HandleError(HWND hWnd, UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns = 0,
00084    UINT_PTR uidRemedyIns = 0, DWORD dwFlags = 0);
00085 void EnsureAlloc(LPVOID p);
00086 void CheckHRCom(HRESULT hr);
00087 #ifdef BMWS_CHECKHRCOM2
00088 void CheckHRCom(HRESULT hr, int code);
00089 #endif
00090 #ifdef _DEBUG
00091 //void ThrowExcep(CExcep *pE);
00092 #endif
00093
00094
00095 //----------------------------------------------------------------------------
00096 //
00097 // CExcep class
00098 //    Encapsulates exception handling.
00099 //
00100 //----------------------------------------------------------------------------
00101 class CExcep
00102 {
00103 public:
00104
00105    //-------------------------------------------------------------------------
00106    //
00107    // CExcep constructor
00108    //
00109    // Parameters:
00110    //    code:          The code identifying the exception or internal error.
00111    //    bDelete:       Whether to delete this exception object.
00112    //
00113    //-------------------------------------------------------------------------
00114    CExcep(int code, BOOL bDelete = TRUE)
00115    {
00116       m_code = code;
00117       m_bDelete = bDelete;
00118    }
00119
00120
00121    //-------------------------------------------------------------------------
00122    //
00123    // Report function
00124    //    Report the error to the user. Handles the error with the specified
00125    //    parameters.
00126    //
00127    // Parameters:
00128    //    bFirst:        Whether this is first-chance reporting. Defaults to
00129    //                   FALSE.
00130    //
00131    // Returns:          None.
00132    //
00133    //-------------------------------------------------------------------------
00134    virtual void Report(
00135 #ifdef _DEBUG
00136       BOOL bFirst = FALSE
00137 #endif
00138       )
00139    {
00140 #ifdef _DEBUG
00141       HandleError(g_hWnd, IDS_BMWS_ERROR_INTERNAL,
00142          IDS_BMWS_REMEDY_CONTACTBMWS, m_code, 0, ERROR_ERRORINS_INT |
00143          (bFirst? ERROR_FIRSTCHANCE : 0));
00144 #else
00145       HandleError(g_hWnd, IDS_BMWS_ERROR_INTERNAL,
00146          IDS_BMWS_REMEDY_CONTACTBMWS, m_code, 0, ERROR_ERRORINS_INT);
00147 #endif
00148    }
00149
00150
00151    //-------------------------------------------------------------------------
00152    //
00153    // Delete function
00154    //    Deletes the exception object, if it was specified to be deleted.
00155    //
00156    // Parameters:       None.
00157    //
00158    // Returns:          None.
00159    //
00160    //-------------------------------------------------------------------------
00161    void Delete()
00162    {
00163       if(m_bDelete)
00164          delete this;
00165    }
00166
00167
00168    int m_code;       // Exception error code
00169    BOOL m_bDelete;   // Whether to delete this exception.
00170 };
00171
00172
00173 //----------------------------------------------------------------------------
00174 //
00175 // CExcepEx class
00176 //    Encapsulates exception handling with advanced error handling.
00177 //
00178 //----------------------------------------------------------------------------
00179 class CExcepEx : public CExcep
00180 {
00181 public:
00182
00183    //-------------------------------------------------------------------------
00184    //
00185    // Default constructor
00186    //
00187    //-------------------------------------------------------------------------
00188    CExcepEx() : CExcep(0)
00189    {
00190    }
00191
00192
00193    //-------------------------------------------------------------------------
00194    //
00195    // Constructor
00196    //
00197    // Parameters:
00198    //    uidError:         String resource identifier of the error that
00199    //                      occurred.
00200    //    uidRemedy:        String resource identifier of what the user should
00201    //                      do.
00202    //    uidErrorIns:      String resource identifier or string that should be
00203    //                      formatted into the error string. Defaults to 0.
00204    //    uidRemedyIns:     String resource identifier or string that should be
00205    //                      formatted into the remedy string. Defaults to 0.
00206    //    dwFlags:          Specifies whether the insert strings are resource
00207    //                      identifiers or existing string buffers. Defaults to
00208    //                      0.
00209    //
00210    //----------------------------------------------------------------------------
00211    CExcepEx(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns = 0, UINT_PTR uidRemedyIns = 0,
00212       DWORD dwFlags = 0) : CExcep(uidError)
00213    {
00214       m_uidError = uidError;
00215       m_uidRemedy = uidRemedy;
00216       m_uidErrorIns = uidErrorIns;
00217       m_uidRemedyIns = uidRemedyIns;
00218       m_dwFlags = dwFlags;
00219       if(m_dwFlags & ERROR_ERRORINS_LPTSTR)
00220          SetErrorInserts((LPTSTR)uidErrorIns, NULL);
00221       if(m_dwFlags & ERROR_REMEDYINS_LPTSTR)
00222          SetErrorInserts((LPTSTR)uidRemedyIns, NULL);
00223    }
00224
00225
00226    virtual void Report(
00227 #ifdef _DEBUG
00228       BOOL bFirst = FALSE
00229 #endif
00230       )
00231    {
00232 #ifdef _DEBUG
00233       HandleError(g_hWnd, m_uidError, m_uidRemedy, m_uidErrorIns, m_uidRemedyIns, m_dwFlags |
00234          (bFirst ? ERROR_FIRSTCHANCE : 0));
00235 #else
00236       HandleError(g_hWnd, m_uidError, m_uidRemedy, m_uidErrorIns, m_uidRemedyIns, m_dwFlags);
00237 #endif
00238    }
00239
00240
00241    UINT m_uidError;           // Error that occurred
00242    UINT m_uidRemedy;          // What the user should do
00243    UINT_PTR m_uidErrorIns;    // String resource identifier or string to format into error
00244    UINT_PTR m_uidRemedyIns;   // String resource identifier or string to format into remedy
00245    DWORD m_dwFlags;           // HandleError flags
00246 };
00247
00248
00249 //----------------------------------------------------------------------------
00250 //
00251 // COOMExcep class
00252 //    Handles out of memory exceptions.
00253 //
00254 //----------------------------------------------------------------------------
00255 class COOMExcep : public CExcep
00256 {
00257 public:
00258
00259    //-------------------------------------------------------------------------
00260    //
00261    // Constructor
00262    //
00263    //-------------------------------------------------------------------------
00264    COOMExcep() : CExcep(IDS_BMWS_ERROR_OOM, FALSE)
00265    {
00266    }
00267
00268
00269    virtual void Report(
00270 #ifdef _DEBUG
00271       BOOL bFirst = FALSE
00272 #endif
00273       )
00274    {
00275 #ifdef _DEBUG
00276       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, 0, 0, bFirst ? ERROR_FIRSTCHANCE : 0);
00277 #else
00278       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART);
00279 #endif
00280    }
00281 };
00282
00283
00284 //----------------------------------------------------------------------------
00285 //
00286 // CCOMExcep class
00287 //    Handles COM error codes.
00288 //
00289 //----------------------------------------------------------------------------
00290 class CCOMExcep : public CExcep
00291 {
00292 public:
00293
00294    //-------------------------------------------------------------------------
00295    //
00296    // Constructor
00297    //
00298    // Parameters:
00299    //    hr:         The COM error code.
00300    //
00301    //-------------------------------------------------------------------------
00302    CCOMExcep(HRESULT hr) : CExcep(IDS_BMWS_ERROR_COMERROR)
00303    {
00304       m_hr = hr;
00305    }
00306
00307
00308    void Report(
00309 #ifdef _DEBUG
00310       BOOL bFirst = FALSE
00311 #endif
00312       )
00313    {
00314 #ifdef _DEBUG
00315       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, m_hr, 0, ERROR_ERRORINS_INT |
00316          (bFirst ? ERROR_FIRSTCHANCE : 0));
00317 #else
00318       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, m_hr, 0, ERROR_ERRORINS_INT);
00319 #endif
00320    }
00321
00322
00323    HRESULT m_hr;     // COM error code
00324 };
00325
00326
00327 #ifdef BMWS_CHECKHRCOM2
00328
00329 class CCOMExcep2 : public CCOMExcep
00330 {
00331 public:
00332
00333    //-------------------------------------------------------------------------
00334    //
00335    // Constructor
00336    //
00337    // Parameters:
00338    //    hr:         The COM error code.
00339    //    code:       An optional code to throw.
00340    //
00341    //-------------------------------------------------------------------------
00342    CCOMExcep2(HRESULT hr, int code) : CCOMExcep(hr)
00343    {
00344       m_optCode = code;
00345    }
00346
00347    void Report(
00348 #ifdef _DEBUG
00349       BOOL bFirst = FALSE
00350 #endif
00351       )
00352    {
00353       TCHAR sz[256];
00354       wsprintf(sz, TEXT("COM error %8.8X. Extra code %d."), m_hr, m_optCode);
00355       MessageBox(g_hWnd, sz, g_szAppTitle, MB_OK | MB_ICONHAND);
00356 #ifdef _DEBUG
00357       g_bFatalExit = !bFirst;
00358 #else
00359       g_bFatalExit = TRUE;
00360 #endif
00361    }
00362
00363    int m_optCode;    // optional code
00364 }
00365
00366 #endif
00367
00368
00369 //----------------------------------------------------------------------------
00370 //
00371 // CWinExcep class
00372 //    Encapsulates handling Windows errors.
00373 //
00374 //----------------------------------------------------------------------------
00375 class CWinExcep : public CExcepEx
00376 {
00377 public:
00378
00379    //-------------------------------------------------------------------------
00380    //
00381    // Constructor
00382    //
00383    // Parameters:
00384    //    dwError:    Win32 error code to report.
00385    //
00386    //-------------------------------------------------------------------------
00387    CWinExcep(DWORD dwError, UINT uidRemedy = IDS_BMWS_REMEDY_RESTART, BOOL bClose = TRUE)
00388    {
00389       LPVOID lpMsgBuf;
00390       FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
00391          FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
00392       m_uidError = IDS_BMWS_ERROR_SYSTEMHOLDER;
00393       m_uidRemedy = uidRemedy;
00394       m_uidErrorIns = (UINT_PTR)lpMsgBuf;
00395       m_uidRemedyIns = 0;
00396       m_dwFlags = ERROR_ERRORINS_LPTSTR | (!bClose ? ERROR_NOCLOSE : 0);
00397       SetErrorInserts((LPTSTR)lpMsgBuf, NULL);
00398       LocalFree(lpMsgBuf);
00399    }
00400 };
00401
00402
00403 #endif // !defined(AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_ERROR_HOLDER 19000
#define | IDS_BMWS_ERROR_INTERNAL 19001
#define | IDS_BMWS_ERROR_ACCEL 19002
#define | IDS_BMWS_ERROR_OLE 19003
#define | IDS_BMWS_ERROR_COMMCTRL 19004
#define | IDS_BMWS_ERROR_OOM 19005
#define | IDS_BMWS_ERROR_COMERROR 19006
#define | IDS_BMWS_ERROR_COMMDLG 19007
#define | IDS_BMWS_ERROR_SYSTEMHOLDER 19008
#define | IDS_BMWS_REMEDY_CONTACTBMWS 19051
#define | IDS_BMWS_REMEDY_RESTART 19052
#define | IDS_BMWS_REMEDY_REINSTALL 19053

Define Documentation

#define IDS_BMWS_ERROR_ACCEL 19002

Definition at line 7 of file bmws_error_res_lc.h.

Referenced by CMainWindow::Create().

#define IDS_BMWS_ERROR_COMERROR 19006

Definition at line 11 of file bmws_error_res_lc.h.

Referenced by CCOMExcep::CCOMExcep().

#define IDS_BMWS_ERROR_COMMCTRL 19004

Definition at line 9 of file bmws_error_res_lc.h.

Referenced by CMainWindow::OnCreate().

#define IDS_BMWS_ERROR_COMMDLG 19007

Definition at line 12 of file bmws_error_res_lc.h.

Referenced by ChooseColorEx(), MultiOFN(), and SingleOFN().

#define IDS_BMWS_ERROR_HOLDER 19000

Definition at line 5 of file bmws_error_res_lc.h.

Referenced by InitErrorHandler().

#define IDS_BMWS_ERROR_INTERNAL 19001

Definition at line 6 of file bmws_error_res_lc.h.

Referenced by CExcep::Report().

#define IDS_BMWS_ERROR_OLE 19003

Definition at line 8 of file bmws_error_res_lc.h.

Referenced by CSolpackApp::Run().

#define IDS_BMWS_ERROR_OOM 19005

Definition at line 10 of file bmws_error_res_lc.h.

Referenced by COOMExcep::COOMExcep().

#define IDS_BMWS_ERROR_SYSTEMHOLDER 19008

Definition at line 13 of file bmws_error_res_lc.h.

Referenced by CWinExcep::CWinExcep().

#define IDS_BMWS_REMEDY_CONTACTBMWS 19051

Definition at line 14 of file bmws_error_res_lc.h.

Referenced by CXMLDocument::GetRootElement(), HHInternalExcep(), and CExcep::Report().

#define IDS_BMWS_REMEDY_REINSTALL 19053

Definition at line 16 of file bmws_error_res_lc.h.

#define IDS_BMWS_REMEDY_RESTART 19052

Definition at line 15 of file bmws_error_res_lc.h.

Referenced by CXMLElement::AltGetAttr(), CTSTR::Assign(), ChooseColorEx(), CMainWindow::Create(), CHWND::CreateWindowEx(), CWinExcep::CWinExcep(), CHTMLHelper::GetEl(), CXMLElement::GetText(), MultiOFN(), CMainWindow::OnCreate(), CHelpPane::OnCreate(), CHWND::RegisterWindowClass(), CCOMExcep::Report(), COOMExcep::Report(), CSolpackApp::Run(), SingleOFN(), CCompoundXMLDocument::SpewFile(), and CHelpPane::UpdateColors().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_error_res_lc.h Source File

bmws_error_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_error_lc.rc
00004 //
00005 #define IDS_BMWS_ERROR_HOLDER           19000
00006 #define IDS_BMWS_ERROR_INTERNAL         19001
00007 #define IDS_BMWS_ERROR_ACCEL            19002
00008 #define IDS_BMWS_ERROR_OLE              19003
00009 #define IDS_BMWS_ERROR_COMMCTRL         19004
00010 #define IDS_BMWS_ERROR_OOM              19005
00011 #define IDS_BMWS_ERROR_COMERROR         19006
00012 #define IDS_BMWS_ERROR_COMMDLG          19007
00013 #define IDS_BMWS_ERROR_SYSTEMHOLDER     19008
00014 #define IDS_BMWS_REMEDY_CONTACTBMWS     19051
00015 #define IDS_BMWS_REMEDY_RESTART         19052
00016 #define IDS_BMWS_REMEDY_REINSTALL       19053
00017 #ifdef BMWS_ERROR_INCLUDEIE
00018 #define IDS_BMWS_REMEDY_IE              19054
00019 #endif
00020
00021 // Next default values for new objects
00022 //
00023 #ifdef APSTUDIO_INVOKED
00024 #ifndef APSTUDIO_READONLY_SYMBOLS
00025 #define _APS_NEXT_RESOURCE_VALUE        101
00026 #define _APS_NEXT_COMMAND_VALUE         40001
00027 #define _APS_NEXT_CONTROL_VALUE         1000
00028 #define _APS_NEXT_SYMED_VALUE           101
00029 #endif
00030 #endif
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventhandler.cpp File Reference

#include <bmws_eventhandler.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventhandler.cpp Source File

bmws_eventhandler.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_eventhandler.cpp
00004 //    Class to implement a generic event handler.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_eventhandler.h>
00013
00014
00015 #ifdef BMWS_TRACKMEMALLOC
00016
00017 //----------------------------------------------------------------------------
00018 // EventHandler object tracking
00019 //----------------------------------------------------------------------------
00020 int CEventHandler::m_scTotalCreated = 0;
00021 int CEventHandler::m_scTotalDeleted = 0;
00022
00023 #endif
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CEventHandler constructor
00029 //
00030 // Parameters:
00031 //    pSite:         Interface of the creator.
00032 //    dwEventID:     Event ID, used by the creator.
00033 //    lParam:        Parameter, used by the creator.
00034 //
00035 //----------------------------------------------------------------------------
00036 CEventHandler::CEventHandler(IEventHandlerSite *pSite, DWORD dwEventID, LPARAM lParam)
00037 {
00038    m_pSite = pSite;
00039    m_dwEventID = dwEventID;
00040    m_lParam = lParam;
00041    m_dwRefCount = 0;
00042 #ifdef BMWS_TRACKMEMALLOC
00043    m_scTotalCreated++;
00044 #endif
00045 }
00046
00047
00048 //----------------------------------------------------------------------------
00049 // IUnknown::QueryInterface method
00050 //----------------------------------------------------------------------------
00051 STDMETHODIMP CEventHandler::QueryInterface(REFIID riid, LPVOID *ppvObject)
00052 {
00053    if(!ppvObject)
00054       return E_POINTER;
00055
00056    if(IsEqualIID(riid, IID_IDispatch))
00057       *ppvObject = (IDispatch*)this;
00058    else if(IsEqualIID(riid, IID_IUnknown))
00059       *ppvObject = this;
00060    else
00061    {
00062       *ppvObject = NULL;
00063       return E_NOINTERFACE;
00064    }
00065
00066    AddRef();
00067    return S_OK;
00068 }
00069
00070
00071 //----------------------------------------------------------------------------
00072 // IUnknown::AddRef method
00073 //----------------------------------------------------------------------------
00074 ULONG CEventHandler::AddRef()
00075 {
00076    return ++m_dwRefCount;
00077 }
00078
00079
00080 //----------------------------------------------------------------------------
00081 // IUnknown::Release method
00082 //----------------------------------------------------------------------------
00083 ULONG CEventHandler::Release()
00084 {
00085    if(--m_dwRefCount)
00086       return m_dwRefCount;
00087
00088    delete this;
00089    return 0;
00090 }
00091
00092
00093 //----------------------------------------------------------------------------
00094 // IDispatch::GetIDsOfNames method
00095 //----------------------------------------------------------------------------
00096 STDMETHODIMP CEventHandler::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames,
00097                                           unsigned int cNames, LCID lcid, DISPID FAR* rgdispid)
00098 {
00099    return S_OK;
00100 }
00101
00102
00103 //----------------------------------------------------------------------------
00104 // IDispatch::GetTypeInfo method
00105 //----------------------------------------------------------------------------
00106 STDMETHODIMP CEventHandler::GetTypeInfo(unsigned int itinfo, LCID lcid,
00107                                         ITypeInfo FAR* FAR* pptinfo)
00108 {
00109    return E_NOTIMPL;
00110 }
00111
00112
00113 //----------------------------------------------------------------------------
00114 // IDispatch::GetTypeInfoCount method
00115 //----------------------------------------------------------------------------
00116 STDMETHODIMP CEventHandler::GetTypeInfoCount(unsigned int FAR * pctinfo)
00117 {
00118    return E_NOTIMPL;
00119 }
00120
00121
00122 //----------------------------------------------------------------------------
00123 //
00124 // IDispatch::Invoke method
00125 //    The event has occurred; call the handler function.
00126 //
00127 //----------------------------------------------------------------------------
00128 STDMETHODIMP CEventHandler::Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
00129                                    DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult,
00130                                    EXCEPINFO FAR * pexecinfo, unsigned int FAR *puArgErr)
00131 {
00132    if(m_pSite && (dispid == DISPID_VALUE))
00133       m_pSite->EventHandler(m_dwEventID, m_lParam);
00134
00135    return S_OK;
00136 }
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventhandler.h File Reference

#include <ocidl.h>

Go to the source code of this file.

Compounds

class | CEventHandler
class | IEventHandlerSite

Defines

#define | AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 10 of file bmws_eventhandler.h.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventhandler.h Source File

bmws_eventhandler.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_eventhandler.h
00004 //    Class to implement a generic event handler.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00010 #define AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <ocidl.h>
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // IEventHandlerSite abstract class
00026 //    Enables notification from an event handler.
00027 //
00028 //----------------------------------------------------------------------------
00029 class IEventHandlerSite
00030 {
00031 public:
00032    virtual void EventHandler(DWORD dwEventID, LPARAM lParam) = 0;
00033 };
00034
00035
00036 //----------------------------------------------------------------------------
00037 //
00038 // CEventHandler class
00039 //    Implements a generic event handler.
00040 //
00041 //----------------------------------------------------------------------------
00042 class CEventHandler : public IDispatch
00043 {
00044 public:
00045    CEventHandler(IEventHandlerSite *pSite, DWORD dwEventID, LPARAM lParam);
00046
00047 #ifdef BMWS_TRACKMEMALLOC
00048
00049    //-------------------------------------------------------------------------
00050    //
00051    // Destructor
00052    //
00053    //-------------------------------------------------------------------------
00054    virtual ~CEventHandler()
00055    {
00056       m_scTotalDeleted++;
00057    }
00058
00059 #endif
00060
00061    // IUnknown methods
00062    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject);
00063    STDMETHOD_(ULONG, AddRef)();
00064    STDMETHOD_(ULONG, Release)();
00065
00066    // IDispatch methods
00067    STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,  unsigned int cNames,
00068       LCID lcid, DISPID FAR* rgdispid);
00069    STDMETHOD (GetTypeInfo)(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
00070    STDMETHOD (GetTypeInfoCount)(unsigned int FAR * pctinfo);
00071    STDMETHOD (Invoke)(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
00072       DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, EXCEPINFO FAR * pexecinfo,
00073       unsigned int FAR *puArgErr);
00074
00075 #ifdef BMWS_TRACKMEMALLOC
00076    static int m_scTotalCreated;  // Total number of event handlers created
00077    static int m_scTotalDeleted;  // Total number of event handlers deleted
00078 #endif
00079
00080 protected:
00081    IEventHandlerSite *m_pSite;   // Interface of the creator
00082    DWORD m_dwRefCount;           // Object reference count
00083    DWORD m_dwEventID;            // Event ID, used by the creator
00084    LPARAM m_lParam;              // Parameter, used by the creator
00085 };
00086
00087
00088 #endif // !defined(AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventsink.cpp File Reference

#include <bmws_eventsink.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventsink.cpp Source File

bmws_eventsink.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_eventsink.cpp
00004 //    Class to implement a generic event sink.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_eventsink.h>
00013
00014
00015 #ifdef BMWS_TRACKMEMALLOC
00016
00017 //----------------------------------------------------------------------------
00018 // EventSink object tracking
00019 //----------------------------------------------------------------------------
00020 int CEventSink::m_scTotalCreated = 0;
00021 int CEventSink::m_scTotalDeleted = 0;
00022
00023 #endif
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CEventSink constructor
00029 //
00030 // Parameters:
00031 //    pSite:         Interface that handles when events are received.
00032 //    lParam:        Parameter, used by creator.
00033 //    pUnkSource:    The object to connect to.
00034 //    riid:          The desired outgoing interface identifier.
00035 //
00036 //----------------------------------------------------------------------------
00037 CEventSink::CEventSink(IEventSinkSite *pSite, LPARAM lParam, IUnknown *pUnkSource, REFIID riid)
00038 {
00039    m_dwCookie = 0;
00040    m_dwRefCount = 0;
00041    m_lParam = lParam;
00042    m_pSite = pSite;
00043    m_bConnected = FALSE;
00044    m_spUnkSource.Assign(pUnkSource);
00045    m_piid = (IID*)&riid;
00046
00047    IConnectionPoint *pcp = GetConnectionPoint();
00048    if(pcp)
00049    {
00050       m_bConnected = SUCCEEDED(pcp->Advise((IDispatch*)this, &m_dwCookie));
00051       SAFERELEASE(pcp);
00052    }
00053
00054 #ifdef BMWS_TRACKMEMALLOC
00055    m_scTotalCreated++;
00056 #endif
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 // IUnknown::QueryInterface method
00062 //----------------------------------------------------------------------------
00063 STDMETHODIMP CEventSink::QueryInterface(REFIID riid, LPVOID *ppvObject)
00064 {
00065    if(!ppvObject)
00066       return E_POINTER;
00067
00068    if(IsEqualIID(riid, *m_piid) || IsEqualIID(riid, IID_IDispatch))
00069       *ppvObject = (IDispatch*)this;
00070    else if(IsEqualIID(riid, IID_IUnknown))
00071       *ppvObject = this;
00072    else
00073    {
00074       *ppvObject = NULL;
00075       return E_NOINTERFACE;
00076    }
00077
00078    AddRef();
00079    return S_OK;
00080 }
00081
00082
00083 //----------------------------------------------------------------------------
00084 // IUnknown::AddRef method
00085 //----------------------------------------------------------------------------
00086 ULONG CEventSink::AddRef()
00087 {
00088    return ++m_dwRefCount;
00089 }
00090
00091
00092 //----------------------------------------------------------------------------
00093 // IUnknown::Release method
00094 //----------------------------------------------------------------------------
00095 ULONG CEventSink::Release()
00096 {
00097    if(--m_dwRefCount)
00098       return m_dwRefCount;
00099
00100    delete this;
00101    return 0;
00102 }
00103
00104
00105 //----------------------------------------------------------------------------
00106 // IDispatch::GetTypeInfoCount method
00107 //----------------------------------------------------------------------------
00108 STDMETHODIMP CEventSink::GetTypeInfoCount(unsigned int FAR* pctinfo)
00109 {
00110    return E_NOTIMPL;
00111 }
00112
00113
00114 //----------------------------------------------------------------------------
00115 // IDispatch::GetTypeInfo method
00116 //----------------------------------------------------------------------------
00117 STDMETHODIMP CEventSink::GetTypeInfo(unsigned int iTIinfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo)
00118 {
00119    return E_NOTIMPL;
00120 }
00121
00122
00123 //----------------------------------------------------------------------------
00124 // IDispatch::GetIDsOfNames method
00125 //----------------------------------------------------------------------------
00126 STDMETHODIMP CEventSink::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames,
00127                                        unsigned int cNames, LCID lcid, DISPID FAR* rgDispId)
00128 {
00129    return E_NOTIMPL;
00130 }
00131
00132
00133 //----------------------------------------------------------------------------
00134 // IDispatch::Invoke method
00135 //----------------------------------------------------------------------------
00136 STDMETHODIMP CEventSink::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00137                                 DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult,
00138                                 EXCEPINFO FAR * pExcepInfo, unsigned int FAR *puArgErr)
00139 {
00140    if(m_pSite)
00141       m_pSite->EventSink(m_lParam, dispIdMember, pDispParams);
00142    return S_OK;
00143 }
00144
00145
00146 //----------------------------------------------------------------------------
00147 //
00148 // Disconnect function
00149 //    Disconnects the sink from the source object.
00150 //
00151 // Parameters:       None.
00152 //
00153 // Returns:          None.
00154 //
00155 //----------------------------------------------------------------------------
00156 void CEventSink::Disconnect()
00157 {
00158    IConnectionPoint *pcp = GetConnectionPoint();
00159    AddRef();
00160    if(pcp)
00161    {
00162       pcp->Unadvise(m_dwCookie);
00163       SAFERELEASE(pcp);
00164       m_bConnected = FALSE;
00165    }
00166    Release();
00167 }
00168
00169
00170 //----------------------------------------------------------------------------
00171 //
00172 // GetConnectionPoint function
00173 //    Retrieves the connection point interface for the object's specified
00174 //    outgoing interface.
00175 //
00176 // Parameters:       None.
00177 //
00178 // Returns:          Pointer to the connection point.
00179 //
00180 //----------------------------------------------------------------------------
00181 IConnectionPoint* CEventSink::GetConnectionPoint()
00182 {
00183    if(!m_spUnkSource)
00184       return NULL;
00185
00186    IConnectionPointContainer *pcpc;
00187    IConnectionPoint *pcp = NULL;
00188
00189    if(SUCCEEDED(m_spUnkSource->QueryInterface(IID_IConnectionPointContainer, (LPVOID*)&pcpc)))
00190    {
00191       pcpc->FindConnectionPoint(*m_piid, &pcp);
00192       SAFERELEASE(pcpc);
00193    }
00194
00195    return pcp;
00196 }
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventsink.h File Reference

#include <bmws_ptr.h>
#include <ocidl.h>

Go to the source code of this file.

Compounds

class | CEventSink
class | IEventSinkSite

Defines

#define | AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 10 of file bmws_eventsink.h.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_eventsink.h Source File

bmws_eventsink.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_eventsink.h
00004 //    Class to implement a generic event sink.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00010 #define AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_ptr.h>
00021 #include <ocidl.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // IEventSinkSite abstract class
00027 //    Enables notification from an event sink.
00028 //
00029 //----------------------------------------------------------------------------
00030 class IEventSinkSite
00031 {
00032 public:
00033    virtual HRESULT EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams) = 0;
00034 };
00035
00036
00037 //----------------------------------------------------------------------------
00038 //
00039 // CEventSink class
00040 //    Implements a generic event sink.
00041 //
00042 //----------------------------------------------------------------------------
00043 class CEventSink : public IDispatch
00044 {
00045 public:
00046    CEventSink(IEventSinkSite *pSite, LPARAM lParam, IUnknown *pUnkSource, REFIID riid);
00047
00048 #ifdef BMWS_TRACKMEMALLOC
00049
00050    //----------------------------------------------------------------------------
00051    //
00052    // Destructor
00053    //
00054    //----------------------------------------------------------------------------
00055    virtual ~CEventSink()
00056    {
00057       m_scTotalDeleted++;
00058    }
00059
00060 #endif
00061
00062    // IUnknown methods
00063    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject);
00064    STDMETHOD_(ULONG, AddRef)();
00065    STDMETHOD_(ULONG, Release)();
00066
00067    // IDispatch methods
00068    STDMETHOD (GetTypeInfoCount)(unsigned int FAR* pctinfo);
00069    STDMETHOD (GetTypeInfo)(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo);
00070    STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,  unsigned int cNames,
00071       LCID lcid,  DISPID FAR* rgDispId);
00072    STDMETHOD (Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
00073       DISPPARAMS FAR *pDispParams, VARIANT FAR *pVarResult, EXCEPINFO FAR * pExcepInfo,
00074       unsigned int FAR *puArgErr);
00075
00076    void Disconnect();
00077
00078 #ifdef BMWS_TRACKMEMALLOC
00079    static int m_scTotalCreated;  // Total number of event sinks created
00080    static int m_scTotalDeleted;  // Total number of event sinks deleted
00081 #endif
00082
00083 protected:
00084    IConnectionPoint* GetConnectionPoint();
00085
00086    IEventSinkSite *m_pSite;      // Interface of the creator
00087    DWORD m_dwRefCount;           // Object reference count
00088    LPARAM m_lParam;              // Parameter, used by creator
00089    DWORD m_dwCookie;             // Identifier for this sink's advise connection
00090    BOOL m_bConnected;            // Whether the sink is currently connected
00091    CUnknownPtr m_spUnkSource;    // Object to connect to
00092    IID *m_piid;                  // The desired outgoing interface identifier
00093 };
00094
00095
00096 #endif // !defined(AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_formatdouble.cpp File Reference

#include <bmws_formatdouble.h>
#include <oleauto.h>

Go to the source code of this file.

Functions

CTSTR FormatDouble (double d)

Function Documentation

CTSTR FormatDouble ( double d )

Definition at line 27 of file bmws_formatdouble.cpp.

Referenced by CMainWindow::PresentUpdate().

00028 {
00029    long i = 0;
00030    VarI4FromR8(d*100, &i);
00031    CTSTR lpsz(TRUE, 8);
00032    if(i%100 == 0)
00033    {
00034       wsprintf(lpsz, TEXT("%d.%d"), i/100, i%100);
00035    } else if(i%10 == 0)
00036    {
00037       wsprintf(lpsz, TEXT("%d.%d"), i/100, (i%100)/10);
00038    } else
00039    {
00040       wsprintf(lpsz, TEXT("%d.%02d"), i/100, i%100);
00041    }
00042    return lpsz;
00043 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_formatdouble.cpp Source File

bmws_formatdouble.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_formatdouble.cpp
00004 //    Function to format a double into a string.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_formatdouble.h>
00013 #include <oleauto.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // FormatDouble function
00019 //    Formats a version number (double) into a string.
00020 //
00021 // Parameters:
00022 //    d:             Double to format.
00023 //
00024 // Returns:          String object containing the number.
00025 //
00026 //----------------------------------------------------------------------------
00027 CTSTR FormatDouble(double d)
00028 {
00029    long i = 0;
00030    VarI4FromR8(d*100, &i);
00031    CTSTR lpsz(TRUE, 8);
00032    if(i%100 == 0)
00033    {
00034       wsprintf(lpsz, TEXT("%d.%d"), i/100, i%100);
00035    } else if(i%10 == 0)
00036    {
00037       wsprintf(lpsz, TEXT("%d.%d"), i/100, (i%100)/10);
00038    } else
00039    {
00040       wsprintf(lpsz, TEXT("%d.%02d"), i/100, i%100);
00041    }
00042    return lpsz;
00043 }
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_formatdouble.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Functions

CTSTR FormatDouble (double d)

Function Documentation

CTSTR FormatDouble ( double d )

Definition at line 27 of file bmws_formatdouble.cpp.

Referenced by CMainWindow::PresentUpdate().

00028 {
00029    long i = 0;
00030    VarI4FromR8(d*100, &i);
00031    CTSTR lpsz(TRUE, 8);
00032    if(i%100 == 0)
00033    {
00034       wsprintf(lpsz, TEXT("%d.%d"), i/100, i%100);
00035    } else if(i%10 == 0)
00036    {
00037       wsprintf(lpsz, TEXT("%d.%d"), i/100, (i%100)/10);
00038    } else
00039    {
00040       wsprintf(lpsz, TEXT("%d.%02d"), i/100, i%100);
00041    }
00042    return lpsz;
00043 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_formatdouble.h Source File

bmws_formatdouble.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_formatdouble.h
00004 //    Function to format a double into a string.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_FORMATDOUBLE_H_
00010 #define __BMWS_FORMATDOUBLE_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_string.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // BMWS_FormatDouble API functions
00021 //----------------------------------------------------------------------------
00022 CTSTR FormatDouble(double d);
00023
00024
00025 #endif //__BMWS_FORMATDOUBLE_H_
Generated on Wed May 8 12:38:50 2002 for Solitaire Pack by doxygen 1.2.15


bmws_handle.h File Reference

Go to the source code of this file.

Compounds

class | CHandle

Defines

#define | AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef BOOL(WINAPI * | HANDLECLOSEFN )(HANDLE)

Define Documentation

#define AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_handle.h.

Typedef Documentation

typedef BOOL(WINAPI * HANDLECLOSEFN)(HANDLE)

Definition at line 16 of file bmws_handle.h.

Referenced by CHandle::Assign(), and CHandle::CHandle().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_handle.h Source File

bmws_handle.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_handle.h
00004 //    Class to encapsulate Win32 handles.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // HANDLECLOSEFN function type
00015 //----------------------------------------------------------------------------
00016 typedef BOOL (WINAPI *HANDLECLOSEFN)(HANDLE);
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CHandle class
00022 //    Encapsulates Win32 handles.
00023 //
00024 //----------------------------------------------------------------------------
00025 class CHandle
00026 {
00027 public:
00028
00029    //-------------------------------------------------------------------------
00030    //
00031    // Default Constructor
00032    //
00033    // Parameters:    None.
00034    //
00035    //-------------------------------------------------------------------------
00036    CHandle()
00037    {
00038       m_h = INVALID_HANDLE_VALUE;
00039       m_pfnClose = NULL;
00040    }
00041
00042
00043    //-------------------------------------------------------------------------
00044    //
00045    // Constructor
00046    //
00047    // Parameters:
00048    //    h:          Handle to encapsulate with this object.
00049    //    pfnClose:   Function to call to close the handle.
00050    //
00051    //-------------------------------------------------------------------------
00052    CHandle(HANDLE h, HANDLECLOSEFN pfnClose)
00053    {
00054       m_h = h;
00055       m_pfnClose = pfnClose;
00056    }
00057
00058
00059    //-------------------------------------------------------------------------
00060    //
00061    // Destructor
00062    //
00063    //-------------------------------------------------------------------------
00064    ~CHandle()
00065    {
00066       Close();
00067    }
00068
00069
00070    //-------------------------------------------------------------------------
00071    //
00072    // HANDLE operator
00073    //
00074    // Parameters:    None.
00075    //
00076    // Returns:       The handle.
00077    //
00078    //-------------------------------------------------------------------------
00079    operator HANDLE() const
00080    {
00081       return m_h;
00082    }
00083
00084
00085    //-------------------------------------------------------------------------
00086    //
00087    // Assign function
00088    //
00089    // Parameters:
00090    //    h:          Handle to encapsulate with this object.
00091    //    pfnClose:   Function to call to close the handle. If NULL, the
00092    //                previous function is maintained.
00093    //
00094    //-------------------------------------------------------------------------
00095    void Assign(HANDLE h, HANDLECLOSEFN pfnClose = NULL)
00096    {
00097       Close();
00098       m_h = h;
00099       if(pfnClose)
00100          m_pfnClose = pfnClose;
00101    }
00102
00103
00104    //-------------------------------------------------------------------------
00105    //
00106    // Close function
00107    //    Closes the handle.
00108    //
00109    // Parameters:    None.
00110    //
00111    // Returns:       None.
00112    //
00113    //-------------------------------------------------------------------------
00114    void Close()
00115    {
00116       if(m_h != INVALID_HANDLE_VALUE)
00117       {
00118          if(m_pfnClose)
00119             m_pfnClose(m_h);
00120          m_h = INVALID_HANDLE_VALUE;
00121       }
00122    }
00123
00124
00125 private:
00126    HANDLE m_h;                // Handle
00127    HANDLECLOSEFN m_pfnClose;  // Function to call to close handle
00128 };
00129
00130
00131 #endif // !defined(AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr.cpp File Reference

#include <bmws_common.h>
#include <bmws_helpmgr.h>
#include <bmws_string.h>
#include <bmws_helpmgr_res.h>
#include <shlwapi.h>
#include <htmlhelp.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr.cpp Source File

bmws_helpmgr.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_helmgr.cpp
00004 //    Class to assist in displaying help files and context-sensitive help.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_helpmgr.h>
00014 #include <bmws_string.h>
00015 #include <bmws_helpmgr_res.h>
00016 #include <shlwapi.h>
00017 #include <htmlhelp.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // CHelpMgr constructor
00023 //
00024 // Parameters:
00025 //    uidHelpFile:      String resource identifier of the compiled help file.
00026 //    uidDefPopupFile:  String resource identifier of the default popup help
00027 //                      text file.
00028 //
00029 //----------------------------------------------------------------------------
00030 CHelpMgr::CHelpMgr(UINT uidHelpFile, UINT uidDefPopupFile)
00031 {
00032    CTSTR lpszTemp(uidHelpFile);
00033    m_lpszFileName.Alloc(MAX_PATH);
00034    GetModuleFileName(NULL, m_lpszFileName, MAX_PATH);
00035    PathRemoveFileSpec(m_lpszFileName);
00036    PathAppend(m_lpszFileName, lpszTemp);
00037    m_lpszDefPopupFile.Assign(uidDefPopupFile);
00038    m_lpszPopupHolder.Assign(IDS_BMWS_HELPMGR_POPUPHOLDER);
00039    m_bOpened = FALSE;
00040 }
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CHelpMgr destructor
00046 //
00047 //----------------------------------------------------------------------------
00048 CHelpMgr::~CHelpMgr()
00049 {
00050    if(m_bOpened)
00051       HtmlHelp(NULL, NULL, HH_CLOSE_ALL, 0);
00052 }
00053
00054
00055 //----------------------------------------------------------------------------
00056 //
00057 // ShowPopup function
00058 //    Displays the HTML help file.
00059 //
00060 // Parameters:       None.
00061 //    hWnd:          Window handle to pass to HtmlHelp.
00062 //    lpszTopic:     The file name of the topic to display. Defaults to NULL.
00063 //
00064 // Returns:          None.
00065 //
00066 //----------------------------------------------------------------------------
00067 void CHelpMgr::ShowHelp(HWND hWnd, LPTSTR lpszTopic)
00068 {
00069    HtmlHelp(hWnd, m_lpszFileName, HH_DISPLAY_TOPIC, (DWORD_PTR)lpszTopic);
00070    m_bOpened = TRUE;
00071 }
00072
00073
00074 //----------------------------------------------------------------------------
00075 //
00076 // ShowPopup function
00077 //    Presents popup help for a specific control.
00078 //
00079 // Parameters:
00080 //    hWnd:          Window handle to pass to HtmlHelp.
00081 //    lpszPopupFile: String containing the file name of the popup texts in the
00082 //                   chm file.
00083 //    adwIDs:        Array of pairs of control IDs and help IDs.
00084 //    uMsg:          Window message which needs to be handled.
00085 //
00086 // Returns:          None.
00087 //
00088 //----------------------------------------------------------------------------
00089 void CHelpMgr::ShowPopup(HWND hWnd, CTSTR& lpszPopupFile, DWORD *adwIDs, UINT uMsg)
00090 {
00091    CTSTR& rlpszPopupFile = (lpszPopupFile ? lpszPopupFile : m_lpszDefPopupFile);
00092    CTSTR lpszTotal(TRUE, lstrlen(m_lpszFileName) + lstrlen(rlpszPopupFile) +
00093       lstrlen(m_lpszPopupHolder) + 1);
00094    wsprintf(lpszTotal, m_lpszPopupHolder, m_lpszFileName, rlpszPopupFile);
00095    HtmlHelp(hWnd, lpszTotal, (uMsg == WM_CONTEXTMENU ? HH_TP_HELP_CONTEXTMENU :
00096       HH_TP_HELP_WM_HELP), (DWORD)adwIDs);
00097    m_bOpened = TRUE;
00098 }
00099
00100
00101 //----------------------------------------------------------------------------
00102 //
00103 // DialogCSHelp function
00104 //    Processes a dialog box WM_CONTEXTMENU or WM_HELP message by calling
00105 //    ShowPopup as appropriate.
00106 //
00107 // Parameters:
00108 //    hwndDlg:       Window handle of the dialog box.
00109 //    uMsg:          Message identifer.
00110 //    wParam:        Message-specific parameter.
00111 //    lParam:        Message-specific parameter.
00112 //    lpszPopupFile: String containing the file name of the popup texts in the
00113 //                   chm file.
00114 //    adwIDs:        Array of pairs of control IDs and help IDs.
00115 //
00116 // Returns:          None.
00117 //
00118 //----------------------------------------------------------------------------
00119 void CHelpMgr::DialogCSHelp(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam,
00120                             CTSTR& lpszPopupFile, DWORD *adwIDs)
00121 {
00122    if((uMsg == WM_HELP) && (LOWORD(((LPHELPINFO)lParam)->iCtrlId) == 0xffff))
00123       return;
00124    HWND hItem = (uMsg == WM_HELP ? (HWND)((LPHELPINFO)lParam)->hItemHandle : (HWND)wParam);
00125    if(hItem != hwndDlg)
00126       ShowPopup(hItem, lpszPopupFile, adwIDs, uMsg);
00127 }
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Compounds

class CHelpMgr

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr.h Source File

bmws_helpmgr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_helpmgr.h
00004 //    Class to assist in displaying help files and context-sensitive help.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008 #ifndef __BMWS_HELPMGR_H_
00009 #define __BMWS_HELPMGR_H_
00010
00011
00012 //----------------------------------------------------------------------------
00013 // Includes
00014 //----------------------------------------------------------------------------
00015 #include <bmws_string.h>
00016
00017
00018 //----------------------------------------------------------------------------
00019 //
00020 // CHelpMgr class
00021 //    Assists in displaying help files and context-sensitive help.
00022 //
00023 //----------------------------------------------------------------------------
00024 class CHelpMgr
00025 {
00026 public:
00027    CHelpMgr(UINT uidHelpFile, UINT uidDefPopupFile);
00028    virtual ~CHelpMgr();
00029
00030    void ShowHelp(HWND hWnd, LPTSTR lpszTopic = NULL);
00031    void ShowPopup(HWND hWnd, CTSTR& lpszPopupFile, DWORD *adwIDs, UINT uMsg);
00032    void DialogCSHelp(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam,
00033       CTSTR& lpszPopupFile, DWORD *adwIDs);
00034
00035 protected:
00036    CTSTR m_lpszPopupHolder;   // String used to format popup text locations
00037    CTSTR m_lpszFileName;      // The help file name
00038    CTSTR m_lpszDefPopupFile;  // The default popup file name
00039    BOOL m_bOpened;            // Whether help has been opened
00040 };
00041
00042
00043 #endif //__BMWS_HELPMGR_H_
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_HELPMGR_POPUPHOLDER 8801

Define Documentation

#define IDS_BMWS_HELPMGR_POPUPHOLDER 8801

Definition at line 5 of file bmws_helpmgr_res.h.

Referenced by CHelpMgr::CHelpMgr().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_helpmgr_res.h Source File

bmws_helpmgr_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_helpmgr.rc
00004 //
00005 #define IDS_BMWS_HELPMGR_POPUPHOLDER    8801
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink.cpp File Reference

#include <bmws_hlink.h>
#include <shellapi.h>
#include <bmws_hlink_res.h>

Go to the source code of this file.

Functions

HRESULT | ExecURL (CTSTR &lpszUrl)

Variables

HINSTANCE | g_hInst

Function Documentation

HRESULT ExecURL ( CTSTR & lpszUrl )

Definition at line 351 of file bmws_hlink.cpp.

Referenced by CHlinkWindow::Execute(), and CRegDlgInfo::HlinkClicked().

00352 {
00353    if(!lpszUrl)
00354       return E_INVALIDARG;
00355
00356    HINSTANCE result = ShellExecute(NULL, TEXT("open"), lpszUrl, NULL, NULL, SW_SHOW);
00357
00358    if((UINT)result <= HINSTANCE_ERROR)
00359       return E_FAIL;
00360
00361    return S_OK;
00362 }

Variable Documentation

HINSTANCE g_hInst

Definition at line 20 of file bmws_hlink.cpp.

Referenced by CHlinkWindowMgr::CHlinkWindowMgr().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink.cpp Source File

bmws_hlink.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_hlink.cpp
00004 //    Class to encapsulate hyperlink text owner-drawn button controls.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_hlink.h>
00013 #include <shellapi.h>
00014 #include <bmws_hlink_res.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 // External variables
00019 //----------------------------------------------------------------------------
00020 extern HINSTANCE g_hInst;     // Application instance handle
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CHlinkWindow constructor
00026 //
00027 // Parameters:
00028 //    hWnd:          The button window handle.
00029 //    lpszUrl:       URL to navigate to.
00030 //
00031 //----------------------------------------------------------------------------
00032 CHlinkWindow::CHlinkWindow(HWND hWnd, CTSTR& lpszUrl)
00033 {
00034    _ASSERT(hWnd);
00035    m_pSite = NULL;
00036    m_lpszUrl = lpszUrl;
00037    CommonSetup(hWnd);
00038 }
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // CHlinkWindow constructor
00044 //
00045 // Parameters:
00046 //    hWnd:          The button window handle.
00047 //    pSite:         Interface to handle clicking on the link.
00048 //    dwID:          ID for this hyperlink.
00049 //
00050 //----------------------------------------------------------------------------
00051 CHlinkWindow::CHlinkWindow(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID)
00052 {
00053    _ASSERT(hWnd);
00054    m_pSite = pSite;
00055    m_dwID = dwID;
00056    CommonSetup(hWnd);
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 //
00062 // CHlinkWindow destructor
00063 //
00064 //----------------------------------------------------------------------------
00065 CHlinkWindow::~CHlinkWindow()
00066 {
00067    if(m_hFont)
00068       DeleteObject(m_hFont);
00069 }
00070
00071
00072 //----------------------------------------------------------------------------
00073 //
00074 // Paint function
00075 //    Draws the URL text on the screen.
00076 //
00077 // Parameters:
00078 //    lpdis:         Pointer containing information about the drawing
00079 //                   operation.
00080 //    color:         Color to draw the text in.
00081 //
00082 // Returns:          None.
00083 //
00084 //----------------------------------------------------------------------------
00085 void CHlinkWindow::Paint(LPDRAWITEMSTRUCT lpdis, COLORREF color)
00086 {
00087    if((lpdis->itemAction & ODA_DRAWENTIRE) || (lpdis->itemAction & ODA_SELECT))
00088    {
00089       int iLen = GetWindowTextLength(m_hWnd) + 1;
00090       CTSTR lpszText(TRUE, iLen);
00091       GetWindowText(m_hWnd, lpszText, iLen);
00092       SetTextColor(lpdis->hDC, color);
00093       SetBkMode(lpdis->hDC, TRANSPARENT);
00094       DrawText(lpdis->hDC, lpszText, -1, &lpdis->rcItem, DT_CENTER | DT_VCENTER |
00095          DT_SINGLELINE);
00096    }
00097    if((lpdis->itemAction & ODA_FOCUS) || (lpdis->itemState & ODS_FOCUS))
00098       DrawFocusRect(lpdis->hDC, &lpdis->rcItem);
00099 }
00100
00101
00102 //----------------------------------------------------------------------------
00103 //
00104 // Execute function
00105 //    Called when the link has been activated (i.e., clicked on). Invokes the
00106 //    URL or calls the site.
00107 //
00108 // Parameters:       None.
00109 //
00110 // Returns:          None.
00111 //
00112 //----------------------------------------------------------------------------
00113 void CHlinkWindow::Execute()
00114 {
00115    if(m_pSite)
00116       m_pSite->HlinkClicked(m_dwID);
00117    else
00118       ExecURL(m_lpszUrl);
00119 }
00120
00121
00122
00123 //----------------------------------------------------------------------------
00124 //
00125 // CommonSetup function
00126 //    Called from constructors to create the font and position the window.
00127 //
00128 // Parameters:
00129 //    hWnd:          The button window handle.
00130 //
00131 // Returns:          None.
00132 //
00133 //----------------------------------------------------------------------------
00134 void CHlinkWindow::CommonSetup(HWND hWnd)
00135 {
00136    m_hWnd = hWnd;
00137    HFONT hFont = (HFONT)SendMessage(m_hWnd, WM_GETFONT, 0, 0);
00138    LOGFONT lf;
00139    GetObject(hFont, sizeof(LOGFONT), &lf);
00140    lf.lfUnderline = TRUE;
00141    m_hFont = CreateFontIndirect(&lf);
00142    SendMessage(m_hWnd, WM_SETFONT, (WPARAM)m_hFont, TRUE);
00143
00144    // Get the current window position
00145    RECT rc;
00146    GetWindowRect(m_hWnd, &rc);
00147
00148    HWND hWndParent = GetParent(m_hWnd);
00149    if(hWndParent)
00150    {
00151       ScreenToClient(hWndParent, (LPPOINT)&rc);
00152       ScreenToClient(hWndParent, ((LPPOINT)&rc)+1);
00153    }
00154
00155    // Get the size of the window text
00156    int iLength = GetWindowTextLength(m_hWnd) + 1;
00157    CTSTR lpszWndText(TRUE, iLength);
00158    GetWindowText(m_hWnd, lpszWndText, iLength);
00159
00160    HDC hdc = GetDC(m_hWnd);
00161    HFONT hFontOld = (HFONT)SelectObject(hdc, m_hFont);
00162    SIZE sizeText;
00163    GetTextExtentPoint32(hdc, lpszWndText, iLength, &sizeText);
00164    SelectObject(hdc, hFontOld);
00165    ReleaseDC(m_hWnd, hdc);
00166
00167    // Get the text justification via the window style
00168    DWORD dwStyle = GetWindowLong(m_hWnd, GWL_STYLE);
00169
00170    // Recalc the window size and position based on the text justification
00171    if((dwStyle & BS_VCENTER) == BS_VCENTER)
00172       InflateRect(&rc, 0, -((rc.bottom - rc.top) - sizeText.cy)/2);
00173    else
00174       rc.bottom = rc.top + sizeText.cy;
00175
00176    if((dwStyle & BS_CENTER) == BS_CENTER)
00177       InflateRect(&rc, -((rc.right - rc.left) - sizeText.cx)/2, 0);
00178    else if((dwStyle & BS_RIGHT) == BS_RIGHT)
00179       rc.left = rc.right - sizeText.cx;
00180    else // SS_LEFT = 0, so we can't test for it explicitly
00181       rc.right = rc.left + sizeText.cx;
00182
00183    InflateRect(&rc, 1, 2);
00184
00185    // Move the window
00186    SetWindowPos(m_hWnd, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
00187       SWP_NOZORDER);
00188 }
00189
00190
00191 //----------------------------------------------------------------------------
00192 //
00193 // CHlinkWindowMgr constructor
00194 //
00195 // Parameters:
00196 //    cWnds:         Number of windows that will be managed.
00197 //    color:         Color that the links should be drawn in.
00198 //
00199 //----------------------------------------------------------------------------
00200 CHlinkWindowMgr::CHlinkWindowMgr(UINT cWnds, COLORREF color)
00201 {
00202    m_aHlinks.SetSize(cWnds);
00203    m_hCur = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_BMWS_HLINK_HANDCUR));
00204    m_color = color;
00205    m_cWnds = 0;
00206 }
00207
00208
00209 //----------------------------------------------------------------------------
00210 //
00211 // CHlinkWindowMgr destructor
00212 //
00213 //----------------------------------------------------------------------------
00214 CHlinkWindowMgr::~CHlinkWindowMgr()
00215 {
00216    if(m_hCur)
00217       DestroyCursor(m_hCur);
00218 }
00219
00220
00221 //----------------------------------------------------------------------------
00222 //
00223 // AddWnd function
00224 //    Creates a new CHlinkWindow object for a specified window handle.
00225 //
00226 // Parameters:
00227 //    hWnd:          The button window handle.
00228 //    lpszUrl:       URL to navigate to.
00229 //
00230 // Returns:          None.
00231 //
00232 //----------------------------------------------------------------------------
00233 void CHlinkWindowMgr::AddWnd(HWND hWnd, CTSTR& lpszUrl)
00234 {
00235    CHlinkWindow *pNew = new CHlinkWindow(hWnd, lpszUrl);
00236    ENSUREALLOC(pNew);
00237    m_aHlinks.SetAt(m_cWnds, pNew);
00238    m_cWnds++;
00239 }
00240
00241
00242 //----------------------------------------------------------------------------
00243 //
00244 // AddWnd function
00245 //    Creates a new CHlinkWindow object for a specified window handle.
00246 //
00247 // Parameters:
00248 //    hWnd:          The button window handle.
00249 //    pSite:         Interface to handle clicking on the link.
00250 //    dwID:          ID for this hyperlink.
00251 //
00252 // Returns:          None.
00253 //
00254 //----------------------------------------------------------------------------
00255 void CHlinkWindowMgr::AddWnd(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID)
00256 {
00257    CHlinkWindow *pNew = new CHlinkWindow(hWnd, pSite, dwID);
00258    ENSUREALLOC(pNew);
00259    m_aHlinks.SetAt(m_cWnds, pNew);
00260    m_cWnds++;
00261 }
00262
00263
00264 //----------------------------------------------------------------------------
00265 //
00266 // PreprocessMsg function
00267 //    Handles any messages related to Hlink child windows.
00268 //
00269 // Parameters:
00270 //    hWnd:          The parent window handle.
00271 //    uMsg:          Message identifer.
00272 //    wParam:        Message-specific parameter.
00273 //    lParam:        Message-specific parameter.
00274 //    pResult:       Pointer to hold the message return value.
00275 //
00276 // Returns:          HLINK_PPM_CONTINUE if the message was not handled.
00277 //                   HLINK_PPM_RETURNDIRECT if the result should always be
00278 //                      returned directly.
00279 //                   HLINK_PPM_RETURNNORMAL if the result should be handled
00280 //                      in the normal manner (i.e. via DWL_MSGRESULT)
00281 //
00282 //----------------------------------------------------------------------------
00283 DWORD CHlinkWindowMgr::PreprocessMsg(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
00284                                     LRESULT* pResult)
00285 {
00286    switch(uMsg)
00287    {
00288       case WM_SETCURSOR:
00289       {
00290          HWND hWndCtl = (HWND)wParam;
00291          int cItems = m_aHlinks.GetSize();
00292          for(int i = 0; i < cItems; i++)
00293          {
00294             if(m_aHlinks[i] && (hWndCtl == m_aHlinks[i]->GetWindow()))
00295             {
00296                if(m_hCur)
00297                   SetCursor(m_hCur);
00298                *pResult = TRUE;
00299                return HLINK_PPM_RETURNNORMAL;
00300             }
00301          }
00302       } break;
00303
00304       case WM_DRAWITEM:
00305       {
00306          int cItems = m_aHlinks.GetSize();
00307          for(int i = 0; i < cItems; i++)
00308          {
00309             if(m_aHlinks[i] &&
00310                (wParam == (UINT)GetWindowLong(m_aHlinks[i]->GetWindow(), GWL_ID)))
00311             {
00312                m_aHlinks[i]->Paint((LPDRAWITEMSTRUCT)lParam, m_color);
00313                *pResult = TRUE;
00314                return HLINK_PPM_RETURNNORMAL;
00315             }
00316          }
00317       } break;
00318
00319       case WM_COMMAND:
00320       {
00321          HWND hWndCtl = (HWND)lParam;
00322          if(LOWORD(wParam) == IDOK)
00323             hWndCtl = GetFocus();
00324          int cItems = m_aHlinks.GetSize();
00325          for(int i = 0; i < cItems; i++)
00326          {
00327             if(m_aHlinks[i] && (hWndCtl == m_aHlinks[i]->GetWindow()))
00328             {
00329                m_aHlinks[i]->Execute();
00330                *pResult = 0;
00331                return HLINK_PPM_RETURNNORMAL;
00332             }
00333          }
00334       } break;
00335    }
00336    return HLINK_PPM_CONTINUE;
00337 }
00338
00339
00340 //----------------------------------------------------------------------------
00341 //
00342 // ExecURL function
00343 //    Navigates to a specific URL.
00344 //
00345 // Parameters:
00346 //    lpszUrl:       URL to navigate to.
00347 //
00348 // Returns:          A standard COM success or error value.
00349 //
00350 //----------------------------------------------------------------------------
00351 HRESULT ExecURL(CTSTR& lpszUrl)
00352 {
00353    if(!lpszUrl)
00354       return E_INVALIDARG;
00355
00356    HINSTANCE result = ShellExecute(NULL, TEXT("open"), lpszUrl, NULL, NULL, SW_SHOW);
00357
00358    if((UINT)result <= HINSTANCE_ERROR)
00359       return E_FAIL;
00360
00361    return S_OK;
00362 }
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink.h File Reference

#include <bmws_array.h>
#include <bmws_string.h>
#include <bmws_pointer.h>

Go to the source code of this file.

Compounds

class | CHlinkWindow
class | CHlinkWindowMgr
class | IHlinkWindowSite

Defines

#define | AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_
#define | HLINK_PPM_CONTINUE 0
#define | HLINK_PPM_RETURNDIRECT 1
#define | HLINK_PPM_RETURNNORMAL 2

Typedefs

typedef CPtrArray< CHlinkWindow *,
CHlinkWindow * > 		CHlinkWindowPtrArray
typedef CPointer< CHlinkWindowMgr > | CHlinkWindowMgrPtr

Functions

HRESULT | ExecURL (CTSTR &lpszUrl)

Define Documentation

#define AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_

Definition at line 10 of file bmws_hlink.h.

#define HLINK_PPM_CONTINUE 0

Definition at line 28 of file bmws_hlink.h.

Referenced by CHlinkWindowMgr::PreprocessMsg().

#define HLINK_PPM_RETURNDIRECT 1

Definition at line 29 of file bmws_hlink.h.

Referenced by CUpdateDlg::DlgProc(), CAboutDlg::DlgProc(), and RegistrationProc().

#define HLINK_PPM_RETURNNORMAL 2

Definition at line 30 of file bmws_hlink.h.

Referenced by CUpdateDlg::DlgProc(), CAboutDlg::DlgProc(), CHlinkWindowMgr::PreprocessMsg(), and RegistrationProc().

Typedef Documentation

typedef CPointer<CHlinkWindowMgr> CHlinkWindowMgrPtr

Definition at line 101 of file bmws_hlink.h.

typedef CPtrArray<CHlinkWindow*, CHlinkWindow*> CHlinkWindowPtrArray

Definition at line 74 of file bmws_hlink.h.

Function Documentation

HRESULT ExecURL ( CTSTR & lpszUrl )

Definition at line 351 of file bmws_hlink.cpp.

Referenced by CHlinkWindow::Execute(), and CRegDlgInfo::HlinkClicked().

00352 {
00353    if(!lpszUrl)
00354       return E_INVALIDARG;
00355
00356    HINSTANCE result = ShellExecute(NULL, TEXT("open"), lpszUrl, NULL, NULL, SW_SHOW);
00357
00358    if((UINT)result <= HINSTANCE_ERROR)
00359       return E_FAIL;
00360
00361    return S_OK;
00362 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink.h Source File

bmws_hlink.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_hlink.h
00004 //    Class to encapsulate hyperlink text owner-drawn button controls.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
00010 #define AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_array.h>
00021 #include <bmws_string.h>
00022 #include <bmws_pointer.h>
00023
00024
00025 //----------------------------------------------------------------------------
00026 // PreprocessMsg return values
00027 //----------------------------------------------------------------------------
00028 #define HLINK_PPM_CONTINUE       0
00029 #define HLINK_PPM_RETURNDIRECT   1
00030 #define HLINK_PPM_RETURNNORMAL   2
00031
00032
00033 //----------------------------------------------------------------------------
00034 //
00035 // IUpdateDlgSite abstract class
00036 //    Informs the caller that update attributes have changed.
00037 //
00038 //----------------------------------------------------------------------------
00039 class IHlinkWindowSite
00040 {
00041 public:
00042    virtual void HlinkClicked(DWORD dwID) = 0;
00043 };
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // CHlinkWindow class
00049 //    Encapsulates a hyperlink text owner-drawn button control.
00050 //
00051 //----------------------------------------------------------------------------
00052 class CHlinkWindow
00053 {
00054 public:
00055    CHlinkWindow(HWND hWnd, CTSTR& lpszUrl);
00056    CHlinkWindow(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID);
00057    ~CHlinkWindow();
00058
00059    HWND GetWindow() { return m_hWnd; }
00060    void Paint(LPDRAWITEMSTRUCT lpdis, COLORREF color);
00061    void Execute();
00062
00063 protected:
00064    void CommonSetup(HWND hWnd);
00065
00066    CTSTR m_lpszText;          // Text of the link
00067    CTSTR m_lpszUrl;           // URL reference
00068    IHlinkWindowSite *m_pSite; // Interface to handle clicking
00069    DWORD m_dwID;              // ID for this hyperlink
00070    HWND m_hWnd;               // Window handle
00071    HFONT m_hFont;             // Font to use
00072 };
00073
00074 typedef CPtrArray<CHlinkWindow*, CHlinkWindow*> CHlinkWindowPtrArray;
00075
00076
00077 //----------------------------------------------------------------------------
00078 //
00079 // CHlinkWindowMgr class
00080 //    Encapsulates multiple hyperlink button controls and interaction with
00081 //    their parent window.
00082 //
00083 //----------------------------------------------------------------------------
00084 class CHlinkWindowMgr : public CRefCount
00085 {
00086 public:
00087    CHlinkWindowMgr(UINT cWnds, COLORREF color);
00088    virtual ~CHlinkWindowMgr();
00089
00090    void AddWnd(HWND hWnd, CTSTR& lpszUrl);
00091    void AddWnd(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID);
00092    DWORD PreprocessMsg(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00093
00094 protected:
00095    HCURSOR m_hCur;                  // Hand cursor
00096    CHlinkWindowPtrArray m_aHlinks;  // Link objects
00097    COLORREF m_color;                // Color of the link
00098    UINT m_cWnds;                    // Number of link windows being managed
00099 };
00100
00101 typedef CPointer<CHlinkWindowMgr> CHlinkWindowMgrPtr;
00102
00103
00104 //----------------------------------------------------------------------------
00105 // BMWS_Hlink API functions
00106 //----------------------------------------------------------------------------
00107 HRESULT ExecURL(CTSTR& lpszUrl);
00108
00109
00110 #endif // !defined(AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink_res.h File Reference

Go to the source code of this file.

Defines

#define IDC_BMWS_HLINK_HANDCUR 7001

Define Documentation

#define IDC_BMWS_HLINK_HANDCUR 7001

Definition at line 5 of file bmws_hlink_res.h.

Referenced by CHlinkWindowMgr::CHlinkWindowMgr().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlink_res.h Source File

bmws_hlink_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_hlink.rc
00004 //
00005 #define IDC_BMWS_HLINK_HANDCUR          7001
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor.cpp File Reference

#include <bmws_registry.h>
#include <bmws_string.h>
#include <shlwapi.h>
#include <bmws_hlinkcolor_res.h>

Go to the source code of this file.

Functions

COLORREF GetHlinkColor ()

Function Documentation

COLORREF GetHlinkColor ( )

Definition at line 31 of file bmws_hlinkcolor.cpp.

References GetRegStringValue(), IDS_BMWS_HLINKCOLOR_MSIEREG, and IDS_BMWS_HLINKCOLOR_VALUENAME.

Referenced by CMainWindow::Create().

00032 {
00033    COLORREF clrReturn = GetSysColor(COLOR_HIGHLIGHT);
00034    CKey     hKeySettings;
00035    LONG     lResult;
00036    DWORD    dwDisp;
00037
00038    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, CTSTR(IDS_BMWS_HLINKCOLOR_MSIEREG), 0, NULL,
00039       REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeySettings, &dwDisp);
00040    if(lResult == NOERROR)
00041    {
00042       CTSTR lpszColor = GetRegStringValue(hKeySettings, IDS_BMWS_HLINKCOLOR_VALUENAME);
00043       if(lpszColor)
00044       {
00045          BOOL bStatus = TRUE;
00046          int nCount = 0;
00047          int aiValues[3];
00048          CTSTR lpsz;
00049
00050          while(bStatus && nCount < 3)
00051          {
00052             bStatus = lpszColor.ExtractSubString(lpsz, nCount, TCHAR(','));
00053             aiValues[nCount] = StrToInt(lpsz);
00054             nCount++;
00055          }
00056
00057          if(nCount == 3)
00058             clrReturn = RGB(aiValues[0], aiValues[1], aiValues[2]);
00059       }
00060    }
00061    return clrReturn;
00062 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor.cpp Source File

bmws_hlinkcolor.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_hlinkcolor.cpp
00004 //    Function to read the user's regular hyperlink color from Internet
00005 //    Explorer's registry settings.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_registry.h>
00014 #include <bmws_string.h>
00015 #include <shlwapi.h>
00016 #include <bmws_hlinkcolor_res.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // GetHlinkColor function
00022 //    Reads the user's regular hyperlink color from Internet Explorer's
00023 //    registry settings.
00024 //
00025 // Parameters:       None.
00026 //
00027 // Returns:          The color to use for hyperlinks. If no setting was found,
00028 //                   the highlight color is returned.
00029 //
00030 //----------------------------------------------------------------------------
00031 COLORREF GetHlinkColor()
00032 {
00033    COLORREF clrReturn = GetSysColor(COLOR_HIGHLIGHT);
00034    CKey     hKeySettings;
00035    LONG     lResult;
00036    DWORD    dwDisp;
00037
00038    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, CTSTR(IDS_BMWS_HLINKCOLOR_MSIEREG), 0, NULL,
00039       REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeySettings, &dwDisp);
00040    if(lResult == NOERROR)
00041    {
00042       CTSTR lpszColor = GetRegStringValue(hKeySettings, IDS_BMWS_HLINKCOLOR_VALUENAME);
00043       if(lpszColor)
00044       {
00045          BOOL bStatus = TRUE;
00046          int nCount = 0;
00047          int aiValues[3];
00048          CTSTR lpsz;
00049
00050          while(bStatus && nCount < 3)
00051          {
00052             bStatus = lpszColor.ExtractSubString(lpsz, nCount, TCHAR(','));
00053             aiValues[nCount] = StrToInt(lpsz);
00054             nCount++;
00055          }
00056
00057          if(nCount == 3)
00058             clrReturn = RGB(aiValues[0], aiValues[1], aiValues[2]);
00059       }
00060    }
00061    return clrReturn;
00062 }
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor.h File Reference

Go to the source code of this file.

Functions

COLORREF GetHlinkColor ()

Function Documentation

COLORREF GetHlinkColor ( )

Definition at line 31 of file bmws_hlinkcolor.cpp.

References GetRegStringValue(), IDS_BMWS_HLINKCOLOR_MSIEREG, and IDS_BMWS_HLINKCOLOR_VALUENAME.

Referenced by CMainWindow::Create().

00032 {
00033    COLORREF clrReturn = GetSysColor(COLOR_HIGHLIGHT);
00034    CKey     hKeySettings;
00035    LONG     lResult;
00036    DWORD    dwDisp;
00037
00038    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, CTSTR(IDS_BMWS_HLINKCOLOR_MSIEREG), 0, NULL,
00039       REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeySettings, &dwDisp);
00040    if(lResult == NOERROR)
00041    {
00042       CTSTR lpszColor = GetRegStringValue(hKeySettings, IDS_BMWS_HLINKCOLOR_VALUENAME);
00043       if(lpszColor)
00044       {
00045          BOOL bStatus = TRUE;
00046          int nCount = 0;
00047          int aiValues[3];
00048          CTSTR lpsz;
00049
00050          while(bStatus && nCount < 3)
00051          {
00052             bStatus = lpszColor.ExtractSubString(lpsz, nCount, TCHAR(','));
00053             aiValues[nCount] = StrToInt(lpsz);
00054             nCount++;
00055          }
00056
00057          if(nCount == 3)
00058             clrReturn = RGB(aiValues[0], aiValues[1], aiValues[2]);
00059       }
00060    }
00061    return clrReturn;
00062 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor.h Source File

bmws_hlinkcolor.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_hlinkcolor.h
00004 //    Function to read the user's regular hyperlink color from Internet
00005 //    Explorer's registry settings.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #ifndef __BMWS_HLINKCOLOR_H_
00011 #define __BMWS_HLINKCOLOR_H_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // BMWS_HlinkColor API functions
00016 //----------------------------------------------------------------------------
00017 COLORREF GetHlinkColor();
00018
00019
00020 #endif //__BMWS_HLINKCOLOR_H_
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_HLINKCOLOR_MSIEREG 8951
#define | IDS_BMWS_HLINKCOLOR_VALUENAME 8952

Define Documentation

#define IDS_BMWS_HLINKCOLOR_MSIEREG 8951

Definition at line 5 of file bmws_hlinkcolor_res.h.

Referenced by GetHlinkColor().

#define IDS_BMWS_HLINKCOLOR_VALUENAME 8952

Definition at line 6 of file bmws_hlinkcolor_res.h.

Referenced by GetHlinkColor().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_hlinkcolor_res.h Source File

bmws_hlinkcolor_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_hlinkcolor.rc
00004 //
00005 #define IDS_BMWS_HLINKCOLOR_MSIEREG     8951
00006 #define IDS_BMWS_HLINKCOLOR_VALUENAME   8952
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchk.cpp File Reference

#include <bmws_htmlchk.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchk.cpp Source File

bmws_htmlchk.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlchk.cpp
00004 //    Class to assist in MSHTML check box control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlchk.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 //
00017 // CHTMLChk constructor
00018 //
00019 // Parameters:
00020 //    pSite:         Interface to notify of changes
00021 //    pHH:           Pointer to the HTML Helper object to use.
00022 //    uID:           String resource identifier of the element's ID.
00023 //    lParam:        Notification parameter.
00024 //    pEl:           The HTML element pointer. Defaults to NULL, signifying
00025 //                   the element should be loaded by ID.
00026 //
00027 //----------------------------------------------------------------------------
00028 CHTMLChk::CHTMLChk(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00029                    IHTMLElement *pEl) : CHTMLControl(pSite, pHH, uID, lParam, pEl)
00030 {
00031    m_spInputEl.Assign(m_spEl);
00032    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00033    ENSUREALLOC(pHandler);
00034    CVariant vHandler;
00035    vHandler.vt = VT_DISPATCH;
00036    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00037    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00038
00039    ResetChanged();
00040 }
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CHTMLChk destructor
00046 //
00047 //----------------------------------------------------------------------------
00048 CHTMLChk::~CHTMLChk()
00049 {
00050    VARIANT vHandler;
00051    VariantInit(&vHandler);
00052    vHandler.vt = VT_NULL;
00053    m_spEl->put_onclick(vHandler);
00054 }
00055
00056
00057 //----------------------------------------------------------------------------
00058 //
00059 // ResetChanged function
00060 //    Resets the "original" contents of the control to the current contents.
00061 //
00062 // Parameters:       None.
00063 //
00064 // Returns:          None.
00065 //
00066 //----------------------------------------------------------------------------
00067 void CHTMLChk::ResetChanged()
00068 {
00069    VARIANT_BOOL vb;
00070    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00071    m_bOrig = (vb == VARIANT_TRUE);
00072 }
00073
00074
00075 //----------------------------------------------------------------------------
00076 //
00077 // Changed function
00078 //    Retrieves whether the contents of the control have changed.
00079 //
00080 // Parameters:       None.
00081 //
00082 // Returns:          TRUE if the contents have changed, else FALSE.
00083 //
00084 //----------------------------------------------------------------------------
00085 BOOL CHTMLChk::Changed()
00086 {
00087    VARIANT_BOOL vb;
00088    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00089    return (m_bOrig != (vb == VARIANT_TRUE));
00090 }
00091
00092
00093 //----------------------------------------------------------------------------
00094 //
00095 // SetCheck function
00096 //    Checks or unchecks the check box control.
00097 //
00098 // Parameters:
00099 //    bCheck:        TRUE to check the box, FALSE to clear it.
00100 //
00101 // Returns:          None.
00102 //
00103 //----------------------------------------------------------------------------
00104 void CHTMLChk::SetCheck(BOOL bCheck)
00105 {
00106    CHECKHRCOM(m_spInputEl->put_checked(bCheck ? VARIANT_TRUE : VARIANT_FALSE));
00107 }
00108
00109
00110 //----------------------------------------------------------------------------
00111 //
00112 // GetCheck function
00113 //    Retrieves the current check state of the control.
00114 //
00115 // Parameters:       None.
00116 //
00117 // Returns:          TRUE if the box is checked, else FALSE.
00118 //
00119 //----------------------------------------------------------------------------
00120 BOOL CHTMLChk::GetCheck()
00121 {
00122    VARIANT_BOOL vb;
00123    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00124    return (vb == VARIANT_TRUE);
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // IEventHandlerSite::EventHandler method
00131 //    Handles events that are trapped via a CEventHandler object.
00132 //
00133 // Parameters:
00134 //    dwEventID:     Event identifier; unused.
00135 //    lParam:        Event-specific parameter. Represents the stringtable ID
00136 //                   of the element.
00137 //
00138 // Returns:          None.
00139 //
00140 //----------------------------------------------------------------------------
00141 void CHTMLChk::EventHandler(DWORD dwEventID, LPARAM lParam)
00142 {
00143    try   // Windows-called code
00144    {
00145       if(m_pSite)
00146          m_pSite->ControlChanged(this, m_uID, m_lParam);
00147    }
00148    catch(CExcep *pE)
00149    {
00150       pE->Report();
00151       pE->Delete();
00152    }
00153 }
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchk.h File Reference

#include <bmws_htmlcontrol.h>

Go to the source code of this file.

Compounds

class CHTMLChk

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchk.h Source File

bmws_htmlchk.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlchk.h
00004 //    Class to assist in MSHTML check box control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLCHK_H_
00010 #define __BMWS_HTMLCHK_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlcontrol.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CHTMLChk class
00022 //    Assists in MSHTML check box control management.
00023 //
00024 //----------------------------------------------------------------------------
00025 class CHTMLChk : public CHTMLControl
00026 {
00027 public:
00028    CHTMLChk(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00029       IHTMLElement *pEl = NULL);
00030    virtual ~CHTMLChk();
00031
00032    void ResetChanged();
00033    BOOL Changed();
00034    void SetCheck(BOOL bCheck);
00035    BOOL GetCheck();
00036
00037    // IEventHandlerSite method
00038    void EventHandler(DWORD dwEventID, LPARAM lParam);
00039
00040 protected:
00041    CPtr<IHTMLInputElement, &IID_IHTMLInputElement> m_spInputEl;   // Input element interface
00042    BOOL m_bOrig;     // Original check state
00043 };
00044
00045
00046 #endif //__BMWS_HTMLCHK_H_
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchoosecolor.cpp File Reference

#include <bmws_htmlchoosecolor.h>
#include <bmws_variant.h>
#include <bmws_choosecolor.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchoosecolor.cpp Source File

bmws_htmlchoosecolor.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlchoosecolor.cpp
00004 //    Class to allow the user to select a color.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlchoosecolor.h>
00013 #include <bmws_variant.h>
00014 #include <bmws_choosecolor.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CHTMLChooseColor constructor
00020 //
00021 // Parameters:
00022 //    pSite:         Interface to notify of changes
00023 //    pHH:           Pointer to the HTML Helper object to use.
00024 //    uID:           String resource identifier of the element's ID.
00025 //    lParam:        Notification parameter.
00026 //    uidHolder:     String resource identifier of the hex color formatter.
00027 //    plpszTitle:    Pointer to the string to display in the Choose Color
00028 //                   dialog box. Defaults to NULL, to use the default string.
00029 //    pEl:           The HTML element pointer. Defaults to NULL, signifying
00030 //                   the element should be loaded by ID.
00031 //
00032 //----------------------------------------------------------------------------
00033 CHTMLChooseColor::CHTMLChooseColor(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID,
00034                                    LPARAM lParam, UINT uidHolder, IHTMLChooseColorSite *pCCSite,
00035                                    IHTMLElement *pEl) : CHTMLControl(pSite, pHH, uID, lParam,
00036                                    pEl)
00037 {
00038    m_pCCSite = pCCSite;
00039    m_uidHolder = uidHolder;
00040    m_color = RGB(0, 0, 0);
00041
00042    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00043    ENSUREALLOC(pHandler);
00044    CVariant vHandler;
00045    vHandler.vt = VT_DISPATCH;
00046    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00047    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00048
00049    ResetChanged();
00050 }
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // CHTMLChooseColor destructor
00056 //
00057 //----------------------------------------------------------------------------
00058 CHTMLChooseColor::~CHTMLChooseColor()
00059 {
00060    VARIANT vHandler;
00061    VariantInit(&vHandler);
00062    vHandler.vt = VT_NULL;
00063    m_spEl->put_onclick(vHandler);
00064 }
00065
00066
00067 //----------------------------------------------------------------------------
00068 //
00069 // ResetChanged function
00070 //    Resets the "original" contents of the control to the current contents.
00071 //
00072 // Parameters:       None.
00073 //
00074 // Returns:          None.
00075 //
00076 //----------------------------------------------------------------------------
00077 void CHTMLChooseColor::ResetChanged()
00078 {
00079    m_colorOrig = m_color;
00080 }
00081
00082
00083 //----------------------------------------------------------------------------
00084 //
00085 // Changed function
00086 //    Retrieves whether the contents of the control have changed.
00087 //
00088 // Parameters:       None.
00089 //
00090 // Returns:          TRUE if the contents changed, else FALSE.
00091 //
00092 //----------------------------------------------------------------------------
00093 BOOL CHTMLChooseColor::Changed()
00094 {
00095    return (m_color != m_colorOrig);
00096 }
00097
00098
00099 //----------------------------------------------------------------------------
00100 //
00101 // IEventHandlerSite::EventHandler method
00102 //    Handles events that are trapped via a CEventHandler object.
00103 //
00104 // Parameters:
00105 //    dwEventID:     Event identifier; unused.
00106 //    lParam:        Event-specific parameter. Represents the stringtable ID
00107 //                   of the element.
00108 //
00109 // Returns:          None.
00110 //
00111 //----------------------------------------------------------------------------
00112 void CHTMLChooseColor::EventHandler(DWORD dwEventID, LPARAM lParam)
00113 {
00114    try   // Windows-called code
00115    {
00116       CTSTR lpszTitle;
00117       HWND hWnd = NULL;
00118       if(m_pCCSite)
00119          hWnd = m_pCCSite->GetColorInfo(this, m_uID, m_lParam, lpszTitle);
00120       if(ChooseColorEx((COLORREF*)&m_color, hWnd, lpszTitle))
00121       {
00122          SetColor(m_color);
00123          if(m_pSite)
00124             m_pSite->ControlChanged(this, m_uID, m_lParam);
00125       }
00126    }
00127    catch(CExcep *pE)
00128    {
00129       pE->Report();
00130       pE->Delete();
00131    }
00132 }
00133
00134
00135 //----------------------------------------------------------------------------
00136 //
00137 // GetColor function
00138 //    Retrieves the current color.
00139 //
00140 // Parameters:       None.
00141 //
00142 // Returns:          The current color.
00143 //
00144 //----------------------------------------------------------------------------
00145 COLORREF CHTMLChooseColor::GetColor()
00146 {
00147    return m_color;
00148 }
00149
00150
00151 //----------------------------------------------------------------------------
00152 //
00153 // SetColor function
00154 //    Sets the current color.
00155 //
00156 // Parameters:
00157 //    color:         The new current color.
00158 //
00159 // Returns:          None.
00160 //
00161 //----------------------------------------------------------------------------
00162 void CHTMLChooseColor::SetColor(COLORREF color)
00163 {
00164    m_color = color;
00165
00166    CHTMLStylePtr spStyle;
00167    CHECKHRCOM(m_spEl->get_style(&spStyle));
00168    CVariant v;
00169    CTSTR lpszHolder(m_uidHolder);
00170    CTSTR lpszTotal(TRUE, lpszHolder.Len() + 16);
00171    wsprintf(lpszTotal, lpszHolder, GetRValue(color), GetGValue(color), GetBValue(color));
00172    v.vt = VT_BSTR;
00173    v.bstrVal = CBSTR(lpszTotal).Detach();
00174    CHECKHRCOM(spStyle->put_backgroundColor(v));
00175 }
Generated on Wed May 8 12:38:51 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchoosecolor.h File Reference

#include <bmws_htmlcontrol.h>

Go to the source code of this file.

Compounds

class | CHTMLChooseColor
class | IHTMLChooseColorSite

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlchoosecolor.h Source File

bmws_htmlchoosecolor.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlchoosecolor.h
00004 //    Class to allow the user to select a color.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLCHOOSECOLOR_H_
00010 #define __BMWS_HTMLCHOOSECOLOR_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlcontrol.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Forward declaration
00021 //----------------------------------------------------------------------------
00022 class CHTMLChooseColor;
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // IHTMLChooseColorSite abstract class
00028 //    Enables the Choose Color control to query its owner for information.
00029 //
00030 //----------------------------------------------------------------------------
00031 class IHTMLChooseColorSite
00032 {
00033 public:
00034    virtual HWND GetColorInfo(CHTMLChooseColor *pControl, UINT uID, LPARAM lParam,
00035       CTSTR& lpszTitle) = 0;
00036 };
00037
00038
00039 //----------------------------------------------------------------------------
00040 //
00041 // CHTMLChooseColor class
00042 //    Allows the user to select a color.
00043 //
00044 //----------------------------------------------------------------------------
00045 class CHTMLChooseColor : public CHTMLControl
00046 {
00047 public:
00048    CHTMLChooseColor(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00049       UINT uidHolder, IHTMLChooseColorSite *pCCSite, IHTMLElement *pEl = NULL);
00050    virtual ~CHTMLChooseColor();
00051
00052    void ResetChanged();
00053    BOOL Changed();
00054    COLORREF GetColor();
00055    void SetColor(COLORREF color);
00056
00057    // IEventHandlerSite method
00058    void EventHandler(DWORD dwEventID, LPARAM lParam);
00059
00060 protected:
00061    IHTMLChooseColorSite *m_pCCSite; // Owner interface
00062    COLORREF m_color;                // Current selected color
00063    COLORREF m_colorOrig;            // Original color value
00064    UINT m_uidHolder;                // Res ID of hex color holder format string
00065 };
00066
00067
00068 #endif //__BMWS_HTMLCHOOSECOLOR_H_
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlcontrol.cpp File Reference

#include <bmws_htmlcontrol.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlcontrol.cpp Source File

bmws_htmlcontrol.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlcontrol.cpp
00004 //    Abstract class to assist in MSHTML control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlcontrol.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 //
00017 // CHTMLControl constructor
00018 //
00019 // Parameters:
00020 //    pSite:         Interface to notify of changes
00021 //    pHH:           Pointer to the HTML Helper object to use.
00022 //    uID:           String resource identifier of the element's ID.
00023 //    lParam:        Notification parameter.
00024 //    pEl:           The HTML element pointer. Defaults to NULL, signifying
00025 //                   the element should be loaded by ID.
00026 //
00027 //----------------------------------------------------------------------------
00028 CHTMLControl::CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00029                            IHTMLElement *pEl)
00030 {
00031    m_pSite = pSite;
00032    m_lParam = lParam;
00033    m_pHH = pHH;
00034    m_uID = uID;
00035    if(pEl)
00036       m_spEl.Assign(pEl);
00037    else if(m_uID != (UINT)-1)
00038       m_spEl.Assign(TRUE, m_pHH->GetNamedEl(uID, IID_IHTMLElement));
00039    m_bParamIsUnk = FALSE;
00040 }
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CHTMLControl destructor
00046 //
00047 //----------------------------------------------------------------------------
00048 CHTMLControl::~CHTMLControl()
00049 {
00050    if(m_bParamIsUnk)
00051       ((IUnknown*)m_lParam)->Release();
00052 }
00053
00054
00055 //----------------------------------------------------------------------------
00056 //
00057 // GetEl function
00058 //    Retrieves the underlying HTML element interface pointer.
00059 //
00060 // Parameters:       None.
00061 //
00062 // Returns:          The HTML element interface pointer object.
00063 //
00064 //----------------------------------------------------------------------------
00065 CHTMLElementPtr& CHTMLControl::GetEl()
00066 {
00067    return m_spEl;
00068 }
00069
00070
00071 //----------------------------------------------------------------------------
00072 //
00073 // SetParamIsUnk function
00074 //    Sets whether the control should manage the lParam as an IUnknown
00075 //    pointer. By default, the lParam is unmanaged.
00076 //
00077 // Parameters:
00078 //    bParamIsUnk:   Whether the lParam is an IUnknown pointer that must be
00079 //                   managed.
00080 //
00081 // Returns:          None.
00082 //
00083 //----------------------------------------------------------------------------
00084 void CHTMLControl::SetParamIsUnk(BOOL bParamIsUnk)
00085 {
00086    m_bParamIsUnk = bParamIsUnk;
00087    if(m_bParamIsUnk)
00088       ((IUnknown*)m_lParam)->AddRef();
00089 }
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlcontrol.h File Reference

#include <bmws_htmlhelpers.h>
#include <bmws_eventhandler.h>
#include <bmws_ptr.h>

Go to the source code of this file.

Compounds

class | CHTMLControl
class | IHTMLControlSite

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlcontrol.h Source File

bmws_htmlcontrol.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlcontrol.h
00004 //    Abstract class to assist in MSHTML control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLCONTROL_H_
00010 #define __BMWS_HTMLCONTROL_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlhelpers.h>
00017 #include <bmws_eventhandler.h>
00018 #include <bmws_ptr.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 // Forward declaration
00023 //----------------------------------------------------------------------------
00024 class CHTMLControl;
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // IHTMLControlSite abstract class
00030 //    Enables notification of HTML control changes.
00031 //
00032 //----------------------------------------------------------------------------
00033 class IHTMLControlSite
00034 {
00035 public:
00036    virtual void ControlChanged(CHTMLControl *pControl, UINT uID, LPARAM lParam) = 0;
00037 };
00038
00039
00040 //----------------------------------------------------------------------------
00041 //
00042 // CHTMLControl abstract class
00043 //    Assists in MSHTML control management.
00044 //
00045 //----------------------------------------------------------------------------
00046 class CHTMLControl : public IEventHandlerSite
00047 {
00048 public:
00049    CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00050       IHTMLElement *pEl = NULL);
00051    virtual ~CHTMLControl();
00052
00053    virtual void ResetChanged() = 0;
00054    virtual BOOL Changed() = 0;
00055    virtual CHTMLElementPtr& GetEl();
00056    void SetParamIsUnk(BOOL bParamIsUnk);
00057
00058    // IEventHandlerSite method
00059    virtual void EventHandler(DWORD dwEventID, LPARAM lParam) = 0;
00060
00061 protected:
00062    CHTMLElementPtr m_spEl;    // The element object
00063    IHTMLControlSite *m_pSite; // Interface to notify of changes
00064    LPARAM m_lParam;           // Parameter for notification
00065    CHTMLHelper *m_pHH;        // HTML Helper object
00066    UINT m_uID;                // String resource identifier of the element's ID
00067    BOOL m_bParamIsUnk;        // Whether the parameter is an IUnknown pointer to be managed
00068 };
00069
00070
00071 #endif //__BMWS_HTMLCONTROL_H_
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit.cpp File Reference

#include <bmws_htmledit.h>
#include <bmws_variant.h>
#include <bmws_htmledit_res.h>

Go to the source code of this file.

Defines

#define | HTMLEDIT_KEYPRESS 0
#define | HTMLEDIT_PASTE 1
#define | HTMLEDIT_CHANGE 2

Define Documentation

#define HTMLEDIT_CHANGE 2

Definition at line 22 of file bmws_htmledit.cpp.

Referenced by CHTMLEdit::CHTMLEdit(), and CHTMLEdit::EventHandler().

#define HTMLEDIT_KEYPRESS 0

Definition at line 20 of file bmws_htmledit.cpp.

Referenced by CHTMLEdit::CHTMLEdit(), and CHTMLEdit::EventHandler().

#define HTMLEDIT_PASTE 1

Definition at line 21 of file bmws_htmledit.cpp.

Referenced by CHTMLEdit::CHTMLEdit(), and CHTMLEdit::EventHandler().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit.cpp Source File

bmws_htmledit.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmledit.cpp
00004 //    Class to assist in MSHTML edit control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmledit.h>
00013 #include <bmws_variant.h>
00014 #include <bmws_htmledit_res.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Event handler IDs
00019 //----------------------------------------------------------------------------
00020 #define HTMLEDIT_KEYPRESS  0
00021 #define HTMLEDIT_PASTE     1
00022 #define HTMLEDIT_CHANGE    2
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // CHTMLEdit constructor
00028 //
00029 // Parameters:
00030 //    pSite:         Interface to notify of changes
00031 //    pHH:           Pointer to the HTML Helper object to use.
00032 //    uID:           String resource identifier of the element's ID.
00033 //    bNumber:       Whether only numbers should be allowed in the edit field.
00034 //    bTextArea:     Whether the element is a TEXTAREA element.
00035 //    lParam:        Notification parameter.
00036 //    pEl:           The HTML element pointer. Defaults to NULL, signifying
00037 //                   the element should be loaded by ID.
00038 //
00039 //----------------------------------------------------------------------------
00040 CHTMLEdit::CHTMLEdit(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, BOOL bNumber,
00041                      BOOL bTextArea, LPARAM lParam, IHTMLElement *pEl) : CHTMLControl(pSite, pHH,
00042                      uID, lParam, pEl)
00043 {
00044    m_bTextArea = bTextArea;
00045    m_bNumber = bNumber;
00046    CEventHandler *pHandler = NULL;
00047    CVariant vHandler;
00048
00049    if(!bTextArea)
00050    {
00051       CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spInputEl(m_spEl);
00052       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_CHANGE, 0);
00053       ENSUREALLOC(pHandler);
00054       vHandler.vt = VT_DISPATCH;
00055       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00056       CHECKHRCOM(spInputEl->put_onchange(vHandler));
00057    }
00058    if(bNumber)
00059    {
00060       VariantClear(&vHandler);
00061       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_KEYPRESS, 0);
00062       ENSUREALLOC(pHandler);
00063       vHandler.vt = VT_DISPATCH;
00064       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00065       CHECKHRCOM(m_spEl->put_onkeypress(vHandler));
00066
00067       VariantClear(&vHandler);
00068       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_PASTE, 0);
00069       ENSUREALLOC(pHandler);
00070       vHandler.vt = VT_DISPATCH;
00071       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00072       CHTMLElement2Ptr spEl2(m_spEl);
00073       CHECKHRCOM(spEl2->put_onpaste(vHandler));
00074    }
00075
00076    ResetChanged();
00077 }
00078
00079
00080 //----------------------------------------------------------------------------
00081 //
00082 // CHTMLEdit destructor
00083 //
00084 //----------------------------------------------------------------------------
00085 CHTMLEdit::~CHTMLEdit()
00086 {
00087    VARIANT vHandler;
00088    VariantInit(&vHandler);
00089    vHandler.vt = VT_NULL;
00090    if(!m_bTextArea)
00091    {
00092       CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spInputEl(m_spEl);
00093       spInputEl->put_onchange(vHandler);
00094    }
00095    if(m_bNumber)
00096    {
00097       m_spEl->put_onkeypress(vHandler);
00098       CHTMLElement2Ptr spEl2(m_spEl);
00099       spEl2->put_onpaste(vHandler);
00100    }
00101 }
00102
00103
00104 //----------------------------------------------------------------------------
00105 //
00106 // ResetChanged function
00107 //    Resets the "original" contents of the edit control to the current
00108 //    contents.
00109 //
00110 // Parameters:       None.
00111 //
00112 // Returns:          None.
00113 //
00114 //----------------------------------------------------------------------------
00115 void CHTMLEdit::ResetChanged()
00116 {
00117    m_bstrOrig = m_pHH->GetElTextWithEl(m_spEl, !m_bTextArea);
00118 }
00119
00120
00121 //----------------------------------------------------------------------------
00122 //
00123 // Changed function
00124 //    Retrieves whether the contents of the edit control have changed.
00125 //
00126 // Parameters:       None.
00127 //
00128 // Returns:          A standard COM success or error value.
00129 //
00130 //----------------------------------------------------------------------------
00131 BOOL CHTMLEdit::Changed()
00132 {
00133    return !m_bstrOrig.Equals(m_pHH->GetElTextWithEl(m_spEl, !m_bTextArea));
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // IEventHandlerSite::EventHandler method
00140 //    Handles events that are trapped via a CEventHandler object.
00141 //
00142 // Parameters:
00143 //    dwEventID:     Event identifier; 0 to signify a key was pressed.
00144 //    lParam:        Event-specific parameter. Represents the stringtable ID
00145 //                   of the element.
00146 //
00147 // Returns:          None.
00148 //
00149 //----------------------------------------------------------------------------
00150 void CHTMLEdit::EventHandler(DWORD dwEventID, LPARAM lParam)
00151 {
00152    try   // Windows-called code
00153    {
00154       switch(dwEventID)
00155       {
00156          case HTMLEDIT_KEYPRESS:
00157          {
00158             CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
00159             long lKeyCode = 0;
00160             CHECKHRCOM(spEventObj->get_keyCode(&lKeyCode));
00161             if(lKeyCode < 48 || lKeyCode > 57)
00162             {
00163                VARIANT v;
00164                v.vt = VT_BOOL;
00165                v.boolVal = VARIANT_FALSE;
00166                CHECKHRCOM(spEventObj->put_returnValue(v));
00167             }
00168          } break;
00169
00170          case HTMLEDIT_PASTE:
00171          {
00172             CVariant vc;
00173             if(SUCCEEDED(m_pHH->GetClipboardData()->getData(CBSTR(IDS_BMWS_HTMLEDIT_CLIP_TEXT),
00174                &vc)))
00175             {
00176                if(vc.vt == VT_BSTR)
00177                {
00178                   CTSTR lpszData(vc.bstrVal);
00179                   int iMax = lstrlen(lpszData);
00180                   BOOL bValid = (iMax <= 4);
00181                   for(int i = 0; i < iMax && bValid; i++)
00182                      bValid = ((lpszData.m_lpsz[i] >= 48) && (lpszData.m_lpsz[i] <= 57));
00183                   if(!bValid)
00184                      m_pHH->CancelEvent();
00185                }
00186             }
00187          } break;
00188
00189          case HTMLEDIT_CHANGE:
00190          {
00191             if(m_pSite)
00192                m_pSite->ControlChanged(this, m_uID, m_lParam);
00193          } break;
00194       }
00195    }
00196    catch(CExcep *pE)
00197    {
00198       pE->Report();
00199       pE->Delete();
00200    }
00201 }
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit.h File Reference

#include <bmws_htmlcontrol.h>
#include <bmws_string.h>

Go to the source code of this file.

Compounds

class CHTMLEdit

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit.h Source File

bmws_htmledit.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmledit.h
00004 //    Class to assist in MSHTML edit control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008 #ifndef __BMWS_HTMLEDIT_H_
00009 #define __BMWS_HTMLEDIT_H_
00010
00011
00012 //----------------------------------------------------------------------------
00013 // Includes
00014 //----------------------------------------------------------------------------
00015 #include <bmws_htmlcontrol.h>
00016 #include <bmws_string.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CHTMLEdit class
00022 //    Assists in MSHTML edit control management.
00023 //
00024 //----------------------------------------------------------------------------
00025 class CHTMLEdit : public CHTMLControl
00026 {
00027 public:
00028    CHTMLEdit(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, BOOL bNumber, BOOL bTextArea,
00029       LPARAM lParam, IHTMLElement *pEl = NULL);
00030    virtual ~CHTMLEdit();
00031
00032    void ResetChanged();
00033    BOOL Changed();
00034
00035    // IEventHandlerSite method
00036    void EventHandler(DWORD dwEventID, LPARAM lParam);
00037
00038 protected:
00039    BOOL m_bNumber;         // Whether the element holds a numerical value
00040    BOOL m_bTextArea;       // Whether the element is a TEXTAREA element
00041    CBSTR m_bstrOrig;       // Original string contents
00042 };
00043
00044
00045 #endif //__BMWS_HTMLEDIT_H_
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_HTMLEDIT_CLIP_TEXT 8351

Define Documentation

#define IDS_BMWS_HTMLEDIT_CLIP_TEXT 8351

Definition at line 5 of file bmws_htmledit_res.h.

Referenced by CHTMLEdit::EventHandler().

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmledit_res.h Source File

bmws_htmledit_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmledit.rc
00004 //
00005 #define IDS_BMWS_HTMLEDIT_CLIP_TEXT     8351
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlenable.cpp File Reference

#include <bmws_htmlenable.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlenable.cpp Source File

bmws_htmlenable.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlenable.cpp
00004 //    Abstract class to assist in enabling and disabling MSHTML elements.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlenable.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 //
00017 // CHTMLEnable constructor
00018 //
00019 // Parameters:
00020 //    pHH:              Pointer to the HTML Helper object to use.
00021 //    spElParent:       Element into which the element is to be inserted.
00022 //    lpszText:         The text of the element.
00023 //    lpszExtraAttrs:   Extra attributes for the element.
00024 //    pSite:            Interface of the owner. Defaults to NULL.
00025 //
00026 //----------------------------------------------------------------------------
00027 CHTMLEnable::CHTMLEnable(CHTMLHelper *pHH, CHTMLElementPtr& spElParent, CTSTR& lpszText,
00028                          CTSTR& lpszExtraAttrs, IHTMLEnableSite *pSite)
00029 {
00030    m_pSite = pSite;
00031    m_pHH = pHH;
00032    m_spElParent.Assign(spElParent);
00033    m_lpszText.Assign(lpszText);
00034    if(lpszExtraAttrs)
00035       m_lpszExtraAttrs.Assign(lpszExtraAttrs);
00036    else
00037       m_lpszExtraAttrs.Assign(TEXT(" "));
00038    m_bEnabled = FALSE;
00039 }
00040
00041
00042 //----------------------------------------------------------------------------
00043 //
00044 // GetEl function
00045 //    Retrieves the underlying HTML element interface pointer.
00046 //
00047 // Parameters:       None.
00048 //
00049 // Returns:          The HTML element interface pointer object.
00050 //
00051 //----------------------------------------------------------------------------
00052 CHTMLElementPtr& CHTMLEnable::GetEl()
00053 {
00054    return m_spEl;
00055 }
00056
00057
00058 //----------------------------------------------------------------------------
00059 //
00060 // EnableHelper function
00061 //    Creates and adds an element to the parent, using the strings specified.
00062 //
00063 // Parameters:
00064 //    bEnable:          Whether to create the element as enabled (TRUE) or
00065 //                      disabled (FALSE).
00066 //    uidHolder:        String resource identifier of the HTML format string.
00067 //    uidDisabled:      String resource identifier of the attribute(s) that
00068 //                      make the element disabled.
00069 //
00070 //----------------------------------------------------------------------------
00071 void CHTMLEnable::EnableHelper(BOOL bEnable, UINT uidHolder, UINT uidDisabled)
00072 {
00073    if(m_pSite && (m_spEl != NULL) && !bEnable)
00074       m_pSite->PreDisable(this, m_spEl);
00075    m_bEnabled = bEnable;
00076    CTSTR lpszHolder(uidHolder);
00077    CTSTR lpszDisabled;
00078    if(!bEnable)
00079       lpszDisabled.Assign(uidDisabled);
00080    else
00081       lpszDisabled.Assign(TEXT(" "));
00082    CTSTR lpszFinal(TRUE, lpszHolder.Len() + lpszDisabled.Len() + m_lpszText.Len() +
00083       m_lpszExtraAttrs.Len() + 2);
00084    wsprintf(lpszFinal, lpszHolder, lpszDisabled, m_lpszExtraAttrs, m_lpszText);
00085    CHECKHRCOM(m_spElParent->put_innerHTML(CBSTR(lpszFinal)));
00086
00087    m_spEl = m_pHH->GetChild(m_spElParent);
00088
00089    if(m_pSite && bEnable)
00090       m_pSite->PostEnable(this, m_spEl);
00091 }
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlenable.h File Reference

#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class | CHTMLEnable
class | IHTMLEnableSite

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlenable.h Source File

bmws_htmlenable.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlenable.h
00004 //    Abstract class to assist in enabling and disabling MSHTML elements.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLENABLE_H_
00010 #define __BMWS_HTMLENABLE_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlhelpers.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Forward declaration
00021 //----------------------------------------------------------------------------
00022 class CHTMLEnable;
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // IHTMLEnableSite abstract class
00028 //    Enables the owner of the object to perform pre- and post-enable
00029 //    operations.
00030 //
00031 //----------------------------------------------------------------------------
00032 class IHTMLEnableSite
00033 {
00034 public:
00035    virtual void PreDisable(CHTMLEnable *pEnable, CHTMLElementPtr& spEl) = 0;
00036    virtual void PostEnable(CHTMLEnable *pEnable, CHTMLElementPtr& spEl) = 0;
00037 };
00038
00039
00040 //----------------------------------------------------------------------------
00041 //
00042 // CHTMLEnable abstract class
00043 //    Assists in enabling and disabling MSHTML elements.
00044 //
00045 //----------------------------------------------------------------------------
00046 class CHTMLEnable
00047 {
00048 public:
00049    CHTMLEnable(CHTMLHelper *pHH, CHTMLElementPtr& spElParent, CTSTR& lpszText,
00050       CTSTR& lpszExtraAttrs, IHTMLEnableSite *pSite = NULL);
00051    virtual ~CHTMLEnable() {}
00052
00053    virtual void Enable(BOOL bEnable) = 0;
00054    CHTMLElementPtr& GetEl();
00055
00056 protected:
00057    void EnableHelper(BOOL bEnable, UINT uidHolder, UINT uidDisabled);
00058
00059    IHTMLEnableSite *m_pSite;     // Interface of the owner
00060    CHTMLElementPtr m_spElParent; // The parent element object
00061    CHTMLElementPtr m_spEl;       // The inserted object
00062    CHTMLHelper *m_pHH;           // HTML Helper object
00063    CTSTR m_lpszText;             // The text of the link
00064    CTSTR m_lpszExtraAttrs;       // Extra attributes for the element
00065    BOOL m_bEnabled;              // Is the link currently enabled
00066 };
00067
00068
00069 #endif //__BMWS_HTMLENABLE_H_
Generated on Wed May 8 12:38:52 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers.cpp File Reference

#include <bmws_common.h>
#include <bmws_htmlhelpers.h>
#include <bmws_htmlhelpers_res.h>
#include <bmws_htmlhelpers_res_lc.h>
#include <bmws_error.h>
#include <bmws_variant.h>

Go to the source code of this file.

Defines

#define | BMWS_HH_SHOWELEMENT 20002
#define | BMWS_HH_GETTEXT 20003
#define | BMWS_HH_SETTEXT 20004
#define | BMWS_HH_CREATEELEMENT 20005
#define | BMWS_HH_GETEVENT 20006
#define | BMWS_HH_GETRULESTYLE 20007
#define | BMWS_HH_GETCLIPBOARDDATA 20008
#define | BMWS_HH_FOCUSELEMENT 20009
#define | BMWS_HH_PROTECTUI 20010
#define | BMWS_HH_ADDSTYLE 20011
#define | BMWS_HH_DOCWRITE 20012
#define | BMWS_HH_GETSTYLE 20013
#define | BMWS_HH_ENABLE 20014

Functions

void | HHInternalExcep (CExcep *pE, int i)

Define Documentation

#define BMWS_HH_ADDSTYLE 20011

Definition at line 35 of file bmws_htmlhelpers.cpp.

#define BMWS_HH_CREATEELEMENT 20005

Definition at line 29 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::CreateElement().

#define BMWS_HH_DOCWRITE 20012

Definition at line 36 of file bmws_htmlhelpers.cpp.

#define BMWS_HH_ENABLE 20014

Definition at line 38 of file bmws_htmlhelpers.cpp.

#define BMWS_HH_FOCUSELEMENT 20009

Definition at line 33 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::FocusElement().

#define BMWS_HH_GETCLIPBOARDDATA 20008

Definition at line 32 of file bmws_htmlhelpers.cpp.

#define BMWS_HH_GETEVENT 20006

Definition at line 30 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::CancelEvent(), and CHTMLHelper::GetEvent().

#define BMWS_HH_GETRULESTYLE 20007

Definition at line 31 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::GetRuleStyle().

#define BMWS_HH_GETSTYLE 20013

Definition at line 37 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::GetStyle().

#define BMWS_HH_GETTEXT 20003

Definition at line 27 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::GetElText(), and CHTMLHelper::GetElTextWithEl().

#define BMWS_HH_PROTECTUI 20010

Definition at line 34 of file bmws_htmlhelpers.cpp.

#define BMWS_HH_SETTEXT 20004

Definition at line 28 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::SetElText(), and CHTMLHelper::SetElTextWithEl().

#define BMWS_HH_SHOWELEMENT 20002

Definition at line 26 of file bmws_htmlhelpers.cpp.

Referenced by CHTMLHelper::ShowElement().

Function Documentation

void HHInternalExcep | ( | CExcep * | pE,
 |  | int | i
 | ) |

Definition at line 44 of file bmws_htmlhelpers.cpp.

References CExcep::Delete(), ERROR_ERRORINS_INT, IDS_BMWS_HTML_E_INTERNAL, IDS_BMWS_REMEDY_CONTACTBMWS, and THROW.

Referenced by CHTMLHelper::CancelEvent(), CHTMLHelper::CreateElement(), CHTMLHelper::FocusElement(), CHTMLHelper::GetElText(), CHTMLHelper::GetElTextWithEl(), CHTMLHelper::GetEvent(), CHTMLHelper::GetRuleStyle(), CHTMLHelper::GetStyle(), CHTMLHelper::SetElText(), CHTMLHelper::SetElTextWithEl(), and CHTMLHelper::ShowElement().

00045 {
00046    pE->Delete();
00047    THROW(new CExcepEx(IDS_BMWS_HTML_E_INTERNAL, IDS_BMWS_REMEDY_CONTACTBMWS, i, 0,
00048       ERROR_ERRORINS_INT), CExcepEx*);
00049 }

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers.cpp Source File

bmws_htmlhelpers.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlhelpers.cpp
00004 //    Class to assist in common MSHTML-related tasks.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_htmlhelpers.h>
00014 #include <bmws_htmlhelpers_res.h>
00015 #include <bmws_htmlhelpers_res_lc.h>
00016 #include <bmws_error.h>
00017 #include <bmws_variant.h>
00018 #ifdef BMWS_HTMLHELPERS_INCLUDEELINT
00019    #include <shlwapi.h>
00020 #endif // BMWS_HTMLHELPERS_INCLUDEELINT
00021
00022
00023 //----------------------------------------------------------------------------
00024 // Internal exception codes
00025 //----------------------------------------------------------------------------
00026 #define BMWS_HH_SHOWELEMENT         20002
00027 #define BMWS_HH_GETTEXT             20003
00028 #define BMWS_HH_SETTEXT             20004
00029 #define BMWS_HH_CREATEELEMENT       20005
00030 #define BMWS_HH_GETEVENT            20006
00031 #define BMWS_HH_GETRULESTYLE        20007
00032 #define BMWS_HH_GETCLIPBOARDDATA    20008
00033 #define BMWS_HH_FOCUSELEMENT        20009
00034 #define BMWS_HH_PROTECTUI           20010
00035 #define BMWS_HH_ADDSTYLE            20011
00036 #define BMWS_HH_DOCWRITE            20012
00037 #define BMWS_HH_GETSTYLE            20013
00038 #define BMWS_HH_ENABLE              20014
00039
00040
00041 //----------------------------------------------------------------------------
00042 // HTML Helpers exception macros
00043 //----------------------------------------------------------------------------
00044 void HHInternalExcep(CExcep *pE, int i)
00045 {
00046    pE->Delete();
00047    THROW(new CExcepEx(IDS_BMWS_HTML_E_INTERNAL, IDS_BMWS_REMEDY_CONTACTBMWS, i, 0,
00048       ERROR_ERRORINS_INT), CExcepEx*);
00049 }
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CHTMLHelper constructor
00055 //
00056 // Parameters:
00057 //    pDoc2:         Pointer to a IHTMLDocument2 interface.
00058 //
00059 //----------------------------------------------------------------------------
00060 CHTMLHelper::CHTMLHelper(IHTMLDocument2 *pDoc2)
00061 {
00062    ODS("CHTMLHelper constructor");
00063    m_spDoc3.Assign(pDoc2);
00064    pDoc2->get_parentWindow(&m_spWindow2);
00065    m_bstrBeforeEnd.Assign(IDS_BMWS_HTML_BEFOREEND);
00066 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00067    m_uidBody = (UINT)-1;
00068 #endif // BMWS_HTMLHELPERS_PROTECTUI
00069 }
00070
00071
00072 #if defined(BMWS_HTMLHELPERS_PROTECTUI) || defined(BMWS_HTMLHELPERS_CLICKHANDLER)
00073
00074 //----------------------------------------------------------------------------
00075 //
00076 // CHTMLHelper destructor
00077 //
00078 //----------------------------------------------------------------------------
00079 CHTMLHelper::~CHTMLHelper()
00080 {
00081    ODS("CHTMLHelper destructor");
00082    VARIANT vHandler;
00083    VariantInit(&vHandler);
00084    vHandler.vt = VT_NULL;
00085
00086 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00087    if(m_uidBody != (UINT)-1)
00088    {
00089       try
00090       {
00091          CHTMLElementPtr spEl(TRUE, GetNamedEl(m_uidBody, IID_IHTMLElement));
00092          spEl->put_ondragstart(vHandler);
00093          spEl->put_onselectstart(vHandler);
00094       }
00095       catch(CExcep *pE)
00096       {
00097          pE->Delete();
00098       }
00099    }
00100 #endif
00101
00102 #ifdef BMWS_HTMLHELPERS_CLICKHANDLER
00103    int cEls = m_auIDsClickHandled.GetSize();
00104    for(int i = 0; i < cEls; i++)
00105    {
00106       CHTMLElementPtr spEl(TRUE, GetNamedEl(m_auIDsClickHandled[i], IID_IHTMLElement));
00107       spEl->put_onclick(vHandler);
00108    }
00109 #endif
00110 }
00111
00112 #endif
00113
00114
00115 //----------------------------------------------------------------------------
00116 //
00117 // GetEl function
00118 //    Retrieves an interface pointer to a HTML element from the element
00119 //    collection, based on the element's ID.
00120 //
00121 // Parameters:
00122 //    bstrID:        The string ID of the element to retrieve.
00123 //    riid:          The identifier of the interface requested.
00124 //
00125 // Returns:          The interface pointer requested.
00126 //
00127 // Throws:           Exception if the element or interface could not be found.
00128 //
00129 //----------------------------------------------------------------------------
00130 LPVOID CHTMLHelper::GetEl(BSTR bstrID, REFIID riid)
00131 {
00132    LPVOID pv = NULL;
00133    CHTMLElementPtr spEl;
00134    try
00135    {
00136       CHECKHRCOM(m_spDoc3->getElementById(bstrID, &spEl));
00137       CHECKHRCOM(spEl->QueryInterface(riid, &pv));
00138    }
00139    catch(CCOMExcep *pE)
00140    {
00141       RETHROWCOM(pE);
00142       THROW(new CExcepEx(IDS_BMWS_HTML_E_NOELEMENT, IDS_BMWS_REMEDY_RESTART,
00143          (UINT_PTR)(LPTSTR)CTSTR(bstrID), 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00144    }
00145
00146    return pv;
00147 }
00148
00149
00150 //----------------------------------------------------------------------------
00151 //
00152 // GetNamedEl function
00153 //    Retrieves an interface pointer to a HTML element from the element
00154 //    collection, loading the element's ID from the string table.
00155 //
00156 // Parameters:
00157 //    uID:           Resource identifier of the element's ID string.
00158 //    riid:          The identifier of the interface requested.
00159 //
00160 // Returns:          The interface pointer requested.
00161 //
00162 // Throws:           Exception if the element or interface could not be found.
00163 //
00164 //----------------------------------------------------------------------------
00165 LPVOID CHTMLHelper::GetNamedEl(UINT uID, REFIID riid)
00166 {
00167    return GetEl(CBSTR(uID), riid);
00168 }
00169
00170
00171 //----------------------------------------------------------------------------
00172 //
00173 // GetNumberedEl function
00174 //    Retrieves an interface pointer to a HTML element from the element
00175 //    collection, creating the element's ID from a resource string and a
00176 //    number.
00177 //
00178 // Parameters:
00179 //    uIDFormatter:  Resource identifier of the string to use to format the
00180 //                   element's ID.
00181 //    uiIndex:       Number to insert into the formatter.
00182 //    riid:          The identifier of the interface requested.
00183 //
00184 // Returns:          The interface pointer requested.
00185 //
00186 // Throws:           Exception if the element or interface could not be found.
00187 //
00188 //----------------------------------------------------------------------------
00189 LPVOID CHTMLHelper::GetNumberedEl(UINT uidFormatter, UINT uiIndex, REFIID riid)
00190 {
00191    return GetEl(CBSTR(CTSTR(uidFormatter), uiIndex), riid);
00192 }
00193
00194
00195 //----------------------------------------------------------------------------
00196 //
00197 // ShowElement function
00198 //    Shows or hides the specified HTML element, by changing CSS attributes.
00199 //
00200 // Parameters:
00201 //    pEl:           HTML element to show or hide.
00202 //    bShow:         Whether to show (TRUE) or hide (FALSE).
00203 //
00204 // Returns:          None.
00205 //
00206 // Throws:           Internal exception if the operation failed.
00207 //
00208 //----------------------------------------------------------------------------
00209 void CHTMLHelper::ShowElement(IHTMLElement *pEl, BOOL bShow)
00210 {
00211    try
00212    {
00213       CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00214       CHECKHRCOM(pEl->get_style(&spStyle));
00215       CBSTR bstrStyleDisplay;
00216
00217       if(!bShow)
00218          bstrStyleDisplay.Assign(IDS_BMWS_HTML_DISPLAYNONE);
00219       CHECKHRCOM(spStyle->put_display(bstrStyleDisplay));
00220    }
00221    catch(CCOMExcep *pE)
00222    {
00223       HHInternalExcep(pE, BMWS_HH_SHOWELEMENT);
00224    }
00225 }
00226
00227
00228 //----------------------------------------------------------------------------
00229 //
00230 // ShowElementEx function
00231 //    Shows or hides the HTML element specified by a resource string, by
00232 //    changing CSS attributes.
00233 //
00234 // Parameters:
00235 //    uID:           Resource identifier of the ID string of the element.
00236 //    bShow:         Whether to show (TRUE) or hide (FALSE).
00237 //
00238 // Returns:          None.
00239 //
00240 // Throws:           Internal exception if the operation failed; Exception if
00241 //                   the element or interface could not be found.
00242 //
00243 //----------------------------------------------------------------------------
00244 void CHTMLHelper::ShowElementEx(UINT uID, BOOL bShow)
00245 {
00246    CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00247    ShowElement(spEl, bShow);
00248 }
00249
00250
00251 //----------------------------------------------------------------------------
00252 //
00253 // SetElText function
00254 //    Sets the inner text contents of the HTML element to the given string.
00255 //
00256 // Parameters:
00257 //    uID:           Resource identifier of the ID string of the element.
00258 //    bstrText:      The text to set.
00259 //    bEdit:         Whether the element is an INPUT type=text element.
00260 //                   Defaults to FALSE.
00261 //
00262 // Returns:          None.
00263 //
00264 // Throws:           Internal exception if the operation failed; Exception if
00265 //                   the element or interface could not be found.
00266 //
00267 //----------------------------------------------------------------------------
00268 void CHTMLHelper::SetElText(UINT uID, CBSTR& bstrText, BOOL bEdit)
00269 {
00270    try
00271    {
00272       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00273       SetElTextWithEl(spEl, bstrText, bEdit);
00274    }
00275    catch(CCOMExcep *pE)
00276    {
00277       HHInternalExcep(pE, BMWS_HH_SETTEXT);
00278    }
00279 }
00280
00281
00282 //----------------------------------------------------------------------------
00283 //
00284 // SetElTextWithEl function
00285 //    Sets the inner text contents of the HTML element to the given string.
00286 //
00287 // Parameters:
00288 //    pEl:           The HTML element whose text is to be set.
00289 //    bstrText:      The text to set.
00290 //    bEdit:         Whether the element is an INPUT type=text element.
00291 //                   Defaults to FALSE.
00292 //
00293 // Returns:          None.
00294 //
00295 // Throws:           Internal exception if the operation failed; Exception if
00296 //                   the element or interface could not be found.
00297 //
00298 //----------------------------------------------------------------------------
00299 void CHTMLHelper::SetElTextWithEl(CHTMLElementPtr& spEl, CBSTR& bstrText, BOOL bEdit)
00300 {
00301    try
00302    {
00303       if(bEdit)
00304       {
00305          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl(spEl);
00306          CHECKHRCOM(spTextEl->put_value(bstrText));
00307       } else
00308       {
00309          CHECKHRCOM(spEl->put_innerText(bstrText));
00310       }
00311    }
00312    catch(CCOMExcep *pE)
00313    {
00314       HHInternalExcep(pE, BMWS_HH_SETTEXT);
00315    }
00316 }
00317
00318
00319 //----------------------------------------------------------------------------
00320 //
00321 // CreateElement function
00322 //    Creates and returns a new HTML element.
00323 //
00324 // Parameters:
00325 //    pDoc:          HTML document in which to create the element.
00326 //    uIDTag:        Resource identifier of the tag name of the element.
00327 //    riid:          The identifier of the interface requested.
00328 //
00329 // Returns:          The requested interface pointer of the new element.
00330 //
00331 // Throws:           Internal exception if the operation failed; Exception if
00332 //                   the element or interface could not be found.
00333 //
00334 //----------------------------------------------------------------------------
00335 LPVOID CHTMLHelper::CreateElement(UINT uIDTag, REFIID riid)
00336 {
00337    LPVOID pv = NULL;
00338    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc2;
00339    CHTMLElementPtr spEl;
00340
00341    try
00342    {
00343       spDoc2.Assign(m_spDoc3);
00344       CHECKHRCOM(spDoc2->createElement(CBSTR(uIDTag), &spEl));
00345       CHECKHRCOM(spEl->QueryInterface(riid, &pv));
00346    }
00347    catch(CCOMExcep *pE)
00348    {
00349       HHInternalExcep(pE, BMWS_HH_CREATEELEMENT);
00350    }
00351
00352    return pv;
00353 }
00354
00355
00356 //----------------------------------------------------------------------------
00357 //
00358 // GetElText function
00359 //    Retrieves the inner text contents of the HTML element.
00360 //
00361 // Parameters:
00362 //    uID:           Resource identifier of the ID string of the element.
00363 //    bEdit:         Whether the element is an INPUT type=text element.
00364 //                   Defaults to FALSE.
00365 //
00366 // Returns:          The text contents of the element.
00367 //
00368 // Throws:           Internal exception if the operation failed; Exception if
00369 //                   the element or interface could not be found.
00370 //
00371 //----------------------------------------------------------------------------
00372 CBSTR CHTMLHelper::GetElText(UINT uID, BOOL bEdit)
00373 {
00374    CBSTR bstrReturn;
00375    try
00376    {
00377       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00378       bstrReturn = GetElTextWithEl(spEl, bEdit);
00379    }
00380    catch(CCOMExcep *pE)
00381    {
00382       HHInternalExcep(pE, BMWS_HH_GETTEXT);
00383    }
00384    return bstrReturn;
00385 }
00386
00387
00388 //----------------------------------------------------------------------------
00389 //
00390 // GetElTextWithEl function
00391 //    Retrieves the inner text contents of the HTML element.
00392 //
00393 // Parameters:
00394 //    pEl:           The HTML element whose text is to be retrieved.
00395 //    bEdit:         Whether the element is an INPUT type=text element.
00396 //                   Defaults to FALSE.
00397 //
00398 // Returns:          The text contents of the element.
00399 //
00400 // Throws:           Internal exception if the operation failed; Exception if
00401 //                   the element or interface could not be found.
00402 //
00403 //----------------------------------------------------------------------------
00404 CBSTR CHTMLHelper::GetElTextWithEl(CHTMLElementPtr& spEl, BOOL bEdit)
00405 {
00406    CBSTR bstrReturn;
00407    try
00408    {
00409       if(bEdit)
00410       {
00411          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl(spEl);
00412          CHECKHRCOM(spTextEl->get_value(bstrReturn.Addr()));
00413       } else
00414       {
00415          CHECKHRCOM(spEl->get_innerText(bstrReturn.Addr()));
00416       }
00417    }
00418    catch(CCOMExcep *pE)
00419    {
00420       HHInternalExcep(pE, BMWS_HH_GETTEXT);
00421    }
00422    return bstrReturn;
00423 }
00424
00425
00426 #ifdef BMWS_HTMLHELPERS_INCLUDEELINT
00427
00428 //----------------------------------------------------------------------------
00429 //
00430 // GetElInt function
00431 //    Retrieves the numerical contents of the HTML element.
00432 //
00433 // Parameters:
00434 //    uID:           Resource identifier of the ID string of the element.
00435 //    bEdit:         Whether the element is an INPUT type=text element.
00436 //                   Defaults to FALSE.
00437 //
00438 // Returns:          The integer value.
00439 //
00440 // Throws:           Internal exception if the operation failed; Exception if
00441 //                   the element or interface could not be found.
00442 //
00443 //----------------------------------------------------------------------------
00444 int CHTMLHelper::GetElInt(UINT uID, BOOL bEdit)
00445 {
00446    CTSTR lpsz(GetElText(uID, bEdit));
00447    if(lpsz.Len() > 0)
00448       return StrToInt(lpsz);
00449    else
00450       return 0;
00451 }
00452
00453
00454 //----------------------------------------------------------------------------
00455 //
00456 // SetElInt function
00457 //    Sets the numerical contents of the HTML element.
00458 //
00459 // Parameters:
00460 //    uID:           Resource identifier of the ID string of the element.
00461 //    iValue:        The integer value.
00462 //    bEdit:         Whether the element is an INPUT type=text element.
00463 //                   Defaults to FALSE.
00464 //
00465 // Returns:          None.
00466 //
00467 // Throws:           Internal exception if the operation failed; Exception if
00468 //                   the element or interface could not be found.
00469 //
00470 //----------------------------------------------------------------------------
00471 void CHTMLHelper::SetElInt(UINT uID, int iValue, BOOL bEdit)
00472 {
00473    SetElText(uID, CBSTR(FMTINT, iValue), bEdit);
00474 }
00475
00476
00477 //----------------------------------------------------------------------------
00478 //
00479 // GetElIntWithEl function
00480 //    Retrieves the numerical contents of the HTML element.
00481 //
00482 // Parameters:
00483 //    pEl:           The HTML element whose value is to be retrieved.
00484 //    bEdit:         Whether the element is an INPUT type=text element.
00485 //                   Defaults to FALSE.
00486 //
00487 // Returns:          The integer value.
00488 //
00489 // Throws:           Internal exception if the operation failed; Exception if
00490 //                   the element or interface could not be found.
00491 //
00492 //----------------------------------------------------------------------------
00493 CHTMLHelper::GetElIntWithEl(CHTMLElementPtr &spEl, BOOL bEdit)
00494 {
00495    CTSTR lpsz(GetElTextWithEl(spEl, bEdit));
00496    if(lpsz.Len() > 0)
00497       return StrToInt(lpsz);
00498    else
00499       return 0;
00500 }
00501
00502
00503 //----------------------------------------------------------------------------
00504 //
00505 // SetElIntWithEl function
00506 //    Sets the numerical contents of the HTML element.
00507 //
00508 // Parameters:
00509 //    pEl:           The HTML element whose value is to be set.
00510 //    iValue:        The integer value.
00511 //    bEdit:         Whether the element is an INPUT type=text element.
00512 //                   Defaults to FALSE.
00513 //
00514 // Returns:          None.
00515 //
00516 // Throws:           Internal exception if the operation failed; Exception if
00517 //                   the element or interface could not be found.
00518 //
00519 //----------------------------------------------------------------------------
00520 void CHTMLHelper::SetElIntWithEl(CHTMLElementPtr &spEl, int iValue, BOOL bEdit)
00521 {
00522    SetElTextWithEl(spEl, CBSTR(FMTINT, iValue), bEdit);
00523 }
00524
00525 #endif // BMWS_HTMLHELPERS_INCLUDEELINT
00526
00527
00528 //----------------------------------------------------------------------------
00529 //
00530 // GetEvent function
00531 //    Retrieves the HTML window's event object.
00532 //
00533 // Parameters:       None.
00534 //
00535 // Returns:          The event object interface pointer.
00536 //
00537 // Throws:           Internal exception if the operation failed.
00538 //
00539 //----------------------------------------------------------------------------
00540 CHTMLEventObjPtr CHTMLHelper::GetEvent()
00541 {
00542    CHTMLEventObjPtr pEventObj;
00543    try
00544    {
00545       CHECKHRCOM(m_spWindow2->get_event(&pEventObj));
00546    }
00547    catch(CCOMExcep *pE)
00548    {
00549       HHInternalExcep(pE, BMWS_HH_GETEVENT);
00550    }
00551    return pEventObj;
00552 }
00553
00554
00555 //----------------------------------------------------------------------------
00556 //
00557 // CancelEvent function
00558 //    Retrieves the HTML window's event object.
00559 //
00560 // Parameters:       None.
00561 //
00562 // Returns:          The event object interface pointer.
00563 //
00564 // Throws:           Internal exception if the operation failed.
00565 //
00566 //----------------------------------------------------------------------------
00567 void CHTMLHelper::CancelEvent()
00568 {
00569    CHTMLEventObjPtr spEventObj;
00570    try
00571    {
00572       CHECKHRCOM(m_spWindow2->get_event(&spEventObj));
00573       VARIANT v;
00574       v.vt = VT_BOOL;
00575       v.boolVal = VARIANT_FALSE;
00576       CHECKHRCOM(spEventObj->put_returnValue(v));
00577    }
00578    catch(CCOMExcep *pE)
00579    {
00580       HHInternalExcep(pE, BMWS_HH_GETEVENT);
00581    }
00582 }
00583
00584
00585 #ifdef BMWS_HTMLHELPERS_INCLUDECLIP
00586
00587 //----------------------------------------------------------------------------
00588 //
00589 // GetClipboardData function
00590 //    Retrieves the HTML window's clipboard data transfer object.
00591 //
00592 // Parameters:       None.
00593 //
00594 // Returns:          The clipboard interface pointer.
00595 //
00596 // Throws:           Internal exception if the operation failed.
00597 //
00598 //----------------------------------------------------------------------------
00599 CPtr<IHTMLDataTransfer, &IID_IHTMLDataTransfer> CHTMLHelper::GetClipboardData()
00600 {
00601    CPtr<IHTMLDataTransfer, &IID_IHTMLDataTransfer> pClipboardData;
00602    try
00603    {
00604       CHECKHRCOM((CPtr<IHTMLWindow3, &IID_IHTMLWindow3>(m_spWindow2))->get_clipboardData(&pClipboardData));
00605    }
00606    catch(CCOMExcep *pE)
00607    {
00608       HHInternalExcep(pE, BMWS_HH_GETCLIPBOARDDATA);
00609    }
00610
00611    return pClipboardData;
00612 }
00613
00614 #endif // BMWS_HTMLHEMLPERS_INCLUDECLIP
00615
00616
00617 //----------------------------------------------------------------------------
00618 //
00619 // GetRuleStyle function
00620 //    Retrieves an IHTMLRuleStyle interface pointer for a specified indexed
00621 //    rule of the specified document stylesheet.
00622 //
00623 // Parameters:
00624 //    uID:           Resource identifier of the ID string of the stylesheet.
00625 //    lIndex:        Index of the rule to retrieve.
00626 //
00627 // Returns:          The interface pointer of the rule.
00628 //
00629 // Throws:           Internal exception if the operation failed; Exception if
00630 //                   the element or interface could not be found.
00631 //
00632 //----------------------------------------------------------------------------
00633 CHTMLRuleStylePtr CHTMLHelper::GetRuleStyle(UINT uID, long lIndex)
00634 {
00635    CHTMLRuleStylePtr pRuleStyle;
00636    try
00637    {
00638 #ifdef BMWS_HTMLHELPERS_ADDSTYLE
00639       CPtr<IHTMLStyleSheet, &IID_IHTMLStyleSheet> spSheet;
00640       if((uID == 0) || (uID == (UINT)-1))
00641          spSheet.Assign(m_spStyleSheet);
00642       else
00643          spSheet = GetStyleSheet(uID);
00644 #else
00645       CPtr<IHTMLStyleSheet, &IID_IHTMLStyleSheet> spSheet = GetStyleSheet(uID);
00646 #endif
00647       CPtr<IHTMLStyleSheetRulesCollection, &IID_IHTMLStyleSheetRulesCollection> spRules;
00648       CHECKHRCOM(spSheet->get_rules(&spRules));
00649       CPtr<IHTMLStyleSheetRule, &IID_IHTMLStyleSheetRule> spRule;
00650       CHECKHRCOM(spRules->item(lIndex, &spRule));
00651       CHECKHRCOM(spRule->get_style(&pRuleStyle));
00652    }
00653    catch(CCOMExcep *pE)
00654    {
00655       HHInternalExcep(pE, BMWS_HH_GETRULESTYLE);
00656    }
00657
00658    return pRuleStyle;
00659 }
00660
00661
00662 //----------------------------------------------------------------------------
00663 //
00664 // FocusElement function
00665 //    Sets or removes focus to or from the specified HTML element.
00666 //
00667 // Parameters:
00668 //    pEl:           HTML element to focus or blur.
00669 //    bFocus:        Whether to set focus (TRUE) or blur (FALSE).
00670 //
00671 // Returns:          None.
00672 //
00673 // Throws:           Internal exception if the operation failed.
00674 //
00675 //----------------------------------------------------------------------------
00676 void CHTMLHelper::FocusElement(CHTMLElementPtr& pEl, BOOL bFocus)
00677 {
00678    try
00679    {
00680       CHTMLElement2Ptr spEl2 = pEl;
00681       if(bFocus)
00682       {
00683          CHECKHRCOM(spEl2->focus());
00684          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl;
00685          if(SUCCEEDED(pEl->QueryInterface(IID_IHTMLInputTextElement, (LPVOID*)&spTextEl)))
00686          {
00687             CHECKHRCOM(spTextEl->select());
00688          }
00689       } else
00690       {
00691          CHECKHRCOM(spEl2->blur());
00692       }
00693    }
00694    catch(CCOMExcep *pE)
00695    {
00696       HHInternalExcep(pE, BMWS_HH_FOCUSELEMENT);
00697    }
00698 }
00699
00700
00701 //----------------------------------------------------------------------------
00702 //
00703 // FocusElement function
00704 //    Sets or removes focus to or from the HTML element specified by a
00705 //    resource string.
00706 //
00707 // Parameters:
00708 //    uID:           Resource identifier of the ID string of the element.
00709 //    bFocus:        Whether to set focus (TRUE) or blur (FALSE).
00710 //
00711 // Returns:          None.
00712 //
00713 // Throws:           Internal exception if the operation failed; Exception if
00714 //                   the element or interface could not be found.
00715 //
00716 //----------------------------------------------------------------------------
00717 void CHTMLHelper::FocusElementEx(UINT uID, BOOL bFocus)
00718 {
00719    FocusElement(CHTMLElementPtr(TRUE, GetNamedEl(uID, IID_IHTMLElement)), bFocus);
00720 }
00721
00722
00723 #ifdef BMWS_HTMLHELPERS_ENABLE
00724
00725 //----------------------------------------------------------------------------
00726 //
00727 // EnableElement function
00728 //    Enables or disables the HTML element specified by a resource string.
00729 //
00730 // Parameters:
00731 //    pEl:           The element to change.
00732 //    bEnable:       Whether to enable (TRUE) or disable (FALSE).
00733 //    bInput:        Whether the element is a type of INPUT element.
00734 //    pbstrClass:    Pointer to the string that the element's class should be
00735 //                   set to. Defaults to NULL, in which case no class is
00736 //                   assigned.
00737 //
00738 // Returns:          None.
00739 //
00740 // Throws:           Internal exception if the operation failed.
00741 //
00742 //----------------------------------------------------------------------------
00743 void CHTMLHelper::EnableElement(CHTMLElementPtr& pEl, BOOL bEnable, BOOL bInput,
00744                                 CBSTR *pbstrClass)
00745 {
00746    try
00747    {
00748       VARIANT_BOOL vb = (bEnable ? VARIANT_FALSE : VARIANT_TRUE);
00749       if(pbstrClass)
00750       {
00751          CHECKHRCOM(pEl->put_className(*pbstrClass));
00752       }
00753       if(bInput)
00754       {
00755          CPtr<IHTMLInputElement, &IID_IHTMLInputElement> spInputEl(pEl);
00756          CHECKHRCOM(spInputEl->put_disabled(vb));
00757       } else
00758       {
00759          CPtr<IHTMLTextAreaElement, &IID_IHTMLTextAreaElement> spTextEl;
00760          if(SUCCEEDED(pEl->QueryInterface(IID_IHTMLTextAreaElement, (LPVOID*)&spTextEl)))
00761          {
00762             CHECKHRCOM(spTextEl->put_disabled(vb));
00763          } else
00764          {
00765             CPtr<IHTMLSelectElement, &IID_IHTMLSelectElement> spSelectEl;
00766             if(SUCCEEDED(pEl->QueryInterface(IID_IHTMLSelectElement, (LPVOID*)&spSelectEl)))
00767             {
00768                CHECKHRCOM(spSelectEl->put_disabled(vb));
00769             } else
00770             {
00771                CPtr<IHTMLButtonElement, &IID_IHTMLButtonElement> spButtonEl;
00772                if(SUCCEEDED(pEl->QueryInterface(IID_IHTMLButtonElement, (LPVOID*)&spButtonEl)))
00773                {
00774                   CHECKHRCOM(spButtonEl->put_disabled(vb));
00775                }
00776             }
00777          }
00778       }
00779    }
00780    catch(CCOMExcep *pE)
00781    {
00782       HHInternalExcep(pE, BMWS_HH_ENABLE);
00783    }
00784 }
00785
00786
00787 //----------------------------------------------------------------------------
00788 //
00789 // EnableElementEx function
00790 //    Enables or disables the HTML element specified by a resource string.
00791 //
00792 // Parameters:
00793 //    uID:           Resource identifier of the ID string of the element.
00794 //    bEnable:       Whether to enable (TRUE) or disable (FALSE).
00795 //    bInput:        Whether the element is a type of INPUT element.
00796 //    pbstrClass:    Pointer to the string that the element's class should be
00797 //                   set to. Defaults to NULL, in which case no class is
00798 //                   assigned.
00799 //
00800 // Returns:          None.
00801 //
00802 // Throws:           Internal exception if the operation failed.
00803 //
00804 //----------------------------------------------------------------------------
00805 void CHTMLHelper::EnableElementEx(UINT uID, BOOL bEnable, BOOL bInput, CBSTR *pbstrClass)
00806 {
00807    EnableElement(CHTMLElementPtr(TRUE, GetNamedEl(uID, IID_IHTMLElement)), bEnable, bInput,
00808       pbstrClass);
00809 }
00810
00811 #endif
00812
00813
00814 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00815
00816 //----------------------------------------------------------------------------
00817 //
00818 // ProtectUI function
00819 //    Sets up event handlers to prevent selecting and/or dragging the UI.
00820 //
00821 // Parameters:
00822 //    uidBody:       Resource identifier of the BODY element's ID string.
00823 //
00824 // Returns:          None.
00825 //
00826 // Throws:           Internal exception if the operation failed; Exception if
00827 //                   the element or interface could not be found.
00828 //
00829 //----------------------------------------------------------------------------
00830 void CHTMLHelper::ProtectUI(UINT uidBody)
00831 {
00832    CVariant vHandler;
00833    CHTMLElementPtr spEl(TRUE, GetNamedEl(uidBody, IID_IHTMLElement));
00834    m_uidBody = uidBody;
00835
00836    try
00837    {
00838       CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00839       ENSUREALLOC(pHandler);
00840       vHandler.vt = VT_DISPATCH;
00841       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00842       CHECKHRCOM(spEl->put_ondragstart(vHandler));
00843
00844       VariantClear(&vHandler);
00845       pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 1);
00846       ENSUREALLOC(pHandler);
00847       vHandler.vt = VT_DISPATCH;
00848       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00849       CHECKHRCOM(spEl->put_onselectstart(vHandler));
00850    }
00851    catch(CCOMExcep *pE)
00852    {
00853       HHInternalExcep(pE, BMWS_HH_PROTECTUI);
00854    }
00855 }
00856
00857
00858 //----------------------------------------------------------------------------
00859 //
00860 // IEventHandlerSite::EventHandler method
00861 //    Handles events that are trapped via a CEventHandler object.
00862 //
00863 // Parameters:
00864 //    dwEventID:     Event identifier; 0 to signify the event should be
00865 //                   cancelled.
00866 //    lParam:        Event-specific parameter. Unused.
00867 //
00868 // Returns:          None.
00869 //
00870 // Throws:           Internal exception if the operation failed.
00871 //
00872 //----------------------------------------------------------------------------
00873 void CHTMLHelper::EventHandler(DWORD dwEventID, LPARAM lParam)
00874 {
00875    if(dwEventID == 0)
00876    {
00877       try
00878       {  // Windows-called code
00879          // Cancels the MSHTML event, unless it came from an Input Text element.
00880          // Used to prohibit dragging and selecting the UI.
00881          CHTMLEventObjPtr spEventObj = GetEvent();
00882          CHTMLElementPtr spElSrc;
00883          CHECKHRCOM(spEventObj->get_srcElement(&spElSrc));
00884          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spElText;
00885          CPtr<IHTMLTextAreaElement, &IID_IHTMLTextAreaElement> spElArea;
00886          if(FAILED(spElSrc->QueryInterface(IID_IHTMLInputTextElement, (LPVOID*)&spElText)) &&
00887             FAILED(spElSrc->QueryInterface(IID_IHTMLTextAreaElement, (LPVOID*)&spElArea)))
00888          {
00889             VARIANT v;
00890             v.vt = VT_BOOL;
00891             v.boolVal = VARIANT_FALSE;
00892             CHECKHRCOM(spEventObj->put_returnValue(v));
00893          }
00894       }
00895       catch(CCOMExcep *pE)
00896       {
00897          pE->Delete();
00898          CExcepEx(IDS_BMWS_HTML_E_INTERNAL, IDS_BMWS_REMEDY_CONTACTBMWS, BMWS_HH_PROTECTUI, 0,
00899             ERROR_ERRORINS_INT).Report();
00900       }
00901    }
00902 }
00903
00904 #endif // BMWS_HTMLHEMLPERS_PROTECTUI
00905
00906
00907 #ifdef BMWS_HTMLHELPERS_ADDSTYLE
00908
00909 //----------------------------------------------------------------------------
00910 //
00911 // InitAddStyle function
00912 //    Caches the document's first style sheet object for use with the AddStyle
00913 //    function.
00914 //
00915 // Parameters:       None.
00916 //
00917 // Returns:          None.
00918 //
00919 // Throws:           Exception if the function fails.
00920 //
00921 //----------------------------------------------------------------------------
00922 void CHTMLHelper::InitAddStyle()
00923 {
00924    m_spStyleSheet = GetStyleSheet((UINT)-1);
00925 }
00926
00927
00928 //----------------------------------------------------------------------------
00929 //
00930 // AddStyle function
00931 //    Adds a style rule to the document's first style sheet.
00932 //
00933 // Parameters:
00934 //    bstrSelector:  String that specifies the selector for the new rule.
00935 //    bstrStyle:     String that specifies the style assignments for the rule.
00936 //
00937 // Returns:          None.
00938 //
00939 // Throws:           Exception if the function fails.
00940 //
00941 //----------------------------------------------------------------------------
00942 void CHTMLHelper::AddStyle(CBSTR& bstrSelector, CBSTR& bstrStyle)
00943 {
00944    _ASSERT(bstrSelector);
00945    _ASSERT(bstrStyle);
00946    _ASSERT(m_spStyleSheet);
00947
00948    try
00949    {
00950       long l;
00951       CHECKHRCOM(m_spStyleSheet->addRule(bstrSelector, bstrStyle, -1, &l));
00952    }
00953    catch(CCOMExcep *pE)
00954    {
00955       HHInternalExcep(pE, BMWS_HH_ADDSTYLE);
00956    }
00957 }
00958
00959
00960 //----------------------------------------------------------------------------
00961 //
00962 // SetHlinkColor function
00963 //    Sets the color that hyperlinks are displayed in.
00964 //
00965 // Parameters:
00966 //    color:         The color value.
00967 //    uidStyle:      String resource identifier of the formatter for the
00968 //                   style.
00969 //
00970 // Returns:          None.
00971 //
00972 // Throws:           Exception if the function fails.
00973 //
00974 //----------------------------------------------------------------------------
00975 void CHTMLHelper::SetHlinkColor(COLORREF color, UINT uidStyle)
00976 {
00977    try
00978    {
00979       CTSTR lpszStyle(uidStyle);
00980       CTSTR lpszTotal(TRUE, lpszStyle.Len() + 16);
00981       wsprintf(lpszTotal, lpszStyle, GetRValue(color), GetGValue(color), GetBValue(color));
00982       AddStyle(CBSTR(TEXT("a")), CBSTR(lpszTotal));
00983    }
00984    catch(CCOMExcep *pE)
00985    {
00986       HHInternalExcep(pE, BMWS_HH_ADDSTYLE);
00987    }
00988 }
00989
00990 #endif
00991
00992
00993 #ifdef BMWS_HTMLHELPERS_WRITE
00994
00995 //----------------------------------------------------------------------------
00996 //
00997 // DocWrite function
00998 //    Writes a string of text directly to the HTML document.
00999 //
01000 // Parameters:
01001 //    bstrText:      String to write into the document.
01002 //
01003 // Returns:          None.
01004 //
01005 // Throws:           Exception if the function fails.
01006 //
01007 //----------------------------------------------------------------------------
01008 void CHTMLHelper::DocWrite(CBSTR& bstrText)
01009 {
01010    _ASSERT(bstrText);
01011
01012    SAFEARRAY *psfArray = NULL;
01013    try
01014    {
01015       CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc2(m_spDoc3);
01016       psfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1);
01017       ENSUREALLOC(psfArray);
01018
01019       VARIANT *pVar;
01020       CHECKHRCOM(SafeArrayAccessData(psfArray, (LPVOID*)&pVar));
01021       pVar->vt = VT_BSTR;
01022       pVar->bstrVal = CBSTR(bstrText).Detach();
01023       CHECKHRCOM(SafeArrayUnaccessData(psfArray));
01024       CHECKHRCOM(spDoc2->write(psfArray));
01025       SafeArrayDestroy(psfArray);
01026    }
01027    catch(CCOMExcep *pE)
01028    {
01029       if(psfArray)
01030          SafeArrayDestroy(psfArray);
01031       HHInternalExcep(pE, BMWS_HH_DOCWRITE);
01032    }
01033    catch(CExcep *pE)
01034    {
01035       if(psfArray)
01036          SafeArrayDestroy(psfArray);
01037       throw pE;
01038    }
01039 }
01040
01041 #endif
01042
01043
01044 #ifdef BMWS_HTMLHELPERS_CLICKHANDLER
01045
01046 //----------------------------------------------------------------------------
01047 //
01048 // InitClickHandler function
01049 //    Sets the number of click events that will be encapsulated.
01050 //
01051 // Parameters:
01052 //    cHelpers:      The number of click events that will be encapsulated.
01053 //
01054 // Returns:          None.
01055 //
01056 //----------------------------------------------------------------------------
01057 void CHTMLHelper::InitClickHandler(int cHelpers)
01058 {
01059    if(cHelpers < m_auIDsClickHandled.GetSize())
01060    {
01061       VARIANT vHandler;
01062       VariantInit(&vHandler);
01063       vHandler.vt = VT_NULL;
01064
01065       for(int i = cHelpers; i < m_auIDsClickHandled.GetSize(); i++)
01066       {
01067          CHTMLElementPtr spEl(TRUE, GetNamedEl(m_auIDsClickHandled[i], IID_IHTMLElement));
01068          spEl->put_onclick(vHandler);
01069       }
01070    }
01071    m_auIDsClickHandled.SetSize(cHelpers);
01072 }
01073
01074
01075 //----------------------------------------------------------------------------
01076 //
01077 // SetClickHandler function
01078 //    Creates and assigns a click handler for a specified element.
01079 //
01080 // Parameters:
01081 //    iIndex:        Zero-based index of the event.
01082 //    uID:           String resource identifier of the element whose onclick
01083 //                   event will be handled.
01084 //    pSite:         Interface of the creator.
01085 //    lParam:        Parameter, used by the creator.
01086 //
01087 // Returns:          None.
01088 //
01089 // Throws:           Exception if the function fails.
01090 //
01091 //----------------------------------------------------------------------------
01092 void CHTMLHelper::SetClickHandler(int iIndex, UINT uID, IEventHandlerSite *pSite, LPARAM lParam)
01093 {
01094    _ASSERT(pSite);
01095    CEventHandler *pHandler = new CEventHandler(pSite, uID, lParam);
01096    ENSUREALLOC(pHandler);
01097    CVariant vHandler;
01098    vHandler.vt = VT_DISPATCH;
01099    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
01100    CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
01101    CHECKHRCOM(spEl->put_onclick(vHandler));
01102    m_auIDsClickHandled.SetAt(iIndex, uID);
01103 }
01104
01105 #endif
01106
01107
01108 //----------------------------------------------------------------------------
01109 //
01110 // GetStyleSheet function
01111 //    Retrieves the IHTMLStyleSheet interface pointer for a specified document
01112 //    stylesheet.
01113 //
01114 // Parameters:
01115 //    uID:           Resource identifier of the ID string of the stylesheet.
01116 //                   If -1, the first stylesheet will be retrieved.
01117 //
01118 // Returns:          The interface pointer of the style sheet.
01119 //
01120 // Throws:           Exception if the element or interface could not be
01121 //                   found.
01122 //
01123 //----------------------------------------------------------------------------
01124 CHTMLStyleSheetPtr CHTMLHelper::GetStyleSheet(UINT uID)
01125 {
01126    CHTMLStyleSheetPtr pReturn;
01127    if(uID == (UINT)-1)
01128    {
01129       CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc2(m_spDoc3);
01130       CPtr<IHTMLStyleSheetsCollection, &IID_IHTMLStyleSheetsCollection> spSheets;
01131       CHECKHRCOM(spDoc2->get_styleSheets(&spSheets));
01132       CVariant vInd, vOut, vOutCoerced;
01133       vInd.vt = VT_UINT;
01134       vInd.lVal = 0;
01135       CHECKHRCOM(spSheets->item(&vInd, &vOut));
01136       CHECKHRCOM(VariantChangeType(&vOutCoerced, &vOut, 0, VT_DISPATCH));
01137       pReturn.Assign(vOutCoerced.pdispVal);
01138    } else
01139    {
01140       CHECKHRCOM(CHTMLStyleElementPtr(TRUE, GetNamedEl(uID,
01141          IID_IHTMLStyleElement))->get_styleSheet(&pReturn));
01142    }
01143    return pReturn;
01144 }
01145
01146
01147 #ifdef BMWS_HTMLHELPERS_GETCHILD
01148
01149 //----------------------------------------------------------------------------
01150 //
01151 // GetChild function
01152 //    Retrieves the interface pointer for a child of the specified element.
01153 //
01154 // Parameters:
01155 //    spEl:          The parent element.
01156 //    iIndex:        The index of the child to retrieve. Defaults to 0.
01157 //
01158 // Returns:          The interface pointer the specified child element.
01159 //
01160 //----------------------------------------------------------------------------
01161 CHTMLElementPtr CHTMLHelper::GetChild(CHTMLElementPtr& spEl, int iIndex)
01162 {
01163    CDispatchPtr spDispColl;
01164    CHECKHRCOM(spEl->get_children(&spDispColl));
01165    CPtr<IHTMLElementCollection, &IID_IHTMLElementCollection> spColl(spDispColl);
01166
01167    CDispatchPtr spDisp;
01168    VARIANT vIndex;
01169    vIndex.vt = VT_I4;
01170    vIndex.lVal = 0;
01171    CHECKHRCOM(spColl->item(vIndex, vIndex, &spDisp));
01172
01173    return CHTMLElementPtr(spDisp);
01174 }
01175
01176 #endif
01177
01178
01179 //----------------------------------------------------------------------------
01180 //
01181 // GetStyle function
01182 //    Retrieves the IHTMLStyle interface pointer for the style object for an
01183 //    element.
01184 //
01185 // Parameters:
01186 //    uID:           Resource identifier of the ID string of the element whose
01187 //                   style is to be retrieved.
01188 //
01189 // Returns:          The interface pointer of the style object.
01190 //
01191 // Throws:           Exception if the element or interface could not be
01192 //                   found.
01193 //
01194 //----------------------------------------------------------------------------
01195 CHTMLStylePtr CHTMLHelper::GetStyle(UINT uID)
01196 {
01197    CHTMLStylePtr spReturn;
01198    try
01199    {
01200       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
01201       CHECKHRCOM(spEl->get_style(&spReturn));
01202    }
01203    catch(CCOMExcep *pE)
01204    {
01205       HHInternalExcep(pE, BMWS_HH_GETSTYLE);
01206    }
01207    return spReturn;
01208 }
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers.h File Reference

#include <bmws_ptr.h>
#include <bmws_pointer.h>
#include <bmws_string.h>
#include <mshtml.h>

Go to the source code of this file.

Compounds

class CHTMLHelper

Typedefs

typedef CPtr< IHTMLElement,
&IID_IHTMLElement > 		CHTMLElementPtr
typedef CPtr< IHTMLElement2,
&IID_IHTMLElement2 > 		CHTMLElement2Ptr
typedef CPtr< IHTMLStyle,
&IID_IHTMLStyle > 		CHTMLStylePtr
typedef CPtr< IHTMLEventObj,
&IID_IHTMLEventObj > 		CHTMLEventObjPtr
typedef CPtr< IHTMLRuleStyle,
&IID_IHTMLRuleStyle > 		CHTMLRuleStylePtr
typedef CPtr< IHTMLStyleSheet,
&IID_IHTMLStyleSheet > 		CHTMLStyleSheetPtr
typedef CPtr< IHTMLStyleElement,
&IID_IHTMLStyleElement > 		CHTMLStyleElementPtr
typedef CPtr< IHTMLWindow3,
&IID_IHTMLWindow3 > 		CHTMLWindow3Ptr
typedef CPtr< IHTMLImgElement,
&IID_IHTMLImgElement > 		CHTMLImgElementPtr

Typedef Documentation

typedef CPtr<IHTMLElement2, &IID_IHTMLElement2> CHTMLElement2Ptr

Definition at line 31 of file bmws_htmlhelpers.h.

Referenced by CPile::PreReceiveCards(), CEngineObj::SetEventHandlers(), and CEngineObj::~CEngineObj().

typedef CPtr<IHTMLElement, &IID_IHTMLElement> CHTMLElementPtr

Definition at line 30 of file bmws_htmlhelpers.h.

Referenced by CHTMLHelper::FocusElementEx(), CGameMenu::Init(), and CGameMenu::Uninit().

typedef CPtr<IHTMLEventObj, &IID_IHTMLEventObj> CHTMLEventObjPtr

Definition at line 33 of file bmws_htmlhelpers.h.

typedef CPtr<IHTMLImgElement, &IID_IHTMLImgElement> CHTMLImgElementPtr

Definition at line 38 of file bmws_htmlhelpers.h.

typedef CPtr<IHTMLRuleStyle, &IID_IHTMLRuleStyle> CHTMLRuleStylePtr

Definition at line 34 of file bmws_htmlhelpers.h.

typedef CPtr<IHTMLStyleElement, &IID_IHTMLStyleElement> CHTMLStyleElementPtr

Definition at line 36 of file bmws_htmlhelpers.h.

Referenced by CHTMLHelper::GetStyleSheet().

typedef CPtr<IHTMLStyle, &IID_IHTMLStyle> CHTMLStylePtr

Definition at line 32 of file bmws_htmlhelpers.h.

typedef CPtr<IHTMLStyleSheet, &IID_IHTMLStyleSheet> CHTMLStyleSheetPtr

Definition at line 35 of file bmws_htmlhelpers.h.

typedef CPtr<IHTMLWindow3, &IID_IHTMLWindow3> CHTMLWindow3Ptr

Definition at line 37 of file bmws_htmlhelpers.h.

Generated on Wed May 8 12:39:16 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers.h Source File

bmws_htmlhelpers.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlhelpers.h
00004 //    Class to assist in common MSHTML-related tasks.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008 #ifndef __BMWS_HTMLHELPERS_H_
00009 #define __BMWS_HTMLHELPERS_H_
00010
00011
00012 //----------------------------------------------------------------------------
00013 // Includes
00014 //----------------------------------------------------------------------------
00015 #include <bmws_ptr.h>
00016 #include <bmws_pointer.h>
00017 #include <bmws_string.h>
00018 #include <mshtml.h>
00019 #if defined(BMWS_HTMLHELPERS_PROTECTUI) || defined(BMWS_HTMLHELPERS_CLICKHANDLER)
00020    #include <bmws_eventhandler.h>
00021 #endif
00022 #ifdef BMWS_HTMLHELPERS_CLICKHANDLER
00023    #include <bmws_uintarray.h>
00024 #endif
00025
00026
00027 //----------------------------------------------------------------------------
00028 // HTML smart pointer classes
00029 //----------------------------------------------------------------------------
00030 typedef CPtr<IHTMLElement,			&IID_IHTMLElement>    CHTMLElementPtr;
00031 typedef CPtr<IHTMLElement2,		&IID_IHTMLElement2>      CHTMLElement2Ptr;
00032 typedef CPtr<IHTMLStyle,			&IID_IHTMLStyle>        CHTMLStylePtr;
00033 typedef CPtr<IHTMLEventObj,		&IID_IHTMLEventObj>      CHTMLEventObjPtr;
00034 typedef CPtr<IHTMLRuleStyle,		&IID_IHTMLRuleStyle>    CHTMLRuleStylePtr;
00035 typedef CPtr<IHTMLStyleSheet,		&IID_IHTMLStyleSheet>  CHTMLStyleSheetPtr;
00036 typedef CPtr<IHTMLStyleElement,	&IID_IHTMLStyleElement>  CHTMLStyleElementPtr;
00037 typedef CPtr<IHTMLWindow3,			&IID_IHTMLWindow3>    CHTMLWindow3Ptr;
00038 typedef CPtr<IHTMLImgElement,		&IID_IHTMLImgElement>  CHTMLImgElementPtr;
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // CHTMLHelper class
00044 //    Assists in common MSHTML-related tasks.
00045 //
00046 //----------------------------------------------------------------------------
00047 class CHTMLHelper
00048 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00049    : public IEventHandlerSite
00050 #endif // BMWS_HTMLHELPERS_PROTECTUI
00051 {
00052 public:
00053    CHTMLHelper(IHTMLDocument2 *pDoc2);
00054 #if defined(BMWS_HTMLHELPERS_PROTECTUI) || defined(BMWS_HTMLHELPERS_CLICKHANDLER)
00055    virtual ~CHTMLHelper();
00056 #endif
00057
00058    LPVOID GetEl(BSTR bstrID, REFIID riid);
00059    LPVOID GetNamedEl(UINT uID, REFIID riid);
00060    LPVOID GetNumberedEl(UINT uidFormatter, UINT uiIndex, REFIID riid);
00061    void ShowElement(IHTMLElement *pEl, BOOL bShow);
00062    void ShowElementEx(UINT uID, BOOL bShow);
00063    void SetElText(UINT uID, CBSTR& bstrText, BOOL bEdit = FALSE);
00064    void SetElTextWithEl(CHTMLElementPtr& spEl, CBSTR& bstrText, BOOL bEdit = FALSE);
00065    LPVOID CreateElement(UINT uIDTag, REFIID riid);
00066    CBSTR GetElText(UINT uID, BOOL bEdit = FALSE);
00067    CBSTR GetElTextWithEl(CHTMLElementPtr& spEl, BOOL bEdit = FALSE);
00068
00069 #ifdef BMWS_HTMLHELPERS_INCLUDEELINT
00070    int GetElInt(UINT uID, BOOL bEdit = FALSE);
00071    void SetElInt(UINT uID, int iValue, BOOL bEdit = FALSE);
00072    int GetElIntWithEl(CHTMLElementPtr& spEl, BOOL bEdit = FALSE);
00073    void SetElIntWithEl(CHTMLElementPtr& spEl, int iValue, BOOL bEdit = FALSE);
00074 #endif
00075
00076    CHTMLEventObjPtr GetEvent();
00077    void CancelEvent();
00078    CHTMLRuleStylePtr GetRuleStyle(UINT uID, long lIndex);
00079
00080 #ifdef BMWS_HTMLHELPERS_INCLUDECLIP
00081    CPtr<IHTMLDataTransfer, &IID_IHTMLDataTransfer> GetClipboardData();
00082 #endif
00083
00084    void FocusElement(CHTMLElementPtr& pEl, BOOL bFocus);
00085    void FocusElementEx(UINT uID, BOOL bFocus);
00086
00087 #ifdef BMWS_HTMLHELPERS_ENABLE
00088    void EnableElement(CHTMLElementPtr& pEl, BOOL bEnable, BOOL bInput, CBSTR *pbstrClass = NULL);
00089    void EnableElementEx(UINT uID, BOOL bEnable, BOOL bInput, CBSTR *pbstrClass = NULL);
00090 #endif
00091
00092 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00093    void ProtectUI(UINT uidBody);
00094
00095    // IEventHandlerSite method
00096    void EventHandler(DWORD dwEventID, LPARAM lParam);
00097 #endif
00098
00099 #ifdef BMWS_HTMLHELPERS_ADDSTYLE
00100    void InitAddStyle();
00101    void AddStyle(CBSTR& bstrSelector, CBSTR& bstrStyle);
00102    void SetHlinkColor(COLORREF color, UINT uidStyle);
00103 #endif
00104
00105 #ifdef BMWS_HTMLHELPERS_WRITE
00106    void DocWrite(CBSTR& bstrText);
00107 #endif
00108
00109 #ifdef BMWS_HTMLHELPERS_CLICKHANDLER
00110    void InitClickHandler(int cHelpers);
00111    void SetClickHandler(int iIndex, UINT uID, IEventHandlerSite *pSite, LPARAM lParam);
00112 #endif
00113
00114 #ifdef BMWS_HTMLHELPERS_GETCHILD
00115    CHTMLElementPtr GetChild(CHTMLElementPtr& spEl, int iIndex = 0);
00116 #endif
00117
00118    CHTMLStylePtr GetStyle(UINT uID);
00119
00120    CPtr<IHTMLDocument3, &IID_IHTMLDocument3> m_spDoc3;   // Document interface pointer
00121    CPtr<IHTMLWindow2, &IID_IHTMLWindow2> m_spWindow2;    // Window interface pointer
00122
00123    CBSTR m_bstrBeforeEnd;  // "beforeEnd" string
00124
00125 protected:
00126    CHTMLStyleSheetPtr GetStyleSheet(UINT uID);
00127
00128 #ifdef BMWS_HTMLHELPERS_ADDSTYLE
00129    CHTMLStyleSheetPtr m_spStyleSheet;  // Document style sheet pointer
00130 #endif
00131
00132 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00133    UINT m_uidBody;   // String resource identifier of the BODY element.
00134 #endif
00135
00136 #ifdef BMWS_HTMLHELPERS_CLICKHANDLER
00137    CUINTArray m_auIDsClickHandled;
00138 #endif
00139 };
00140
00141
00142 #endif //__BMWS_HTMLHELPERS_H_
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_HTML_DISPLAYNONE 8301
#define | IDS_BMWS_HTML_BEFOREEND 8302

Define Documentation

#define IDS_BMWS_HTML_BEFOREEND 8302

Definition at line 6 of file bmws_htmlhelpers_res.h.

Referenced by CHTMLHelper::CHTMLHelper().

#define IDS_BMWS_HTML_DISPLAYNONE 8301

Definition at line 5 of file bmws_htmlhelpers_res.h.

Referenced by CHTMLHelper::ShowElement().

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers_res.h Source File

bmws_htmlhelpers_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmlhelpers.rc
00004 //
00005 #define IDS_BMWS_HTML_DISPLAYNONE       8301
00006 #define IDS_BMWS_HTML_BEFOREEND         8302
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_HTML_E_NOELEMENT 18301
#define | IDS_BMWS_HTML_E_INTERNAL 18302
#define | IDS_BMWS_HTML_E_QIELEMENT 18303

Define Documentation

#define IDS_BMWS_HTML_E_INTERNAL 18302

Definition at line 6 of file bmws_htmlhelpers_res_lc.h.

Referenced by HHInternalExcep().

#define IDS_BMWS_HTML_E_NOELEMENT 18301

Definition at line 5 of file bmws_htmlhelpers_res_lc.h.

Referenced by CHTMLHelper::GetEl().

#define IDS_BMWS_HTML_E_QIELEMENT 18303

Definition at line 7 of file bmws_htmlhelpers_res_lc.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlhelpers_res_lc.h Source File

bmws_htmlhelpers_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmlhelpers_lc.rc
00004 //
00005 #define IDS_BMWS_HTML_E_NOELEMENT       18301
00006 #define IDS_BMWS_HTML_E_INTERNAL        18302
00007 #define IDS_BMWS_HTML_E_QIELEMENT       18303
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        101
00014 #define _APS_NEXT_COMMAND_VALUE         40001
00015 #define _APS_NEXT_CONTROL_VALUE         1000
00016 #define _APS_NEXT_SYMED_VALUE           101
00017 #endif
00018 #endif
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink.cpp File Reference

#include <bmws_htmllink.h>
#include <bmws_htmllink_res.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink.cpp Source File

bmws_htmllink.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmllink.cpp
00004 //    Class to encapsulate an embedded hyperlink.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmllink.h>
00013 #include <bmws_htmllink_res.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CHTMLLink constructor
00019 //
00020 // Parameters:
00021 //    pSite:            Interface to notify of clicking.
00022 //    pHH:              Pointer to the HTML Helper object to use.
00023 //    dwEventID:        Site notification parameter.
00024 //    lParam:           Site notification parameter.
00025 //    spElParent:       Element into which the link is to be inserted.
00026 //    lpszText:         The text of the link.
00027 //    lpszExtraAttrs:   Extra attributes for the anchor element.
00028 //    bParamIsUnk:      Whether the lParam is an IUnknown pointer that must be
00029 //                      managed. Defaults to FALSE.
00030 //    pEnableSite:      Interface of the owner. Defaults to NULL.
00031 //
00032 //----------------------------------------------------------------------------
00033 CHTMLLink::CHTMLLink(IHTMLLinkSite *pSite, CHTMLHelper *pHH, DWORD dwEventID, LPARAM lParam,
00034                      CHTMLElementPtr& spElParent, CTSTR& lpszText, CTSTR& lpszExtraAttrs,
00035                      BOOL bParamIsUnk, IHTMLEnableSite *pEnableSite) : CHTMLEnable(pHH,
00036                      spElParent, lpszText, lpszExtraAttrs, pEnableSite)
00037 {
00038    m_pLinkSite = pSite;
00039    m_dwEventID = dwEventID;
00040    m_lParam = lParam;
00041    m_bParamIsUnk = bParamIsUnk;
00042    if(m_bParamIsUnk)
00043       ((IUnknown*)lParam)->AddRef();
00044 }
00045
00046
00047 //----------------------------------------------------------------------------
00048 //
00049 // CHTMLLink destructor
00050 //
00051 //----------------------------------------------------------------------------
00052 CHTMLLink::~CHTMLLink()
00053 {
00054    Cleanup();
00055    if(m_bParamIsUnk)
00056       ((IUnknown*)m_lParam)->Release();
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 //
00062 // Enable function
00063 //    Recreates the link object in a disabled or enabled state.
00064 //
00065 // Parameters:
00066 //    bEnable:       TRUE if the link should be enabled, else FALSE.
00067 //
00068 // Returns:          None.
00069 //
00070 //----------------------------------------------------------------------------
00071 void CHTMLLink::Enable(BOOL bEnable)
00072 {
00073    Cleanup();
00074
00075    EnableHelper(bEnable, IDS_BMWS_HTMLLINK_HOLDER, IDS_BMWS_HTMLLINK_DISABLED);
00076
00077    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, m_dwEventID, m_lParam);
00078    ENSUREALLOC(pHandler);
00079
00080    CVariant vHandler;
00081    vHandler.vt = VT_DISPATCH;
00082    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00083    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00084 }
00085
00086
00087 //----------------------------------------------------------------------------
00088 //
00089 // IEventHandlerSite::EventHandler method
00090 //    Handles events that are trapped via a CEventHandler object.
00091 //
00092 // Parameters:
00093 //    dwEventID:     Event identifier; passed to site.
00094 //    lParam:        Event-specific parameter; passed to site.
00095 //
00096 // Returns:          None.
00097 //
00098 //----------------------------------------------------------------------------
00099 void CHTMLLink::EventHandler(DWORD dwEventID, LPARAM lParam)
00100 {
00101    try   // Windows-called code
00102    {
00103       m_pHH->CancelEvent();
00104       if(m_bEnabled && m_pLinkSite)
00105          m_pLinkSite->LinkClicked(this, dwEventID, lParam);
00106    }
00107    catch(CExcep *pE)
00108    {
00109       pE->Report();
00110       pE->Delete();
00111    }
00112 }
00113
00114
00115 //----------------------------------------------------------------------------
00116 //
00117 // Cleanup function
00118 //    Removes the event handler associated with the link object.
00119 //
00120 // Parameters:       None.
00121 //
00122 // Returns:          None.
00123 //
00124 //----------------------------------------------------------------------------
00125 void CHTMLLink::Cleanup()
00126 {
00127    if(m_spEl)
00128    {
00129       VARIANT vHandler;
00130       VariantInit(&vHandler);
00131       vHandler.vt = VT_NULL;
00132       m_spEl->put_onclick(vHandler);
00133    }
00134 }
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink.h File Reference

#include <bmws_htmlenable.h>
#include <bmws_eventhandler.h>

Go to the source code of this file.

Compounds

class | CHTMLLink
class | IHTMLLinkSite

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink.h Source File

bmws_htmllink.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmllink.h
00004 //    Class to encapsulate an embedded hyperlink.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLLINK_H_
00010 #define __BMWS_HTMLLINK_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlenable.h>
00017 #include <bmws_eventhandler.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Forward declaration
00022 //----------------------------------------------------------------------------
00023 class CHTMLLink;
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // IHTMLLinkSite abstract class
00029 //    Enables notification of clicking on the link.
00030 //
00031 //----------------------------------------------------------------------------
00032 class IHTMLLinkSite
00033 {
00034 public:
00035    virtual void LinkClicked(CHTMLLink *pLink, DWORD dwEventID, LPARAM lParam) = 0;
00036 };
00037
00038
00039 //----------------------------------------------------------------------------
00040 //
00041 // CHTMLLink class
00042 //    Encapsulates an embedded hyperlink.
00043 //
00044 //----------------------------------------------------------------------------
00045 class CHTMLLink : public CHTMLEnable, public IEventHandlerSite
00046 {
00047 public:
00048    CHTMLLink(IHTMLLinkSite *pSite, CHTMLHelper *pHH, DWORD dwEventID, LPARAM lParam,
00049       CHTMLElementPtr& spElParent, CTSTR& lpszText, CTSTR& lpszExtraAttrs,
00050       BOOL bParamIsUnk = FALSE, IHTMLEnableSite *pEnableSite = NULL);
00051    virtual ~CHTMLLink();
00052
00053    void Enable(BOOL bEnable);
00054
00055    // IEventHandlerSite method
00056    virtual void EventHandler(DWORD dwEventID, LPARAM lParam);
00057
00058 protected:
00059    void Cleanup();
00060
00061    IHTMLLinkSite *m_pLinkSite;   // Interface to notify of click
00062    DWORD m_dwEventID;            // Parameter for notification
00063    LPARAM m_lParam;              // Parameter for notification
00064    BOOL m_bParamIsUnk;           // Whether the parameter is an IUnknown pointer to be managed
00065 };
00066
00067
00068 #endif //__BMWS_HTMLLINK_H_
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_HTMLLINK_HOLDER 8451
#define | IDS_BMWS_HTMLLINK_DISABLED 8452

Define Documentation

#define IDS_BMWS_HTMLLINK_DISABLED 8452

Definition at line 6 of file bmws_htmllink_res.h.

Referenced by CHTMLLink::Enable().

#define IDS_BMWS_HTMLLINK_HOLDER 8451

Definition at line 5 of file bmws_htmllink_res.h.

Referenced by CHTMLLink::Enable().

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmllink_res.h Source File

bmws_htmllink_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmllink.rc
00004 //
00005 #define IDS_BMWS_HTMLLINK_HOLDER        8451
00006 #define IDS_BMWS_HTMLLINK_DISABLED      8452
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlradiogroup.cpp File Reference

#include <bmws_htmlradiogroup.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlradiogroup.cpp Source File

bmws_htmlradiogroup.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlradiogroup.cpp
00004 //    Class to assist in MSHTML radio button control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlradiogroup.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 //
00017 // CHTMLRadioGroup constructor
00018 //
00019 // Parameters:
00020 //    pSite:         Interface to notify of changes
00021 //    pHH:           Pointer to the HTML Helper object to use.
00022 //    uidFirst:      String resource identifier of the first radio button
00023 //                   element.
00024 //    cElements:     The number of radio buttons to include in the group.
00025 //
00026 //----------------------------------------------------------------------------
00027 CHTMLRadioGroup::CHTMLRadioGroup(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uidFirst,
00028                                  UINT cElements) : CHTMLControl(pSite, pHH, -1, -1)
00029 {
00030    m_iIndex = -1;
00031    m_iRecentIndex = -1;
00032    m_uidFirst = uidFirst;
00033    m_apControls.SetSize(cElements);
00034    m_apInputEls.SetSize(cElements);
00035    m_apInputEls.SetRelease(TRUE);
00036    for(UINT i = 0; i < cElements; i++)
00037    {
00038       IHTMLInputElement *pInputEl = (IHTMLInputElement*)pHH->GetNamedEl(uidFirst + i,
00039          IID_IHTMLInputElement);
00040       m_apInputEls.SetAt(i, pInputEl);
00041       CHTMLChk *pChk = new CHTMLChk((IHTMLControlSite*)this, pHH, uidFirst + i, (LPARAM)i, NULL);
00042       ENSUREALLOC(pChk);
00043       m_apControls.SetAt(i, pChk);
00044    }
00045
00046    ResetChanged();
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // ResetChanged function
00053 //    Resets the "original" contents of the control to the current contents.
00054 //
00055 // Parameters:       None.
00056 //
00057 // Returns:          None.
00058 //
00059 //----------------------------------------------------------------------------
00060 void CHTMLRadioGroup::ResetChanged()
00061 {
00062    m_iIndex = GetChecked();
00063    m_iRecentIndex = m_iIndex;
00064 }
00065
00066
00067 //----------------------------------------------------------------------------
00068 //
00069 // Changed function
00070 //    Retrieves whether the contents of the control have changed.
00071 //
00072 // Parameters:       None.
00073 //
00074 // Returns:          A standard COM success or error value.
00075 //
00076 //----------------------------------------------------------------------------
00077 BOOL CHTMLRadioGroup::Changed()
00078 {
00079    return (m_iIndex != GetChecked());
00080 }
00081
00082
00083 //----------------------------------------------------------------------------
00084 //
00085 // IHTMLControlSite::ControlChanged method
00086 //    Called when the contents of the control have changed.
00087 //
00088 // Parameters:
00089 //    pControl:      Pointer to the control.
00090 //    uID:           String resource identifier of the element's ID.
00091 //    lParam:        Application-defined parameter for the control (the index
00092 //                   of the control).
00093 //
00094 // Returns:          None.
00095 //
00096 //----------------------------------------------------------------------------
00097 void CHTMLRadioGroup::ControlChanged(CHTMLControl *pControl, UINT uID, LPARAM lParam)
00098 {
00099    int i = GetChecked();
00100    if(m_iRecentIndex != i)
00101    {
00102       m_iRecentIndex = i;
00103       m_pSite->ControlChanged(this, m_uidFirst, lParam);
00104    }
00105 }
00106
00107
00108 //----------------------------------------------------------------------------
00109 //
00110 // GetChecked function
00111 //    Retrieves the index of the currently selected radio button.
00112 //
00113 // Parameters:       None.
00114 //
00115 // Returns:          The index of the currently selected radio button.
00116 //
00117 //----------------------------------------------------------------------------
00118 int CHTMLRadioGroup::GetChecked()
00119 {
00120    VARIANT_BOOL vb;
00121    int cElements = m_apInputEls.GetSize();
00122    for(int i = 0; i < cElements; i++)
00123    {
00124       CHECKHRCOM(m_apInputEls[i]->get_checked(&vb));
00125       if(vb == VARIANT_TRUE)
00126          return i;
00127    }
00128    return -1;
00129 }
00130
00131
00132 //----------------------------------------------------------------------------
00133 //
00134 // SetChecked function
00135 //    Sets the index of the currently selected radio button.
00136 //
00137 // Parameters:
00138 //    iIndex:        Zero-based index of the radio button to select.
00139 //
00140 // Returns:          None.
00141 //
00142 //----------------------------------------------------------------------------
00143 void CHTMLRadioGroup::SetChecked(int iIndex)
00144 {
00145    _ASSERT((iIndex >= 0) && (iIndex < m_apInputEls.GetSize()));
00146    m_iRecentIndex = iIndex;
00147    CHECKHRCOM(m_apInputEls[iIndex]->put_checked(VARIANT_TRUE));
00148 }
Generated on Wed May 8 12:38:53 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlradiogroup.h File Reference

#include <bmws_htmlcontrol.h>
#include <bmws_htmlchk.h>
#include <bmws_uintarray.h>

Go to the source code of this file.

Compounds

class CHTMLRadioGroup

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlradiogroup.h Source File

bmws_htmlradiogroup.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlradiogroup.h
00004 //    Class to assist in MSHTML radio button control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLRADIOGROUP_H_
00010 #define __BMWS_HTMLRADIOGROUP_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlcontrol.h>
00017 #include <bmws_htmlchk.h>
00018 #include <bmws_uintarray.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 //
00023 // CHTMLRadioGroup class
00024 //    Assists in MSHTML radio button control management.
00025 //
00026 //----------------------------------------------------------------------------
00027 class CHTMLRadioGroup : public CHTMLControl, public IHTMLControlSite
00028 {
00029 public:
00030    CHTMLRadioGroup(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uidFirst, UINT cElements);
00031
00032    void ResetChanged();
00033    BOOL Changed();
00034
00035    // IEventHandlerSite method
00036    void EventHandler(DWORD dwEventID, LPARAM lParam) {}
00037
00038    // IHTMLControlSite method
00039    virtual void ControlChanged(CHTMLControl *pControl, UINT uID, LPARAM lParam);
00040
00041    int GetChecked();
00042    void SetChecked(int iIndex);
00043
00044 protected:
00045    CPtrArray<CHTMLChk*, CHTMLChk*> m_apControls;   // Array of radio button controls
00046    CPtrArray<IHTMLInputElement*, IHTMLInputElement*> m_apInputEls;   // Array of radio elements
00047    int m_iIndex;        // Index of originally selected button
00048    int m_iRecentIndex;  // Index of most recently selected item
00049    UINT m_uidFirst;     // ID of the first radio button
00050 };
00051
00052
00053 #endif //__BMWS_HTMLRADIOGROUP_H_
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect.cpp File Reference

#include <bmws_htmlselect.h>
#include <bmws_htmlselect_res.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect.cpp Source File

bmws_htmlselect.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlselect.cpp
00004 //    Class to assist in MSHTML select control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlselect.h>
00013 #include <bmws_htmlselect_res.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CHTMLSelect constructor
00019 //
00020 // Parameters:
00021 //    pSite:         Interface to notify of changes
00022 //    pHH:           Pointer to the HTML Helper object to use.
00023 //    uID:           String resource identifier of the element's ID.
00024 //    lParam:        Notification parameter.
00025 //    pEl:           The HTML element pointer. Defaults to NULL, signifying
00026 //                   the element should be loaded by ID.
00027 //
00028 //----------------------------------------------------------------------------
00029 CHTMLSelect::CHTMLSelect(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00030                          IHTMLElement *pEl) : CHTMLControl(pSite, pHH, uID, lParam, pEl)
00031 {
00032    m_spSelectEl.Assign(m_spEl);
00033    CEventHandler *pHandler = NULL;
00034    CVariant vHandler;
00035
00036    pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00037    ENSUREALLOC(pHandler);
00038    vHandler.vt = VT_DISPATCH;
00039    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00040    CHECKHRCOM(m_spSelectEl->put_onchange(vHandler));
00041
00042    ResetChanged();
00043 }
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // CHTMLSelect destructor
00049 //
00050 //----------------------------------------------------------------------------
00051 CHTMLSelect::~CHTMLSelect()
00052 {
00053    VARIANT vHandler;
00054    VariantInit(&vHandler);
00055    vHandler.vt = VT_NULL;
00056    m_spSelectEl->put_onchange(vHandler);
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 //
00062 // ResetChanged function
00063 //    Resets the "original" contents of the control to the current contents.
00064 //
00065 // Parameters:       None.
00066 //
00067 // Returns:          None.
00068 //
00069 //----------------------------------------------------------------------------
00070 void CHTMLSelect::ResetChanged()
00071 {
00072    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&m_lOrig));
00073 }
00074
00075
00076 //----------------------------------------------------------------------------
00077 //
00078 // Changed function
00079 //    Retrieves whether the contents of the control have changed.
00080 //
00081 // Parameters:       None.
00082 //
00083 // Returns:          TRUE if the contents changed, else FALSE.
00084 //
00085 //----------------------------------------------------------------------------
00086 BOOL CHTMLSelect::Changed()
00087 {
00088    long lIndex = 0;
00089    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&lIndex));
00090    return (m_lOrig != lIndex);
00091 }
00092
00093
00094 //----------------------------------------------------------------------------
00095 //
00096 // IEventHandlerSite::EventHandler method
00097 //    Handles events that are trapped via a CEventHandler object.
00098 //
00099 // Parameters:
00100 //    dwEventID:     Event identifier; unused.
00101 //    lParam:        Event-specific parameter. Represents the stringtable ID
00102 //                   of the element.
00103 //
00104 // Returns:          None.
00105 //
00106 //----------------------------------------------------------------------------
00107 void CHTMLSelect::EventHandler(DWORD dwEventID, LPARAM lParam)
00108 {
00109    try   // Windows-called code
00110    {
00111       if(m_pSite)
00112          m_pSite->ControlChanged(this, m_uID, m_lParam);
00113    }
00114    catch(CExcep *pE)
00115    {
00116       pE->Report();
00117       pE->Delete();
00118    }
00119 }
00120
00121
00122 //----------------------------------------------------------------------------
00123 //
00124 // Add function
00125 //    Adds an option to the drop-down list.
00126 //
00127 // Parameters:
00128 //    lIndex:        Zero-based index at which to add the option; -1 to append
00129 //                   the option at the end.
00130 //    bstrText:      The text of the option.
00131 //
00132 // Returns:          None.
00133 //
00134 //----------------------------------------------------------------------------
00135 void CHTMLSelect::Add(long lIndex, CBSTR& bstrText)
00136 {
00137    CHTMLElementPtr spOption(TRUE, m_pHH->CreateElement(IDS_BMWS_HTMLSELECT_OPTIONTAG,
00138       IID_IHTMLElement));
00139    CPtr<IHTMLOptionElement, &IID_IHTMLOptionElement> spOptionEl(spOption);
00140    CHECKHRCOM(spOptionEl->put_text(bstrText));
00141    VARIANT v;
00142    v.vt = VT_I4;
00143    v.lVal = lIndex;
00144    CHECKHRCOM(m_spSelectEl->add(spOption, v));
00145 }
00146
00147
00148 //----------------------------------------------------------------------------
00149 //
00150 // Remove function
00151 //    Removes an option from the drop-down list.
00152 //
00153 // Parameters:
00154 //    lIndex:        Zero-based index of the option to remove.
00155 //
00156 // Returns:          None.
00157 //
00158 //----------------------------------------------------------------------------
00159 void CHTMLSelect::Remove(long lIndex)
00160 {
00161    CHECKHRCOM(m_spSelectEl->remove(lIndex));
00162 }
00163
00164
00165 //----------------------------------------------------------------------------
00166 //
00167 // Replace function
00168 //    Changes the text of an existing option in the list.
00169 //
00170 // Parameters:
00171 //    lIndex:        Zero-based index of the option to change.
00172 //    bstrNewText:   The new text of the option.
00173 //
00174 // Returns:          None.
00175 //
00176 //----------------------------------------------------------------------------
00177 void CHTMLSelect::Replace(long lIndex, CBSTR& bstrNewText)
00178 {
00179    CPtr<IDispatch, &IID_IDispatch> spDispOption;
00180    VARIANT vIndex;
00181    vIndex.vt = VT_I4;
00182    vIndex.lVal = lIndex;
00183    CHECKHRCOM(m_spSelectEl->item(vIndex, vIndex, &spDispOption));
00184    CPtr<IHTMLOptionElement, &IID_IHTMLOptionElement> spOptionEl(spDispOption);
00185    CHECKHRCOM(spOptionEl->put_text(bstrNewText));
00186 }
00187
00188
00189 //----------------------------------------------------------------------------
00190 //
00191 // GetSelected function
00192 //    Retrieves which option is selected.
00193 //
00194 // Parameters:       None.
00195 //
00196 // Returns:          The index of the currently selected option.
00197 //
00198 //----------------------------------------------------------------------------
00199 long CHTMLSelect::GetSelected()
00200 {
00201    long lIndex;
00202    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&lIndex));
00203    return lIndex;
00204 }
00205
00206
00207 //----------------------------------------------------------------------------
00208 //
00209 // SetSelected function
00210 //    Sets the index of which option is selected.
00211 //
00212 // Parameters:
00213 //    lIndex:        Zero-based index of the option to be selected.
00214 //
00215 // Returns:          None.
00216 //
00217 //----------------------------------------------------------------------------
00218 void CHTMLSelect::SetSelected(long lIndex)
00219 {
00220    CHECKHRCOM(m_spSelectEl->put_selectedIndex(lIndex));
00221 }
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect.h File Reference

#include <bmws_htmlcontrol.h>

Go to the source code of this file.

Compounds

class CHTMLSelect

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect.h Source File

bmws_htmlselect.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlselect.h
00004 //    Class to assist in MSHTML select control management.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLSELECT_H_
00010 #define __BMWS_HTMLSELECT_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlcontrol.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CHTMLSelect class
00022 //    Assists in MSHTML select control management.
00023 //
00024 //----------------------------------------------------------------------------
00025 class CHTMLSelect : public CHTMLControl
00026 {
00027 public:
00028    CHTMLSelect(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam,
00029       IHTMLElement *pEl = NULL);
00030    virtual ~CHTMLSelect();
00031
00032    void ResetChanged();
00033    BOOL Changed();
00034    void Add(long lIndex, CBSTR& bstrText);
00035    void Remove(long lIndex);
00036    void Replace(long lIndex, CBSTR& bstrNewText);
00037    long GetSelected();
00038    void SetSelected(long lIndex);
00039
00040    // IEventHandlerSite method
00041    void EventHandler(DWORD dwEventID, LPARAM lParam);
00042
00043 protected:
00044    CPtr<IHTMLSelectElement, &IID_IHTMLSelectElement> m_spSelectEl;   // The select element
00045    long m_lOrig;        // Original selected index
00046 };
00047
00048
00049 #endif //__BMWS_HTMLSELECT_H_
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_HTMLSELECT_OPTIONTAG 8701

Define Documentation

#define IDS_BMWS_HTMLSELECT_OPTIONTAG 8701

Definition at line 5 of file bmws_htmlselect_res.h.

Referenced by CHTMLSelect::Add().

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlselect_res.h Source File

bmws_htmlselect_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmlselect.rc
00004 //
00005 #define IDS_BMWS_HTMLSELECT_OPTIONTAG   8701
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic.cpp File Reference

#include <bmws_htmlstatic.h>
#include <bmws_htmlstatic_res.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic.cpp Source File

bmws_htmlstatic.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlstatic.cpp
00004 //    Class to encapsulate a span of HTML that can be enabled and disabled.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_htmlstatic.h>
00013 #include <bmws_htmlstatic_res.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CHTMLStatic constructor
00019 //
00020 // Parameters:
00021 //    pSite:            Interface of the parent object.
00022 //    pHH:              Pointer to the HTML Helper object to use.
00023 //    spElParent:       Element into which the label is to be inserted.
00024 //    lpszText:         The text of the label.
00025 //    lpszExtraAttrs:   Extra attributes for the element.
00026 //    uidFormatter:     String resource identifier of the format string to
00027 //                      use. Defaults to -1, in which case the default SPAN
00028 //                      formatter will be used.
00029 //    pSite:            Interface of the owner. Defaults to NULL.
00030 //
00031 //----------------------------------------------------------------------------
00032 CHTMLStatic::CHTMLStatic(CHTMLHelper *pHH, CHTMLElementPtr& spElParent, CTSTR& lpszText,
00033                          CTSTR& lpszExtraAttrs, UINT uidFormatter, IHTMLEnableSite *pSite) :
00034                          CHTMLEnable(pHH, spElParent, lpszText, lpszExtraAttrs, pSite)
00035 {
00036    m_uidFormatter = (uidFormatter == (UINT)-1 ? IDS_BMWS_HTMLSTATIC_HOLDER : uidFormatter);
00037 }
00038
00039
00040 //----------------------------------------------------------------------------
00041 //
00042 // CHTMLStatic destructor
00043 //
00044 //----------------------------------------------------------------------------
00045 CHTMLStatic::~CHTMLStatic()
00046 {
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // Enable function
00053 //    Recreates the span in a disabled or enabled state.
00054 //
00055 // Parameters:
00056 //    bEnable:       TRUE if the span should be enabled, else FALSE.
00057 //
00058 // Returns:          None.
00059 //
00060 //----------------------------------------------------------------------------
00061 void CHTMLStatic::Enable(BOOL bEnable)
00062 {
00063    EnableHelper(bEnable, m_uidFormatter, IDS_BMWS_HTMLSTATIC_DISABLED);
00064 }
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic.h File Reference

#include <bmws_htmlenable.h>

Go to the source code of this file.

Compounds

class CHTMLStatic

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic.h Source File

bmws_htmlstatic.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_htmlstatic.h
00004 //    Class to encapsulate a span of HTML that can be enabled and disabled.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_HTMLSTATIC_H_
00010 #define __BMWS_HTMLSTATIC_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_htmlenable.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CHTMLStatic class
00022 //    Encapsulates a span of HTML that can be enabled and disabled.
00023 //
00024 //----------------------------------------------------------------------------
00025 class CHTMLStatic : public CHTMLEnable
00026 {
00027 public:
00028    CHTMLStatic(CHTMLHelper *pHH, CHTMLElementPtr& spElParent, CTSTR& lpszText,
00029       CTSTR& lpszExtraAttrs, UINT uidFormatter = (UINT)-1, IHTMLEnableSite *pSite = NULL);
00030    virtual ~CHTMLStatic();
00031
00032    void Enable(BOOL bEnable);
00033
00034 protected:
00035    UINT m_uidFormatter;    // String used to format the element
00036 };
00037
00038
00039 #endif //__BMWS_HTMLSTATIC_H_
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_HTMLSTATIC_HOLDER 8651
#define | IDS_BMWS_HTMLSTATIC_DISABLED 8652

Define Documentation

#define IDS_BMWS_HTMLSTATIC_DISABLED 8652

Definition at line 6 of file bmws_htmlstatic_res.h.

Referenced by CHTMLStatic::Enable().

#define IDS_BMWS_HTMLSTATIC_HOLDER 8651

Definition at line 5 of file bmws_htmlstatic_res.h.

Referenced by CHTMLStatic::CHTMLStatic().

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_htmlstatic_res.h Source File

bmws_htmlstatic_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_htmlstatic.rc
00004 //
00005 #define IDS_BMWS_HTMLSTATIC_HOLDER        8651
00006 #define IDS_BMWS_HTMLSTATIC_DISABLED      8652
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_key.h File Reference

Go to the source code of this file.

Compounds

class | CKey

Defines

#define | AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_key.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_key.h Source File

bmws_key.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_key.h
00004 //    Classes to encapsulate registry keys.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 //
00015 // CKey class
00016 //    Encapsulates registry keys.
00017 //
00018 //----------------------------------------------------------------------------
00019 class CKey
00020 {
00021 public:
00022
00023    //-------------------------------------------------------------------------
00024    //
00025    // Constructor
00026    //
00027    //-------------------------------------------------------------------------
00028    CKey()
00029    {
00030       m_hKey = NULL;
00031    }
00032
00033
00034    //-------------------------------------------------------------------------
00035    //
00036    // Constructor
00037    //
00038    // Parameters:
00039    //    hKey:       Pointer to an existing registry key.
00040    //
00041    //-------------------------------------------------------------------------
00042    CKey(HKEY hKey)
00043    {
00044       m_hKey = hKey;
00045    }
00046
00047
00048    //-------------------------------------------------------------------------
00049    //
00050    // Copy Constructor
00051    //
00052    // Parameters:
00053    //    key:        An existing registry key object.
00054    //
00055    //-------------------------------------------------------------------------
00056    CKey(CKey& key)
00057    {
00058       if(m_hKey)
00059          RegCloseKey(m_hKey);
00060       m_hKey = key.m_hKey;
00061    }
00062
00063
00064    //-------------------------------------------------------------------------
00065    //
00066    // Destructor
00067    //
00068    //-------------------------------------------------------------------------
00069    ~CKey()
00070    {
00071       if(m_hKey)
00072          RegCloseKey(m_hKey);
00073    }
00074
00075
00076    //-------------------------------------------------------------------------
00077    //
00078    // HKEY operator
00079    //
00080    // Parameters:    None.
00081    //
00082    // Returns:       The registry key handle.
00083    //
00084    //-------------------------------------------------------------------------
00085    operator HKEY() const
00086    {
00087       return m_hKey;
00088    }
00089
00090
00091    //-------------------------------------------------------------------------
00092    //
00093    // & operator
00094    //
00095    // Parameters:    None.
00096    //
00097    // Returns:       The address of the registy key handle.
00098    //
00099    //-------------------------------------------------------------------------
00100    HKEY* operator&()
00101    {
00102       return &m_hKey;
00103    }
00104
00105
00106    //-------------------------------------------------------------------------
00107    //
00108    // ! operator
00109    //
00110    // Parameters:    None.
00111    //
00112    // Returns:       Whether the registry key handle is NULL.
00113    //
00114    //-------------------------------------------------------------------------
00115    BOOL operator!()
00116    {
00117       return (m_hKey == NULL);
00118    }
00119
00120
00121    //-------------------------------------------------------------------------
00122    //
00123    // BOOL operator
00124    //
00125    // Parameters:    None.
00126    //
00127    // Returns:       Whether the registry key handle is non-NULL.
00128    //
00129    //-------------------------------------------------------------------------
00130    operator BOOL() const
00131    {
00132       return (m_hKey != NULL);
00133    }
00134
00135
00136
00137    //-------------------------------------------------------------------------
00138    //
00139    // = operator
00140    //
00141    // Parameters:
00142    //    keySrc:        Existing key object to copy from.
00143    //
00144    // Returns:          The new current key object.
00145    //
00146    //-------------------------------------------------------------------------
00147    const CKey& operator=(const CKey& keySrc)
00148    {
00149       if(m_hKey)
00150          RegCloseKey(m_hKey);
00151       m_hKey = keySrc.m_hKey;
00152       return *this;
00153    }
00154
00155
00156 private:
00157    HKEY m_hKey;         // Registry key handle
00158 };
00159
00160
00161 #endif // !defined(AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_lib.h File Reference

Go to the source code of this file.

Compounds

class | CLib

Defines

#define | AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_lib.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_lib.h Source File

bmws_lib.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_lib.h
00004 //    Class to encapsulate loading libraries.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 //
00015 // CLib class
00016 //    Encapsulates loading libraries.
00017 //
00018 //----------------------------------------------------------------------------
00019 class CLib
00020 {
00021 public:
00022
00023    //-------------------------------------------------------------------------
00024    //
00025    // Constructor
00026    //
00027    // Parameters:
00028    //    lpszModule: File name of the module to load.
00029    //    bDataFile:  TRUE to load the module as a data file, FALSE to load in
00030    //                the normal way.
00031    //
00032    //-------------------------------------------------------------------------
00033    CLib(LPTSTR lpszModule, BOOL bDataFile = FALSE)
00034    {
00035       m_hModule = bDataFile ? LoadLibraryEx(lpszModule, NULL, LOAD_LIBRARY_AS_DATAFILE)
00036                             : LoadLibrary(lpszModule);
00037    }
00038
00039
00040    //-------------------------------------------------------------------------
00041    //
00042    // Destructor
00043    //
00044    //-------------------------------------------------------------------------
00045    ~CLib()
00046    {
00047       if(m_hModule)
00048          FreeLibrary(m_hModule);
00049    }
00050
00051
00052    //-------------------------------------------------------------------------
00053    //
00054    // HINSTANCE operator
00055    //
00056    // Parameters:    None.
00057    //
00058    // Returns:       The library module handle.
00059    //
00060    //-------------------------------------------------------------------------
00061    operator HINSTANCE() const
00062    {
00063       return m_hModule;
00064    }
00065
00066
00067 private:
00068    HMODULE m_hModule;         // Library module handle
00069 };
00070
00071
00072 #endif // !defined(AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_limitsingleinstance.cpp File Reference

#include <bmws_limitsingleinstance.h>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 19 of file bmws_limitsingleinstance.cpp.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_limitsingleinstance.cpp Source File

bmws_limitsingleinstance.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_limitsingleinstance.cpp
00004 //    Class to encapsulate limiting the application to one instance running at
00005 //    a time.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_limitsingleinstance.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 // External variables
00018 //----------------------------------------------------------------------------
00019 extern HINSTANCE g_hInst;     // Application instance handle
00020
00021
00022 //----------------------------------------------------------------------------
00023 //
00024 // TestPrevInstance function
00025 //    Determines if this application is already running; attempts to switch to
00026 //    the specified window if it is.
00027 //
00028 // Parameters:
00029 //    lspzClass:     Class for the window to switch to.
00030 //    lpszMessage:   Text message to send to the window.
00031 //
00032 // Returns:          TRUE if the application is already running, else FALSE.
00033 //
00034 //----------------------------------------------------------------------------
00035 BOOL CLimitSingleInstance::TestPrevInstance(LPTSTR lpszClass, LPTSTR lpszMessage)
00036 {
00037    if(m_dwLastError != ERROR_ALREADY_EXISTS)
00038       return FALSE;
00039
00040    if(!lpszClass)
00041       return TRUE;
00042
00043    // Determine if another window with the class name exists
00044    HWND hWndPrev = FindWindow(lpszClass, NULL);
00045    if(hWndPrev)
00046    {
00047       // If so, check for popups.
00048       HWND hWndChild = GetLastActivePopup(hWndPrev);
00049
00050       // If iconic, restore the main window
00051       if(IsIconic(hWndPrev))
00052          ShowWindow(hWndPrev, SW_RESTORE);
00053
00054       if(lpszMessage)
00055       {
00056          static TCHAR buf[1024];
00057          int iLen = max(lstrlen(lpszMessage) * sizeof(TCHAR), 1024);
00058          CopyMemory(buf, lpszMessage, iLen);
00059          COPYDATASTRUCT cds;
00060          cds.dwData = 6007;
00061          cds.cbData = iLen;
00062          cds.lpData = buf;
00063          SendMessage(hWndPrev, WM_COPYDATA, NULL, (LPARAM)&cds);
00064       }
00065       // Bring the main window or its popup to the foreground
00066       SetForegroundWindow(hWndChild);
00067    }
00068
00069    return TRUE;
00070 }
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_limitsingleinstance.h File Reference

#include <bmws_handle.h>

Go to the source code of this file.

Compounds

class | CLimitSingleInstance

Defines

#define | AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 11 of file bmws_limitsingleinstance.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_limitsingleinstance.h Source File

bmws_limitsingleinstance.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_limitsingleinstance.h
00004 //    Class to encapsulate limiting the application to one instance running at
00005 //    a time.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00011 #define AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <bmws_handle.h>
00018
00019
00020 class CLimitSingleInstance
00021 {
00022 public:
00023
00024    //-------------------------------------------------------------------------
00025    //
00026    // Constructor
00027    //
00028    // Parameters:    None.
00029    //
00030    //-------------------------------------------------------------------------
00031    CLimitSingleInstance() : m_hMutex(CreateMutex(NULL, FALSE, BMWS_APPID), CloseHandle)
00032    {
00033       m_dwLastError = GetLastError();
00034    }
00035
00036    BOOL TestPrevInstance(LPTSTR lpszClass, LPTSTR lpszMessage);
00037
00038 protected:
00039    DWORD m_dwLastError;    // Last error after creating the mutex.
00040    CHandle m_hMutex;       // Mutext handle object
00041 };
00042
00043
00044 #endif // !defined(AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_multiofn.cpp File Reference

#include <bmws_multiofn.h>
#include <bmws_ofn.h>
#include <bmws_window.h>
#include <commdlg.h>

Go to the source code of this file.

Functions

UINT_PTR CALLBACK | OFNDialogHook (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
int | MultiOFN (CTSTR &lpszPath, CTSTRArray &alpszFiles, UINT uidFilter, UINT *puidFilterIndex, HWND hwndOwner, DWORD dwFlags, CTSTR &lpszTitle, CTSTR &lpszInitialPath, UINT uidDefExt)

Variables

WNDPROC * | g_lpfnOFNDialogProc = NULL

Function Documentation

int MultiOFN | ( | CTSTR & | lpszPath,
 |  | CTSTRArray & | alpszFiles,
 |  | UINT | uidFilter,
 |  | UINT * | puidFilterIndex,
 |  | HWND | hwndOwner,
 |  | DWORD | dwFlags,
 |  | CTSTR & | lpszTitle,
 |  | CTSTR & | lpszInitialPath,
 |  | UINT | uidDefExt
 | ) |

Definition at line 124 of file bmws_multiofn.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, OFNDialogHook(), OfnGetFilter(), CArray< CTSTR, CTSTR & >::RemoveAll(), SAFEALLOC, SAFEFREEMEMORY, CArray< CTSTR, CTSTR & >::SetAt(), CArray< CTSTR, CTSTR & >::SetSize(), and THROW.

00127 {
00128    lpszPath = NULL;
00129    alpszFiles.RemoveAll();
00130
00131    CTSTR lpszFilter;
00132    OfnGetFilter(uidFilter, lpszFilter);
00133
00134    int iReturn = 0;
00135
00136    OPENFILENAME ofn;
00137    ZeroMemory(&ofn, sizeof(ofn));
00138    ofn.lStructSize = sizeof(ofn);
00139    ofn.hInstance = NULL;
00140    ofn.hwndOwner = hwndOwner;
00141    ofn.lpstrFilter = lpszFilter;
00142    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00143    ofn.lpstrFile = SAFEALLOC(1024);
00144    ZeroMemory(ofn.lpstrFile, 1024);
00145    ofn.nMaxFile = 1024;
00146    ofn.lpstrInitialDir = lpszInitialPath;
00147    ofn.lpfnHook = OFNDialogHook;
00148    ofn.lpstrTitle = lpszTitle;
00149    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ALLOWMULTISELECT | dwFlags;
00150
00151    CTSTR lpszDefExt;
00152    if(uidDefExt != (UINT)-1)
00153    {
00154       lpszDefExt.Assign(uidDefExt);
00155       ofn.lpstrDefExt = lpszDefExt;
00156    }
00157
00158    if(GetOpenFileName(&ofn) > 0)
00159    {
00160       if(lstrlen(ofn.lpstrFile) > ofn.nFileOffset)
00161       {
00162          lpszPath.Alloc(ofn.nFileOffset);
00163          lstrcpyn(lpszPath, ofn.lpstrFile, ofn.nFileOffset);
00164       } else
00165          lpszPath.Assign(ofn.lpstrFile);
00166       LPTSTR lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00167       int cFiles = 0;
00168       int k = lstrlen(lpszStart);
00169       while(k > 0)
00170       {
00171          cFiles++;
00172          lpszStart = &lpszStart[k+1];
00173          k = lstrlen(lpszStart);
00174       };
00175       alpszFiles.SetSize(cFiles);
00176       lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00177       k = lstrlen(lpszStart);
00178       int i = 0;
00179       while(k > 0)
00180       {
00181          alpszFiles.SetAt(i, CTSTR(lpszStart));
00182          lpszStart = &lpszStart[k+1];
00183          k = lstrlen(lpszStart);
00184          i++;
00185       };
00186       if(puidFilterIndex)
00187          *puidFilterIndex = ofn.nFilterIndex;
00188       iReturn = cFiles;
00189    } else
00190    {
00191       if(CommDlgExtendedError() != 0)
00192          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART));
00193       iReturn = 0;
00194    }
00195
00196    SAFEFREEMEMORY(ofn.lpstrFile);
00197
00198    return iReturn;
00199 }

UINT_PTR CALLBACK OFNDialogHook | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 41 of file bmws_multiofn.cpp.

References ARRAYSIZE, CHWND::CenterWindow(), SAFEALLOC, and SAFEFREEMEMORY.

Referenced by MultiOFN().

00042 {
00043    LPOFNOTIFY lpofny;
00044    LPOPENFILENAME lpofn;
00045    DWORD cbLength;
00046    TCHAR szTemp[8];
00047
00048    switch(uMsg)
00049    {
00050       case WM_INITDIALOG:
00051          // You need to use a copy of the OPENFILENAME struct used to
00052          // create this dialog. You can store a pointer to the
00053          // OPENFILENAME struct in the ofn.lCustData so you can
00054          // retrieve it here in the lParam. Once you have it, you
00055          // need to hang on to it. Using window properties provides a
00056          // good thread safe solution to using a global variable.
00057
00058          SetProp(GetParent(hWnd), TEXT("BMWSOFN"), (LPVOID)lParam);
00059          return 0;
00060
00061       case WM_NOTIFY:
00062          // The OFNOTIFY struct is passed in the lParam of this message.
00063
00064          lpofny = (LPOFNOTIFY)lParam;
00065
00066          switch(lpofny->hdr.code)
00067          {
00068             case CDN_SELCHANGE:
00069                cbLength = CommDlg_OpenSave_GetSpec(GetParent(hWnd), szTemp, ARRAYSIZE(szTemp));
00070                cbLength += _MAX_PATH;
00071
00072                // The OFN struct is stored in a property of dialog window
00073
00074                lpofn = (LPOPENFILENAME)GetProp(GetParent(hWnd), TEXT("BMWSOFN"));
00075                if(lpofn->nMaxFile < cbLength)
00076                {
00077                   // Free the previously allocated buffer.
00078                   SAFEFREEMEMORY(lpofn->lpstrFile);
00079                   // Allocate a new buffer
00080                   lpofn->lpstrFile = SAFEALLOC(cbLength);
00081                   if(lpofn->lpstrFile)
00082                   {
00083                      lpofn->nMaxFile = cbLength;
00084                   }
00085                }
00086                break;
00087
00088             case CDN_INITDONE:
00089                CHWND::CenterWindow(GetParent(hWnd));
00090                break;
00091          }
00092
00093          return 0;
00094
00095       case WM_DESTROY:
00096       // Also need to free the property with the OPENFILENAME struct.
00097          RemoveProp(GetParent(hWnd), TEXT("BMWSOFN"));
00098          return 0;
00099    }
00100    return 0;
00101 }

Variable Documentation

WNDPROC* g_lpfnOFNDialogProc = NULL

Definition at line 22 of file bmws_multiofn.cpp.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_multiofn.cpp Source File

bmws_multiofn.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_multiofn.cpp
00004 //    Functions to support opening multiple files from the Open common
00005 //    dialog box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_multiofn.h>
00014 #include <bmws_ofn.h>
00015 #include <bmws_window.h>
00016 #include <commdlg.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Global variables
00021 //----------------------------------------------------------------------------
00022 WNDPROC* g_lpfnOFNDialogProc = NULL;
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // OFNDialogHook function
00028 //    Callback function for the Open common dialog box hook, used to
00029 //    reallocate the selected file buffer if needed.
00030 //
00031 // Parameters:
00032 //    hWnd:          The window handle to a hooking child window of the Open
00033 //                   dialog box.
00034 //    uMsg:          Message identifer.
00035 //    wParam:        Message-specific parameter.
00036 //    lParam:        Message-specific parameter.
00037 //
00038 // Returns:          0 in all cases.
00039 //
00040 //----------------------------------------------------------------------------
00041 UINT_PTR CALLBACK OFNDialogHook(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00042 {
00043    LPOFNOTIFY lpofny;
00044    LPOPENFILENAME lpofn;
00045    DWORD cbLength;
00046    TCHAR szTemp[8];
00047
00048    switch(uMsg)
00049    {
00050       case WM_INITDIALOG:
00051          // You need to use a copy of the OPENFILENAME struct used to
00052          // create this dialog. You can store a pointer to the
00053          // OPENFILENAME struct in the ofn.lCustData so you can
00054          // retrieve it here in the lParam. Once you have it, you
00055          // need to hang on to it. Using window properties provides a
00056          // good thread safe solution to using a global variable.
00057
00058          SetProp(GetParent(hWnd), TEXT("BMWSOFN"), (LPVOID)lParam);
00059          return 0;
00060
00061       case WM_NOTIFY:
00062          // The OFNOTIFY struct is passed in the lParam of this message.
00063
00064          lpofny = (LPOFNOTIFY)lParam;
00065
00066          switch(lpofny->hdr.code)
00067          {
00068             case CDN_SELCHANGE:
00069                cbLength = CommDlg_OpenSave_GetSpec(GetParent(hWnd), szTemp, ARRAYSIZE(szTemp));
00070                cbLength += _MAX_PATH;
00071
00072                // The OFN struct is stored in a property of dialog window
00073
00074                lpofn = (LPOPENFILENAME)GetProp(GetParent(hWnd), TEXT("BMWSOFN"));
00075                if(lpofn->nMaxFile < cbLength)
00076                {
00077                   // Free the previously allocated buffer.
00078                   SAFEFREEMEMORY(lpofn->lpstrFile);
00079                   // Allocate a new buffer
00080                   lpofn->lpstrFile = SAFEALLOC(cbLength);
00081                   if(lpofn->lpstrFile)
00082                   {
00083                      lpofn->nMaxFile = cbLength;
00084                   }
00085                }
00086                break;
00087
00088             case CDN_INITDONE:
00089                CHWND::CenterWindow(GetParent(hWnd));
00090                break;
00091          }
00092
00093          return 0;
00094
00095       case WM_DESTROY:
00096       // Also need to free the property with the OPENFILENAME struct.
00097          RemoveProp(GetParent(hWnd), TEXT("BMWSOFN"));
00098          return 0;
00099    }
00100    return 0;
00101 }
00102
00103
00104 //----------------------------------------------------------------------------
00105 //
00106 // MultiOFN function
00107 //    Presents the Open common dialog box, allowing multiple selections.
00108 //
00109 // Parameters:
00110 //    lpszPath:         String to receive the chosen file path.
00111 //    alpszFiles:       Array to be filled with file names.
00112 //    uidFilter:        String resource identifer of the filter string.
00113 //    puidFilterIndex:  Pointer to the filter index to use; will be updated if
00114 //                      the user selects a different filter.
00115 //    hwndOwner:        Parent window of the dialog box.
00116 //    dwFlags:          Flags for the OPENFILENAME structure.
00117 //    lpszTitle:        Title of the dialog box.
00118 //    lpszInitialPath:  Path to start in.
00119 //    uidDefExt:        String resource identifier of the default extension.
00120 //
00121 // Returns:             The number of files selected.
00122 //
00123 //----------------------------------------------------------------------------
00124 int MultiOFN(CTSTR& lpszPath, CTSTRArray& alpszFiles, UINT uidFilter, UINT *puidFilterIndex,
00125              HWND hwndOwner, DWORD dwFlags, CTSTR& lpszTitle, CTSTR& lpszInitialPath,
00126              UINT uidDefExt)
00127 {
00128    lpszPath = NULL;
00129    alpszFiles.RemoveAll();
00130
00131    CTSTR lpszFilter;
00132    OfnGetFilter(uidFilter, lpszFilter);
00133
00134    int iReturn = 0;
00135
00136    OPENFILENAME ofn;
00137    ZeroMemory(&ofn, sizeof(ofn));
00138    ofn.lStructSize = sizeof(ofn);
00139    ofn.hInstance = NULL;
00140    ofn.hwndOwner = hwndOwner;
00141    ofn.lpstrFilter = lpszFilter;
00142    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00143    ofn.lpstrFile = SAFEALLOC(1024);
00144    ZeroMemory(ofn.lpstrFile, 1024);
00145    ofn.nMaxFile = 1024;
00146    ofn.lpstrInitialDir = lpszInitialPath;
00147    ofn.lpfnHook = OFNDialogHook;
00148    ofn.lpstrTitle = lpszTitle;
00149    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ALLOWMULTISELECT | dwFlags;
00150
00151    CTSTR lpszDefExt;
00152    if(uidDefExt != (UINT)-1)
00153    {
00154       lpszDefExt.Assign(uidDefExt);
00155       ofn.lpstrDefExt = lpszDefExt;
00156    }
00157
00158    if(GetOpenFileName(&ofn) > 0)
00159    {
00160       if(lstrlen(ofn.lpstrFile) > ofn.nFileOffset)
00161       {
00162          lpszPath.Alloc(ofn.nFileOffset);
00163          lstrcpyn(lpszPath, ofn.lpstrFile, ofn.nFileOffset);
00164       } else
00165          lpszPath.Assign(ofn.lpstrFile);
00166       LPTSTR lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00167       int cFiles = 0;
00168       int k = lstrlen(lpszStart);
00169       while(k > 0)
00170       {
00171          cFiles++;
00172          lpszStart = &lpszStart[k+1];
00173          k = lstrlen(lpszStart);
00174       };
00175       alpszFiles.SetSize(cFiles);
00176       lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00177       k = lstrlen(lpszStart);
00178       int i = 0;
00179       while(k > 0)
00180       {
00181          alpszFiles.SetAt(i, CTSTR(lpszStart));
00182          lpszStart = &lpszStart[k+1];
00183          k = lstrlen(lpszStart);
00184          i++;
00185       };
00186       if(puidFilterIndex)
00187          *puidFilterIndex = ofn.nFilterIndex;
00188       iReturn = cFiles;
00189    } else
00190    {
00191       if(CommDlgExtendedError() != 0)
00192          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART));
00193       iReturn = 0;
00194    }
00195
00196    SAFEFREEMEMORY(ofn.lpstrFile);
00197
00198    return iReturn;
00199 }
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_multiofn.h File Reference

#include <bmws_stringarray.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

int | MultiOFN (CTSTR &lpszPath, CTSTRArray &alpszFiles, UINT uidFilter, UINT *puidFilterIndex, HWND hwndOwner, DWORD dwFlags, CTSTR &lpszTitle, CTSTR &lpszInitialPath, UINT uidDefExt)

Define Documentation

#define AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_multiofn.h.

Function Documentation

int MultiOFN | ( | CTSTR & | lpszPath,
 |  | CTSTRArray & | alpszFiles,
 |  | UINT | uidFilter,
 |  | UINT * | puidFilterIndex,
 |  | HWND | hwndOwner,
 |  | DWORD | dwFlags,
 |  | CTSTR & | lpszTitle,
 |  | CTSTR & | lpszInitialPath,
 |  | UINT | uidDefExt
 | ) |

Definition at line 124 of file bmws_multiofn.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, OFNDialogHook(), OfnGetFilter(), CArray< CTSTR, CTSTR & >::RemoveAll(), SAFEALLOC, SAFEFREEMEMORY, CArray< CTSTR, CTSTR & >::SetAt(), CArray< CTSTR, CTSTR & >::SetSize(), and THROW.

00127 {
00128    lpszPath = NULL;
00129    alpszFiles.RemoveAll();
00130
00131    CTSTR lpszFilter;
00132    OfnGetFilter(uidFilter, lpszFilter);
00133
00134    int iReturn = 0;
00135
00136    OPENFILENAME ofn;
00137    ZeroMemory(&ofn, sizeof(ofn));
00138    ofn.lStructSize = sizeof(ofn);
00139    ofn.hInstance = NULL;
00140    ofn.hwndOwner = hwndOwner;
00141    ofn.lpstrFilter = lpszFilter;
00142    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00143    ofn.lpstrFile = SAFEALLOC(1024);
00144    ZeroMemory(ofn.lpstrFile, 1024);
00145    ofn.nMaxFile = 1024;
00146    ofn.lpstrInitialDir = lpszInitialPath;
00147    ofn.lpfnHook = OFNDialogHook;
00148    ofn.lpstrTitle = lpszTitle;
00149    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ALLOWMULTISELECT | dwFlags;
00150
00151    CTSTR lpszDefExt;
00152    if(uidDefExt != (UINT)-1)
00153    {
00154       lpszDefExt.Assign(uidDefExt);
00155       ofn.lpstrDefExt = lpszDefExt;
00156    }
00157
00158    if(GetOpenFileName(&ofn) > 0)
00159    {
00160       if(lstrlen(ofn.lpstrFile) > ofn.nFileOffset)
00161       {
00162          lpszPath.Alloc(ofn.nFileOffset);
00163          lstrcpyn(lpszPath, ofn.lpstrFile, ofn.nFileOffset);
00164       } else
00165          lpszPath.Assign(ofn.lpstrFile);
00166       LPTSTR lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00167       int cFiles = 0;
00168       int k = lstrlen(lpszStart);
00169       while(k > 0)
00170       {
00171          cFiles++;
00172          lpszStart = &lpszStart[k+1];
00173          k = lstrlen(lpszStart);
00174       };
00175       alpszFiles.SetSize(cFiles);
00176       lpszStart = &ofn.lpstrFile[ofn.nFileOffset];
00177       k = lstrlen(lpszStart);
00178       int i = 0;
00179       while(k > 0)
00180       {
00181          alpszFiles.SetAt(i, CTSTR(lpszStart));
00182          lpszStart = &lpszStart[k+1];
00183          k = lstrlen(lpszStart);
00184          i++;
00185       };
00186       if(puidFilterIndex)
00187          *puidFilterIndex = ofn.nFilterIndex;
00188       iReturn = cFiles;
00189    } else
00190    {
00191       if(CommDlgExtendedError() != 0)
00192          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART));
00193       iReturn = 0;
00194    }
00195
00196    SAFEFREEMEMORY(ofn.lpstrFile);
00197
00198    return iReturn;
00199 }

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_multiofn.h Source File

bmws_multiofn.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_multiofn.h
00004 //    Functions to support opening multiple files from the Open common
00005 //    dialog box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009 #if !defined(AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_stringarray.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // BMWS_MultiOFN API functions
00021 //----------------------------------------------------------------------------
00022 int MultiOFN(CTSTR& lpszPath, CTSTRArray& alpszFiles, UINT uidFilter,
00023              UINT *puidFilterIndex, HWND hwndOwner, DWORD dwFlags, CTSTR& lpszTitle,
00024              CTSTR& lpszInitialPath, UINT uidDefExt);
00025
00026
00027 #endif // !defined(AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ofn.cpp File Reference

#include <bmws_ofn.h>

Go to the source code of this file.

Functions

void OfnGetFilter (UINT uidFilter, CTSTR &lpszFilter)

Function Documentation

void OfnGetFilter | ( | UINT | uidFilter,
 |  | CTSTR & | lpszFilter
 | ) |

Definition at line 27 of file bmws_ofn.cpp.

References CTSTR::Assign(), and CTSTR::m_lpsz.

Referenced by MultiOFN(), and SingleOFN().

00028 {
00029    if(uidFilter == (UINT)-1)
00030    {
00031       lpszFilter = NULL;
00032       return;
00033    }
00034
00035    lpszFilter.Assign(uidFilter);
00036
00037    TCHAR chReplace;
00038
00039    chReplace = lpszFilter.m_lpsz[lstrlen(lpszFilter)-1];
00040    for(int k = 0; lpszFilter.m_lpsz[k] != '\0'; k++)
00041       if(lpszFilter.m_lpsz[k] == chReplace)
00042          lpszFilter.m_lpsz[k] = '\0';
00043 }

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ofn.cpp Source File

bmws_ofn.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_ofn.h
00004 //    Functions to support using the Open common dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_ofn.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 //
00017 // OfnGetFilter function
00018 //    Loads and formats a filter string.
00019 //
00020 // Parameters:
00021 //    uidFilter:     String resource identifier of the filter string.
00022 //    lpszFilter:    String to receive the formatted filter.
00023 //
00024 // Returns:          None.
00025 //
00026 //----------------------------------------------------------------------------
00027 void OfnGetFilter(UINT uidFilter, CTSTR& lpszFilter)
00028 {
00029    if(uidFilter == (UINT)-1)
00030    {
00031       lpszFilter = NULL;
00032       return;
00033    }
00034
00035    lpszFilter.Assign(uidFilter);
00036
00037    TCHAR chReplace;
00038
00039    chReplace = lpszFilter.m_lpsz[lstrlen(lpszFilter)-1];
00040    for(int k = 0; lpszFilter.m_lpsz[k] != '\0'; k++)
00041       if(lpszFilter.m_lpsz[k] == chReplace)
00042          lpszFilter.m_lpsz[k] = '\0';
00043 }
Generated on Wed May 8 12:38:54 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ofn.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

void | OfnGetFilter (UINT uidFilter, CTSTR &lpszFilter)

Define Documentation

#define AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_ofn.h.

Function Documentation

void OfnGetFilter | ( | UINT | uidFilter,
 |  | CTSTR & | lpszFilter
 | ) |

Definition at line 27 of file bmws_ofn.cpp.

References CTSTR::Assign(), and CTSTR::m_lpsz.

Referenced by MultiOFN(), and SingleOFN().

00028 {
00029    if(uidFilter == (UINT)-1)
00030    {
00031       lpszFilter = NULL;
00032       return;
00033    }
00034
00035    lpszFilter.Assign(uidFilter);
00036
00037    TCHAR chReplace;
00038
00039    chReplace = lpszFilter.m_lpsz[lstrlen(lpszFilter)-1];
00040    for(int k = 0; lpszFilter.m_lpsz[k] != '\0'; k++)
00041       if(lpszFilter.m_lpsz[k] == chReplace)
00042          lpszFilter.m_lpsz[k] = '\0';
00043 }

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ofn.h Source File

bmws_ofn.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_ofn.h
00004 //    Functions to support using the Open common dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_string.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Internal functions (used by MultiOFN and SingleOFN components)
00021 //----------------------------------------------------------------------------
00022 void OfnGetFilter(UINT uidFilter, CTSTR& lpszFilter);
00023
00024
00025 #endif // !defined(AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:55 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pidl.h File Reference

#include <bmws_ptr.h>
#include <shlobj.h>

Go to the source code of this file.

Compounds

class | CPidl

Defines

#define | AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_pidl.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pidl.h Source File

bmws_pidl.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_pidl.h
00004 //    Class to encapsulate an LPITEMIDLIST.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_ptr.h>
00017 #include <shlobj.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // CPidl class
00023 //    Encapsulates an LPITEMIDLIST.
00024 //
00025 //----------------------------------------------------------------------------
00026 class CPidl
00027 {
00028 public:
00029
00030    //-------------------------------------------------------------------------
00031    //
00032    // Default Constructor
00033    //
00034    // Parameters:    None.
00035    //
00036    //-------------------------------------------------------------------------
00037    CPidl()
00038    {
00039       m_pidl = NULL;
00040    }
00041
00042
00043    //-------------------------------------------------------------------------
00044    //
00045    // Constructor
00046    //
00047    // Parameters:
00048    //    pidl:       LPITEMIDLIST to assign to this object.
00049    //
00050    //-------------------------------------------------------------------------
00051    CPidl(LPITEMIDLIST pidl)
00052    {
00053       m_pidl = pidl;
00054    }
00055
00056
00057    //-------------------------------------------------------------------------
00058    //
00059    // Destructor
00060    //
00061    //-------------------------------------------------------------------------
00062    ~CPidl()
00063    {
00064       Free();
00065    }
00066
00067
00068    //-------------------------------------------------------------------------
00069    //
00070    // LPITEMIDLIST operator
00071    //
00072    // Parameters:    None.
00073    //
00074    // Returns:       The LPITEMIDLIST.
00075    //
00076    //-------------------------------------------------------------------------
00077    operator LPITEMIDLIST() const
00078    {
00079       return m_pidl;
00080    }
00081
00082
00083    //-------------------------------------------------------------------------
00084    //
00085    // & operator
00086    //
00087    // Parameters:    None.
00088    //
00089    // Returns:       The address of the LPITEMIDLIST.
00090    //
00091    //-------------------------------------------------------------------------
00092    LPITEMIDLIST* operator&()
00093    {
00094       return &m_pidl;
00095    }
00096
00097
00098    //-------------------------------------------------------------------------
00099    //
00100    // Assign function
00101    //
00102    // Parameters:
00103    //    pidl:       LPITEMIDLIST to encapsulate with this object.
00104    //
00105    //-------------------------------------------------------------------------
00106    void Assign(LPITEMIDLIST pidl)
00107    {
00108       Free();
00109       m_pidl = pidl;
00110    }
00111
00112
00113    //-------------------------------------------------------------------------
00114    //
00115    // Free function
00116    //    Releases the LPITEMIDLIST from memory.
00117    //
00118    // Parameters:    None.
00119    //
00120    // Returns:       None.
00121    //
00122    //-------------------------------------------------------------------------
00123    void Free()
00124    {
00125       if(m_pidl != NULL)
00126       {
00127          CPtr<IMalloc, &IID_IMalloc> spMalloc;
00128          CHECKHRCOM(SHGetMalloc(&spMalloc));
00129          spMalloc->Free(m_pidl);
00130          m_pidl = NULL;
00131       }
00132    }
00133
00134
00135 private:
00136    LPITEMIDLIST m_pidl;
00137 };
00138
00139
00140 #endif // !defined(AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:55 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pointer.cpp File Reference

#include <bmws_pointer.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pointer.cpp Source File

bmws_pointer.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_pointer.cpp
00004 //    Initialization of reference counting tracking variables.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_pointer.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 // Reference count object tracking
00017 //----------------------------------------------------------------------------
00018 int CRefCount::m_scTotalCreated = 0;
00019 int CRefCount::m_scTotalDeleted = 0;
Generated on Wed May 8 12:38:55 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pointer.h File Reference

#include <bmws_common.h>
#include <bmws_error.h>

Go to the source code of this file.

Compounds

class | CPointer
class | CRefCount

Defines

#define | AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_pointer.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_pointer.h Source File

bmws_pointer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_pointer.h
00004 //    Classes to encapsulate smart pointers and reference counting.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_common.h>
00017 #include <bmws_error.h>
00018
00019 class CRefCount
00020 {
00021 public:
00022
00023    //-------------------------------------------------------------------------
00024    //
00025    // Constructor
00026    //
00027    // Parameters:    None.
00028    //
00029    //-------------------------------------------------------------------------
00030    CRefCount()
00031    {
00032       m_cRefs = 0;
00033 #ifdef BMWS_TRACKMEMALLOC
00034       m_scTotalCreated++;
00035 #endif
00036    }
00037
00038
00039    //-------------------------------------------------------------------------
00040    //
00041    // Destructor
00042    //
00043    //-------------------------------------------------------------------------
00044    virtual ~CRefCount()
00045    {
00046 #ifdef BMWS_TRACKMEMALLOC
00047       m_scTotalDeleted++;
00048 #endif
00049    }
00050
00051
00052
00053    //-------------------------------------------------------------------------
00054    //
00055    // upcount function
00056    //    Increases the object's reference count.
00057    //
00058    // Parameters:    None.
00059    //
00060    // Returns:       None.
00061    //
00062    //-------------------------------------------------------------------------
00063    void upcount()
00064    {
00065       m_cRefs++;
00066    }
00067
00068
00069    //-------------------------------------------------------------------------
00070    //
00071    // downcount function
00072    //    Decreases the object's reference count.
00073    //
00074    // Parameters:    None.
00075    //
00076    // Returns:       None.
00077    //
00078    //-------------------------------------------------------------------------
00079    void downcount()
00080    {
00081       m_cRefs--;
00082       if(m_cRefs == 0)
00083          delete this;
00084    }
00085
00086
00087 #ifdef BMWS_TRACKMEMALLOC
00088    static int m_scTotalCreated;  // Total number of objects created
00089    static int m_scTotalDeleted;  // Total number of objects deleted
00090 #endif
00091
00092
00093 private:
00094    int m_cRefs;   // Reference count on this object
00095 };
00096
00097
00098 //----------------------------------------------------------------------------
00099 //
00100 // CPointer template class
00101 //    Encapsulates smart pointers.
00102 //
00103 // Template parameters:
00104 //    T:             Data type to wrap.
00105 //
00106 //----------------------------------------------------------------------------
00107 template <class T> class CPointer
00108 {
00109 public:
00110
00111    //-------------------------------------------------------------------------
00112    //
00113    // Constructor
00114    //
00115    //-------------------------------------------------------------------------
00116    CPointer()
00117    {
00118       m_p = NULL;
00119    }
00120
00121
00122    //-------------------------------------------------------------------------
00123    //
00124    // Constructor
00125    //
00126    // Parameters:
00127    //    p:          Pointer to assign to this object.
00128    //
00129    //-------------------------------------------------------------------------
00130    CPointer(T* p)
00131    {
00132       m_p = p;
00133       if(m_p)
00134          m_p->upcount();
00135    }
00136
00137
00138    //-------------------------------------------------------------------------
00139    //
00140    // Destructor
00141    //
00142    //-------------------------------------------------------------------------
00143    ~CPointer()
00144    {
00145       if(m_p)
00146          m_p->downcount();
00147    }
00148
00149
00150    //-------------------------------------------------------------------------
00151    //
00152    // T* operator
00153    //
00154    // Parameters:    None.
00155    //
00156    // Returns:       The contained pointer.
00157    //
00158    //-------------------------------------------------------------------------
00159    operator T*()
00160    {
00161       return m_p;
00162    }
00163
00164
00165    //-------------------------------------------------------------------------
00166    //
00167    // * operator
00168    //
00169    // Parameters:    None.
00170    //
00171    // Returns:       The value of the contained pointer.
00172    //
00173    //-------------------------------------------------------------------------
00174    T& operator*()
00175    {
00176       _ASSERT(m_p);
00177       return *m_p;
00178    }
00179
00180
00181    //-------------------------------------------------------------------------
00182    //
00183    // -> operator
00184    //
00185    // Parameters:    None.
00186    //
00187    // Returns:       The contained pointer.
00188    //
00189    //-------------------------------------------------------------------------
00190    T* operator->()
00191    {
00192       _ASSERT(m_p);
00193       return m_p;
00194    }
00195
00196
00197    //-------------------------------------------------------------------------
00198    //
00199    // = operator
00200    //
00201    // Parameters:
00202    //    p:          Pointer to set this object to.
00203    //
00204    // Returns:       This pointer object.
00205    //
00206    //-------------------------------------------------------------------------
00207    CPointer& operator=(CPointer<T> &p)
00208    {
00209       return operator=((T*)p);
00210    }
00211
00212
00213    //-------------------------------------------------------------------------
00214    //
00215    // = operator
00216    //
00217    // Parameters:
00218    //    pI:         Pointer to set this object to.
00219    //
00220    // Returns:       The new contained pointer.
00221    //
00222    //-------------------------------------------------------------------------
00223    CPointer& operator=(T* p)
00224    {
00225       if(m_p)
00226          m_p->downcount();
00227       m_p = p;
00228       if(m_p)
00229          m_p->upcount();
00230       return *this;
00231    }
00232
00233
00234    //-------------------------------------------------------------------------
00235    //
00236    // ! operator
00237    //
00238    // Parameters:    None.
00239    //
00240    // Returns:       Whether the contained pointer is NULL.
00241    //
00242    //-------------------------------------------------------------------------
00243    BOOL operator!()
00244    {
00245       return (m_p == NULL);
00246    }
00247
00248
00249    //-------------------------------------------------------------------------
00250    //
00251    // BOOL operator
00252    //
00253    // Parameters:    None.
00254    //
00255    // Returns:       Whether the contained pointer is non-NULL.
00256    //
00257    //-------------------------------------------------------------------------
00258    operator BOOL() const
00259    {
00260       return (m_p != NULL);
00261    }
00262
00263
00264 private:
00265    T* m_p;        // Contained pointer
00266 };
00267
00268
00269 #endif // !defined(AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:55 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ptr.h File Reference

#include <bmws_common.h>
#include <bmws_error.h>
#include <objbase.h>

Go to the source code of this file.

Compounds

class | CPtr

Defines

#define | AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef CPtr< IUnknown,&IID_IUnknown > | CUnknownPtr
typedef CPtr< IDispatch,&IID_IDispatch > | CDispatchPtr

Define Documentation

#define AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_ptr.h.

Typedef Documentation

typedef CPtr<IDispatch, &IID_IDispatch> CDispatchPtr

Definition at line 309 of file bmws_ptr.h.

typedef CPtr<IUnknown, &IID_IUnknown> CUnknownPtr

Definition at line 306 of file bmws_ptr.h.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_ptr.h Source File

bmws_ptr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_ptr.h
00004 //    Class to encapsulate smart COM interface pointers.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_common.h>
00017 #include <bmws_error.h>
00018 #include <objbase.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 //
00023 // CPtr template class
00024 //    Encapsulates smart COM interface pointers.
00025 //
00026 // Template parameters:
00027 //    T:             Interface to wrap.
00028 //    piid:          Pointer to the interface identifier of the interface T.
00029 //
00030 //----------------------------------------------------------------------------
00031 template <class T, const IID* piid> class CPtr
00032 {
00033 public:
00034
00035    //-------------------------------------------------------------------------
00036    //
00037    // Constructor
00038    //
00039    //-------------------------------------------------------------------------
00040    CPtr()
00041    {
00042       m_pI = NULL;
00043    }
00044
00045
00046    //-------------------------------------------------------------------------
00047    //
00048    // Copy Constructor
00049    //
00050    // Parameters:
00051    //    lp:         Existing smart pointer object.
00052    //
00053    //-------------------------------------------------------------------------
00054    CPtr(const CPtr<T, piid>& lp)
00055    {
00056       m_pI = lp.m_pI;
00057       if(m_pI)
00058          m_pI->AddRef();
00059    }
00060
00061
00062    //-------------------------------------------------------------------------
00063    //
00064    // Constructor
00065    //
00066    // Parameters:
00067    //    pI:         Void pointer to an existing interface which is the same
00068    //                as the one for this pointer.
00069    //
00070    //-------------------------------------------------------------------------
00071    CPtr(BOOL, LPVOID pI)
00072    {
00073       m_pI = (T*)pI;
00074    }
00075
00076
00077    //-------------------------------------------------------------------------
00078    //
00079    // Constructor
00080    //
00081    // Parameters:
00082    //    pI:         Pointer to an existing interface which is not the same
00083    //                as the one for this pointer.
00084    //
00085    //-------------------------------------------------------------------------
00086    CPtr(IUnknown *pI)
00087    {
00088       m_pI = NULL;
00089       if(pI)
00090          CHECKHRCOM(pI->QueryInterface(*piid, (LPVOID*)&m_pI));
00091    }
00092
00093
00094    //-------------------------------------------------------------------------
00095    //
00096    // Destructor
00097    //
00098    //-------------------------------------------------------------------------
00099    ~CPtr()
00100    {
00101       Release();
00102    }
00103
00104
00105    //-------------------------------------------------------------------------
00106    //
00107    // Release function
00108    //    Releases the held interface pointer and sets it to NULL.
00109    //
00110    // Parameters:    None.
00111    //
00112    // Returns:       None.
00113    //
00114    //-------------------------------------------------------------------------
00115    void Release()
00116    {
00117       SAFERELEASE(m_pI);
00118    }
00119
00120
00121    //-------------------------------------------------------------------------
00122    //
00123    // T* operator
00124    //
00125    // Parameters:    None.
00126    //
00127    // Returns:       The interface pointer.
00128    //
00129    //-------------------------------------------------------------------------
00130    operator T*()
00131    {
00132       return m_pI;
00133    }
00134
00135
00136    //-------------------------------------------------------------------------
00137    //
00138    // * operator
00139    //
00140    // Parameters:    None.
00141    //
00142    // Returns:       The value of the interface pointer.
00143    //
00144    //-------------------------------------------------------------------------
00145    T& operator*()
00146    {
00147       if(!m_pI)
00148          THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
00149       return *m_pI;
00150    }
00151
00152
00153    //-------------------------------------------------------------------------
00154    //
00155    // & operator
00156    //
00157    // Parameters:    None.
00158    //
00159    // Returns:       The address of the interface pointer.
00160    //
00161    //-------------------------------------------------------------------------
00162    T** operator&()
00163    {
00164       return &m_pI;
00165    }
00166
00167
00168    //-------------------------------------------------------------------------
00169    //
00170    // -> operator
00171    //
00172    // Parameters:    None.
00173    //
00174    // Returns:       The interface pointer.
00175    //
00176    //-------------------------------------------------------------------------
00177    T* operator->()
00178    {
00179       if(!m_pI)
00180          THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
00181       return m_pI;
00182    }
00183
00184
00185    //-------------------------------------------------------------------------
00186    //
00187    // = operator
00188    //
00189    // Parameters:
00190    //    pI:         Pointer to an existing interface which is the same as the
00191    //                one for this pointer.
00192    //
00193    // Returns:       The new interface pointer.
00194    //
00195    //-------------------------------------------------------------------------
00196    T* operator=(T* pI)
00197    {
00198       if(m_pI != pI)
00199       {
00200          IUnknown *pOld = m_pI;
00201          m_pI = pI;
00202          if(m_pI)
00203             m_pI->AddRef();
00204          SAFERELEASE(pOld);
00205       }
00206       return m_pI;
00207    }
00208
00209
00210    //-------------------------------------------------------------------------
00211    //
00212    // = operator
00213    //
00214    // Parameters:
00215    //    lp:         Existing smart pointer object.
00216    //
00217    // Returns:       The new interface pointer.
00218    //
00219    //-------------------------------------------------------------------------
00220    CPtr<T, piid>& operator=(const CPtr<T, piid>& lp)
00221    {
00222       IUnknown *pOld = m_pI;
00223       m_pI = lp.m_pI;
00224       if(m_pI)
00225          m_pI->AddRef();
00226       SAFERELEASE(pOld);
00227       return *this;
00228    }
00229
00230
00231    //-------------------------------------------------------------------------
00232    //
00233    // ! operator
00234    //
00235    // Parameters:    None.
00236    //
00237    // Returns:       Whether the interface pointer is NULL.
00238    //
00239    //-------------------------------------------------------------------------
00240    BOOL operator!()
00241    {
00242       return (m_pI == NULL);
00243    }
00244
00245
00246    //-------------------------------------------------------------------------
00247    //
00248    // BOOL operator
00249    //
00250    // Parameters:    None.
00251    //
00252    // Returns:       Whether the interface pointer is non-NULL.
00253    //
00254    //-------------------------------------------------------------------------
00255    operator BOOL() const
00256    {
00257       return (m_pI != NULL);
00258    }
00259
00260
00261    //-------------------------------------------------------------------------
00262    //
00263    // Assign function
00264    //
00265    // Parameters:
00266    //    pI:         Pointer to an existing interface which is not the same
00267    //                as the one for this pointer.
00268    //
00269    // Returns:       The new interface pointer.
00270    //
00271    //-------------------------------------------------------------------------
00272    T* Assign(IUnknown *pI)
00273    {
00274       SAFERELEASE(m_pI);
00275       if(pI)
00276          CHECKHRCOM(pI->QueryInterface(*piid, (LPVOID*)&m_pI));
00277       return m_pI;
00278    }
00279
00280
00281    //-------------------------------------------------------------------------
00282    //
00283    // Assign function
00284    //
00285    // Parameters:
00286    //    pI:         Void pointer to an existing interface which is the same
00287    //                as the one for this pointer.
00288    //
00289    //-------------------------------------------------------------------------
00290    void Assign(BOOL, LPVOID pI)
00291    {
00292       SAFERELEASE(m_pI);
00293       m_pI = (T*)pI;
00294    }
00295
00296
00297 private:
00298    T* m_pI;       // Interface pointer
00299 };
00300
00301
00302 //----------------------------------------------------------------------------
00303 // Smart pointer classes
00304 //----------------------------------------------------------------------------
00305 #ifndef BMWS_PTR_NOUNKNOWN
00306 typedef CPtr<IUnknown, &IID_IUnknown> CUnknownPtr;
00307 #endif
00308 #ifndef BMWS_PTR_NODISPATCH
00309 typedef CPtr<IDispatch, &IID_IDispatch> CDispatchPtr;
00310 #endif
00311
00312
00313 #endif // !defined(AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:55 2002 for Solitaire Pack by doxygen 1.2.15


bmws_registry.cpp File Reference

#include <bmws_common.h>
#include <bmws_registry.h>

Go to the source code of this file.

Functions

HRESULT | GetProductKey (CKey &hKey, BOOL bUser)
HRESULT | GetRegDWORDValue (CKey &hKey, UINT uidValue, DWORD *pdwResult)
CTSTR | GetRegStringValue (CKey &hKey, UINT uidValue)
void | SetRegDWORDValue (CKey &hKey, UINT uidValue, DWORD dwValue)
void | SetRegStringValue (CKey &hKey, UINT uidValue, CTSTR &lpszNewValue)

Variables

HINSTANCE | g_hInst

Function Documentation

HRESULT GetProductKey | ( | CKey & | hKey,
 |  | BOOL | bUser
 | ) |

Definition at line 36 of file bmws_registry.cpp.

Referenced by CMainWindow::Create(), CMainWindow::OnCommand(), CMainWindow::OnDestroy(), CUserPrefs::ReadRegistry(), CSolpackApp::Register(), CSolpackApp::Run(), CUserPrefs::WriteRegistry(), and CUpdateInfo::XMLDone().

00037 {
00038    CKey     hKeySoftware;
00039    LONG     lResult;
00040    DWORD    dwDisp;
00041
00042    lResult = RegCreateKeyEx(bUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
00043       CTSTR(IDS_REG_SOFTWARE), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00044       &hKeySoftware, &dwDisp);
00045    if(lResult == NOERROR)
00046    {
00047       CKey hKeyCompany;
00048       lResult = RegCreateKeyEx(hKeySoftware, CTSTR(IDS_COMPANY), 0, NULL,
00049          REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeyCompany, &dwDisp);
00050       if(lResult == NOERROR)
00051       {
00052          lResult = RegCreateKeyEx(hKeyCompany, CTSTR(IDS_APP_TITLE), 0, NULL,
00053             REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
00054          if(lResult == NOERROR)
00055             return S_OK;
00056       }
00057    }
00058    return E_FAIL;
00059 }

HRESULT GetRegDWORDValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | DWORD * | pdwResult
 | ) |

Definition at line 76 of file bmws_registry.cpp.

References _ASSERT, and CTSTR::Assign().

Referenced by CUserPrefs::ReadRegistry(), and CUpdateInfo::XMLDone().

00077 {
00078    _ASSERT(pdwResult);
00079
00080    *pdwResult = 0;
00081    DWORD dwValue;
00082    DWORD dwSize = sizeof(dwValue);
00083    DWORD dwTemp;
00084
00085    CTSTR lpszValue;
00086    if(uidValue != -1)
00087       lpszValue.Assign(uidValue);
00088
00089    long lResult = RegQueryValueEx(hKey, lpszValue, NULL, &dwTemp, (LPBYTE)&dwValue, &dwSize);
00090    if(lResult == NOERROR)
00091    {
00092       *pdwResult = dwValue;
00093       return S_OK;
00094    }
00095    return E_FAIL;
00096 }

CTSTR GetRegStringValue | ( | CKey & | hKey,
 |  | UINT | uidValue
 | ) |

Definition at line 112 of file bmws_registry.cpp.

References CTSTR::Alloc(), and CTSTR::Assign().

Referenced by CCPSounds::CCPSounds(), GetHlinkColor(), and CUserPrefs::ReadRegistry().

00113 {
00114    CTSTR lpszValue;
00115    if(uidValue != -1)
00116       lpszValue.Assign(uidValue);
00117
00118    LONG lResult;
00119    DWORD dwTemp;
00120    DWORD dwSize = 80;
00121    CTSTR lpszTemp(TRUE, dwSize);
00122    lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp, &dwSize);
00123    if(lResult == ERROR_MORE_DATA)
00124    {
00125       lpszTemp.Alloc(dwSize);
00126       lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp,
00127          &dwSize);
00128    }
00129
00130    if(lResult != ERROR_SUCCESS)
00131       return CTSTR();
00132
00133    return lpszTemp;
00134 }

void SetRegDWORDValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | DWORD | dwValue
 | ) |

Definition at line 151 of file bmws_registry.cpp.

References CTSTR::Assign().

Referenced by CSolpackApp::Register(), CUserPrefs::WriteRegistry(), and CUpdateInfo::XMLDone().

00152 {
00153    CTSTR lpszValue;
00154    if(uidValue != -1)
00155       lpszValue.Assign(uidValue);
00156
00157    RegSetValueEx(hKey, lpszValue, 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(dwValue));
00158 }

void SetRegStringValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | CTSTR & | lpszNewValue
 | ) |

Definition at line 175 of file bmws_registry.cpp.

References CTSTR::Assign().

Referenced by CCPSounds::CCPSounds(), CCPSounds::Save(), and CUserPrefs::WriteRegistry().

00176 {
00177    CTSTR lpszValue;
00178    if(uidValue != -1)
00179       lpszValue.Assign(uidValue);
00180
00181    if(lpszNewValue)
00182       RegSetValueEx(hKey, lpszValue, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszNewValue,
00183          sizeof(TCHAR) * (lstrlen(lpszNewValue)+1));
00184    else
00185       RegDeleteValue(hKey, lpszValue);
00186 }

Variable Documentation

HINSTANCE g_hInst

Definition at line 19 of file bmws_registry.cpp.

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_registry.cpp Source File

bmws_registry.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_registry.cpp
00004 //    Functions to assist in using the Registry.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_registry.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 // External variables
00018 //----------------------------------------------------------------------------
00019 extern HINSTANCE g_hInst;
00020
00021
00022 //----------------------------------------------------------------------------
00023 //
00024 // GetProductKey function
00025 //    Retrieves the registry key that is used to store settings for this
00026 //    product.
00027 //
00028 // Parameters:
00029 //    hKey:          Key object to receive the registry key for the product.
00030 //    bUser:         Whether to use HKEY_CURRENT_USER (TRUE) or
00031 //                   HKEY_LOCAL_MACHINE (FALSE).
00032 //
00033 // Returns:          A standard COM success or error value.
00034 //
00035 //----------------------------------------------------------------------------
00036 HRESULT GetProductKey(CKey& hKey, BOOL bUser)
00037 {
00038    CKey     hKeySoftware;
00039    LONG     lResult;
00040    DWORD    dwDisp;
00041
00042    lResult = RegCreateKeyEx(bUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
00043       CTSTR(IDS_REG_SOFTWARE), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00044       &hKeySoftware, &dwDisp);
00045    if(lResult == NOERROR)
00046    {
00047       CKey hKeyCompany;
00048       lResult = RegCreateKeyEx(hKeySoftware, CTSTR(IDS_COMPANY), 0, NULL,
00049          REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeyCompany, &dwDisp);
00050       if(lResult == NOERROR)
00051       {
00052          lResult = RegCreateKeyEx(hKeyCompany, CTSTR(IDS_APP_TITLE), 0, NULL,
00053             REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
00054          if(lResult == NOERROR)
00055             return S_OK;
00056       }
00057    }
00058    return E_FAIL;
00059 }
00060
00061
00062 //----------------------------------------------------------------------------
00063 //
00064 // GetRegDWORDValue
00065 //    Retrieves the setting of a DWORD registry value.
00066 //
00067 // Parameters:
00068 //    hKey:          Key object that contains the desired value.
00069 //    uidValue:      String resource identifier of the value name. Passing -1
00070 //                   indicates that the key's default value is desired.
00071 //    pdwResult:     Pointer to hold the registry setting.
00072 //
00073 // Returns:          A standard COM success or error value.
00074 //
00075 //----------------------------------------------------------------------------
00076 HRESULT GetRegDWORDValue(CKey& hKey, UINT uidValue, DWORD* pdwResult)
00077 {
00078    _ASSERT(pdwResult);
00079
00080    *pdwResult = 0;
00081    DWORD dwValue;
00082    DWORD dwSize = sizeof(dwValue);
00083    DWORD dwTemp;
00084
00085    CTSTR lpszValue;
00086    if(uidValue != -1)
00087       lpszValue.Assign(uidValue);
00088
00089    long lResult = RegQueryValueEx(hKey, lpszValue, NULL, &dwTemp, (LPBYTE)&dwValue, &dwSize);
00090    if(lResult == NOERROR)
00091    {
00092       *pdwResult = dwValue;
00093       return S_OK;
00094    }
00095    return E_FAIL;
00096 }
00097
00098
00099 //----------------------------------------------------------------------------
00100 //
00101 // GetRegStringValue
00102 //    Retrieves the setting of a string registry value.
00103 //
00104 // Parameters:
00105 //    hKey:          Key object that contains the desired value.
00106 //    uidValue:      String resource identifier of the value name. Passing -1
00107 //                   indicates that the key's default value is desired.
00108 //
00109 // Returns:          The value's string setting, or NULL if it does not exist.
00110 //
00111 //----------------------------------------------------------------------------
00112 CTSTR GetRegStringValue(CKey& hKey, UINT uidValue)
00113 {
00114    CTSTR lpszValue;
00115    if(uidValue != -1)
00116       lpszValue.Assign(uidValue);
00117
00118    LONG lResult;
00119    DWORD dwTemp;
00120    DWORD dwSize = 80;
00121    CTSTR lpszTemp(TRUE, dwSize);
00122    lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp, &dwSize);
00123    if(lResult == ERROR_MORE_DATA)
00124    {
00125       lpszTemp.Alloc(dwSize);
00126       lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp,
00127          &dwSize);
00128    }
00129
00130    if(lResult != ERROR_SUCCESS)
00131       return CTSTR();
00132
00133    return lpszTemp;
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // SetRegDWORDValue
00140 //    Sets the setting of a DWORD registry value.
00141 //
00142 // Parameters:
00143 //    hKey:          Key object to contain the desired value.
00144 //    uidValue:      String resource identifier of the value name. Passing -1
00145 //                   indicates that the key's default value is desired.
00146 //    dwValue:       The new registry setting.
00147 //
00148 // Returns:          None.
00149 //
00150 //----------------------------------------------------------------------------
00151 void SetRegDWORDValue(CKey& hKey, UINT uidValue, DWORD dwValue)
00152 {
00153    CTSTR lpszValue;
00154    if(uidValue != -1)
00155       lpszValue.Assign(uidValue);
00156
00157    RegSetValueEx(hKey, lpszValue, 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(dwValue));
00158 }
00159
00160
00161 //----------------------------------------------------------------------------
00162 //
00163 // SetRegStringValue
00164 //    Sets the setting of a string registry value.
00165 //
00166 // Parameters:
00167 //    hKey:          Key object to contain the desired value.
00168 //    uidValue:      String resource identifier of the value name. Passing -1
00169 //                   indicates that the key's default value is desired.
00170 //    lpszNewValue:  The new registry setting.
00171 //
00172 // Returns:          None.
00173 //
00174 //----------------------------------------------------------------------------
00175 void SetRegStringValue(CKey& hKey, UINT uidValue, CTSTR& lpszNewValue)
00176 {
00177    CTSTR lpszValue;
00178    if(uidValue != -1)
00179       lpszValue.Assign(uidValue);
00180
00181    if(lpszNewValue)
00182       RegSetValueEx(hKey, lpszValue, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszNewValue,
00183          sizeof(TCHAR) * (lstrlen(lpszNewValue)+1));
00184    else
00185       RegDeleteValue(hKey, lpszValue);
00186 }
00187
00188
00189 #ifdef BMWS_REGISTRY_SETKEYANDVALUE
00190
00191 //----------------------------------------------------------------------------
00192 //
00193 // SetRegKeyAndValue function
00194 //    Create a key and set its value. This helper function was borrowed
00195 //    and modifed from Kraig Brockschmidt's book Inside OLE.
00196 //
00197 // Parameters:
00198 //    hKey:          Key under which to create the subkey.
00199 //    lpszKey:       Path to an existing key under HKEY_CLASSES_ROOT.
00200 //    lpszSubkey:    Name of the key to create.
00201 //    szValue:       The new key's default value.
00202 //
00203 // Returns:          A standard COM success or error value.
00204 //
00205 //----------------------------------------------------------------------------
00206 HRESULT SetRegKeyAndValue(CKey& hKey, CTSTR& lpszKey, CTSTR& lpszSubkey, CTSTR& lpszValue)
00207 {
00208    CTSTR lpszKeyBuf(TRUE, lpszKey.Len() + lpszSubkey.Len() + 8);
00209
00210    lstrcpy(lpszKeyBuf, lpszKey);
00211    if(lpszSubkey)
00212    {
00213       lstrcat(lpszKeyBuf, TEXT("\\"));
00214       lstrcat(lpszKeyBuf, lpszSubkey);
00215    }
00216
00217    // Create and open key and subkey.
00218    CKey hKeyTemp;
00219    if(RegCreateKeyEx(hKey, lpszKeyBuf, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
00220       &hKeyTemp, NULL) != ERROR_SUCCESS)
00221       return E_FAIL;
00222
00223    // Set the Value.
00224    if(lpszValue)
00225       RegSetValueEx(hKeyTemp, NULL, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszValue, lpszValue.Len()+1);
00226
00227    return S_OK;
00228 }
00229
00230 #endif
Generated on Wed May 8 12:38:56 2002 for Solitaire Pack by doxygen 1.2.15


bmws_registry.h File Reference

#include <bmws_key.h>
#include <bmws_string.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_REGISTRY_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

HRESULT | GetProductKey (CKey &hKey, BOOL bUser)
HRESULT | GetRegDWORDValue (CKey &hKey, UINT uidValue, DWORD *pdwResult)
CTSTR | GetRegStringValue (CKey &hKey, UINT uidValue)
void | SetRegDWORDValue (CKey &hKey, UINT uidValue, DWORD dwValue)
void | SetRegStringValue (CKey &hKey, UINT uidValue, CTSTR &lpszValue)

Define Documentation

#define AFX_BMWS_REGISTRY_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_registry.h.

Function Documentation

HRESULT GetProductKey | ( | CKey & | hKey,
 |  | BOOL | bUser
 | ) |

Definition at line 36 of file bmws_registry.cpp.

Referenced by CMainWindow::Create(), CMainWindow::OnCommand(), CMainWindow::OnDestroy(), CUserPrefs::ReadRegistry(), CSolpackApp::Register(), CSolpackApp::Run(), CUserPrefs::WriteRegistry(), and CUpdateInfo::XMLDone().

00037 {
00038    CKey     hKeySoftware;
00039    LONG     lResult;
00040    DWORD    dwDisp;
00041
00042    lResult = RegCreateKeyEx(bUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
00043       CTSTR(IDS_REG_SOFTWARE), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
00044       &hKeySoftware, &dwDisp);
00045    if(lResult == NOERROR)
00046    {
00047       CKey hKeyCompany;
00048       lResult = RegCreateKeyEx(hKeySoftware, CTSTR(IDS_COMPANY), 0, NULL,
00049          REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKeyCompany, &dwDisp);
00050       if(lResult == NOERROR)
00051       {
00052          lResult = RegCreateKeyEx(hKeyCompany, CTSTR(IDS_APP_TITLE), 0, NULL,
00053             REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
00054          if(lResult == NOERROR)
00055             return S_OK;
00056       }
00057    }
00058    return E_FAIL;
00059 }

HRESULT GetRegDWORDValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | DWORD * | pdwResult
 | ) |

Definition at line 76 of file bmws_registry.cpp.

References _ASSERT, and CTSTR::Assign().

Referenced by CUserPrefs::ReadRegistry(), and CUpdateInfo::XMLDone().

00077 {
00078    _ASSERT(pdwResult);
00079
00080    *pdwResult = 0;
00081    DWORD dwValue;
00082    DWORD dwSize = sizeof(dwValue);
00083    DWORD dwTemp;
00084
00085    CTSTR lpszValue;
00086    if(uidValue != -1)
00087       lpszValue.Assign(uidValue);
00088
00089    long lResult = RegQueryValueEx(hKey, lpszValue, NULL, &dwTemp, (LPBYTE)&dwValue, &dwSize);
00090    if(lResult == NOERROR)
00091    {
00092       *pdwResult = dwValue;
00093       return S_OK;
00094    }
00095    return E_FAIL;
00096 }

CTSTR GetRegStringValue | ( | CKey & | hKey,
 |  | UINT | uidValue
 | ) |

Definition at line 112 of file bmws_registry.cpp.

References CTSTR::Alloc(), and CTSTR::Assign().

Referenced by CCPSounds::CCPSounds(), GetHlinkColor(), and CUserPrefs::ReadRegistry().

00113 {
00114    CTSTR lpszValue;
00115    if(uidValue != -1)
00116       lpszValue.Assign(uidValue);
00117
00118    LONG lResult;
00119    DWORD dwTemp;
00120    DWORD dwSize = 80;
00121    CTSTR lpszTemp(TRUE, dwSize);
00122    lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp, &dwSize);
00123    if(lResult == ERROR_MORE_DATA)
00124    {
00125       lpszTemp.Alloc(dwSize);
00126       lResult = RegQueryValueEx(hKey, lpszValue, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszTemp,
00127          &dwSize);
00128    }
00129
00130    if(lResult != ERROR_SUCCESS)
00131       return CTSTR();
00132
00133    return lpszTemp;
00134 }

void SetRegDWORDValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | DWORD | dwValue
 | ) |

Definition at line 151 of file bmws_registry.cpp.

References CTSTR::Assign().

Referenced by CSolpackApp::Register(), CUserPrefs::WriteRegistry(), and CUpdateInfo::XMLDone().

00152 {
00153    CTSTR lpszValue;
00154    if(uidValue != -1)
00155       lpszValue.Assign(uidValue);
00156
00157    RegSetValueEx(hKey, lpszValue, 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(dwValue));
00158 }

void SetRegStringValue | ( | CKey & | hKey,
 |  | UINT | uidValue,
 |  | CTSTR & | lpszValue
 | ) |

Definition at line 175 of file bmws_registry.cpp.

References CTSTR::Assign().

Referenced by CCPSounds::CCPSounds(), CCPSounds::Save(), and CUserPrefs::WriteRegistry().

00176 {
00177    CTSTR lpszValue;
00178    if(uidValue != -1)
00179       lpszValue.Assign(uidValue);
00180
00181    if(lpszNewValue)
00182       RegSetValueEx(hKey, lpszValue, 0, REG_SZ, (LPBYTE)(LPTSTR)lpszNewValue,
00183          sizeof(TCHAR) * (lstrlen(lpszNewValue)+1));
00184    else
00185       RegDeleteValue(hKey, lpszValue);
00186 }

Generated on Wed May 8 12:39:17 2002 for Solitaire Pack by doxygen 1.2.15


bmws_registry.h Source File

bmws_registry.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_registry.h
00004 //    Functions to assist in using the Registry.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_REGISTRY_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_REGISTRY_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_key.h>
00017 #include <bmws_string.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // BMWS_Registry API functions
00022 //----------------------------------------------------------------------------
00023 HRESULT GetProductKey(CKey& hKey, BOOL bUser);
00024 HRESULT GetRegDWORDValue(CKey& hKey, UINT uidValue, DWORD* pdwResult);
00025 CTSTR GetRegStringValue(CKey& hKey, UINT uidValue);
00026 void SetRegDWORDValue(CKey& hKey, UINT uidValue, DWORD dwValue);
00027 void SetRegStringValue(CKey& hKey, UINT uidValue, CTSTR& lpszValue);
00028 #ifdef BMWS_REGISTRY_SETKEYANDVALUE
00029 HRESULT SetRegKeyAndValue(CKey& hKey, CTSTR& lpszKey, CTSTR& lpszSubkey, CTSTR& lpszValue);
00030 #endif
00031
00032
00033 #endif // !defined(AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:56 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices.cpp File Reference

#include <bmws_common.h>
#include <bmws_regservices.h>
#include <bmws_hlink.h>
#include <bmws_regservices_res.h>
#include <bmws_regservices_res_lc.h>

Go to the source code of this file.

Compounds

class | CRegDlgInfo

Functions

unsigned int | GenerateHashID (LPTSTR lpszStr, long lHash)
BOOL | IsValidRegistration (LPTSTR lpszProduct, int iHash, LPTSTR lpszUserName, LPTSTR lpszAccessID)
LRESULT CALLBACK | RegistrationProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
BOOL | ShowRegistrationDialog (HWND hwndParent, HKEY hKeyProduct, CTSTR &lpszProduct, CTSTR &lpszURL, COLORREF color, int iHash)
CTSTR | GetRegisteredName (HKEY hKeyProduct, CTSTR &lpszProduct, int iHash)

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Function Documentation

unsigned int GenerateHashID | ( | LPTSTR | lpszStr,
 |  | long | lHash
 | ) |

Definition at line 105 of file bmws_regservices.cpp.

Referenced by IsValidRegistration().

00106 {
00107    unsigned int iTotal = 0;
00108    int iLength = lstrlen(lpszStr);
00109    for(int i = 0; i < iLength; i++)
00110    {
00111       int iMultiplier = lHash;
00112       for(int j = 0; j < iLength-(i+1); j++)
00113       {
00114          iMultiplier *= iMultiplier;
00115       }
00116       iTotal += (lpszStr[i]*iMultiplier);
00117    }
00118    return iTotal;
00119 }

CTSTR GetRegisteredName | ( | HKEY | hKeyProduct,
 |  | CTSTR & | lpszProduct,
 |  | int | iHash
 | ) |

Definition at line 297 of file bmws_regservices.cpp.

References CTSTR::Alloc(), g_hInst, IDS_BMWS_REGSVC_ACCESSID, IDS_BMWS_REGSVC_USERNAME, and IsValidRegistration().

Referenced by CMainWindow::OnCommand(), and CSolpackApp::Run().

00298 {
00299    CTSTR lpszUserName;
00300    CTSTR lpszAccessID;
00301    TCHAR szValueName[32];
00302    LoadString(g_hInst, IDS_BMWS_REGSVC_USERNAME, szValueName, sizeof(szValueName));
00303
00304    BOOL bValid = FALSE;
00305    DWORD dwTemp;
00306    DWORD dwSize = 80;
00307    lpszUserName.Alloc(dwSize);
00308
00309    LONG lResult;
00310    lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszUserName,
00311       &dwSize);
00312    if(lResult == ERROR_MORE_DATA)
00313    {
00314       lpszUserName.Alloc(dwSize);
00315       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00316          (LPBYTE)(LPTSTR)lpszUserName, &dwSize);
00317    }
00318    if(lResult == NOERROR)
00319    {
00320       dwSize = 80;
00321       LoadString(g_hInst, IDS_BMWS_REGSVC_ACCESSID, szValueName, sizeof(szValueName));
00322       lpszAccessID.Alloc(dwSize);
00323       LONG lResult;
00324       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00325          (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00326       if(lResult == ERROR_MORE_DATA)
00327       {
00328          lpszAccessID.Alloc(dwSize);
00329          lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00330             (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00331       }
00332       if(lResult == NOERROR)
00333          bValid = IsValidRegistration(lpszProduct, iHash, lpszUserName, lpszAccessID);
00334    }
00335
00336    if(!bValid)
00337       lpszUserName = NULL;
00338    return lpszUserName;
00339 }

BOOL IsValidRegistration | ( | LPTSTR | lpszProduct,
 |  | int | iHash,
 |  | LPTSTR | lpszUserName,
 |  | LPTSTR | lpszAccessID
 | ) |

Definition at line 137 of file bmws_regservices.cpp.

References GenerateHashID().

Referenced by GetRegisteredName(), and RegistrationProc().

00138 {
00139    if(!lpszProduct || !lpszUserName || !lpszAccessID)
00140       return FALSE;
00141
00142    unsigned int iTotal = GenerateHashID(lpszUserName, iHash);
00143    TCHAR szFinal[24];
00144    wsprintf(szFinal, TEXT("%05u-%010u-%05u"), LOWORD(iTotal), GenerateHashID(lpszProduct, iHash),
00145       HIWORD(iTotal));
00146    return (lstrcmp(szFinal, lpszAccessID) == 0);
00147 }

LRESULT CALLBACK RegistrationProc | ( | HWND | hDlg,
 |  | UINT | message,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 164 of file bmws_regservices.cpp.

References CHlinkWindowMgr::AddWnd(), CHWND::CenterWindow(), CRegDlgInfo::color, ENSUREALLOC, g_hInst, CRegDlgInfo::hDlg, HLINK_PPM_RETURNDIRECT, HLINK_PPM_RETURNNORMAL, IDC_BMWS_REGSVC_ACCESSIDEDIT, IDC_BMWS_REGSVC_PRODUCTEDIT, IDC_BMWS_REGSVC_STATUS, IDC_BMWS_REGSVC_URL, IDC_BMWS_REGSVC_USERNAMEEDIT, IDS_BMWS_REGSVC_ACCESSID, IDS_BMWS_REGSVC_INCORRECT, IDS_BMWS_REGSVC_USERNAME, IsValidRegistration(), CRegDlgInfo::pHlinkMgr, CRegDlgInfo::plpszProduct, CRegDlgInfo::plpszURL, and CHlinkWindowMgr::PreprocessMsg().

Referenced by ShowRegistrationDialog().

00165 {
00166    CRegDlgInfo *lprdi = (CRegDlgInfo*)GetWindowLong(hDlg, GWL_USERDATA);
00167
00168    try
00169    {
00170       LRESULT lResult;
00171       if(lprdi && (BOOL)lprdi->pHlinkMgr)
00172       {
00173          DWORD dwReturn = lprdi->pHlinkMgr->PreprocessMsg(hDlg, message, wParam, lParam,
00174             &lResult);
00175          if(dwReturn == HLINK_PPM_RETURNDIRECT)
00176             return lResult;
00177          if(dwReturn == HLINK_PPM_RETURNNORMAL)
00178          {
00179             SetWindowLong(hDlg, DWL_MSGRESULT, lResult);
00180             return TRUE;
00181          }
00182       }
00183
00184       switch(message)
00185       {
00186          case WM_INITDIALOG:
00187             lprdi = (CRegDlgInfo*)lParam;
00188             SetWindowLong(hDlg, GWL_USERDATA, (LONG)lprdi);
00189             SetDlgItemText(hDlg, IDC_BMWS_REGSVC_PRODUCTEDIT, *lprdi->plpszProduct);
00190             SetDlgItemText(hDlg, IDC_BMWS_REGSVC_URL, *lprdi->plpszURL);
00191
00192             lprdi->hDlg = hDlg;
00193             lprdi->pHlinkMgr = new CHlinkWindowMgr(1, lprdi->color);
00194             ENSUREALLOC(lprdi->pHlinkMgr);
00195             lprdi->pHlinkMgr->AddWnd(GetDlgItem(hDlg, IDC_BMWS_REGSVC_URL),
00196                (IHlinkWindowSite*)lprdi, 0);
00197
00198 #ifdef AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00199             CHWND::CenterWindow(hDlg);
00200 #endif
00201             return TRUE;
00202
00203          case WM_COMMAND:
00204             if(LOWORD(wParam) == IDOK)
00205             {
00206                CTSTR lpszUserName(hDlg, IDC_BMWS_REGSVC_USERNAMEEDIT);
00207                CTSTR lpszAccessID(hDlg, IDC_BMWS_REGSVC_ACCESSIDEDIT);
00208                if(lpszUserName != NULL && lpszAccessID != NULL)
00209                   lprdi->bValid = IsValidRegistration(*lprdi->plpszProduct, lprdi->iHash,
00210                      lpszUserName, lpszAccessID);
00211                if(!lprdi->bValid)
00212                {
00213                   SetDlgItemText(hDlg, IDC_BMWS_REGSVC_STATUS, CTSTR(IDS_BMWS_REGSVC_INCORRECT));
00214                } else
00215                {
00216                   TCHAR szValue[80];
00217
00218                   LoadString(g_hInst, IDS_BMWS_REGSVC_USERNAME, szValue, sizeof(szValue));
00219                   RegSetValueEx(lprdi->hKeyProduct, szValue, 0, REG_SZ,
00220                      (LPBYTE)(LPTSTR)lpszUserName, lstrlen(lpszUserName)+1);
00221
00222                   LoadString(g_hInst, IDS_BMWS_REGSVC_ACCESSID, szValue, sizeof(szValue));
00223                   RegSetValueEx(lprdi->hKeyProduct, szValue, 0, REG_SZ,
00224                      (LPBYTE)(LPTSTR)lpszAccessID, lstrlen(lpszAccessID)+1);
00225
00226                   EndDialog(hDlg, IDOK);
00227                }
00228             } else if (LOWORD(wParam) == IDCANCEL)
00229             {
00230                EndDialog(hDlg, IDCANCEL);
00231                return TRUE;
00232             }
00233             break;
00234       }
00235    }
00236    catch(CExcep *pE)
00237    {
00238       pE->Report();
00239       pE->Delete();
00240    }
00241    return FALSE;
00242 }

BOOL ShowRegistrationDialog | ( | HWND | hwndParent,
 |  | HKEY | hKeyProduct,
 |  | CTSTR & | lpszProduct,
 |  | CTSTR & | lpszURL,
 |  | COLORREF | color,
 |  | int | iHash
 | ) |

Definition at line 262 of file bmws_regservices.cpp.

References CRegDlgInfo::bValid, CRegDlgInfo::color, g_hInstLC, CRegDlgInfo::hDlg, CRegDlgInfo::hKeyProduct, IDD_BMWS_REGDIALOG, CRegDlgInfo::iHash, CRegDlgInfo::pHlinkMgr, CRegDlgInfo::plpszProduct, CRegDlgInfo::plpszURL, and RegistrationProc().

Referenced by CMainWindow::OnCommand().

00264 {
00265    CRegDlgInfo rdi;
00266    rdi.hKeyProduct = hKeyProduct;
00267    rdi.plpszProduct = &lpszProduct;
00268    rdi.plpszURL = &lpszURL;
00269    rdi.color = color;
00270    rdi.iHash = iHash;
00271    rdi.bValid = FALSE;
00272    rdi.pHlinkMgr = NULL;
00273    rdi.hDlg = NULL;
00274
00275    DialogBoxParam(g_hInstLC, MAKEINTRESOURCE(IDD_BMWS_REGDIALOG), hwndParent,
00276       (DLGPROC)RegistrationProc, (LPARAM)&rdi);
00277
00278    return rdi.bValid;
00279 }

Variable Documentation

HINSTANCE g_hInst

Definition at line 22 of file bmws_regservices.cpp.

Referenced by GetRegisteredName(), and RegistrationProc().

HINSTANCE g_hInstLC

Definition at line 23 of file bmws_regservices.cpp.

Referenced by ShowRegistrationDialog().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices.cpp Source File

bmws_regservices.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_regservices.cpp
00004 //    Functions to implement shareware product registration.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_regservices.h>
00014 #include <bmws_hlink.h>
00015 #include <bmws_regservices_res.h>
00016 #include <bmws_regservices_res_lc.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // External variables
00021 //----------------------------------------------------------------------------
00022 extern HINSTANCE g_hInst;     // Application instance handle
00023 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CRegDlgInfo class
00029 //    Holds information used by the Registration dialog box.
00030 //
00031 //----------------------------------------------------------------------------
00032 class CRegDlgInfo : public IHlinkWindowSite
00033 {
00034 public:
00035    CRegDlgInfo();
00036    virtual ~CRegDlgInfo();
00037
00038    // IHlinkWindowSite method
00039    virtual void HlinkClicked(DWORD dwID);
00040
00041    HKEY hKeyProduct;             // Registry key for the product
00042    CTSTR *plpszProduct;          // Product name
00043    CTSTR *plpszURL;              // Registration URL
00044    int iHash;                    // Corresponding hash value
00045    int bValid;                   // Is the registration valid
00046    CHlinkWindowMgr *pHlinkMgr;   // Hyperlink window manager
00047    COLORREF color;               // Hyperlink color
00048    HWND hDlg;                    // Dialog window handle
00049 };
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CRegDlgInfo Constructor
00055 //
00056 //----------------------------------------------------------------------------
00057 CRegDlgInfo::CRegDlgInfo()
00058 {
00059    hDlg = NULL;
00060    pHlinkMgr = NULL;
00061 }
00062
00063
00064 //----------------------------------------------------------------------------
00065 //
00066 // CRegDlgInfo destructor
00067 //
00068 //----------------------------------------------------------------------------
00069 CRegDlgInfo::~CRegDlgInfo()
00070 {
00071    SAFEDELETE(pHlinkMgr);
00072 }
00073
00074
00075 //----------------------------------------------------------------------------
00076 //
00077 // IHlinkWindowSite::HlinkClicked method
00078 //    Called when the link was clicked.
00079 //
00080 // Parameters:
00081 //    dwID:          The ID of the link that was clicked. Unused.
00082 //
00083 // Returns:          None.
00084 //
00085 //----------------------------------------------------------------------------
00086 void CRegDlgInfo::HlinkClicked(DWORD dwID)
00087 {
00088    EndDialog(hDlg, IDCANCEL);
00089    ExecURL(*plpszURL);
00090 }
00091
00092
00093 //----------------------------------------------------------------------------
00094 //
00095 // GenerateHashID function
00096 //    Given a string and hash key, computes the hash value for the string.
00097 //
00098 // Parameters:
00099 //    lpszStr:       String to use.
00100 //    lHash:         Hash key to use.
00101 //
00102 // Returns:          The computed hash value.
00103 //
00104 //----------------------------------------------------------------------------
00105 unsigned int GenerateHashID(LPTSTR lpszStr, long lHash)
00106 {
00107    unsigned int iTotal = 0;
00108    int iLength = lstrlen(lpszStr);
00109    for(int i = 0; i < iLength; i++)
00110    {
00111       int iMultiplier = lHash;
00112       for(int j = 0; j < iLength-(i+1); j++)
00113       {
00114          iMultiplier *= iMultiplier;
00115       }
00116       iTotal += (lpszStr[i]*iMultiplier);
00117    }
00118    return iTotal;
00119 }
00120
00121
00122 //----------------------------------------------------------------------------
00123 //
00124 // IsValidRegistration function
00125 //    Determines if the product registration is valid, based on the use name,
00126 //    hash key, and access ID.
00127 //
00128 // Parameters:
00129 //    lpszProduct:   Name of the product.
00130 //    iHash:         Hash key to use.
00131 //    lpszUserName:  The name of the user.
00132 //    lpszAccessID:  The access ID the user wants to use.
00133 //
00134 // Returns:          Whether the registration is valid.
00135 //
00136 //----------------------------------------------------------------------------
00137 BOOL IsValidRegistration(LPTSTR lpszProduct, int iHash, LPTSTR lpszUserName, LPTSTR lpszAccessID)
00138 {
00139    if(!lpszProduct || !lpszUserName || !lpszAccessID)
00140       return FALSE;
00141
00142    unsigned int iTotal = GenerateHashID(lpszUserName, iHash);
00143    TCHAR szFinal[24];
00144    wsprintf(szFinal, TEXT("%05u-%010u-%05u"), LOWORD(iTotal), GenerateHashID(lpszProduct, iHash),
00145       HIWORD(iTotal));
00146    return (lstrcmp(szFinal, lpszAccessID) == 0);
00147 }
00148
00149
00150 //----------------------------------------------------------------------------
00151 //
00152 // RegistrationProc function
00153 //    Callback function that handles messages to the Registration dialog box.
00154 //
00155 // Parameters:
00156 //    hDlg:          The dialog box handle.
00157 //    message:       Message identifier.
00158 //    wParam:        Message-dependent value.
00159 //    lParam:        Message-dependent value.
00160 //
00161 // Returns:          TRUE if the message is handled, FALSE if not.
00162 //
00163 //----------------------------------------------------------------------------
00164 LRESULT CALLBACK RegistrationProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
00165 {
00166    CRegDlgInfo *lprdi = (CRegDlgInfo*)GetWindowLong(hDlg, GWL_USERDATA);
00167
00168    try
00169    {
00170       LRESULT lResult;
00171       if(lprdi && (BOOL)lprdi->pHlinkMgr)
00172       {
00173          DWORD dwReturn = lprdi->pHlinkMgr->PreprocessMsg(hDlg, message, wParam, lParam,
00174             &lResult);
00175          if(dwReturn == HLINK_PPM_RETURNDIRECT)
00176             return lResult;
00177          if(dwReturn == HLINK_PPM_RETURNNORMAL)
00178          {
00179             SetWindowLong(hDlg, DWL_MSGRESULT, lResult);
00180             return TRUE;
00181          }
00182       }
00183
00184       switch(message)
00185       {
00186          case WM_INITDIALOG:
00187             lprdi = (CRegDlgInfo*)lParam;
00188             SetWindowLong(hDlg, GWL_USERDATA, (LONG)lprdi);
00189             SetDlgItemText(hDlg, IDC_BMWS_REGSVC_PRODUCTEDIT, *lprdi->plpszProduct);
00190             SetDlgItemText(hDlg, IDC_BMWS_REGSVC_URL, *lprdi->plpszURL);
00191
00192             lprdi->hDlg = hDlg;
00193             lprdi->pHlinkMgr = new CHlinkWindowMgr(1, lprdi->color);
00194             ENSUREALLOC(lprdi->pHlinkMgr);
00195             lprdi->pHlinkMgr->AddWnd(GetDlgItem(hDlg, IDC_BMWS_REGSVC_URL),
00196                (IHlinkWindowSite*)lprdi, 0);
00197
00198 #ifdef AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00199             CHWND::CenterWindow(hDlg);
00200 #endif
00201             return TRUE;
00202
00203          case WM_COMMAND:
00204             if(LOWORD(wParam) == IDOK)
00205             {
00206                CTSTR lpszUserName(hDlg, IDC_BMWS_REGSVC_USERNAMEEDIT);
00207                CTSTR lpszAccessID(hDlg, IDC_BMWS_REGSVC_ACCESSIDEDIT);
00208                if(lpszUserName != NULL && lpszAccessID != NULL)
00209                   lprdi->bValid = IsValidRegistration(*lprdi->plpszProduct, lprdi->iHash,
00210                      lpszUserName, lpszAccessID);
00211                if(!lprdi->bValid)
00212                {
00213                   SetDlgItemText(hDlg, IDC_BMWS_REGSVC_STATUS, CTSTR(IDS_BMWS_REGSVC_INCORRECT));
00214                } else
00215                {
00216                   TCHAR szValue[80];
00217
00218                   LoadString(g_hInst, IDS_BMWS_REGSVC_USERNAME, szValue, sizeof(szValue));
00219                   RegSetValueEx(lprdi->hKeyProduct, szValue, 0, REG_SZ,
00220                      (LPBYTE)(LPTSTR)lpszUserName, lstrlen(lpszUserName)+1);
00221
00222                   LoadString(g_hInst, IDS_BMWS_REGSVC_ACCESSID, szValue, sizeof(szValue));
00223                   RegSetValueEx(lprdi->hKeyProduct, szValue, 0, REG_SZ,
00224                      (LPBYTE)(LPTSTR)lpszAccessID, lstrlen(lpszAccessID)+1);
00225
00226                   EndDialog(hDlg, IDOK);
00227                }
00228             } else if (LOWORD(wParam) == IDCANCEL)
00229             {
00230                EndDialog(hDlg, IDCANCEL);
00231                return TRUE;
00232             }
00233             break;
00234       }
00235    }
00236    catch(CExcep *pE)
00237    {
00238       pE->Report();
00239       pE->Delete();
00240    }
00241    return FALSE;
00242 }
00243
00244
00245 //----------------------------------------------------------------------------
00246 //
00247 // ShowRegistrationDialog function
00248 //    Prompt the user for a user name and access code, and determine whether
00249 //    the code is valid.
00250 //
00251 // Parameters:
00252 //    hwndParent:    Parent window for the dialog box.
00253 //    hKeyProduct:   Handle to the registry key to put the final values in.
00254 //    lpszProduct:   The name of the product.
00255 //    lpszURL:       The address of the registration web page.
00256 //    color:         The color to display hyperlinks in.
00257 //    iHash:         The hash value corresponding to the product.
00258 //
00259 // Returns:          Whether or not the user name and access code are valid.
00260 //
00261 //----------------------------------------------------------------------------
00262 BOOL ShowRegistrationDialog(HWND hwndParent, HKEY hKeyProduct, CTSTR& lpszProduct,
00263                             CTSTR& lpszURL, COLORREF color, int iHash)
00264 {
00265    CRegDlgInfo rdi;
00266    rdi.hKeyProduct = hKeyProduct;
00267    rdi.plpszProduct = &lpszProduct;
00268    rdi.plpszURL = &lpszURL;
00269    rdi.color = color;
00270    rdi.iHash = iHash;
00271    rdi.bValid = FALSE;
00272    rdi.pHlinkMgr = NULL;
00273    rdi.hDlg = NULL;
00274
00275    DialogBoxParam(g_hInstLC, MAKEINTRESOURCE(IDD_BMWS_REGDIALOG), hwndParent,
00276       (DLGPROC)RegistrationProc, (LPARAM)&rdi);
00277
00278    return rdi.bValid;
00279 }
00280
00281
00282 //----------------------------------------------------------------------------
00283 //
00284 // GetRegisteredName function
00285 //    Retrieves the name of the registered user, according to the registry,
00286 //    then detmines whether the registration is valid.
00287 //
00288 // Parameters:
00289 //    hKeyProduct:   Handle to the registry key to retrieve the values from.
00290 //    lpszProduct:   The name of the product.
00291 //    iHash:         Hash value to use.
00292 //
00293 // Returns:
00294 //    The registered user's name, or an empty string if not registered.
00295 //
00296 //----------------------------------------------------------------------------
00297 CTSTR GetRegisteredName(HKEY hKeyProduct, CTSTR& lpszProduct, int iHash)
00298 {
00299    CTSTR lpszUserName;
00300    CTSTR lpszAccessID;
00301    TCHAR szValueName[32];
00302    LoadString(g_hInst, IDS_BMWS_REGSVC_USERNAME, szValueName, sizeof(szValueName));
00303
00304    BOOL bValid = FALSE;
00305    DWORD dwTemp;
00306    DWORD dwSize = 80;
00307    lpszUserName.Alloc(dwSize);
00308
00309    LONG lResult;
00310    lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszUserName,
00311       &dwSize);
00312    if(lResult == ERROR_MORE_DATA)
00313    {
00314       lpszUserName.Alloc(dwSize);
00315       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00316          (LPBYTE)(LPTSTR)lpszUserName, &dwSize);
00317    }
00318    if(lResult == NOERROR)
00319    {
00320       dwSize = 80;
00321       LoadString(g_hInst, IDS_BMWS_REGSVC_ACCESSID, szValueName, sizeof(szValueName));
00322       lpszAccessID.Alloc(dwSize);
00323       LONG lResult;
00324       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00325          (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00326       if(lResult == ERROR_MORE_DATA)
00327       {
00328          lpszAccessID.Alloc(dwSize);
00329          lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00330             (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00331       }
00332       if(lResult == NOERROR)
00333          bValid = IsValidRegistration(lpszProduct, iHash, lpszUserName, lpszAccessID);
00334    }
00335
00336    if(!bValid)
00337       lpszUserName = NULL;
00338    return lpszUserName;
00339 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Functions

BOOL | ShowRegistrationDialog (HWND hwndParent, HKEY hKeyProduct, CTSTR &lpszProduct, CTSTR &lpszURL, COLORREF color, int iHash)
CTSTR | GetRegisteredName (HKEY hKeyProduct, CTSTR &lpszProduct, int iHash)

Define Documentation

#define AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 10 of file bmws_regservices.h.

Function Documentation

CTSTR GetRegisteredName | ( | HKEY | hKeyProduct,
 |  | CTSTR & | lpszProduct,
 |  | int | iHash
 | ) |

Definition at line 297 of file bmws_regservices.cpp.

References CTSTR::Alloc(), g_hInst, IDS_BMWS_REGSVC_ACCESSID, IDS_BMWS_REGSVC_USERNAME, and IsValidRegistration().

Referenced by CMainWindow::OnCommand(), and CSolpackApp::Run().

00298 {
00299    CTSTR lpszUserName;
00300    CTSTR lpszAccessID;
00301    TCHAR szValueName[32];
00302    LoadString(g_hInst, IDS_BMWS_REGSVC_USERNAME, szValueName, sizeof(szValueName));
00303
00304    BOOL bValid = FALSE;
00305    DWORD dwTemp;
00306    DWORD dwSize = 80;
00307    lpszUserName.Alloc(dwSize);
00308
00309    LONG lResult;
00310    lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp, (LPBYTE)(LPTSTR)lpszUserName,
00311       &dwSize);
00312    if(lResult == ERROR_MORE_DATA)
00313    {
00314       lpszUserName.Alloc(dwSize);
00315       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00316          (LPBYTE)(LPTSTR)lpszUserName, &dwSize);
00317    }
00318    if(lResult == NOERROR)
00319    {
00320       dwSize = 80;
00321       LoadString(g_hInst, IDS_BMWS_REGSVC_ACCESSID, szValueName, sizeof(szValueName));
00322       lpszAccessID.Alloc(dwSize);
00323       LONG lResult;
00324       lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00325          (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00326       if(lResult == ERROR_MORE_DATA)
00327       {
00328          lpszAccessID.Alloc(dwSize);
00329          lResult = RegQueryValueEx(hKeyProduct, szValueName, 0, &dwTemp,
00330             (LPBYTE)(LPTSTR)lpszAccessID, &dwSize);
00331       }
00332       if(lResult == NOERROR)
00333          bValid = IsValidRegistration(lpszProduct, iHash, lpszUserName, lpszAccessID);
00334    }
00335
00336    if(!bValid)
00337       lpszUserName = NULL;
00338    return lpszUserName;
00339 }

BOOL ShowRegistrationDialog | ( | HWND | hwndParent,
 |  | HKEY | hKeyProduct,
 |  | CTSTR & | lpszProduct,
 |  | CTSTR & | lpszURL,
 |  | COLORREF | color,
 |  | int | iHash
 | ) |

Definition at line 262 of file bmws_regservices.cpp.

References CRegDlgInfo::bValid, CRegDlgInfo::color, g_hInstLC, CRegDlgInfo::hDlg, CRegDlgInfo::hKeyProduct, IDD_BMWS_REGDIALOG, CRegDlgInfo::iHash, CRegDlgInfo::pHlinkMgr, CRegDlgInfo::plpszProduct, CRegDlgInfo::plpszURL, and RegistrationProc().

Referenced by CMainWindow::OnCommand().

00264 {
00265    CRegDlgInfo rdi;
00266    rdi.hKeyProduct = hKeyProduct;
00267    rdi.plpszProduct = &lpszProduct;
00268    rdi.plpszURL = &lpszURL;
00269    rdi.color = color;
00270    rdi.iHash = iHash;
00271    rdi.bValid = FALSE;
00272    rdi.pHlinkMgr = NULL;
00273    rdi.hDlg = NULL;
00274
00275    DialogBoxParam(g_hInstLC, MAKEINTRESOURCE(IDD_BMWS_REGDIALOG), hwndParent,
00276       (DLGPROC)RegistrationProc, (LPARAM)&rdi);
00277
00278    return rdi.bValid;
00279 }

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices.h Source File

bmws_regservices.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_regservices.h
00004 //    Functions to implement shareware product registration.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00010 #define AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_string.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // BMWS_RegServices API functions
00021 //----------------------------------------------------------------------------
00022 BOOL ShowRegistrationDialog(HWND hwndParent, HKEY hKeyProduct, CTSTR& lpszProduct,
00023    CTSTR& lpszURL, COLORREF color, int iHash);
00024 CTSTR GetRegisteredName(HKEY hKeyProduct, CTSTR& lpszProduct, int iHash);
00025
00026
00027 #endif // !defined(AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_REGSVC_USERNAME 8101
#define | IDS_BMWS_REGSVC_ACCESSID 8102

Define Documentation

#define IDS_BMWS_REGSVC_ACCESSID 8102

Definition at line 6 of file bmws_regservices_res.h.

Referenced by GetRegisteredName(), and RegistrationProc().

#define IDS_BMWS_REGSVC_USERNAME 8101

Definition at line 5 of file bmws_regservices_res.h.

Referenced by GetRegisteredName(), and RegistrationProc().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices_res.h Source File

bmws_regservices_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_regservices.rc
00004 //
00005 #define IDS_BMWS_REGSVC_USERNAME        8101
00006 #define IDS_BMWS_REGSVC_ACCESSID        8102
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           102
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDC_BMWS_REGSVC_PRODUCTEDIT 8101
#define | IDC_BMWS_REGSVC_USERNAMEEDIT 8102
#define | IDC_BMWS_REGSVC_ACCESSIDEDIT 8103
#define | IDC_BMWS_REGSVC_STATUS 8104
#define | IDC_BMWS_REGSVC_URL 8105
#define | IDD_BMWS_REGDIALOG 18101
#define | IDS_BMWS_REGSVC_INCORRECT 18103
#define | IDC_STATIC -1

Define Documentation

#define IDC_BMWS_REGSVC_ACCESSIDEDIT 8103

Definition at line 7 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

#define IDC_BMWS_REGSVC_PRODUCTEDIT 8101

Definition at line 5 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

#define IDC_BMWS_REGSVC_STATUS 8104

Definition at line 8 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

#define IDC_BMWS_REGSVC_URL 8105

Definition at line 9 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

#define IDC_BMWS_REGSVC_USERNAMEEDIT 8102

Definition at line 6 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

#define IDC_STATIC -1

Definition at line 12 of file bmws_regservices_res_lc.h.

#define IDD_BMWS_REGDIALOG 18101

Definition at line 10 of file bmws_regservices_res_lc.h.

Referenced by ShowRegistrationDialog().

#define IDS_BMWS_REGSVC_INCORRECT 18103

Definition at line 11 of file bmws_regservices_res_lc.h.

Referenced by RegistrationProc().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_regservices_res_lc.h Source File

bmws_regservices_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_regservices_lc.rc
00004 //
00005 #define IDC_BMWS_REGSVC_PRODUCTEDIT     8101
00006 #define IDC_BMWS_REGSVC_USERNAMEEDIT    8102
00007 #define IDC_BMWS_REGSVC_ACCESSIDEDIT    8103
00008 #define IDC_BMWS_REGSVC_STATUS          8104
00009 #define IDC_BMWS_REGSVC_URL             8105
00010 #define IDD_BMWS_REGDIALOG              18101
00011 #define IDS_BMWS_REGSVC_INCORRECT       18103
00012 #define IDC_STATIC                      -1
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        101
00019 #define _APS_NEXT_COMMAND_VALUE         40001
00020 #define _APS_NEXT_CONTROL_VALUE         1000
00021 #define _APS_NEXT_SYMED_VALUE           102
00022 #endif
00023 #endif
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl.cpp File Reference

#include <bmws_resurl.h>
#include <bmws_resurl_res.h>

Go to the source code of this file.

Functions

CTSTR CreateResURL (HINSTANCE hInst, CTSTR &lpszFilename)

Function Documentation

CTSTR CreateResURL | ( | HINSTANCE | hInst,
 |  | CTSTR & | lpszFilename
 | ) |

Definition at line 28 of file bmws_resurl.cpp.

References ARRAYSIZE, IDS_BMWS_RESURL_RESPROTOCOL, and CTSTR::Len().

Referenced by CMainWindow::Create(), and CHelpPane::OnCreatePane().

00029 {
00030    TCHAR szModule[MAX_PATH];
00031    GetModuleFileName(hInst, szModule, ARRAYSIZE(szModule));
00032    CTSTR lpszProtocol(IDS_BMWS_RESURL_RESPROTOCOL);
00033
00034    CTSTR lpszTotal(TRUE, lstrlen(szModule) + lpszProtocol.Len() + lpszFilename.Len() + 2);
00035    lstrcpy(lpszTotal, lpszProtocol);
00036    lstrcat(lpszTotal, szModule);
00037    lstrcat(lpszTotal, TEXT("/"));
00038    lstrcat(lpszTotal, lpszFilename);
00039
00040    return lpszTotal;
00041 }

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl.cpp Source File

bmws_resurl.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_resurl.cpp
00004 //    Function to create a res:// URL.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_resurl.h>
00013 #include <bmws_resurl_res.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CreateResURL function
00019 //    Creates a res:// URL for a file within a module.
00020 //
00021 // Parameters:
00022 //    hInst:               Instance handle of the module containing the file.
00023 //    lpszFilename:        The file name.
00024 //
00025 // Returns:                A string containing the URL to the embedded file.
00026 //
00027 //----------------------------------------------------------------------------
00028 CTSTR CreateResURL(HINSTANCE hInst, CTSTR& lpszFilename)
00029 {
00030    TCHAR szModule[MAX_PATH];
00031    GetModuleFileName(hInst, szModule, ARRAYSIZE(szModule));
00032    CTSTR lpszProtocol(IDS_BMWS_RESURL_RESPROTOCOL);
00033
00034    CTSTR lpszTotal(TRUE, lstrlen(szModule) + lpszProtocol.Len() + lpszFilename.Len() + 2);
00035    lstrcpy(lpszTotal, lpszProtocol);
00036    lstrcat(lpszTotal, szModule);
00037    lstrcat(lpszTotal, TEXT("/"));
00038    lstrcat(lpszTotal, lpszFilename);
00039
00040    return lpszTotal;
00041 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Functions

CTSTR | CreateResURL (HINSTANCE hInst, CTSTR &lpszFilename)

Define Documentation

#define AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_resurl.h.

Function Documentation

CTSTR CreateResURL | ( | HINSTANCE | hInst,
 |  | CTSTR & | lpszFilename
 | ) |

Definition at line 28 of file bmws_resurl.cpp.

References ARRAYSIZE, IDS_BMWS_RESURL_RESPROTOCOL, and CTSTR::Len().

Referenced by CMainWindow::Create(), and CHelpPane::OnCreatePane().

00029 {
00030    TCHAR szModule[MAX_PATH];
00031    GetModuleFileName(hInst, szModule, ARRAYSIZE(szModule));
00032    CTSTR lpszProtocol(IDS_BMWS_RESURL_RESPROTOCOL);
00033
00034    CTSTR lpszTotal(TRUE, lstrlen(szModule) + lpszProtocol.Len() + lpszFilename.Len() + 2);
00035    lstrcpy(lpszTotal, lpszProtocol);
00036    lstrcat(lpszTotal, szModule);
00037    lstrcat(lpszTotal, TEXT("/"));
00038    lstrcat(lpszTotal, lpszFilename);
00039
00040    return lpszTotal;
00041 }

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl.h Source File

bmws_resurl.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_resurl.h
00004 //    Function to create a res:// URL.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_string.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // BMWS_ResURL API function
00021 //----------------------------------------------------------------------------
00022 CTSTR CreateResURL(HINSTANCE hInst, CTSTR& lpszFilename);
00023
00024
00025 #endif // !defined(AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_RESURL_RESPROTOCOL 8751

Define Documentation

#define IDS_BMWS_RESURL_RESPROTOCOL 8751

Definition at line 5 of file bmws_resurl_res.h.

Referenced by CreateResURL().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_resurl_res.h Source File

bmws_resurl_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_resurl.rc
00004 //
00005 #define IDS_BMWS_RESURL_RESPROTOCOL     8751
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_scriptfn.cpp File Reference

#include <bmws_scriptfn.h>
#include <bmws_string.h>
#include <bmws_error.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_scriptfn.cpp Source File

bmws_scriptfn.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_scriptfn.cpp
00004 //    Class to implement an object which represents a script function.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_scriptfn.h>
00013 #include <bmws_string.h>
00014 #include <bmws_error.h>
00015
00016
00017 #ifdef BMWS_TRACKMEMALLOC
00018
00019 //----------------------------------------------------------------------------
00020 // ScriptFn object tracking
00021 //----------------------------------------------------------------------------
00022 int CScriptFn::m_scTotalCreated = 0;
00023 int CScriptFn::m_scTotalDeleted = 0;
00024
00025 #endif
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // CScriptFn constructor
00031 //
00032 // Parameters:
00033 //    dispid:        Dispatch ID of the function.
00034 //    uidName:       String resource identifier of the function name.
00035 //
00036 //----------------------------------------------------------------------------
00037 CScriptFn::CScriptFn(DISPID dispid, UINT uidName)
00038 {
00039    ODS("CScriptFn constructor");
00040    m_dispid = dispid;
00041    m_uidName = uidName;
00042    m_dwRefCount = 0;
00043 #ifdef BMWS_TRACKMEMALLOC
00044    m_scTotalCreated++;
00045 #endif
00046 }
00047
00048
00049 //----------------------------------------------------------------------------
00050 // IUnknown::QueryInterface method
00051 //----------------------------------------------------------------------------
00052 STDMETHODIMP CScriptFn::QueryInterface(REFIID riid, LPVOID *ppvObject)
00053 {
00054    ODS("CScriptFn::QueryInterface");
00055    if(!ppvObject)
00056       return E_POINTER;
00057
00058    if(IsEqualIID(riid, IID_IDispatch))
00059       *ppvObject = (IDispatch*)this;
00060    else if(IsEqualIID(riid, IID_IUnknown))
00061       *ppvObject = this;
00062    else
00063    {
00064       *ppvObject = NULL;
00065       return E_NOINTERFACE;
00066    }
00067
00068    AddRef();
00069    return S_OK;
00070 }
00071
00072
00073 //----------------------------------------------------------------------------
00074 // IUnknown::AddRef method
00075 //----------------------------------------------------------------------------
00076 ULONG CScriptFn::AddRef()
00077 {
00078    return ++m_dwRefCount;
00079 }
00080
00081
00082 //----------------------------------------------------------------------------
00083 // IUnknown::Release method
00084 //----------------------------------------------------------------------------
00085 ULONG CScriptFn::Release()
00086 {
00087    if(--m_dwRefCount)
00088       return m_dwRefCount;
00089
00090    delete this;
00091    return 0;
00092 }
00093
00094
00095 //----------------------------------------------------------------------------
00096 // IDispatch::GetIDsOfNames method
00097 //----------------------------------------------------------------------------
00098 STDMETHODIMP CScriptFn::GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames,
00099                                       unsigned int cNames, LCID lcid, DISPID FAR* rgdispid)
00100 {
00101    return S_OK;
00102 }
00103
00104
00105 //----------------------------------------------------------------------------
00106 // IDispatch::GetTypeInfo method
00107 //----------------------------------------------------------------------------
00108 STDMETHODIMP CScriptFn::GetTypeInfo(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo)
00109 {
00110    return E_NOTIMPL;
00111 }
00112
00113
00114 //----------------------------------------------------------------------------
00115 // IDispatch::GetTypeInfoCount method
00116 //----------------------------------------------------------------------------
00117 STDMETHODIMP CScriptFn::GetTypeInfoCount(unsigned int FAR * pctinfo)
00118 {
00119    return E_NOTIMPL;
00120 }
00121
00122
00123 //----------------------------------------------------------------------------
00124 //
00125 // IDispatch::Invoke method
00126 //    The function is being called; call the handler function.
00127 //
00128 //----------------------------------------------------------------------------
00129 STDMETHODIMP CScriptFn::Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
00130                                DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult,
00131                                EXCEPINFO FAR * pexecinfo, unsigned int FAR *puArgErr)
00132 {
00133    ODS("CScriptFn::Invoke");
00134    if(dispid == DISPID_VALUE)
00135       return m_pImplementor->Invoke(m_dispid, riid, lcid, wFlags, pdispparams, pvarResult,
00136          pexecinfo, puArgErr);
00137
00138    return DISP_E_MEMBERNOTFOUND;
00139 }
00140
00141
00142 //----------------------------------------------------------------------------
00143 //
00144 // Create function
00145 //    Creates and initializes a script function object.
00146 //
00147 // Parameters:
00148 //    pDispEx:       Pointer to the IDispatchEx interface to which the
00149 //                   function should be added.
00150 //    pImplementor:  Pointer to the object that implements this function.
00151 //    dispid:        Dispatch ID of the function.
00152 //    uidName:       String resource identifier of the function name.
00153 //
00154 // Returns:          None.
00155 //
00156 //----------------------------------------------------------------------------
00157 void CScriptFn::Create(IDispatchEx *pDispEx, IDispatch *pImplementor, DISPID dispid,
00158                        UINT uidName)
00159 {
00160    _ASSERT(pDispEx);
00161    _ASSERT(pImplementor);
00162
00163    CScriptFn *pFn = new CScriptFn(dispid, uidName);
00164    ENSUREALLOC(pFn);
00165    pFn->AddRef();
00166
00167    pFn->m_pImplementor = pImplementor;
00168    DISPID d;
00169    CHECKHRCOM(pDispEx->GetDispID(CBSTR(pFn->m_uidName), fdexNameEnsure, &d));
00170
00171    VARIANT vHandler;
00172    vHandler.vt = VT_DISPATCH;
00173    vHandler.pdispVal = (LPDISPATCH)pFn;
00174
00175    DISPPARAMS dp;
00176    DISPID dispidParam = DISPID_PROPERTYPUT;
00177    dp.cArgs = 1;
00178    dp.cNamedArgs = 1;
00179    dp.rgdispidNamedArgs = &dispidParam;
00180    dp.rgvarg = &vHandler;
00181
00182    try
00183    {
00184       CHECKHRCOM(pDispEx->InvokeEx(d, GetUserDefaultLCID(), DISPATCH_PROPERTYPUT, &dp, NULL,
00185          NULL, NULL));
00186    }
00187    catch(CExcep *pE)
00188    {
00189       SAFERELEASE(pFn);
00190       throw pE;
00191    }
00192
00193    SAFERELEASE(pFn);
00194 }
00195
00196
00197 //----------------------------------------------------------------------------
00198 //
00199 // CreateArray function
00200 //    Creates and initializes a number of script function objects.
00201 //
00202 // Parameters:
00203 //    pDispEx:       Pointer to the IDispatchEx interface to which the
00204 //                   function should be added.
00205 //    pImplementor:  Pointer to the object that implements this function.
00206 //    uidBase:       The string resource identifier of the first in a
00207 //                   consecutive list of function names, of length cItems.
00208 //    cItems:        The number of elements to add.
00209 //
00210 // Returns:          None.
00211 //
00212 //----------------------------------------------------------------------------
00213 void CScriptFn::CreateArray(IDispatchEx *pDispEx, IDispatch *pImplementor, UINT uidBase,
00214                             UINT cItems)
00215 {
00216    for(UINT i = uidBase; i < uidBase + cItems; i++)
00217    {
00218       Create(pDispEx, pImplementor, (DISPID)i, i);
00219    }
00220 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_scriptfn.h File Reference

#include <ocidl.h>
#include <dispex.h>
#include <bmws_ptr.h>

Go to the source code of this file.

Compounds

class | CScriptFn

Defines

#define | AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 10 of file bmws_scriptfn.h.

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_scriptfn.h Source File

bmws_scriptfn.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_scriptfn.h
00004 //    Class to implement an object which represents a script function.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00010 #define AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <ocidl.h>
00021 #include <dispex.h>
00022 #include <bmws_ptr.h>
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // CScriptFn class
00028 //    Implements an object which represents a script function.
00029 //
00030 //----------------------------------------------------------------------------
00031 class CScriptFn : public IDispatch
00032 {
00033 public:
00034    CScriptFn(DISPID dispid, UINT uidName);
00035
00036 #ifdef BMWS_TRACKMEMALLOC
00037
00038    //-------------------------------------------------------------------------
00039    //
00040    // Destructor
00041    //
00042    //-------------------------------------------------------------------------
00043    virtual ~CScriptFn()
00044    {
00045       ODS("CScriptFn destructor");
00046       m_scTotalDeleted++;
00047    }
00048
00049 #endif
00050
00051    // IUnknown methods
00052    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject);
00053    STDMETHOD_(ULONG, AddRef)();
00054    STDMETHOD_(ULONG, Release)();
00055
00056    // IDispatch methods
00057    STDMETHOD (GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,  unsigned int cNames,
00058       LCID lcid, DISPID FAR* rgdispid);
00059    STDMETHOD (GetTypeInfo)(unsigned int itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
00060    STDMETHOD (GetTypeInfoCount)(unsigned int FAR * pctinfo);
00061    STDMETHOD (Invoke)(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
00062       DISPPARAMS FAR *pdispparams, VARIANT FAR *pvarResult, EXCEPINFO FAR * pexecinfo,
00063       unsigned int FAR *puArgErr);
00064
00065    static void Create(IDispatchEx *pDispEx, IDispatch *pImplementor, DISPID dispid,
00066       UINT uidName);
00067    static void CreateArray(IDispatchEx *pDispEx, IDispatch *pImplementor, UINT uidBase,
00068       UINT cItems);
00069
00070 #ifdef BMWS_TRACKMEMALLOC
00071    static int m_scTotalCreated;
00072    static int m_scTotalDeleted;
00073 #endif
00074
00075 protected:
00076    CPtr<IDispatch, &IID_IDispatch> m_pImplementor; // Object that implements the functions
00077    DWORD m_dwRefCount;     // Object reference count
00078    DISPID m_dispid;        // Dispatch ID of the function
00079    UINT m_uidName;         // String resource identifier of the function name
00080 };
00081
00082
00083 #endif // !defined(AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_shelldataobj.cpp File Reference

#include <bmws_common.h>
#include <bmws_shelldataobj.h>
#include <shlwapi.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_shelldataobj.cpp Source File

bmws_shelldataobj.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_shelldataobj.cpp
00004 //    Class to encapsulate extracting shell data from an IDataObject pointer.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_shelldataobj.h>
00014 #include <shlwapi.h>
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CShellDataObj constructor
00020 //
00021 // Parameters:
00022 //    pDataObj:      Interface pointer of the data object to use.
00023 //
00024 //----------------------------------------------------------------------------
00025 CShellDataObj::CShellDataObj(IDataObject *pDataObj)
00026 {
00027    FORMATETC fmte = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00028    pDataObj->GetData(&fmte, &m_medium);
00029 }
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // CShellDataObj destructor
00035 //
00036 //----------------------------------------------------------------------------
00037 CShellDataObj::~CShellDataObj()
00038 {
00039    ReleaseStgMedium(&m_medium);
00040 }
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // GetNumFiles function
00046 //    Retrieves the number of files in the data object.
00047 //
00048 // Parameters:       None.
00049 //
00050 // Returns:          The number of files in the data object.
00051 //
00052 //----------------------------------------------------------------------------
00053 UINT CShellDataObj::GetNumFiles()
00054 {
00055    if(m_medium.hGlobal)
00056       return DragQueryFile((HDROP)m_medium.hGlobal, (UINT)-1, NULL, 0);
00057    return 0;
00058 }
00059
00060
00061 //----------------------------------------------------------------------------
00062 //
00063 // GetFileExt function
00064 //    Retrieves the extension of a specified file.
00065 //
00066 // Parameters:
00067 //    iFile:         Zero-based index of the file.
00068 //
00069 // Returns:          The file extension string.
00070 //
00071 //----------------------------------------------------------------------------
00072 CTSTR CShellDataObj::GetFileExt(UINT iFile)
00073 {
00074    if(m_medium.hGlobal)
00075    {
00076       CTSTR lpsz(TRUE, MAX_PATH);
00077       DragQueryFile((HDROP)m_medium.hGlobal, iFile, lpsz, MAX_PATH);
00078       LPTSTR lpszExtension = PathFindExtension(lpsz);
00079       if(lpszExtension)
00080          return CTSTR(lpszExtension+1);
00081    }
00082    return CTSTR();
00083 }
00084
00085
00086 //----------------------------------------------------------------------------
00087 //
00088 // GetFileName function
00089 //    Retrieves the path of a specified file.
00090 //
00091 // Parameters:
00092 //    iFile:         Zero-based index of the file.
00093 //
00094 // Returns:          The file name string.
00095 //
00096 //----------------------------------------------------------------------------
00097 CTSTR CShellDataObj::GetFileName(UINT iFile)
00098 {
00099    if(m_medium.hGlobal)
00100    {
00101       CTSTR lpszFile(TRUE, MAX_PATH);
00102       DragQueryFile((HDROP)m_medium.hGlobal, iFile, lpszFile, MAX_PATH);
00103       return lpszFile;
00104    }
00105    return CTSTR();
00106 }
00107
00108
00109 //----------------------------------------------------------------------------
00110 //
00111 // GetFileNameArray function
00112 //    Fills an array with the file paths.
00113 //
00114 // Parameters:
00115 //    iFile:         Zero-based index of the file.
00116 //    lspzFile:      String to receive the file name.
00117 //
00118 // Returns:          None.
00119 //
00120 //----------------------------------------------------------------------------
00121 void CShellDataObj::GetFileNameArray(CTSTRArray& alpszFiles)
00122 {
00123    if(!m_medium.hGlobal)
00124       return;
00125    alpszFiles.RemoveAll();
00126    UINT cFiles = DragQueryFile((HDROP)m_medium.hGlobal, (UINT)-1, NULL, 0);
00127    alpszFiles.SetSize(cFiles);
00128    for(UINT i = 0; i < cFiles; i++)
00129    {
00130       alpszFiles[i].Alloc(MAX_PATH);
00131       DragQueryFile((HDROP)m_medium.hGlobal, i, alpszFiles[i], MAX_PATH);
00132    }
00133 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_shelldataobj.h File Reference

#include <bmws_stringarray.h>
#include <bmws_pointer.h>
#include <shellapi.h>

Go to the source code of this file.

Compounds

class | CShellDataObj

Typedefs

typedef CPointer< CShellDataObj > | CShellDataObjPtr

Typedef Documentation

typedef CPointer<CShellDataObj> CShellDataObjPtr

Definition at line 41 of file bmws_shelldataobj.h.

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_shelldataobj.h Source File

bmws_shelldataobj.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_shelldataobj.h
00004 //    Class to encapsulate extracting shell data from an IDataObject pointer.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008 #ifndef __BMWS_SHELLDATAOBJ_H_
00009 #define __BMWS_SHELLDATAOBJ_H_
00010
00011
00012 //----------------------------------------------------------------------------
00013 // Includes
00014 //----------------------------------------------------------------------------
00015 #include <bmws_stringarray.h>
00016 #include <bmws_pointer.h>
00017 #include <shellapi.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // CShellDataObj class
00023 //    Encapsulates extracting shell data from an IDataObject pointer.
00024 //
00025 //----------------------------------------------------------------------------
00026 class CShellDataObj : public CRefCount
00027 {
00028 public:
00029    CShellDataObj(IDataObject *pDataObj);
00030    virtual ~CShellDataObj();
00031
00032    UINT GetNumFiles();
00033    CTSTR GetFileExt(UINT iFile);
00034    CTSTR GetFileName(UINT iFile);
00035    void GetFileNameArray(CTSTRArray& alpszFiles);
00036
00037 protected:
00038    STGMEDIUM m_medium;     // Storage medium containing the data
00039 };
00040
00041 typedef CPointer<CShellDataObj> CShellDataObjPtr;
00042
00043
00044 #endif //__BMWS_HTMLHELPERS_H_
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_singleofn.cpp File Reference

#include <bmws_singleofn.h>
#include <bmws_ofn.h>
#include <bmws_window.h>
#include <bmws_error.h>
#include <commdlg.h>

Go to the source code of this file.

Functions

UINT_PTR CALLBACK | SingleOFNDialogHook (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
int | SingleOFN (CTSTR &lpszPath, UINT uidFilter, UINT *puidFilterIndex, HWND hwndOwner, DWORD dwFlags, CTSTR &lpszTitle, CTSTR &lpszInitialPath, UINT uidDefExt, DWORD dwFlags2)

Function Documentation

int SingleOFN | ( | CTSTR & | lpszPath,
 |  | UINT | uidFilter,
 |  | UINT * | puidFilterIndex,
 |  | HWND | hwndOwner,
 |  | DWORD | dwFlags,
 |  | CTSTR & | lpszTitle,
 |  | CTSTR & | lpszInitialPath,
 |  | UINT | uidDefExt,
 |  | DWORD | dwFlags2
 | ) |

Definition at line 65 of file bmws_singleofn.cpp.

References CTSTR::Assign(), IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, OfnGetFilter(), SINGLE_OFN_INITFILETITLE, SINGLE_OFN_SAVE, SingleOFNDialogHook(), and THROW.

Referenced by CCPSoundsDlg::CPSoundsProc(), CMainWindow::OnCommand(), and CAppearanceDlg::OptionsAppearanceProc().

00068 {
00069    CTSTR lpszFilter;
00070    OfnGetFilter(uidFilter, lpszFilter);
00071
00072    int iReturn = 0;
00073    CTSTR lpszFile(TRUE, MAX_PATH);
00074    if((dwFlags2 & SINGLE_OFN_INITFILETITLE) && lpszPath)
00075       lstrcpyn(lpszFile, lpszPath, MAX_PATH);
00076
00077    OPENFILENAME ofn;
00078    ZeroMemory(&ofn, sizeof(ofn));
00079    ofn.lStructSize = sizeof(ofn);
00080    ofn.hInstance = NULL;
00081    ofn.hwndOwner = hwndOwner;
00082    ofn.lpstrFilter = lpszFilter;
00083    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00084    ofn.lpstrFile = lpszFile;
00085    ofn.nMaxFile = MAX_PATH;
00086    ofn.lpstrInitialDir = lpszInitialPath;
00087    ofn.lpstrTitle = lpszTitle;
00088    ofn.lpfnHook = SingleOFNDialogHook;
00089    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | dwFlags;
00090
00091    CTSTR lpszDefExt;
00092    if(uidDefExt != (UINT)-1)
00093    {
00094       lpszDefExt.Assign(uidDefExt);
00095       ofn.lpstrDefExt = lpszDefExt;
00096    }
00097
00098    BOOL bOK = ((dwFlags2 & SINGLE_OFN_SAVE) ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn));
00099    if(bOK)
00100    {
00101       lpszPath.Assign(lpszFile);
00102       if(puidFilterIndex)
00103          *puidFilterIndex = ofn.nFilterIndex;
00104       iReturn = 1;
00105    } else
00106    {
00107       if(CommDlgExtendedError() != 0)
00108          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00109       iReturn = 0;
00110    }
00111
00112    return iReturn;
00113 }

UINT_PTR CALLBACK SingleOFNDialogHook | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 36 of file bmws_singleofn.cpp.

References CHWND::CenterWindow().

Referenced by SingleOFN().

00037 {
00038    if((uMsg == WM_NOTIFY) && (((LPOFNOTIFY)lParam)->hdr.code == CDN_INITDONE))
00039       CHWND::CenterWindow(GetParent(hWnd));
00040
00041    return 0;
00042 }

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_singleofn.cpp Source File

bmws_singleofn.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_singleofn.cpp
00004 //    Functions to support opening a single file from the Open common dialog
00005 //    box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_singleofn.h>
00014 #include <bmws_ofn.h>
00015 #include <bmws_window.h>
00016 #include <bmws_error.h>
00017 #include <commdlg.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // SingleOFNDialogHook function
00023 //    Callback function for the Open common dialog box hook, used to center
00024 //    the dialog box.
00025 //
00026 // Parameters:
00027 //    hWnd:          The window handle to a hooking child window of the Open
00028 //                   dialog box.
00029 //    uMsg:          Message identifer.
00030 //    wParam:        Message-specific parameter.
00031 //    lParam:        Message-specific parameter.
00032 //
00033 // Returns:          0 in all cases.
00034 //
00035 //----------------------------------------------------------------------------
00036 UINT_PTR CALLBACK SingleOFNDialogHook(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00037 {
00038    if((uMsg == WM_NOTIFY) && (((LPOFNOTIFY)lParam)->hdr.code == CDN_INITDONE))
00039       CHWND::CenterWindow(GetParent(hWnd));
00040
00041    return 0;
00042 }
00043
00044
00045 //----------------------------------------------------------------------------
00046 //
00047 // SingleOFN function
00048 //    Presents the Open or Save common dialog box.
00049 //
00050 // Parameters:
00051 //    lpszPath:         String to receive the path of the chosen filename.
00052 //    uidFilter:        String resource identifer of the filter string.
00053 //    puidFilterIndex:  Pointer to the filter index to use; will be updated if
00054 //                      the user selects a different filter.
00055 //    hwndOwner:        Parent window of the dialog box.
00056 //    dwFlags:          Flags for the OPENFILENAME structure.
00057 //    lpszTitle:        Title of the dialog box.
00058 //    lpszInitialPath:  Path to start in.
00059 //    uidDefExt:        String resource identifier of the default extension.
00060 //    dwFlags2:         Flags for this function.
00061 //
00062 // Returns:             1 if a file was selected, 0 if not.
00063 //
00064 //----------------------------------------------------------------------------
00065 int SingleOFN(CTSTR& lpszPath, UINT uidFilter, UINT* puidFilterIndex, HWND hwndOwner,
00066               DWORD dwFlags, CTSTR& lpszTitle, CTSTR& lpszInitialPath, UINT uidDefExt,
00067               DWORD dwFlags2)
00068 {
00069    CTSTR lpszFilter;
00070    OfnGetFilter(uidFilter, lpszFilter);
00071
00072    int iReturn = 0;
00073    CTSTR lpszFile(TRUE, MAX_PATH);
00074    if((dwFlags2 & SINGLE_OFN_INITFILETITLE) && lpszPath)
00075       lstrcpyn(lpszFile, lpszPath, MAX_PATH);
00076
00077    OPENFILENAME ofn;
00078    ZeroMemory(&ofn, sizeof(ofn));
00079    ofn.lStructSize = sizeof(ofn);
00080    ofn.hInstance = NULL;
00081    ofn.hwndOwner = hwndOwner;
00082    ofn.lpstrFilter = lpszFilter;
00083    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00084    ofn.lpstrFile = lpszFile;
00085    ofn.nMaxFile = MAX_PATH;
00086    ofn.lpstrInitialDir = lpszInitialPath;
00087    ofn.lpstrTitle = lpszTitle;
00088    ofn.lpfnHook = SingleOFNDialogHook;
00089    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | dwFlags;
00090
00091    CTSTR lpszDefExt;
00092    if(uidDefExt != (UINT)-1)
00093    {
00094       lpszDefExt.Assign(uidDefExt);
00095       ofn.lpstrDefExt = lpszDefExt;
00096    }
00097
00098    BOOL bOK = ((dwFlags2 & SINGLE_OFN_SAVE) ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn));
00099    if(bOK)
00100    {
00101       lpszPath.Assign(lpszFile);
00102       if(puidFilterIndex)
00103          *puidFilterIndex = ofn.nFilterIndex;
00104       iReturn = 1;
00105    } else
00106    {
00107       if(CommDlgExtendedError() != 0)
00108          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00109       iReturn = 0;
00110    }
00111
00112    return iReturn;
00113 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_singleofn.h File Reference

#include <commdlg.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
#define | SINGLE_OFN_INITFILETITLE 0x00000001
#define | SINGLE_OFN_SAVE 0x00000002

Functions

int | SingleOFN (CTSTR &lpszPath, UINT uidFilter, UINT *puidFilterIndex, HWND hwndOwner, DWORD dwFlags, CTSTR &lpszTitle, CTSTR &lpszInitialPath, UINT uidDefExt, DWORD dwFlags2=0)

Define Documentation

#define AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_

Definition at line 11 of file bmws_singleofn.h.

#define SINGLE_OFN_INITFILETITLE 0x00000001

Definition at line 23 of file bmws_singleofn.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc(), and SingleOFN().

#define SINGLE_OFN_SAVE 0x00000002

Definition at line 24 of file bmws_singleofn.h.

Referenced by SingleOFN().

Function Documentation

int SingleOFN | ( | CTSTR & | lpszPath,
 |  | UINT | uidFilter,
 |  | UINT * | puidFilterIndex,
 |  | HWND | hwndOwner,
 |  | DWORD | dwFlags,
 |  | CTSTR & | lpszTitle,
 |  | CTSTR & | lpszInitialPath,
 |  | UINT | uidDefExt,
 |  | DWORD | dwFlags2 = 0
 | ) |

Definition at line 65 of file bmws_singleofn.cpp.

References CTSTR::Assign(), IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART, OfnGetFilter(), SINGLE_OFN_INITFILETITLE, SINGLE_OFN_SAVE, SingleOFNDialogHook(), and THROW.

Referenced by CCPSoundsDlg::CPSoundsProc(), CMainWindow::OnCommand(), and CAppearanceDlg::OptionsAppearanceProc().

00068 {
00069    CTSTR lpszFilter;
00070    OfnGetFilter(uidFilter, lpszFilter);
00071
00072    int iReturn = 0;
00073    CTSTR lpszFile(TRUE, MAX_PATH);
00074    if((dwFlags2 & SINGLE_OFN_INITFILETITLE) && lpszPath)
00075       lstrcpyn(lpszFile, lpszPath, MAX_PATH);
00076
00077    OPENFILENAME ofn;
00078    ZeroMemory(&ofn, sizeof(ofn));
00079    ofn.lStructSize = sizeof(ofn);
00080    ofn.hInstance = NULL;
00081    ofn.hwndOwner = hwndOwner;
00082    ofn.lpstrFilter = lpszFilter;
00083    ofn.nFilterIndex = (puidFilterIndex ? *puidFilterIndex : 1);
00084    ofn.lpstrFile = lpszFile;
00085    ofn.nMaxFile = MAX_PATH;
00086    ofn.lpstrInitialDir = lpszInitialPath;
00087    ofn.lpstrTitle = lpszTitle;
00088    ofn.lpfnHook = SingleOFNDialogHook;
00089    ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | dwFlags;
00090
00091    CTSTR lpszDefExt;
00092    if(uidDefExt != (UINT)-1)
00093    {
00094       lpszDefExt.Assign(uidDefExt);
00095       ofn.lpstrDefExt = lpszDefExt;
00096    }
00097
00098    BOOL bOK = ((dwFlags2 & SINGLE_OFN_SAVE) ? GetSaveFileName(&ofn) : GetOpenFileName(&ofn));
00099    if(bOK)
00100    {
00101       lpszPath.Assign(lpszFile);
00102       if(puidFilterIndex)
00103          *puidFilterIndex = ofn.nFilterIndex;
00104       iReturn = 1;
00105    } else
00106    {
00107       if(CommDlgExtendedError() != 0)
00108          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMDLG, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00109       iReturn = 0;
00110    }
00111
00112    return iReturn;
00113 }

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_singleofn.h Source File

bmws_singleofn.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_singleofn.h
00004 //    Functions to support opening a single file from the Open common dialog
00005 //    box.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
00011 #define AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <commdlg.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // SingleOFN flags
00022 //----------------------------------------------------------------------------
00023 #define SINGLE_OFN_INITFILETITLE    0x00000001
00024 #define SINGLE_OFN_SAVE             0x00000002
00025
00026
00027 //----------------------------------------------------------------------------
00028 // BMWS_SingleOFN API functions
00029 //----------------------------------------------------------------------------
00030 int SingleOFN(CTSTR& lpszPath, UINT uidFilter, UINT* puidFilterIndex, HWND hwndOwner,
00031               DWORD dwFlags, CTSTR& lpszTitle, CTSTR& lpszInitialPath, UINT uidDefExt,
00032               DWORD dwFlags2 = 0);
00033
00034
00035 #endif // !defined(AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen.cpp File Reference

#include <bmws_splashscreen.h>
#include <bmws_splashscreen_res.h>
#include <bmws_splashscreen_res_lc.h>

Go to the source code of this file.

Defines

#define | SPLASH_FONTSIZE 8

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Define Documentation

#define SPLASH_FONTSIZE 8

Definition at line 29 of file bmws_splashscreen.cpp.

Referenced by CSplashWindow::SplashWndProc().

Variable Documentation

HINSTANCE g_hInst

Definition at line 22 of file bmws_splashscreen.cpp.

Referenced by CSplashWindow::Create(), CSplashWindow::Register(), and CSplashWindow::SplashWndProc().

HINSTANCE g_hInstLC

Definition at line 23 of file bmws_splashscreen.cpp.

Referenced by CSplashWindow::Create().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen.cpp Source File

bmws_splashscreen.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_splashscreen.cpp
00004 //    Class to encapsulate a splash screen window.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_splashscreen.h>
00013 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00014 #include <bmws_splashscreen_res.h>
00015 #include <bmws_splashscreen_res_lc.h>
00016 #endif
00017
00018
00019 //----------------------------------------------------------------------------
00020 // External variables
00021 //----------------------------------------------------------------------------
00022 extern HINSTANCE g_hInst;     // Application instance handle
00023 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00024
00025
00026 //----------------------------------------------------------------------------
00027 // The default size of the font to display
00028 //----------------------------------------------------------------------------
00029 #define SPLASH_FONTSIZE 8
00030
00031
00032 #ifdef BMWS_SPLASHSCREEN_SIMPLE
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CSplashWindow constructor
00037 //
00038 // Parameters:       None.
00039 //
00040 //----------------------------------------------------------------------------
00041 CSplashWindow::CSplashWindow()
00042 {
00043    m_hbmSplash = NULL;
00044 }
00045
00046
00047 #else
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // CSplashWindow constructor
00053 //
00054 // Parameters:
00055 //    lpszRegMsg:    Registration message.
00056 //    lpszVersion:   Current version.
00057 //    lpszCopyright: Copyright string.
00058 //    bIncludeReg:   Whether to display the registration message.
00059 //    colorText:     The color to display text in.
00060 //
00061 //----------------------------------------------------------------------------
00062 CSplashWindow::CSplashWindow(CTSTR& lpszRegMsg, CTSTR& lpszVersion, CTSTR& lpszCopyright,
00063                              BOOL bIncludeReg, COLORREF colorText)
00064 {
00065    if(bIncludeReg)
00066    {
00067       if(lpszRegMsg)
00068       {
00069          CTSTR lpszRegFormatter(IDS_BMWS_SPLASH_REGMSG);
00070          m_lpszRegMsg.Alloc(lstrlen(lpszRegFormatter) + lstrlen(lpszRegMsg) + 1);
00071          wsprintf(m_lpszRegMsg, lpszRegFormatter, lpszRegMsg);
00072       } else
00073          m_lpszRegMsg.Assign(IDS_BMWS_SPLASH_UNREGMSG);
00074    }
00075    m_lpszVersion = lpszVersion;
00076    m_lpszCopyright = lpszCopyright;
00077    m_colorText = colorText;
00078    m_hbmSplash = NULL;
00079    m_hfontUser = NULL;
00080 }
00081
00082 #endif
00083
00084
00085 //----------------------------------------------------------------------------
00086 //
00087 // CSplashWindow destructor
00088 //
00089 //----------------------------------------------------------------------------
00090 CSplashWindow::~CSplashWindow()
00091 {
00092    if(m_hbmSplash)
00093       DeleteObject(m_hbmSplash);
00094 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00095    if(m_hfontUser)
00096       DeleteObject(m_hfontUser);
00097 #endif
00098 }
00099
00100
00101 //----------------------------------------------------------------------------
00102 //
00103 // Create function
00104 //    Creates the splash window and loads the splash image.
00105 //
00106 // Parameters:       None.
00107 //
00108 // Returns:          Whether the window was successfully created.
00109 //
00110 //----------------------------------------------------------------------------
00111 BOOL CSplashWindow::Create()
00112 {
00113    m_hbmSplash = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_SPLASH), IMAGE_BITMAP, 0, 0,
00114       LR_DEFAULTCOLOR);
00115    if(!m_hbmSplash)
00116       return FALSE;
00117
00118    BITMAP bm;
00119    GetObject((HGDIOBJ)m_hbmSplash, sizeof(BITMAP), &bm);
00120
00121    TCHAR szWindowClass[64];
00122    LoadString(g_hInst, IDS_SPLASHCLASSNAME, szWindowClass, sizeof(szWindowClass));
00123
00124    CreateWindowEx(0, szWindowClass, NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth,
00125       bm.bmHeight, NULL, NULL, (LPVOID)this);
00126    return TRUE;
00127 }
00128
00129
00130 //----------------------------------------------------------------------------
00131 //
00132 // Register function
00133 //    Registers the splash window class.
00134 //
00135 // Parameters:       None.
00136 //
00137 // Returns:          Whether the window class was successfully registered.
00138 //
00139 //----------------------------------------------------------------------------
00140 BOOL CSplashWindow::Register()
00141 {
00142    TCHAR szWindowClass[64];
00143    LoadString(g_hInst, IDS_SPLASHCLASSNAME, szWindowClass, sizeof(szWindowClass));
00144
00145    WNDCLASS wc;
00146
00147    wc.style          = CS_HREDRAW | CS_VREDRAW;
00148    wc.lpfnWndProc    = (WNDPROC)SplashWndProc;
00149    wc.cbClsExtra     = 0;
00150    wc.cbWndExtra     = 0;
00151    wc.hInstance      = g_hInst;
00152    wc.hIcon          = NULL;
00153    wc.hCursor        = LoadCursor(NULL, IDC_WAIT);
00154    wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
00155    wc.lpszMenuName   = NULL;
00156    wc.lpszClassName  = szWindowClass;
00157
00158    return RegisterClass(&wc);
00159 }
00160
00161
00162 //----------------------------------------------------------------------------
00163 //
00164 // SplashWndProc function
00165 //    Callback function that handles messages to the splash screen.
00166 //
00167 // Parameters:
00168 //    hWnd:          The splash window handle.
00169 //    uMsg:          Message identifer.
00170 //    wParam:        Message-specific parameter.
00171 //    lParam:        Message-specific parameter.
00172 //
00173 // Returns:
00174 //    Depends on the message. If the message was not handled, the return value
00175 //    of DefWndProc will be returned.
00176 //
00177 //----------------------------------------------------------------------------
00178 LRESULT CALLBACK CSplashWindow::SplashWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00179 {
00180    CSplashWindow *pThis = (CSplashWindow*)GetWindowLong(hWnd, GWL_USERDATA);
00181
00182    switch(uMsg)
00183    {
00184       case WM_CLOSE:
00185          return 0;
00186
00187       case WM_NCCREATE:
00188       {
00189          LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00190          pThis = (CSplashWindow*)(lpcs->lpCreateParams);
00191          SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00192          pThis->m_hWnd = hWnd;
00193       } break;
00194
00195       case WM_CREATE:
00196       {
00197 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00198          HDC hdc = GetDC(hWnd);
00199          TCHAR szFaceName[LF_FACESIZE];
00200          LoadString(g_hInst, IDS_BMWS_SPLASH_FONT, szFaceName, LF_FACESIZE);
00201          pThis->m_hfontUser = CreateFont(-MulDiv(SPLASH_FONTSIZE, GetDeviceCaps(hdc, LOGPIXELSY),
00202             72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, szFaceName);
00203          ReleaseDC(hWnd, hdc);
00204 #endif
00205
00206          CenterWindow(hWnd);
00207       } return 0;
00208
00209       case WM_PAINT:
00210       {
00211          PAINTSTRUCT ps;
00212          HDC hdc = BeginPaint(hWnd, &ps);
00213
00214          BITMAP bm;
00215          GetObject((HGDIOBJ)pThis->m_hbmSplash, sizeof(BITMAP), &bm);
00216
00217          HDC hdcMem = CreateCompatibleDC(hdc);
00218          HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, pThis->m_hbmSplash);
00219
00220          BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
00221
00222 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00223          HFONT hfontOld = (HFONT)SelectObject(hdc, pThis->m_hfontUser);
00224
00225          int iPrevBkMode = SetBkMode(hdc, TRANSPARENT);
00226          COLORREF colorOld = SetTextColor(hdc, pThis->m_colorText);
00227
00228          SIZE s;
00229          RECT rc;
00230
00231          GetTextExtentPoint32(hdc, pThis->m_lpszCopyright, lstrlen(pThis->m_lpszCopyright), &s);
00232          SetRect(&rc, 326, 312 - s.cy, 489, 312);
00233          DrawText(hdc, pThis->m_lpszCopyright, -1, &rc, DT_CENTER);
00234
00235          GetTextExtentPoint32(hdc, pThis->m_lpszVersion, lstrlen(pThis->m_lpszVersion), &s);
00236          rc.bottom = rc.top - 3;
00237          rc.top = rc.bottom - s.cy;
00238          DrawText(hdc, pThis->m_lpszVersion, -1, &rc, DT_CENTER);
00239
00240          if(pThis->m_lpszRegMsg)
00241          {
00242             RECT rcNew;
00243             SetRect(&rcNew, 0, 0, 0, 0);
00244             DrawText(hdc, pThis->m_lpszRegMsg, -1, &rcNew, DT_CENTER | DT_CALCRECT);
00245             rc.bottom = rc.top - 9;
00246             rc.top = rc.bottom - rcNew.bottom;
00247             DrawText(hdc, pThis->m_lpszRegMsg, -1, &rc, DT_CENTER);
00248          }
00249
00250          SetBkMode(hdc, iPrevBkMode);
00251          SetTextColor(hdc, colorOld);
00252
00253          SelectObject(hdc, hfontOld);
00254 #endif
00255
00256          SelectObject(hdcMem, hbmOld);
00257          DeleteDC(hdcMem);
00258          EndPaint(hWnd, &ps);
00259       } return 0;
00260    }
00261
00262    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00263 }
Generated on Wed May 8 12:38:57 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen.h File Reference

#include <bmws_window.h>

Go to the source code of this file.

Compounds

class | CSplashWindow

Defines

#define | AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_

Definition at line 10 of file bmws_splashscreen.h.

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen.h Source File

bmws_splashscreen.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_splashscreen.h
00004 //    Class to encapsulate a splash screen window.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
00010 #define AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_window.h>
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CSplashWindow class
00026 //    Encapsulates a splash screen window.
00027 //
00028 //----------------------------------------------------------------------------
00029 class CSplashWindow : public CHWND
00030 {
00031 public:
00032 #ifdef BMWS_SPLASHSCREEN_SIMPLE
00033    CSplashWindow();
00034 #else
00035    CSplashWindow(CTSTR& lpszRegMsg, CTSTR& lpszVersion, CTSTR& lpszCopyright,
00036       BOOL bIncludeReg = TRUE, COLORREF colorText = RGB(0,0,0));
00037 #endif
00038    virtual ~CSplashWindow();
00039
00040    BOOL Register();
00041    BOOL Create();
00042
00043    static LRESULT CALLBACK SplashWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00044
00045 protected:
00046    HBITMAP m_hbmSplash;    // Bitmap to display
00047 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00048    HFONT m_hfontUser;      // Font to use for displaying registration and copyright
00049    CTSTR m_lpszRegMsg;     // Registration message
00050    CTSTR m_lpszVersion;    // Current version
00051    CTSTR m_lpszCopyright;  // Copyright string
00052    COLORREF m_colorText;   // Text color
00053 #endif
00054 };
00055
00056
00057 #endif // !defined(AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_SPLASH_FONT 8201

Define Documentation

#define IDS_BMWS_SPLASH_FONT 8201

Definition at line 5 of file bmws_splashscreen_res.h.

Referenced by CSplashWindow::SplashWndProc().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen_res.h Source File

bmws_splashscreen_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_splashscreen.rc
00004 //
00005 #define IDS_BMWS_SPLASH_FONT            8201
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_SPLASH_REGMSG 18201
#define | IDS_BMWS_SPLASH_UNREGMSG 18202

Define Documentation

#define IDS_BMWS_SPLASH_REGMSG 18201

Definition at line 5 of file bmws_splashscreen_res_lc.h.

Referenced by CSplashWindow::CSplashWindow().

#define IDS_BMWS_SPLASH_UNREGMSG 18202

Definition at line 6 of file bmws_splashscreen_res_lc.h.

Referenced by CSplashWindow::CSplashWindow().

Generated on Wed May 8 12:39:18 2002 for Solitaire Pack by doxygen 1.2.15


bmws_splashscreen_res_lc.h Source File

bmws_splashscreen_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_splashscreen_lc.rc
00004 //
00005 #define IDS_BMWS_SPLASH_REGMSG          18201
00006 #define IDS_BMWS_SPLASH_UNREGMSG        18202
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string.cpp File Reference

#include <bmws_common.h>
#include <bmws_string.h>
#include <bmws_error.h>
#include <bmws_string_res_lc.h>
#include <shlwapi.h>

Go to the source code of this file.

Variables

COOMExcep * g_pOOMExcep
HWND | g_hWnd
HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Variable Documentation

HINSTANCE g_hInst

Definition at line 24 of file bmws_string.cpp.

Referenced by CTSTR::Assign().

HINSTANCE g_hInstLC

Definition at line 25 of file bmws_string.cpp.

Referenced by CTSTR::Assign().

HWND g_hWnd

Definition at line 23 of file bmws_string.cpp.

COOMExcep* g_pOOMExcep

Definition at line 22 of file bmws_string.cpp.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string.cpp Source File

bmws_string.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_string.cpp
00004 //    Classes to encapsulate local and BSTR strings.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_string.h>
00014 #include <bmws_error.h>
00015 #include <bmws_string_res_lc.h>
00016 #include <shlwapi.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // External variables
00021 //----------------------------------------------------------------------------
00022 extern COOMExcep *g_pOOMExcep;   // Out of memory exception object
00023 extern HWND g_hWnd;              // Main window handle
00024 extern HINSTANCE g_hInst;        // Application instance handle
00025 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // CTSTR constructor
00031 //
00032 // Parameters:       None.
00033 //
00034 //----------------------------------------------------------------------------
00035 CTSTR::CTSTR()
00036 {
00037    m_lpsz = NULL;
00038 }
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // CTSTR copy constructor
00044 //
00045 // Parameters:
00046 //    bmwslocal:     String object to copy from.
00047 //
00048 //----------------------------------------------------------------------------
00049 CTSTR::CTSTR(const CTSTR& bmwslocal)
00050 {
00051    m_lpsz = NULL;
00052    if(bmwslocal.m_lpsz)
00053       CopyString(bmwslocal);
00054 }
00055
00056
00057 //----------------------------------------------------------------------------
00058 //
00059 // CTSTR constructor
00060 //
00061 // Parameters:
00062 //    uID:           Resource identifier of the string to load.
00063 //
00064 //----------------------------------------------------------------------------
00065 CTSTR::CTSTR(UINT uID)
00066 {
00067    m_lpsz = NULL;
00068    Assign(uID);
00069 }
00070
00071
00072 //----------------------------------------------------------------------------
00073 //
00074 // CTSTR constructor
00075 //
00076 // Parameters:
00077 //    uID:           Resource identifier of the string to load.
00078 //    cch:           Initial count of characters to allocate. Defaults to 128.
00079 //
00080 //----------------------------------------------------------------------------
00081 CTSTR::CTSTR(UINT uID, UINT cch, BOOL)
00082 {
00083    m_lpsz = NULL;
00084    Assign(uID, cch);
00085 }
00086
00087
00088 //----------------------------------------------------------------------------
00089 //
00090 // CTSTR constructor
00091 //
00092 // Parameters:
00093 //    lpsz:          LPTSTR string to copy from.
00094 //    bAssign:       Whether to assign the existing buffer (TRUE) or copy the
00095 //                   buffer (FALSE, default).
00096 //
00097 //----------------------------------------------------------------------------
00098 CTSTR::CTSTR(LPTSTR lpsz, BOOL bAssign)
00099 {
00100    m_lpsz = NULL;
00101    if(bAssign)
00102       m_lpsz = lpsz;
00103    else
00104       CopyString(lpsz);
00105 }
00106
00107
00108 #ifndef BMWS_NOOLE
00109
00110 //----------------------------------------------------------------------------
00111 //
00112 // CTSTR constructor
00113 //
00114 // Parameters:
00115 //    bstr:          BSTR string to copy from.
00116 //
00117 //----------------------------------------------------------------------------
00118 CTSTR::CTSTR(BSTR bstr)
00119 {
00120    m_lpsz = NULL;
00121    Assign(bstr);
00122 }
00123
00124 #endif
00125
00126
00127 //----------------------------------------------------------------------------
00128 //
00129 // CTSTR constructor
00130 //
00131 // Parameters:
00132 //    cch:           Number of characters to allocate.
00133 //
00134 //----------------------------------------------------------------------------
00135 CTSTR::CTSTR(BOOL, UINT cch)
00136 {
00137    m_lpsz = NULL;
00138    Alloc(cch);
00139 }
00140
00141
00142 #ifdef BMWS_STRING_DLGITEM
00143
00144 //----------------------------------------------------------------------------
00145 //
00146 // CTSTR constructor
00147 //
00148 // Parameters:
00149 //    hwndDlg:       Dialog window handle.
00150 //    nIDDlgItem:    Control ID.
00151 //
00152 //----------------------------------------------------------------------------
00153 CTSTR::CTSTR(HWND hwndDlg, int nIDDlgItem)
00154 {
00155    m_lpsz = NULL;
00156    Assign(hwndDlg, nIDDlgItem);
00157 }
00158
00159 #endif
00160
00161
00162 //----------------------------------------------------------------------------
00163 //
00164 // CTSTR destructor
00165 //
00166 //----------------------------------------------------------------------------
00167 CTSTR::~CTSTR()
00168 {
00169    SAFEFREEMEMORY(m_lpsz);
00170 }
00171
00172
00173 //----------------------------------------------------------------------------
00174 //
00175 // Assign function
00176 //    Copy an ANSI string into this string.
00177 //
00178 // Parameters:
00179 //    lpsz:          LPSTR string to copy from.
00180 //
00181 // Returns:          None.
00182 //
00183 //----------------------------------------------------------------------------
00184 void CTSTR::Assign(LPSTR lpsz)
00185 {
00186    SAFEFREEMEMORY(m_lpsz);
00187
00188    if(lpsz)
00189    {
00190       #ifdef UNICODE
00191          int iLen = lstrlenA(lpsz) + 1;
00192          Alloc(iLen);
00193          MultiByteToWideChar(CP_ACP, 0, lpsz, -1, m_lpsz, iLen);
00194          m_lpsz[iLen-1] = 0;
00195       #else
00196          CopyString(lpsz);
00197       #endif
00198    }
00199 }
00200
00201
00202 //----------------------------------------------------------------------------
00203 //
00204 // AssignW function
00205 //    Copy a Unicode string into this string.
00206 //
00207 // Parameters:
00208 //    lpsz:          LPWSTR string to copy from.
00209 //    iLen:          Length of the string. If -1, it is null-terminated.
00210 //
00211 // Returns:          None.
00212 //
00213 //----------------------------------------------------------------------------
00214 void CTSTR::AssignW(LPWSTR lpwsz, int iLen)
00215 {
00216    SAFEFREEMEMORY(m_lpsz);
00217
00218 #ifdef UNICODE
00219    CopyString(lpwsz, iLen);
00220 #else
00221    if(iLen == -1)
00222       iLen = lstrlenW(lpwsz) + 1;
00223    Alloc(iLen);
00224    WideCharToMultiByte(CP_ACP, 0, lpwsz, -1, m_lpsz, iLen, NULL, NULL);
00225    m_lpsz[iLen-1] = 0;
00226 #endif
00227 }
00228
00229
00230 #ifndef BMWS_NOOLE
00231
00232 //----------------------------------------------------------------------------
00233 //
00234 // Assign function
00235 //    Copy a BSTR string into this string.
00236 //
00237 // Parameters:
00238 //    bstr:          BSTR string to copy from.
00239 //
00240 // Returns:          None.
00241 //
00242 //----------------------------------------------------------------------------
00243 void CTSTR::Assign(BSTR bstr)
00244 {
00245    if(!bstr)
00246    {
00247       SAFEFREEMEMORY(m_lpsz);
00248       return;
00249    }
00250    int iLen = SysStringLen(bstr) + 1;
00251    AssignW(bstr, iLen);
00252 }
00253
00254 #endif
00255
00256
00257 //----------------------------------------------------------------------------
00258 //
00259 // Assign function
00260 //    Load a string into this string.
00261 //
00262 // Parameters:
00263 //    uID:           Resource identifier of the string to load.
00264 //    cch:           Initial count of characters to allocate. Defaults to 128.
00265 //
00266 // Returns:          None.
00267 //
00268 //----------------------------------------------------------------------------
00269 void CTSTR::Assign(UINT uID, UINT cch)
00270 {
00271    SAFEFREEMEMORY(m_lpsz);
00272
00273    LPTSTR lpszBuf = NULL;
00274    int nLen;
00275    int nSize = cch - 128;
00276    do
00277    {
00278       SAFEFREEMEMORY(lpszBuf);
00279       nSize += 128;
00280       lpszBuf = SAFEALLOC(nSize);
00281       ENSUREALLOC(lpszBuf);
00282       nLen = LoadString(uID > 10000 ? g_hInstLC : g_hInst, uID, lpszBuf, nSize);
00283    } while (nSize - nLen <= 2);
00284    if(nLen == 0)
00285    {
00286       SAFEFREEMEMORY(lpszBuf);
00287       THROW(new CExcepEx(IDS_BMWS_STRING_RESNOTFOUND, IDS_BMWS_REMEDY_RESTART, uID, 0,
00288          ERROR_ERRORINS_INT), CExcepEx*);
00289    }
00290    m_lpsz = lpszBuf;
00291 }
00292
00293
00294 #ifdef BMWS_STRING_DLGITEM
00295
00296 //----------------------------------------------------------------------------
00297 //
00298 // Assign function
00299 //    Load a string into this string.
00300 //
00301 // Parameters:
00302 //    hwndDlg:       Dialog window handle.
00303 //    nIDDlgItem:    Control ID.
00304 //
00305 // Returns:          None.
00306 //
00307 //----------------------------------------------------------------------------
00308 void CTSTR::Assign(HWND hwndDlg, int nIDDlgItem)
00309 {
00310    SAFEFREEMEMORY(m_lpsz);
00311    int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, nIDDlgItem)) + 1;
00312    Alloc(iLen);
00313    GetDlgItemText(hwndDlg, nIDDlgItem, m_lpsz, iLen);
00314 }
00315
00316 #endif
00317
00318
00319 //----------------------------------------------------------------------------
00320 //
00321 // Alloc function
00322 //    Allocates a specified amount of memory for the string.
00323 //
00324 // Parameters:
00325 //    cch:           Number of characters to allocate.
00326 //
00327 // Returns:          None.
00328 //
00329 //----------------------------------------------------------------------------
00330 void CTSTR::Alloc(UINT cch)
00331 {
00332    SAFEFREEMEMORY(m_lpsz);
00333    m_lpsz = SAFEALLOC(cch);
00334    ENSUREALLOC(m_lpsz);
00335    ZeroMemory(m_lpsz, cch * sizeof(TCHAR));
00336 }
00337
00338
00339 //----------------------------------------------------------------------------
00340 //
00341 // = operator
00342 //
00343 // Parameters:
00344 //    lpszSrc:       Existing string to copy from.
00345 //
00346 // Returns:          The new current string object.
00347 //
00348 //----------------------------------------------------------------------------
00349 const CTSTR& CTSTR::operator=(const CTSTR& lpszSrc)
00350 {
00351    if(m_lpsz != lpszSrc.m_lpsz)
00352       CopyString(lpszSrc.m_lpsz);
00353    return *this;
00354 }
00355
00356
00357 #ifndef BMWS_NOOLE
00358
00359 //----------------------------------------------------------------------------
00360 //
00361 // = operator
00362 //
00363 // Parameters:
00364 //    bstr:          Existing BSTR string to copy from.
00365 //
00366 // Returns:          The new current string object.
00367 //
00368 //----------------------------------------------------------------------------
00369 const CTSTR& CTSTR::operator=(const BSTR bstr)
00370 {
00371    Assign(bstr);
00372    return *this;
00373 }
00374
00375 #endif
00376
00377
00378 //----------------------------------------------------------------------------
00379 //
00380 // Equals function
00381 //    Determines whether this string is equal to another string.
00382 //
00383 // Parameters:
00384 //    lpsz:          The string to test against.
00385 //    iLen:          The length of the string to use to test against.
00386 //
00387 // Returns:          TRUE if the strings are equal, else false.
00388 //
00389 //----------------------------------------------------------------------------
00390 BOOL CTSTR::Equals(LPTSTR lpsz, int iLen)
00391 {
00392    BOOL bReturn = FALSE;
00393    CTSTR lpszCopy(TRUE, iLen);
00394    lstrcpyn(lpszCopy, lpsz, iLen);
00395    return (lstrcmp(m_lpsz, lpszCopy.m_lpsz) == 0);
00396 }
00397
00398
00399 //----------------------------------------------------------------------------
00400 //
00401 // CopyString function
00402 //    Copies the specified string into this string object.
00403 //
00404 // Parameters:
00405 //    lpsz:          The string to copy.
00406 //    iLen:          Length of the string. If -1, it is null-terminated.
00407 //
00408 // Returns:          None.
00409 //
00410 //----------------------------------------------------------------------------
00411 void CTSTR::CopyString(LPTSTR lpsz, int iLen)
00412 {
00413    SAFEFREEMEMORY(m_lpsz);
00414    if(lpsz)
00415    {
00416       if(iLen == -1)
00417          iLen = lstrlen(lpsz) + 1;
00418       Alloc(iLen);
00419       lstrcpyn(m_lpsz, lpsz, iLen);
00420    }
00421 }
00422
00423
00424 //----------------------------------------------------------------------------
00425 //
00426 // Format method
00427 //    Formats the string into the formatter string and sets it to this object.
00428 //
00429 // Parameters:
00430 //    lpszFormatter: String to use for formatting.
00431 //    lpszInsert:    String to insert.
00432 //
00433 // Returns:          This object.
00434 //
00435 //----------------------------------------------------------------------------
00436 CTSTR& CTSTR::Format(LPTSTR lpszFormatter, LPTSTR lpszInsert)
00437 {
00438    _ASSERT(lpszFormatter);
00439    _ASSERT(lpszInsert);
00440    Alloc(lstrlen(lpszFormatter) + lstrlen(lpszInsert));
00441    wsprintf(m_lpsz, lpszFormatter, lpszInsert);
00442    return *this;
00443 }
00444
00445
00446 //----------------------------------------------------------------------------
00447 //
00448 // Format method
00449 //    Formats the number into the formatter string and sets it to this object.
00450 //
00451 // Parameters:
00452 //    lpszFormatter: String to use for formatting.
00453 //    iInsert:       Integer to insert.
00454 //
00455 // Returns:          This object.
00456 //
00457 //----------------------------------------------------------------------------
00458 CTSTR& CTSTR::Format(LPTSTR lpszFormatter, int iInsert)
00459 {
00460    _ASSERT(lpszFormatter);
00461    Alloc(lstrlen(lpszFormatter) + 16);
00462    wsprintf(m_lpsz, lpszFormatter, iInsert);
00463    return *this;
00464 }
00465
00466
00467 #ifdef BMWS_STRING_EXTRACTSUBSTRING
00468
00469 //----------------------------------------------------------------------------
00470 //
00471 // ExtractSubString function
00472 //    Extracts a substring from a deliminated string.
00473 //
00474 // Parameters:
00475 //    lpszOut:       String to hold the substring.
00476 //    iSubString:    Zero-based index of the substring to extract.
00477 //    chSep:         Character that deliminates the substrings.
00478 //
00479 // Returns:          TRUE if the substring was found, else FALSE.
00480 //
00481 //----------------------------------------------------------------------------
00482 BOOL CTSTR::ExtractSubString(CTSTR& lpszOut, int iSubString, TCHAR chSep)
00483 {
00484    LPTSTR lpszString = m_lpsz;
00485    if(lpszString == NULL)
00486       return FALSE;
00487
00488    while(iSubString--)
00489    {
00490       lpszString = StrChr(lpszString, chSep);
00491       if(lpszString == NULL)
00492       {
00493          lpszOut.Assign((LPTSTR)NULL);    // return empty string as well
00494          return FALSE;
00495       }
00496       lpszString++;     // point past the separator
00497    }
00498    LPCTSTR lpchEnd = StrChr(lpszString, chSep);
00499    int nLen = ((lpchEnd == NULL) ? lstrlen(lpszString) : (int)(lpchEnd - lpszString)) + 1;
00500    lpszOut.Alloc(nLen);
00501    lstrcpyn(lpszOut, lpszString, nLen);
00502    return TRUE;
00503 }
00504
00505 #endif
00506
00507
00508 #ifdef BMWS_STRING_REPLACE
00509
00510 //----------------------------------------------------------------------------
00511 //
00512 // Replace function
00513 //    Replaces all instances of a substring with a new substring.
00514 //
00515 // Parameters:
00516 //    lpszOld:       The substring to find and replace with lpszNew.
00517 //    lpszNew:       The substring to put in place of lpszOld.
00518 //
00519 // Returns:          The number of replacements made.
00520 //
00521 //----------------------------------------------------------------------------
00522 int CTSTR::Replace(CTSTR& lpszOld, CTSTR& lpszNew)
00523 {
00524    if(Len() == 0)
00525       return 0;
00526    int nSourceLen = lpszOld.Len();
00527    if(nSourceLen == 0)
00528       return 0;
00529
00530    int nReplacementLen = lpszNew.Len();
00531
00532    // loop once to figure out the size of the result string
00533    int nCount = 0;
00534    LPTSTR lpszStart = m_lpsz;
00535    LPTSTR lpszEnd = m_lpsz + Len();
00536    LPTSTR lpszTarget;
00537    while(lpszStart < lpszEnd)
00538    {
00539       while((lpszTarget = StrStr(lpszStart, lpszOld)) != NULL)
00540       {
00541          nCount++;
00542          lpszStart = lpszTarget + nSourceLen;
00543       }
00544       lpszStart += lstrlen(lpszStart) + 1;
00545    }
00546
00547    // if any changes were made, make them
00548    if(nCount > 0)
00549    {
00550       int nOldLength = Len();
00551       int nNewLength =  nOldLength + ((nReplacementLen - nSourceLen) * nCount);
00552       if(nOldLength < nNewLength)
00553       {
00554          CTSTR lpszNew2(m_lpsz);
00555          Alloc(nNewLength+1);
00556          lstrcpy(m_lpsz, lpszNew2);
00557       }
00558
00559       lpszStart = m_lpsz;
00560       lpszEnd = m_lpsz + Len();
00561
00562       // loop again to actually do the work
00563       while(lpszStart < lpszEnd)
00564       {
00565          while((lpszTarget = StrStr(lpszStart, lpszOld)) != NULL)
00566          {
00567             int nBalance = nOldLength - (lpszTarget - m_lpsz + nSourceLen);
00568             MoveMemory(lpszTarget + nReplacementLen, lpszTarget + nSourceLen,
00569                nBalance * sizeof(TCHAR));
00570             CopyMemory(lpszTarget, lpszNew.m_lpsz, nReplacementLen*sizeof(TCHAR));
00571             lpszStart = lpszTarget + nReplacementLen;
00572             lpszStart[nBalance] = '\0';
00573             nOldLength += (nReplacementLen - nSourceLen);
00574          }
00575          lpszStart += lstrlen(lpszStart) + 1;
00576       }
00577       _ASSERT(m_lpsz[nNewLength] == '\0');
00578    }
00579
00580    return nCount;
00581 }
00582
00583 #endif
00584
00585
00586 #ifndef BMWS_NOOLE
00587
00588 //----------------------------------------------------------------------------
00589 //
00590 // CBSTR constructor
00591 //
00592 // Parameters:       None.
00593 //
00594 //----------------------------------------------------------------------------
00595 CBSTR::CBSTR()
00596 {
00597    m_bstr = NULL;
00598 }
00599
00600
00601 //----------------------------------------------------------------------------
00602 //
00603 // CBSTR constructor
00604 //
00605 // Parameters:
00606 //    uID:           Resource identifier of the string to load.
00607 //
00608 //----------------------------------------------------------------------------
00609 CBSTR::CBSTR(UINT uID)
00610 {
00611    m_bstr = NULL;
00612    Assign(uID);
00613 }
00614
00615
00616 //----------------------------------------------------------------------------
00617 //
00618 // CBSTR constructor
00619 //
00620 // Parameters:
00621 //    bstr:          BSTR string to copy from.
00622 //    bAssign:       Whether to assign the existing buffer (TRUE) or copy the
00623 //                   buffer (FALSE, default).
00624 //
00625 //----------------------------------------------------------------------------
00626 CBSTR::CBSTR(BSTR bstr, BOOL bAssign)
00627 {
00628    m_bstr = NULL;
00629    if(bAssign)
00630       m_bstr = bstr;
00631    else
00632       CopyString(bstr);
00633 }
00634
00635
00636 //----------------------------------------------------------------------------
00637 //
00638 // CBSTR constructor
00639 //
00640 // Parameters:
00641 //    bmwslocal:     Local string object to copy from.
00642 //
00643 //----------------------------------------------------------------------------
00644 CBSTR::CBSTR(const CTSTR& bmwslocal)
00645 {
00646    m_bstr = NULL;
00647    Assign(bmwslocal.m_lpsz);
00648 }
00649
00650
00651 //----------------------------------------------------------------------------
00652 //
00653 // CBSTR copy constructor
00654 //
00655 // Parameters:
00656 //    bmwsbstr:      BSTR string object to copy from.
00657 //
00658 //----------------------------------------------------------------------------
00659 CBSTR::CBSTR(const CBSTR& bmwsbstr)
00660 {
00661    m_bstr = NULL;
00662    CopyString(bmwsbstr.m_bstr);
00663 }
00664
00665
00666 //----------------------------------------------------------------------------
00667 //
00668 // CBSTR constructor
00669 //
00670 // Parameters:
00671 //    lpszFormatter: String to use for formatting.
00672 //    ival:          Integer value to insert.
00673 //
00674 //----------------------------------------------------------------------------
00675 CBSTR::CBSTR(LPTSTR lpszFormatter, int iVal)
00676 {
00677    m_bstr = NULL;
00678    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + 8);
00679    wsprintf(lpszFinal, lpszFormatter, iVal);
00680    Assign(lpszFinal);
00681 }
00682
00683
00684 //----------------------------------------------------------------------------
00685 //
00686 // CBSTR destructor
00687 //
00688 //----------------------------------------------------------------------------
00689 CBSTR::~CBSTR()
00690 {
00691    SAFEFREESTRING(m_bstr);
00692 }
00693
00694
00695 //----------------------------------------------------------------------------
00696 //
00697 // = operator
00698 //
00699 // Parameters:
00700 //    bstrSrc:       Existing BSTR string object to copy from.
00701 //
00702 // Returns:          The new current BSTR string object.
00703 //
00704 //----------------------------------------------------------------------------
00705 const CBSTR& CBSTR::operator=(const CBSTR& bstrSrc)
00706 {
00707    if(m_bstr != bstrSrc.m_bstr)
00708       CopyString(bstrSrc.m_bstr);
00709    return *this;
00710 }
00711
00712
00713 //----------------------------------------------------------------------------
00714 //
00715 // = operator
00716 //
00717 // Parameters:
00718 //    bstr:          Existing BSTR string to copy from.
00719 //
00720 // Returns:          The new current BSTR string object.
00721 //
00722 //----------------------------------------------------------------------------
00723 const CBSTR& CBSTR::operator=(const BSTR bstr)
00724 {
00725    if(m_bstr != bstr)
00726       CopyString(bstr);
00727    return *this;
00728 }
00729
00730
00731 //----------------------------------------------------------------------------
00732 //
00733 // Assign function
00734 //    Load a string into this string.
00735 //
00736 // Parameters:
00737 //    uID:           Resource identifier of the string to load.
00738 //
00739 // Returns:          None.
00740 //
00741 //----------------------------------------------------------------------------
00742 void CBSTR::Assign(UINT uID)
00743 {
00744    Assign(CTSTR(uID));
00745 }
00746
00747
00748 //----------------------------------------------------------------------------
00749 //
00750 // Assign function
00751 //    Copy a local string into this string.
00752 //
00753 // Parameters:
00754 //    lpsz:          Local string to copy from.
00755 //
00756 // Returns:          None.
00757 //
00758 //----------------------------------------------------------------------------
00759 void CBSTR::Assign(LPTSTR lpsz)
00760 {
00761    SAFEFREESTRING(m_bstr);
00762    if(!lpsz)
00763       return;
00764
00765 #ifdef UNICODE
00766    m_bstr = SysAllocString(lpsz);
00767    ENSUREALLOC(m_bstr);
00768 #else
00769    int iLen = lstrlenA(lpsz) + 1;
00770    LPWSTR lpwsz = SAFEALLOCW(iLen);
00771    ENSUREALLOC(lpwsz);
00772    MultiByteToWideChar(CP_ACP, 0, lpsz, -1, lpwsz, iLen);
00773    lpwsz[iLen-1] = 0;
00774    m_bstr = SysAllocString(lpwsz);
00775    SAFEFREEMEMORY(lpwsz);
00776    ENSUREALLOC(m_bstr);
00777 #endif
00778 }
00779
00780
00781 //----------------------------------------------------------------------------
00782 //
00783 // AssignW function
00784 //    Copy a Unicode string into this string.
00785 //
00786 // Parameters:
00787 //    lpsz:          LPWSTR string to copy from.
00788 //    iLen:          Length of the string. If -1, it is null-terminated.
00789 //
00790 // Returns:          None.
00791 //
00792 //----------------------------------------------------------------------------
00793 void CBSTR::AssignW(LPWSTR lpwsz, int iLen)
00794 {
00795    SAFEFREESTRING(m_bstr);
00796    if(!lpwsz)
00797       return;
00798
00799    if(iLen == -1)
00800       m_bstr = SysAllocString(lpwsz);
00801    else
00802       m_bstr = SysAllocStringLen(lpwsz, (UINT)iLen);
00803    ENSUREALLOC(m_bstr);
00804 }
00805
00806
00807 //----------------------------------------------------------------------------
00808 //
00809 // Equals function
00810 //    Determines whether this string is equal to another string.
00811 //
00812 // Parameters:
00813 //    bstr:          The string to test against.
00814 //
00815 // Returns:          TRUE if the strings are equal, else FALSE.
00816 //
00817 //----------------------------------------------------------------------------
00818 BOOL CBSTR::Equals(BSTR bstr)
00819 {
00820    if(!m_bstr && !bstr)
00821       return TRUE;
00822    if(!m_bstr || !bstr)
00823       return FALSE;
00824
00825    if(SysStringLen(m_bstr) != SysStringLen(bstr))
00826       return FALSE;
00827
00828    return (lstrcmp(CTSTR(m_bstr), CTSTR(bstr)) == 0);
00829 }
00830
00831
00832 //----------------------------------------------------------------------------
00833 //
00834 // CopyString function
00835 //    Copies the specified BSTR string into this string object.
00836 //
00837 // Parameters:
00838 //    bstr:          The BSTR string to copy.
00839 //
00840 // Returns:          None.
00841 //
00842 //----------------------------------------------------------------------------
00843 void CBSTR::CopyString(BSTR bstr)
00844 {
00845    SAFEFREESTRING(m_bstr);
00846    if(bstr)
00847    {
00848       m_bstr = SysAllocStringLen(bstr, SysStringLen(bstr));
00849       ENSUREALLOC(m_bstr);
00850    }
00851 }
00852
00853
00854 //----------------------------------------------------------------------------
00855 //
00856 // Detach function
00857 //    Empties this string object, returning the BSTR for separate use.
00858 //
00859 // Parameters:       None.
00860 //
00861 // Returns:          The BSTR this object used to contain.
00862 //
00863 //----------------------------------------------------------------------------
00864 BSTR CBSTR::Detach()
00865 {
00866    BSTR bstr = m_bstr;
00867    m_bstr = NULL;
00868    return bstr;
00869 }
00870
00871
00872 //----------------------------------------------------------------------------
00873 //
00874 // Format method
00875 //    Formats the string into the formatter string and sets it to this object.
00876 //
00877 // Parameters:
00878 //    lpszFormatter: String to use for formatting.
00879 //    lpszInsert:    String to insert.
00880 //
00881 // Returns:          This object.
00882 //
00883 //----------------------------------------------------------------------------
00884 CBSTR& CBSTR::Format(LPTSTR lpszFormatter, LPTSTR lpszInsert)
00885 {
00886    _ASSERT(lpszFormatter);
00887    _ASSERT(lpszInsert);
00888    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + lstrlen(lpszInsert));
00889    wsprintf(lpszFinal, lpszFormatter, lpszInsert);
00890    Assign(lpszFinal);
00891    return *this;
00892 }
00893
00894 #endif
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string.h File Reference

#include <bmws_common.h>

Go to the source code of this file.

Compounds

class | CBSTR
class | CTSTR

Defines

#define | AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#define | FMTINT TEXT("%d")

Functions

void | StringToLowerCase (CHAR *pstrKey)

Define Documentation

#define AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_string.h.

#define FMTINT TEXT("%d")

Definition at line 22 of file bmws_string.h.

Function Documentation

void StringToLowerCase ( CHAR * pstrKey ) [inline]

Definition at line 222 of file bmws_string.h.

00223 {
00224    if(pstrKey)
00225    {
00226       while(*pstrKey)
00227       {
00228          if((*pstrKey >= 'A') && (*pstrKey <= 'Z'))
00229          {
00230             *pstrKey = 'a' + *pstrKey - 'A';
00231          }
00232          pstrKey++;
00233       }
00234    }
00235 }

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string.h Source File

bmws_string.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_string.h
00004 //    Classes to encapsulate local and BSTR strings.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_common.h>
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Default
00021 //----------------------------------------------------------------------------
00022 #define FMTINT TEXT("%d")
00023
00024
00025 class CBSTR;         // Forward definition
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // CTSTR class
00030 //    Encapsulates a local string (LPTSTR).
00031 //
00032 //----------------------------------------------------------------------------
00033 class CTSTR
00034 {
00035 public:
00036    CTSTR();
00037    CTSTR(UINT uID);
00038    CTSTR(UINT uID, UINT cch, BOOL);
00039    CTSTR(LPTSTR lpsz, BOOL bAssign = FALSE);
00040 #ifndef BMWS_NOOLE
00041    CTSTR(BSTR bstr);
00042 #endif
00043    CTSTR(const CTSTR& bmwslocal);
00044    CTSTR(BOOL, UINT cch);
00045 #ifdef BMWS_STRING_DLGITEM
00046    CTSTR(HWND hwndDlg, int nIDDlgItem);
00047 #endif
00048    ~CTSTR();
00049
00050
00051    //-------------------------------------------------------------------------
00052    //
00053    // LPTSTR operator
00054    //
00055    // Parameters:    None.
00056    //
00057    // Returns:       The string buffer.
00058    //
00059    //-------------------------------------------------------------------------
00060    operator LPTSTR() const
00061    {
00062       return m_lpsz;
00063    }
00064
00065
00066    //-------------------------------------------------------------------------
00067    //
00068    // Addr function
00069    //
00070    // Parameters:    None.
00071    //
00072    // Returns:       The address of the string buffer.
00073    //
00074    //-------------------------------------------------------------------------
00075    LPTSTR* Addr()
00076    {
00077       return &m_lpsz;
00078    }
00079
00080
00081    //-------------------------------------------------------------------------
00082    //
00083    // Len function
00084    //
00085    // Parameters:    None.
00086    //
00087    // Returns:       The length of the string.
00088    //
00089    //-------------------------------------------------------------------------
00090    int Len()
00091    {
00092       return (m_lpsz ? lstrlen(m_lpsz) : 0);
00093    }
00094
00095
00096    const CTSTR& operator=(const CTSTR& lpszSrc);
00097 #ifndef BMWS_NOOLE
00098    const CTSTR& operator=(const BSTR bstr);
00099 #endif
00100
00101    void Assign(LPSTR lpsz);
00102    void AssignW(LPWSTR lpwsz, int iLen = -1);
00103 #ifndef BMWS_NOOLE
00104    void Assign(BSTR bstr);
00105 #endif
00106    void Assign(UINT uID, UINT cch = 128);
00107    void Alloc(UINT cch);
00108    BOOL Equals(LPTSTR lpsz, int iLen);
00109    void CopyString(LPTSTR lpsz, int iLen = -1);
00110    CTSTR& Format(LPTSTR lpszFormatter, LPTSTR lpszInsert);
00111    CTSTR& Format(LPTSTR lpszFormatter, int iInsert);
00112
00113 #ifdef BMWS_STRING_DLGITEM
00114    void Assign(HWND hwndDlg, int nIDDlgItem);
00115 #endif
00116
00117 #ifdef BMWS_STRING_EXTRACTSUBSTRING
00118    BOOL ExtractSubString(CTSTR& lpszOut, int iSubString, TCHAR chSep);
00119 #endif
00120
00121 #ifdef BMWS_STRING_REPLACE
00122    int Replace(CTSTR& lpszOld, CTSTR& lpszNew);
00123 #endif
00124
00125    LPTSTR m_lpsz;    // Contained string
00126 };
00127
00128
00129 #ifndef BMWS_NOOLE
00130
00131 //----------------------------------------------------------------------------
00132 //
00133 // CBSTR class
00134 //    Encapsulates a BSTR.
00135 //
00136 //----------------------------------------------------------------------------
00137 class CBSTR
00138 {
00139 public:
00140    CBSTR();
00141    CBSTR(UINT uID);
00142    CBSTR(BSTR bstr, BOOL bAssign = FALSE);
00143    CBSTR(const CTSTR& bmwslocal);
00144    CBSTR(const CBSTR& bmwsbstr);
00145    CBSTR(LPTSTR lpszFormatter, int iVal);
00146    ~CBSTR();
00147
00148
00149    //-------------------------------------------------------------------------
00150    //
00151    // BSTR operator
00152    //
00153    // Parameters:    None.
00154    //
00155    // Returns:       The BSTR value.
00156    //
00157    //-------------------------------------------------------------------------
00158    operator BSTR() const
00159    {
00160       return m_bstr;
00161    }
00162
00163
00164    //-------------------------------------------------------------------------
00165    //
00166    // Addr function
00167    //
00168    // Parameters:    None.
00169    //
00170    // Returns:       The address of the BSTR value.
00171    //
00172    //-------------------------------------------------------------------------
00173    BSTR* Addr()
00174    {
00175       return &m_bstr;
00176    }
00177
00178
00179    //-------------------------------------------------------------------------
00180    //
00181    // Len function
00182    //
00183    // Parameters:    None.
00184    //
00185    // Returns:       The length of the string.
00186    //
00187    //-------------------------------------------------------------------------
00188    int Len()
00189    {
00190       return (m_bstr ? SysStringLen(m_bstr) : 0);
00191    }
00192
00193
00194    const CBSTR& operator=(const CBSTR& bstrSrc);
00195    const CBSTR& operator=(const BSTR bstr);
00196
00197    void Assign(UINT uID);
00198    void Assign(LPTSTR lpsz);
00199    void AssignW(LPWSTR lpwsz, int iLen = -1);
00200    BOOL Equals(BSTR bstr);
00201    void CopyString(BSTR bstr);
00202    BSTR Detach();
00203    CBSTR& Format(LPTSTR lpszFormatter, LPTSTR lpszInsert);
00204
00205    BSTR m_bstr;   // Contained string
00206 };
00207
00208 #endif
00209
00210
00211 //----------------------------------------------------------------------------
00212 //
00213 // StringToLowerCase function
00214 //    Converts a string to lower case.
00215 //
00216 // Parameters:
00217 //    pstrKey:       [in] ANSI character array to convert.
00218 //
00219 // Returns:          None.
00220 //
00221 //----------------------------------------------------------------------------
00222 inline void StringToLowerCase(CHAR *pstrKey)
00223 {
00224    if(pstrKey)
00225    {
00226       while(*pstrKey)
00227       {
00228          if((*pstrKey >= 'A') && (*pstrKey <= 'Z'))
00229          {
00230             *pstrKey = 'a' + *pstrKey - 'A';
00231          }
00232          pstrKey++;
00233       }
00234    }
00235 }
00236
00237
00238 #endif // !defined(AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string_res_lc.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_STRING_RESNOTFOUND 18051

Define Documentation

#define IDS_BMWS_STRING_RESNOTFOUND 18051

Definition at line 5 of file bmws_string_res_lc.h.

Referenced by CTSTR::Assign().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_string_res_lc.h Source File

bmws_string_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_string_lc.rc
00004 //
00005 #define IDS_BMWS_STRING_RESNOTFOUND     18051
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_stringarray.cpp File Reference

Go to the source code of this file.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_stringarray.cpp Source File

bmws_stringarray.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_stringarray.cpp
00004 //    Function to split strings and put the parts into an array.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008 #ifdef BMWS_STRINGARRAY_SPLIT
00009
00010
00011 //----------------------------------------------------------------------------
00012 // Includes
00013 //----------------------------------------------------------------------------
00014 #include <bmws_common.h>
00015 #include <bmws_stringarray.h>
00016
00017
00018 //----------------------------------------------------------------------------
00019 //
00020 // SplitString function
00021 //    Splits a string based upon a separator character and puts the substrings
00022 //    into an array.
00023 //
00024 // Parameters:
00025 //    alpsz:         The array into which substrings are placed.
00026 //    lpsz:          The string to split.
00027 //    chSep:         The character which deliminates substrings.
00028 //
00029 // Returns:          The number of substrings found.
00030 //
00031 //----------------------------------------------------------------------------
00032 int SplitString(CTSTRArray& alpsz, CTSTR& lpsz, TCHAR chSep)
00033 {
00034    alpsz.SetSize(0);
00035    if(!lpsz)
00036       return 0;
00037
00038    int cFound = 0;
00039    LPTSTR lpszString = lpsz;
00040    while(TRUE)
00041    {
00042       cFound++;
00043       LPTSTR lpchEnd = StrChr(lpszString, chSep);
00044       int nLen = ((lpchEnd == NULL) ? lstrlen(lpszString) : (int)(lpchEnd - lpszString))+1;
00045       CTSTR lpszTemp(TRUE, nLen);
00046       lstrcpyn(lpszTemp, lpszString, nLen);
00047       alpsz.Add(lpszTemp);
00048       if(lpchEnd == NULL)
00049          return cFound;
00050       lpszString = lpchEnd + 1;     // point past the separator
00051    }
00052 }
00053
00054
00055 #endif
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_stringarray.h File Reference

#include <bmws_string.h>
#include <bmws_array.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef CArray< CTSTR, CTSTR & > | CTSTRArray

Define Documentation

#define AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_stringarray.h.

Typedef Documentation

typedef CArray<CTSTR, CTSTR&> CTSTRArray

Definition at line 20 of file bmws_stringarray.h.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_stringarray.h Source File

bmws_stringarray.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_stringarray.h
00004 //    Definition of string array type.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_string.h>
00017 #include <bmws_array.h>
00018
00019
00020 typedef CArray<CTSTR, CTSTR&> CTSTRArray;
00021
00022
00023 #ifdef BMWS_STRINGARRAY_SPLIT
00024
00025 //----------------------------------------------------------------------------
00026 // BMWS_StringArray API function
00027 //----------------------------------------------------------------------------
00028 int SplitString(CTSTRArray& alpsz, CTSTR& lpsz, TCHAR chSep);
00029
00030 #endif
00031
00032
00033 #endif // !defined(AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:58 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport.cpp File Reference

Go to the source code of this file.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport.cpp Source File

bmws_techsupport.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_techsupport.cpp
00004 //    Class to encapsulate integrated technical support.
00005 //
00006 //----------------------------------------------------------------------------
00007 #ifdef 0
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_techsupport.h>
00013 #include <exdispid.h>
00014 //#include <bmws_techsupport_res.h>
00015 #include <bmws_techsupport_res_lc.h>
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Global and external variables
00020 //----------------------------------------------------------------------------
00021 //extern TCHAR g_szAppTitle[64]; // The title bar text
00022 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00023
00024
00025 BOOL CTechSupportDlg::s_bRegistered = FALSE; // Initially, window class is not registered
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // CTechSupportDlg constructor
00031 //
00032 // Parameters:
00033 //
00034 //----------------------------------------------------------------------------
00035 CTechSupportDlg::CTechSupportDlg()
00036 {
00037    m_pBrowserContainer = NULL;
00038    m_pHH = NULL;
00039    m_bNavigated = FALSE;
00040 }
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CTechSupportDlg destructor
00046 //
00047 //----------------------------------------------------------------------------
00048 CTechSupportDlg::~CTechSupportDlg()
00049 {
00050 }
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // Register function
00056 //    Registers the technical support window class with Windows.
00057 //
00058 // Parameters:       None.
00059 //
00060 // Returns:          None.
00061 //
00062 // Throws:           Exception if the class could not be registered.
00063 //
00064 //----------------------------------------------------------------------------
00065 void CTechSupportDlg::Register()
00066 {
00067    // Load the class name; register the class, if not already registered.
00068    //m_lpszClassName.Assign(IDS_BMWS_TECHSUPPORT_CLASSNAME);
00069    m_lpszClassName.Assign(TEXT("BMWSTechSupportWndClass"));
00070    if(s_bRegistered)
00071       return;
00072    RegisterWindowClass(m_lpszClassName, 0, (WNDPROC)TechSupportWndProc,
00073       /*MAKEINTRESOURCE(IDI_SOLPACK)*/NULL, (HBRUSH)(COLOR_3DFACE+1), NULL);
00074    s_bRegistered = TRUE;
00075 }
00076
00077
00078 //----------------------------------------------------------------------------
00079 //
00080 // Create function
00081 //    Creates the technical support window.
00082 //
00083 // Parameters:
00084 //    hwndParent:    Parent window handle.
00085 //
00086 // Returns:          TRUE or FALSE: whether the window was successfully
00087 //                   created or not.
00088 //
00089 //----------------------------------------------------------------------------
00090 BOOL CTechSupportDlg::Create(HWND hwndParent)
00091 {
00092    try
00093    {
00094       // Create the window.
00095       // Note: OnCreate() will be called before this function returns
00096       CreateWindowEx(0, m_lpszClassName, TEXT("Tech Support"), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN |
00097          WS_CLIPSIBLINGS | WS_POPUPWINDOW | WS_VISIBLE, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
00098          hwndParent, NULL, (LPVOID)this);
00099
00100       // Prepare to navigate the browser to the Technical Support HTML file
00101       TCHAR szHtml[MAX_PATH*2];
00102       TCHAR szModule[MAX_PATH*2];
00103
00104       //Construct URL to point to index.html inside of the resource module
00105       /*LoadString(g_hInst, IDS_RESPROTOCOL, szModule, sizeof(szModule));
00106       GetModuleFileName(g_hInstLC, szModule + lstrlen(szModule), sizeof(szModule) -
00107          lstrlen(szModule));
00108       lstrcpyn(szHtml, szModule, sizeof(szHtml));
00109       LoadString(g_hInst, IDS_MAINHTML, szHtml + lstrlen(szHtml),
00110          sizeof(szHtml) - lstrlen(szHtml));*/
00111
00112       // Remove below line to use the resource instead of the file
00113       lstrcpy(szHtml, TEXT("C:\\Programming\\Microsoft Visual Studio\\MyProjects\\bmws\\techsupport.html"));
00114
00115       VARIANT v;
00116       v.vt = VT_I4;
00117       v.lVal = navNoHistory | navNoReadFromCache | navNoWriteToCache;
00118       CHECKHRCOM(m_spBrowser->Navigate(CBSTR(szHtml), &v, NULL, NULL, NULL));
00119    }
00120    catch(CExcep *pE)
00121    {
00122       throw pE;
00123    }
00124
00125    return TRUE;
00126 }
00127
00128
00129 //----------------------------------------------------------------------------
00130 //
00131 // MainWndProc function
00132 //    Callback function that handles messages to the main window.
00133 //
00134 // Parameters:
00135 //    hWnd:          The main window handle.
00136 //    uMsg:          Message identifer.
00137 //    wParam:        Message-specific parameter.
00138 //    lParam:        Message-specific parameter.
00139 //
00140 // Returns:
00141 //    Depends on the message. If the message was not handled, the return value
00142 //    of DefWindowProc will be returned.
00143 //
00144 //----------------------------------------------------------------------------
00145 LRESULT CALLBACK CTechSupportDlg::TechSupportWndProc(HWND hWnd, UINT uMsg, WPARAM wParam,
00146                                                         LPARAM lParam)
00147 {
00148    // Retrieve "this" pointer from window handle
00149    CTechSupportDlg *pThis = (CTechSupportDlg*)GetWindowLong(hWnd, GWL_USERDATA);
00150
00151    try   // Windows-called code
00152    {
00153       switch(uMsg)
00154       {
00155          // Called before the window is created.
00156          case WM_NCCREATE:
00157             // Store the "this" pointer with the window handle
00158             pThis = (CTechSupportDlg*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00159             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00160             pThis->m_hWnd = hWnd;
00161             return TRUE;
00162
00163          // Called when the window is created
00164          case WM_CREATE:
00165             return (pThis->OnCreate() ? 0 : -1);
00166
00167          // Called when the user is sizing the window
00168          case WM_SIZE:
00169             if(wParam != SIZE_MINIMIZED)
00170                pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00171             return 0;
00172
00173          // Called before the window is destroyed
00174          case WM_DESTROY:
00175             pThis->OnDestroy();
00176             return 0;
00177       }
00178    }
00179    catch(CExcep *pE)
00180    {
00181       pE->Report();
00182       pE->Delete();
00183    }
00184
00185    // Let Windows process the message
00186    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00187 }
00188
00189
00190 //----------------------------------------------------------------------------
00191 //
00192 // OnCreate function
00193 //    Called in response to the WM_CREATE messsage. Sets up child windows and
00194 //    window-dependent objects.
00195 //
00196 // Parameters:       None.
00197 //
00198 // Returns:          TRUE if successful, FALSE if not.
00199 //
00200 //----------------------------------------------------------------------------
00201 BOOL CTechSupportDlg::OnCreate()
00202 {
00203    try
00204    {
00205       // Create and initialize the web browser container
00206       m_pBrowserContainer = new CBrowserContainer(FALSE);
00207       ENSUREALLOC(m_pBrowserContainer);
00208       m_pBrowserContainer->AddRef();
00209       m_pBrowserContainer->Init(m_hWnd, &m_spBrowser, (IEventSinkSite*)this, 0, NULL);
00210       m_spBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
00211    }
00212    catch(CExcep *pE)
00213    {
00214       pE->Report();
00215       pE->Delete();
00216       return FALSE;
00217    }
00218
00219    return TRUE;
00220 }
00221
00222
00223 //----------------------------------------------------------------------------
00224 //
00225 // OnSize function
00226 //    Called in response to the WM_SIZE messsage. Resizes and moves child
00227 //    windows, as necessary.
00228 //
00229 // Parameters:
00230 //    nWidth:        Width of the client area, in pixels.
00231 //    nHeight:       Height of the client area, in pixels.
00232 //    cyHelpPane:    The height of the help pane (if called during sizing).
00233 //                   Defaults to -1, in which case the stored help pane height
00234 //                   is used.
00235 //
00236 // Returns:          None.
00237 //
00238 //----------------------------------------------------------------------------
00239 void CTechSupportDlg::OnSize(int nWidth, int nHeight, int cyHelpPane)
00240 {
00241    // Position the browser container
00242    if(m_pBrowserContainer)
00243       m_pBrowserContainer->SetLocation(0, 0, nWidth, nHeight);
00244 }
00245
00246
00247 //----------------------------------------------------------------------------
00248 //
00249 // OnDestroy function
00250 //    Called in response to the WM_DESTROY messsage. Delete all created
00251 //    objects, free all memory, and post quit message.
00252 //
00253 // Parameters:       None.
00254 //
00255 // Returns:          None.
00256 //
00257 //----------------------------------------------------------------------------
00258 void CTechSupportDlg::OnDestroy()
00259 {
00260    // Delete the HTML helper object
00261    SAFEDELETE(m_pHH);
00262
00263    // Uninitialize and free the browser container
00264    m_spBrowser.Release();
00265    if(m_pBrowserContainer)
00266    {
00267       m_pBrowserContainer->Uninit();
00268       m_pBrowserContainer->Release();
00269       m_pBrowserContainer = NULL;
00270    }
00271 }
00272
00273
00274 //----------------------------------------------------------------------------
00275 //
00276 // IEventSinkSite::EventSink method
00277 //    Handles all events from the WebBrowser event sink.
00278 //
00279 // Parameters:
00280 //    lParam:        Optional site-specific parameter. (Not used)
00281 //    dispid:        The identifier of the event.
00282 //    pdispparams:   Pointer to any parameters associated with the event.
00283 //
00284 // Returns:          S_OK in all cases.
00285 //
00286 //----------------------------------------------------------------------------
00287 HRESULT CTechSupportDlg::EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS *pdispparams)
00288 {
00289    try   // Windows-called code
00290    {
00291       switch(dispid)
00292       {
00293          // The HTML document has reached the READYSTATE_COMPLETE state
00294          case DISPID_DOCUMENTCOMPLETE:
00295          {
00296             CDispatchPtr spDocDisp;
00297             CHECKHRCOM(m_spBrowser->get_Document(&spDocDisp));
00298             if(!spDocDisp)
00299                THROW(new CCOMExcep(E_FAIL));
00300             CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTMLDoc = spDocDisp;
00301             m_pHH = new CHTMLHelper(spHTMLDoc);
00302             ENSUREALLOC(m_pHH);
00303
00304             // Prevent the HTML from being selected or dragged
00305             //m_pHH->ProtectUI(IDS_EL_BODY);
00306
00307             // Initialize the HTML helper for adding document styles
00308             m_pHH->InitAddStyle();
00309          } break;
00310
00311          // Before navigation occurs in the browser
00312          case DISPID_BEFORENAVIGATE2:
00313             m_bNavigated = TRUE;
00314             /*if(m_bNavigated)
00315             {
00316                // We've already shown our UI HTML document, so this must be a link, which should
00317                // be displayed in a new window
00318                *(pdispparams->rgvarg[0].pboolVal) = VARIANT_TRUE;
00319                if(pdispparams->rgvarg[5].vt == (VT_VARIANT | VT_BYREF))
00320                {
00321                   VARIANT *pvar = pdispparams->rgvarg[5].pvarVal;
00322                   if(pvar->vt == VT_BSTR)
00323                   {
00324                      CHECKHRCOM(m_spBrowser->Navigate(pvar->bstrVal,
00325                         &(CVariant(navOpenInNewWindow)), NULL, NULL, NULL));
00326                   }
00327                }
00328             } else   // This is the first navigation (to our UI HTML document)
00329                m_bNavigated = TRUE;*/
00330             break;
00331       }
00332    }
00333    catch(CExcep *pE)
00334    {
00335       pE->Report();
00336       pE->Delete();
00337    }
00338    return S_OK;
00339 }
00340 #endif
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport.h File Reference

#include <bmws_dlg.h>
#include <bmws_browsercontainer.h>
#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class CTechSupportDlg

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport.h Source File

bmws_techsupport.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_techsupport.h
00004 //    Class to encapsulate integrated technical support.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_TECHSUPPORT_H_
00010 #define __BMWS_TECHSUPPORT_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_dlg.h>
00017 #include <bmws_browsercontainer.h>
00018 #include <bmws_htmlhelpers.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 //
00023 // CTechSupportDlg class
00024 //    Encapsulates the technical support dialog box.
00025 //
00026 //----------------------------------------------------------------------------
00027 class CTechSupportDlg : public CDlg, public IEventSinkSite
00028 {
00029 public:
00030    CTechSupportDlg();
00031    virtual ~CTechSupportDlg();
00032
00033    INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00034
00035    // IEventSinkSite method
00036    HRESULT EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams);
00037
00038 protected:
00039    CBrowserContainer *m_pBrowserContainer;   // Browser container object
00040    CWebBrowser2Ptr m_spBrowser;              // Web browser interface
00041    CHTMLHelper *m_pHH;                       // HTML Helper object
00042    BOOL m_bNavigated;                        // Whether the page has been navigated to
00043 };
00044
00045
00046 #endif //__BMWS_TECHSUPPORT_H_
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_TECHSUPP_REGMSG 18851
#define | IDS_BMWS_TECHSUPP_UNREGMSG 18852

Define Documentation

#define IDS_BMWS_TECHSUPP_REGMSG 18851

Definition at line 5 of file bmws_techsupport_res_lc.h.

#define IDS_BMWS_TECHSUPP_UNREGMSG 18852

Definition at line 6 of file bmws_techsupport_res_lc.h.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_techsupport_res_lc.h Source File

bmws_techsupport_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_techsupport_lc.rc
00004 //
00005 #define IDS_BMWS_TECHSUPP_REGMSG        18851
00006 #define IDS_BMWS_TECHSUPP_UNREGMSG      18852
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_tlb.cpp File Reference

#include <bmws_common.h>
#include <bmws_tlb.h>
#include <bmws_error.h>
#include <bmws_string.h>
#include <bmws_registry.h>
#include <bmws_lib.h>

Go to the source code of this file.

Typedefs

typedef HRESULT STDAPICALLTYPE | UNREGTYPELIBFN (REFGUID libID, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)

Functions

HRESULT | RegisterTLB (REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)
HRESULT | UnregisterTLB (REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)

Variables

HINSTANCE | g_hInst

Typedef Documentation

typedef HRESULT STDAPICALLTYPE UNREGTYPELIBFN(REFGUID libID, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)

Definition at line 29 of file bmws_tlb.cpp.

Referenced by UnregisterTLB().

Function Documentation

HRESULT RegisterTLB | ( | REFGUID | rlibid,
 |  | WORD | wVerMajor,
 |  | WORD | wVerMinor
 | ) |

Definition at line 46 of file bmws_tlb.cpp.

References ARRAYSIZE, CHECKHRCOM, g_hInst, and SAFERELEASE.

Referenced by DllRegisterServer(), CSolpackApp::Register(), and CSolpackApp::Run().

00047 {
00048    HRESULT hr = CoInitialize(NULL);
00049    if(FAILED(hr))
00050       return hr;
00051
00052    ITypeLib *pTypeLib = NULL;
00053    try
00054    {
00055       if(FAILED(LoadRegTypeLib(rlibid, wVerMajor, wVerMinor, 0x00, &pTypeLib)))
00056       {
00057          TCHAR szModule[512];
00058          OLECHAR wszModule[512];
00059
00060          GetModuleFileName(g_hInst, szModule, sizeof(szModule));
00061
00062          #ifdef UNICODE
00063             lstrcpy(wszModule, szModule);
00064          #else
00065             int iLen = lstrlenA(szModule) + 1;
00066             MultiByteToWideChar(CP_ACP, 0, szModule, -1, wszModule, ARRAYSIZE(wszModule));
00067             wszModule[iLen-1] = 0;
00068          #endif
00069
00070          CHECKHRCOM(LoadTypeLib(wszModule, &pTypeLib));
00071          CHECKHRCOM(RegisterTypeLib(pTypeLib, wszModule, NULL));
00072       }
00073       SAFERELEASE(pTypeLib);
00074       CoUninitialize();
00075    }
00076    catch(CExcep *pE)
00077    {
00078       SAFERELEASE(pTypeLib);
00079       pE->Report();
00080       pE->Delete();
00081       CoUninitialize();
00082       return E_FAIL;
00083    }
00084
00085    return S_OK;
00086 }

HRESULT UnregisterTLB | ( | REFGUID | rlibid,
 |  | WORD | wVerMajor,
 |  | WORD | wVerMinor
 | ) |

Definition at line 103 of file bmws_tlb.cpp.

References UNREGTYPELIBFN.

Referenced by DllUnregisterServer(), and CSolpackApp::Unregister().

00104 {
00105    HRESULT hr = S_OK;
00106    CLib libOLEAUT32(TEXT("OLEAUT32.DLL"));
00107    if(libOLEAUT32)
00108    {
00109       UNREGTYPELIBFN *pfn = (UNREGTYPELIBFN*)GetProcAddress(libOLEAUT32, TEXT("UnRegisterTypeLib"));
00110       if(pfn)
00111       {
00112          hr = (*pfn)(rlibid, wVerMajor, wVerMinor, 0x00, SYS_WIN32);
00113       }
00114    }
00115
00116    return hr;
00117 }

Variable Documentation

HINSTANCE g_hInst

Definition at line 23 of file bmws_tlb.cpp.

Referenced by RegisterTLB().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_tlb.cpp Source File

bmws_tlb.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_tlb.cpp
00004 //    Functions to register and unregister type libraries.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_common.h>
00013 #include <bmws_tlb.h>
00014 #include <bmws_error.h>
00015 #include <bmws_string.h>
00016 #include <bmws_registry.h>
00017 #include <bmws_lib.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // External and static variables
00022 //----------------------------------------------------------------------------
00023 extern HINSTANCE g_hInst;           // Application instance handle
00024
00025
00026 //----------------------------------------------------------------------------
00027 // OLEAUT32 UnRegisterTypeLib function
00028 //----------------------------------------------------------------------------
00029 typedef HRESULT STDAPICALLTYPE UNREGTYPELIBFN (REFGUID libID, WORD wVerMajor, WORD wVerMinor,
00030                                                LCID lcid, SYSKIND syskind);
00031
00032
00033 //----------------------------------------------------------------------------
00034 //
00035 // RegisterTLB function
00036 //    Ensures that a type library is registered in the registry.
00037 //
00038 // Parameters:
00039 //    rlibid:              LIBID of the type library.
00040 //    wVerMajor:           Major version number of the type library.
00041 //    wVerMinor:           Minor version number of the type library.
00042 //
00043 // Returns:                A standard COM success or error value.
00044 //
00045 //----------------------------------------------------------------------------
00046 HRESULT RegisterTLB(REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)
00047 {
00048    HRESULT hr = CoInitialize(NULL);
00049    if(FAILED(hr))
00050       return hr;
00051
00052    ITypeLib *pTypeLib = NULL;
00053    try
00054    {
00055       if(FAILED(LoadRegTypeLib(rlibid, wVerMajor, wVerMinor, 0x00, &pTypeLib)))
00056       {
00057          TCHAR szModule[512];
00058          OLECHAR wszModule[512];
00059
00060          GetModuleFileName(g_hInst, szModule, sizeof(szModule));
00061
00062          #ifdef UNICODE
00063             lstrcpy(wszModule, szModule);
00064          #else
00065             int iLen = lstrlenA(szModule) + 1;
00066             MultiByteToWideChar(CP_ACP, 0, szModule, -1, wszModule, ARRAYSIZE(wszModule));
00067             wszModule[iLen-1] = 0;
00068          #endif
00069
00070          CHECKHRCOM(LoadTypeLib(wszModule, &pTypeLib));
00071          CHECKHRCOM(RegisterTypeLib(pTypeLib, wszModule, NULL));
00072       }
00073       SAFERELEASE(pTypeLib);
00074       CoUninitialize();
00075    }
00076    catch(CExcep *pE)
00077    {
00078       SAFERELEASE(pTypeLib);
00079       pE->Report();
00080       pE->Delete();
00081       CoUninitialize();
00082       return E_FAIL;
00083    }
00084
00085    return S_OK;
00086 }
00087
00088
00089 //----------------------------------------------------------------------------
00090 //
00091 // UnregisterTLB function
00092 //    Removes a type library from the registry, if the operating system
00093 //    supports this operation.
00094 //
00095 // Parameters:
00096 //    rlibid:              LIBID of the type library.
00097 //    wVerMajor:           Major version number of the type library.
00098 //    wVerMinor:           Minor version number of the type library.
00099 //
00100 // Returns:                A standard COM success or error value.
00101 //
00102 //----------------------------------------------------------------------------
00103 HRESULT UnregisterTLB(REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)
00104 {
00105    HRESULT hr = S_OK;
00106    CLib libOLEAUT32(TEXT("OLEAUT32.DLL"));
00107    if(libOLEAUT32)
00108    {
00109       UNREGTYPELIBFN *pfn = (UNREGTYPELIBFN*)GetProcAddress(libOLEAUT32, TEXT("UnRegisterTypeLib"));
00110       if(pfn)
00111       {
00112          hr = (*pfn)(rlibid, wVerMajor, wVerMinor, 0x00, SYS_WIN32);
00113       }
00114    }
00115
00116    return hr;
00117 }
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_tlb.h File Reference

Go to the source code of this file.

Defines

#define | AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Functions

HRESULT | RegisterTLB (REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)
HRESULT | UnregisterTLB (REFGUID rlibid, WORD wVerMajor, WORD wVerMinor)

Define Documentation

#define AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_tlb.h.

Function Documentation

HRESULT RegisterTLB | ( | REFGUID | rlibid,
 |  | WORD | wVerMajor,
 |  | WORD | wVerMinor
 | ) |

Definition at line 46 of file bmws_tlb.cpp.

References ARRAYSIZE, CHECKHRCOM, g_hInst, and SAFERELEASE.

Referenced by DllRegisterServer(), CSolpackApp::Register(), and CSolpackApp::Run().

00047 {
00048    HRESULT hr = CoInitialize(NULL);
00049    if(FAILED(hr))
00050       return hr;
00051
00052    ITypeLib *pTypeLib = NULL;
00053    try
00054    {
00055       if(FAILED(LoadRegTypeLib(rlibid, wVerMajor, wVerMinor, 0x00, &pTypeLib)))
00056       {
00057          TCHAR szModule[512];
00058          OLECHAR wszModule[512];
00059
00060          GetModuleFileName(g_hInst, szModule, sizeof(szModule));
00061
00062          #ifdef UNICODE
00063             lstrcpy(wszModule, szModule);
00064          #else
00065             int iLen = lstrlenA(szModule) + 1;
00066             MultiByteToWideChar(CP_ACP, 0, szModule, -1, wszModule, ARRAYSIZE(wszModule));
00067             wszModule[iLen-1] = 0;
00068          #endif
00069
00070          CHECKHRCOM(LoadTypeLib(wszModule, &pTypeLib));
00071          CHECKHRCOM(RegisterTypeLib(pTypeLib, wszModule, NULL));
00072       }
00073       SAFERELEASE(pTypeLib);
00074       CoUninitialize();
00075    }
00076    catch(CExcep *pE)
00077    {
00078       SAFERELEASE(pTypeLib);
00079       pE->Report();
00080       pE->Delete();
00081       CoUninitialize();
00082       return E_FAIL;
00083    }
00084
00085    return S_OK;
00086 }

HRESULT UnregisterTLB | ( | REFGUID | rlibid,
 |  | WORD | wVerMajor,
 |  | WORD | wVerMinor
 | ) |

Definition at line 103 of file bmws_tlb.cpp.

References UNREGTYPELIBFN.

Referenced by DllUnregisterServer(), and CSolpackApp::Unregister().

00104 {
00105    HRESULT hr = S_OK;
00106    CLib libOLEAUT32(TEXT("OLEAUT32.DLL"));
00107    if(libOLEAUT32)
00108    {
00109       UNREGTYPELIBFN *pfn = (UNREGTYPELIBFN*)GetProcAddress(libOLEAUT32, TEXT("UnRegisterTypeLib"));
00110       if(pfn)
00111       {
00112          hr = (*pfn)(rlibid, wVerMajor, wVerMinor, 0x00, SYS_WIN32);
00113       }
00114    }
00115
00116    return hr;
00117 }

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_tlb.h Source File

bmws_tlb.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_tlb.h
00004 //    Functions to register and unregister type libraries.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // BMWS_TLB API functions
00015 //----------------------------------------------------------------------------
00016 HRESULT RegisterTLB(REFGUID rlibid, WORD wVerMajor, WORD wVerMinor);
00017 HRESULT UnregisterTLB(REFGUID rlibid, WORD wVerMajor, WORD wVerMinor);
00018
00019
00020 #endif // !defined(AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_trackmemalloc.cpp File Reference

#include <objbase.h>

Go to the source code of this file.

Functions

void | BMWSMemInit ()
LPVOID | BMWSMemAlloc (ULONG nBytes)
void | BMWSMemFree (LPVOID lpv)
void | BMWSMemUninit ()

Variables

IMalloc * | g_pMalloc = NULL
ULONG | g_nBytesAlloc = 0
ULONG | g_nBytesFreed = 0
ULONG | g_nBytesMax = 0
TCHAR | g_szModule [10]

Function Documentation

LPVOID BMWSMemAlloc ( ULONG nBytes )

Definition at line 71 of file bmws_trackmemalloc.cpp.

References g_nBytesAlloc, g_nBytesFreed, g_nBytesMax, g_pMalloc, and g_szModule.

00072 {
00073    LPVOID lpv = g_pMalloc->Alloc(nBytes);
00074    if(!lpv)
00075       return NULL;
00076    ULONG ul = g_pMalloc->GetSize(lpv);
00077    g_nBytesAlloc += ul;
00078    ULONG ud = g_nBytesAlloc - g_nBytesFreed;
00079    if(ud > g_nBytesMax)
00080       g_nBytesMax = ud;
00081 #ifdef BMWS_OUTPUTMEMALLOC
00082    TCHAR szBuf[256];
00083    wsprintf(szBuf, TEXT("%s: Allocating %d bytes (%d requested)\n"), g_szModule, ul, nBytes);
00084    OutputDebugString(szBuf);
00085 #endif
00086    return lpv;
00087 }

void BMWSMemFree ( LPVOID lpv )

Definition at line 101 of file bmws_trackmemalloc.cpp.

References g_nBytesFreed, g_pMalloc, and g_szModule.

00102 {
00103    ULONG ul = g_pMalloc->GetSize(lpv);
00104    g_nBytesFreed += ul;
00105    g_pMalloc->Free(lpv);
00106 #ifdef BMWS_OUTPUTMEMALLOC
00107    TCHAR szBuf[256];
00108    wsprintf(szBuf, TEXT("%s: Freeing %d bytes\n"), g_szModule, ul);
00109    OutputDebugString(szBuf);
00110 #endif
00111 }

void BMWSMemInit ( )

Definition at line 53 of file bmws_trackmemalloc.cpp.

References g_pMalloc.

Referenced by CSolpackApp::CSolpackApp(), and InitModule().

00054 {
00055    if(!g_pMalloc)
00056       CoGetMalloc(1, &g_pMalloc);
00057 }

void BMWSMemUninit ( )

Definition at line 124 of file bmws_trackmemalloc.cpp.

References g_nBytesAlloc, g_nBytesFreed, g_nBytesMax, g_pMalloc, and g_szModule.

Referenced by DllMain(), and CSolpackApp::~CSolpackApp().

00125 {
00126    if(g_pMalloc)
00127    {
00128       TCHAR szBuf[256];
00129       wsprintf(szBuf, TEXT("\n--- %s -----------------------------------------------------------------\n\n"), g_szModule);
00130       OutputDebugString(szBuf);
00131       wsprintf(szBuf, TEXT("Allocated:  \t%d\nFreed:      \t%d\nDifference: \t%d\nMaximum:    \t%d\n\n"),
00132          g_nBytesAlloc, g_nBytesFreed, g_nBytesAlloc-g_nBytesFreed, g_nBytesMax);
00133       OutputDebugString(szBuf);
00134       g_pMalloc->Release();
00135       g_pMalloc = NULL;
00136 #ifdef BMWS_USEPOINTER
00137       wsprintf(szBuf, TEXT("Objects Created:  \t%d\nObjects Deleted:  \t%d\nDifference:       \t%d\n\n"),
00138          CRefCount::m_scTotalCreated, CRefCount::m_scTotalDeleted, CRefCount::m_scTotalCreated -
00139          CRefCount::m_scTotalDeleted);
00140       OutputDebugString(szBuf);
00141 #endif
00142 #ifdef BMWS_USEEVENTSINK
00143       wsprintf(szBuf, TEXT("EventSinks Created:  \t%d\nEventSinks Deleted:  \t%d\nDifference:          \t%d\n\n"),
00144          CEventSink::m_scTotalCreated, CEventSink::m_scTotalDeleted, CEventSink::m_scTotalCreated -
00145          CEventSink::m_scTotalDeleted);
00146       OutputDebugString(szBuf);
00147 #endif
00148 #ifdef BMWS_USEEVENTHANDLER
00149       wsprintf(szBuf, TEXT("EventHandlers Created:  \t%d\nEventHandlers Deleted:  \t%d\nDifference:             \t%d\n\n"),
00150          CEventHandler::m_scTotalCreated, CEventHandler::m_scTotalDeleted,
00151          CEventHandler::m_scTotalCreated - CEventHandler::m_scTotalDeleted);
00152       OutputDebugString(szBuf);
00153 #endif
00154 #ifdef BMWS_USEUNKBASE
00155       wsprintf(szBuf, TEXT("UnkBase Objects Created:  \t%d\nUnkBase Objects Deleted:  \t%d\nDifference:               \t%d\n\n"),
00156          CUnkBase::m_scTotalCreated, CUnkBase::m_scTotalDeleted,
00157          CUnkBase::m_scTotalCreated - CUnkBase::m_scTotalDeleted);
00158       OutputDebugString(szBuf);
00159 #endif
00160 #ifdef BMWS_USEDISPBASE
00161       wsprintf(szBuf, TEXT("DispBase Objects Created:  \t%d\nDispBase Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00162          CDispBase::m_scTotalCreated, CDispBase::m_scTotalDeleted,
00163          CDispBase::m_scTotalCreated - CDispBase::m_scTotalDeleted);
00164       OutputDebugString(szBuf);
00165 #endif
00166 #ifdef BMWS_USESCRIPTFN
00167       wsprintf(szBuf, TEXT("ScriptFn Objects Created:  \t%d\nScriptFn Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00168          CScriptFn::m_scTotalCreated, CScriptFn::m_scTotalDeleted,
00169          CScriptFn::m_scTotalCreated - CScriptFn::m_scTotalDeleted);
00170       OutputDebugString(szBuf);
00171 #endif
00172       OutputDebugString(TEXT("------------------------------------------------------------------------------\n\n"));
00173    }
00174 }

Variable Documentation

ULONG g_nBytesAlloc = 0

Definition at line 37 of file bmws_trackmemalloc.cpp.

Referenced by BMWSMemAlloc(), and BMWSMemUninit().

ULONG g_nBytesFreed = 0

Definition at line 38 of file bmws_trackmemalloc.cpp.

Referenced by BMWSMemAlloc(), BMWSMemFree(), and BMWSMemUninit().

ULONG g_nBytesMax = 0

Definition at line 39 of file bmws_trackmemalloc.cpp.

Referenced by BMWSMemAlloc(), and BMWSMemUninit().

IMalloc* g_pMalloc = NULL

Definition at line 36 of file bmws_trackmemalloc.cpp.

Referenced by BMWSMemAlloc(), BMWSMemFree(), BMWSMemInit(), and BMWSMemUninit().

TCHAR g_szModule[10]

Definition at line 40 of file bmws_trackmemalloc.cpp.

Referenced by BMWSMemAlloc(), BMWSMemFree(), and BMWSMemUninit().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_trackmemalloc.cpp Source File

bmws_trackmemalloc.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_trackmemalloc.cpp
00004 //    Function to track memory allocation.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #ifdef BMWS_USEPOINTER
00013 #include <bmws_pointer.h>
00014 #endif
00015 #ifdef BMWS_USEEVENTSINK
00016 #include <bmws_eventsink.h>
00017 #endif
00018 #ifdef BMWS_USEEVENTHANDLER
00019 #include <bmws_eventhandler.h>
00020 #endif
00021 #ifdef BMWS_USEDISPBASE
00022 #include <bmws_dispbase.h>
00023 #endif
00024 #ifdef BMWS_USEUNKBASE
00025 #include <bmws_unkbase.h>
00026 #endif
00027 #ifdef BMWS_USESCRIPTFN
00028 #include <bmws_scriptfn.h>
00029 #endif
00030 #include <objbase.h>
00031
00032
00033 //----------------------------------------------------------------------------
00034 // Global variables
00035 //----------------------------------------------------------------------------
00036 IMalloc *g_pMalloc = NULL;    // Task memory allocator
00037 ULONG g_nBytesAlloc = 0;      // Bytes allocated so far
00038 ULONG g_nBytesFreed = 0;      // Bytes freed so far
00039 ULONG g_nBytesMax = 0;        // Maximum bytes allocated at one time
00040 extern TCHAR g_szModule[10];  // Module name for debugging
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // BMWSMemInit function
00046 //    Initializes the BMWS memory tracker.
00047 //
00048 // Parameters:       None.
00049 //
00050 // Returns:          None.
00051 //
00052 //----------------------------------------------------------------------------
00053 void BMWSMemInit()
00054 {
00055    if(!g_pMalloc)
00056       CoGetMalloc(1, &g_pMalloc);
00057 }
00058
00059
00060 //----------------------------------------------------------------------------
00061 //
00062 // BMWSMemAlloc function
00063 //    Allocates a range of memory.
00064 //
00065 // Parameters:
00066 //    nBytes:        Length of the block of memory.
00067 //
00068 // Returns:          Pointer to the range of memory.
00069 //
00070 //----------------------------------------------------------------------------
00071 LPVOID BMWSMemAlloc(ULONG nBytes)
00072 {
00073    LPVOID lpv = g_pMalloc->Alloc(nBytes);
00074    if(!lpv)
00075       return NULL;
00076    ULONG ul = g_pMalloc->GetSize(lpv);
00077    g_nBytesAlloc += ul;
00078    ULONG ud = g_nBytesAlloc - g_nBytesFreed;
00079    if(ud > g_nBytesMax)
00080       g_nBytesMax = ud;
00081 #ifdef BMWS_OUTPUTMEMALLOC
00082    TCHAR szBuf[256];
00083    wsprintf(szBuf, TEXT("%s: Allocating %d bytes (%d requested)\n"), g_szModule, ul, nBytes);
00084    OutputDebugString(szBuf);
00085 #endif
00086    return lpv;
00087 }
00088
00089
00090 //----------------------------------------------------------------------------
00091 //
00092 // BMWSMemFree function
00093 //    Frees a range of memory.
00094 //
00095 // Parameters:
00096 //    lpv:           Pointer to the block of memory.
00097 //
00098 // Returns:          None.
00099 //
00100 //----------------------------------------------------------------------------
00101 void BMWSMemFree(LPVOID lpv)
00102 {
00103    ULONG ul = g_pMalloc->GetSize(lpv);
00104    g_nBytesFreed += ul;
00105    g_pMalloc->Free(lpv);
00106 #ifdef BMWS_OUTPUTMEMALLOC
00107    TCHAR szBuf[256];
00108    wsprintf(szBuf, TEXT("%s: Freeing %d bytes\n"), g_szModule, ul);
00109    OutputDebugString(szBuf);
00110 #endif
00111 }
00112
00113
00114 //----------------------------------------------------------------------------
00115 //
00116 // BMWSMemUninit function
00117 //    Uninitializes the BMWS memory tracker.
00118 //
00119 // Parameters:       None.
00120 //
00121 // Returns:          None.
00122 //
00123 //----------------------------------------------------------------------------
00124 void BMWSMemUninit()
00125 {
00126    if(g_pMalloc)
00127    {
00128       TCHAR szBuf[256];
00129       wsprintf(szBuf, TEXT("\n--- %s -----------------------------------------------------------------\n\n"), g_szModule);
00130       OutputDebugString(szBuf);
00131       wsprintf(szBuf, TEXT("Allocated:  \t%d\nFreed:      \t%d\nDifference: \t%d\nMaximum:    \t%d\n\n"),
00132          g_nBytesAlloc, g_nBytesFreed, g_nBytesAlloc-g_nBytesFreed, g_nBytesMax);
00133       OutputDebugString(szBuf);
00134       g_pMalloc->Release();
00135       g_pMalloc = NULL;
00136 #ifdef BMWS_USEPOINTER
00137       wsprintf(szBuf, TEXT("Objects Created:  \t%d\nObjects Deleted:  \t%d\nDifference:       \t%d\n\n"),
00138          CRefCount::m_scTotalCreated, CRefCount::m_scTotalDeleted, CRefCount::m_scTotalCreated -
00139          CRefCount::m_scTotalDeleted);
00140       OutputDebugString(szBuf);
00141 #endif
00142 #ifdef BMWS_USEEVENTSINK
00143       wsprintf(szBuf, TEXT("EventSinks Created:  \t%d\nEventSinks Deleted:  \t%d\nDifference:          \t%d\n\n"),
00144          CEventSink::m_scTotalCreated, CEventSink::m_scTotalDeleted, CEventSink::m_scTotalCreated -
00145          CEventSink::m_scTotalDeleted);
00146       OutputDebugString(szBuf);
00147 #endif
00148 #ifdef BMWS_USEEVENTHANDLER
00149       wsprintf(szBuf, TEXT("EventHandlers Created:  \t%d\nEventHandlers Deleted:  \t%d\nDifference:             \t%d\n\n"),
00150          CEventHandler::m_scTotalCreated, CEventHandler::m_scTotalDeleted,
00151          CEventHandler::m_scTotalCreated - CEventHandler::m_scTotalDeleted);
00152       OutputDebugString(szBuf);
00153 #endif
00154 #ifdef BMWS_USEUNKBASE
00155       wsprintf(szBuf, TEXT("UnkBase Objects Created:  \t%d\nUnkBase Objects Deleted:  \t%d\nDifference:               \t%d\n\n"),
00156          CUnkBase::m_scTotalCreated, CUnkBase::m_scTotalDeleted,
00157          CUnkBase::m_scTotalCreated - CUnkBase::m_scTotalDeleted);
00158       OutputDebugString(szBuf);
00159 #endif
00160 #ifdef BMWS_USEDISPBASE
00161       wsprintf(szBuf, TEXT("DispBase Objects Created:  \t%d\nDispBase Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00162          CDispBase::m_scTotalCreated, CDispBase::m_scTotalDeleted,
00163          CDispBase::m_scTotalCreated - CDispBase::m_scTotalDeleted);
00164       OutputDebugString(szBuf);
00165 #endif
00166 #ifdef BMWS_USESCRIPTFN
00167       wsprintf(szBuf, TEXT("ScriptFn Objects Created:  \t%d\nScriptFn Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00168          CScriptFn::m_scTotalCreated, CScriptFn::m_scTotalDeleted,
00169          CScriptFn::m_scTotalCreated - CScriptFn::m_scTotalDeleted);
00170       OutputDebugString(szBuf);
00171 #endif
00172       OutputDebugString(TEXT("------------------------------------------------------------------------------\n\n"));
00173    }
00174 }
00175
00176
00177 #ifdef BMWS_MEMSPEW
00178
00179 //----------------------------------------------------------------------------
00180 //
00181 // BMWSMemSpew function
00182 //    Outputs memory and object allocation so far. BMWS memory tracker.
00183 //
00184 // Parameters:       None.
00185 //
00186 // Returns:          None.
00187 //
00188 //----------------------------------------------------------------------------
00189 void BMWSMemSpew()
00190 {
00191    if(g_pMalloc)
00192    {
00193       TCHAR szBuf[256];
00194       wsprintf(szBuf, TEXT("\n--- %s -----------------------------------------------------------------\n\n"), g_szModule);
00195       OutputDebugString(szBuf);
00196       wsprintf(szBuf, TEXT("Allocated:  \t%d\nFreed:      \t%d\nDifference: \t%d\n\n"),
00197          g_nBytesAlloc, g_nBytesFreed, g_nBytesAlloc-g_nBytesFreed);
00198       OutputDebugString(szBuf);
00199 #ifdef BMWS_USEPOINTER
00200       wsprintf(szBuf, TEXT("Objects Created:  \t%d\nObjects Deleted:  \t%d\nDifference:       \t%d\n\n"),
00201          CRefCount::m_scTotalCreated, CRefCount::m_scTotalDeleted, CRefCount::m_scTotalCreated -
00202          CRefCount::m_scTotalDeleted);
00203       OutputDebugString(szBuf);
00204 #endif
00205 #ifdef BMWS_USEEVENTSINK
00206       wsprintf(szBuf, TEXT("EventSinks Created:  \t%d\nEventSinks Deleted:  \t%d\nDifference:          \t%d\n\n"),
00207          CEventSink::m_scTotalCreated, CEventSink::m_scTotalDeleted, CEventSink::m_scTotalCreated -
00208          CEventSink::m_scTotalDeleted);
00209       OutputDebugString(szBuf);
00210 #endif
00211 #ifdef BMWS_USEEVENTHANDLER
00212       wsprintf(szBuf, TEXT("EventHandlers Created:  \t%d\nEventHandlers Deleted:  \t%d\nDifference:             \t%d\n\n"),
00213          CEventHandler::m_scTotalCreated, CEventHandler::m_scTotalDeleted,
00214          CEventHandler::m_scTotalCreated - CEventHandler::m_scTotalDeleted);
00215       OutputDebugString(szBuf);
00216 #endif
00217 #ifdef BMWS_USEUNKBASE
00218       wsprintf(szBuf, TEXT("UnkBase Objects Created:  \t%d\nUnkBase Objects Deleted:  \t%d\nDifference:               \t%d\n\n"),
00219          CUnkBase::m_scTotalCreated, CUnkBase::m_scTotalDeleted,
00220          CUnkBase::m_scTotalCreated - CUnkBase::m_scTotalDeleted);
00221       OutputDebugString(szBuf);
00222 #endif
00223 #ifdef BMWS_USEDISPBASE
00224       wsprintf(szBuf, TEXT("DispBase Objects Created:  \t%d\nDispBase Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00225          CDispBase::m_scTotalCreated, CDispBase::m_scTotalDeleted,
00226          CDispBase::m_scTotalCreated - CDispBase::m_scTotalDeleted);
00227       OutputDebugString(szBuf);
00228 #endif
00229       OutputDebugString(TEXT("------------------------------------------------------------------------------\n\n"));
00230    }
00231 }
00232
00233 #endif
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_trackmemalloc.h File Reference

Go to the source code of this file.

Defines

#define | AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Functions

void | BMWSMemInit ()
LPVOID | BMWSMemAlloc (ULONG nBytes)
void | BMWSMemFree (LPVOID lpv)
void | BMWSMemUninit ()

Define Documentation

#define AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_trackmemalloc.h.

Function Documentation

LPVOID BMWSMemAlloc ( ULONG nBytes )

Definition at line 71 of file bmws_trackmemalloc.cpp.

References g_nBytesAlloc, g_nBytesFreed, g_nBytesMax, g_pMalloc, and g_szModule.

00072 {
00073    LPVOID lpv = g_pMalloc->Alloc(nBytes);
00074    if(!lpv)
00075       return NULL;
00076    ULONG ul = g_pMalloc->GetSize(lpv);
00077    g_nBytesAlloc += ul;
00078    ULONG ud = g_nBytesAlloc - g_nBytesFreed;
00079    if(ud > g_nBytesMax)
00080       g_nBytesMax = ud;
00081 #ifdef BMWS_OUTPUTMEMALLOC
00082    TCHAR szBuf[256];
00083    wsprintf(szBuf, TEXT("%s: Allocating %d bytes (%d requested)\n"), g_szModule, ul, nBytes);
00084    OutputDebugString(szBuf);
00085 #endif
00086    return lpv;
00087 }

void BMWSMemFree ( LPVOID lpv )

Definition at line 101 of file bmws_trackmemalloc.cpp.

References g_nBytesFreed, g_pMalloc, and g_szModule.

00102 {
00103    ULONG ul = g_pMalloc->GetSize(lpv);
00104    g_nBytesFreed += ul;
00105    g_pMalloc->Free(lpv);
00106 #ifdef BMWS_OUTPUTMEMALLOC
00107    TCHAR szBuf[256];
00108    wsprintf(szBuf, TEXT("%s: Freeing %d bytes\n"), g_szModule, ul);
00109    OutputDebugString(szBuf);
00110 #endif
00111 }

void BMWSMemInit ( )

Definition at line 53 of file bmws_trackmemalloc.cpp.

References g_pMalloc.

Referenced by CSolpackApp::CSolpackApp(), and InitModule().

00054 {
00055    if(!g_pMalloc)
00056       CoGetMalloc(1, &g_pMalloc);
00057 }

void BMWSMemUninit ( )

Definition at line 124 of file bmws_trackmemalloc.cpp.

References g_nBytesAlloc, g_nBytesFreed, g_nBytesMax, g_pMalloc, and g_szModule.

Referenced by DllMain(), and CSolpackApp::~CSolpackApp().

00125 {
00126    if(g_pMalloc)
00127    {
00128       TCHAR szBuf[256];
00129       wsprintf(szBuf, TEXT("\n--- %s -----------------------------------------------------------------\n\n"), g_szModule);
00130       OutputDebugString(szBuf);
00131       wsprintf(szBuf, TEXT("Allocated:  \t%d\nFreed:      \t%d\nDifference: \t%d\nMaximum:    \t%d\n\n"),
00132          g_nBytesAlloc, g_nBytesFreed, g_nBytesAlloc-g_nBytesFreed, g_nBytesMax);
00133       OutputDebugString(szBuf);
00134       g_pMalloc->Release();
00135       g_pMalloc = NULL;
00136 #ifdef BMWS_USEPOINTER
00137       wsprintf(szBuf, TEXT("Objects Created:  \t%d\nObjects Deleted:  \t%d\nDifference:       \t%d\n\n"),
00138          CRefCount::m_scTotalCreated, CRefCount::m_scTotalDeleted, CRefCount::m_scTotalCreated -
00139          CRefCount::m_scTotalDeleted);
00140       OutputDebugString(szBuf);
00141 #endif
00142 #ifdef BMWS_USEEVENTSINK
00143       wsprintf(szBuf, TEXT("EventSinks Created:  \t%d\nEventSinks Deleted:  \t%d\nDifference:          \t%d\n\n"),
00144          CEventSink::m_scTotalCreated, CEventSink::m_scTotalDeleted, CEventSink::m_scTotalCreated -
00145          CEventSink::m_scTotalDeleted);
00146       OutputDebugString(szBuf);
00147 #endif
00148 #ifdef BMWS_USEEVENTHANDLER
00149       wsprintf(szBuf, TEXT("EventHandlers Created:  \t%d\nEventHandlers Deleted:  \t%d\nDifference:             \t%d\n\n"),
00150          CEventHandler::m_scTotalCreated, CEventHandler::m_scTotalDeleted,
00151          CEventHandler::m_scTotalCreated - CEventHandler::m_scTotalDeleted);
00152       OutputDebugString(szBuf);
00153 #endif
00154 #ifdef BMWS_USEUNKBASE
00155       wsprintf(szBuf, TEXT("UnkBase Objects Created:  \t%d\nUnkBase Objects Deleted:  \t%d\nDifference:               \t%d\n\n"),
00156          CUnkBase::m_scTotalCreated, CUnkBase::m_scTotalDeleted,
00157          CUnkBase::m_scTotalCreated - CUnkBase::m_scTotalDeleted);
00158       OutputDebugString(szBuf);
00159 #endif
00160 #ifdef BMWS_USEDISPBASE
00161       wsprintf(szBuf, TEXT("DispBase Objects Created:  \t%d\nDispBase Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00162          CDispBase::m_scTotalCreated, CDispBase::m_scTotalDeleted,
00163          CDispBase::m_scTotalCreated - CDispBase::m_scTotalDeleted);
00164       OutputDebugString(szBuf);
00165 #endif
00166 #ifdef BMWS_USESCRIPTFN
00167       wsprintf(szBuf, TEXT("ScriptFn Objects Created:  \t%d\nScriptFn Objects Deleted:  \t%d\nDifference:                \t%d\n\n"),
00168          CScriptFn::m_scTotalCreated, CScriptFn::m_scTotalDeleted,
00169          CScriptFn::m_scTotalCreated - CScriptFn::m_scTotalDeleted);
00170       OutputDebugString(szBuf);
00171 #endif
00172       OutputDebugString(TEXT("------------------------------------------------------------------------------\n\n"));
00173    }
00174 }

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_trackmemalloc.h Source File

bmws_trackmemalloc.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_trackmemalloc.h
00004 //    Function to track memory allocation.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // BMWS_TrackMemAlloc API
00015 //----------------------------------------------------------------------------
00016 void BMWSMemInit();
00017 LPVOID BMWSMemAlloc(ULONG nBytes);
00018 void BMWSMemFree(LPVOID lpv);
00019 void BMWSMemUninit();
00020 #ifdef BMWS_MEMSPEW
00021 void BMWSMemSpew();
00022 #endif
00023
00024
00025 #endif // !defined(AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_uintarray.h File Reference

#include <bmws_array.h>

Go to the source code of this file.

Defines

#define | AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Typedefs

typedef CArray< UINT, UINT > | CUINTArray

Define Documentation

#define AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_uintarray.h.

Typedef Documentation

typedef CArray<UINT, UINT> CUINTArray

Definition at line 19 of file bmws_uintarray.h.

Referenced by CSolpackApp::Register(), CUserPrefs::SetSite(), and CSolpackApp::Unregister().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_uintarray.h Source File

bmws_uintarray.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_uintarray.h
00004 //    Definition of UINT array type.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_array.h>
00017
00018
00019 typedef CArray<UINT, UINT> CUINTArray;
00020
00021
00022 #endif // !defined(AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_unkbase.cpp File Reference

#include <bmws_unkbase.h>

Go to the source code of this file.

Functions

STDMETHODIMP_ (DWORD) CUnkBase

Variables

long g_cActiveComponents

Function Documentation

STDMETHODIMP_ ( DWORD )

Definition at line 85 of file bmws_unkbase.cpp.

00086 {
00087    return ++m_cRef;
00088 }

Variable Documentation

long g_cActiveComponents

Definition at line 19 of file bmws_unkbase.cpp.

Referenced by CUnkBase::CUnkBase(), DllMain(), and CUnkBase::~CUnkBase().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_unkbase.cpp Source File

bmws_unkbase.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_unkbase.cpp
00004 //    Class to encapsulate IUnknown functionality, used as a base for COM
00005 //    object classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_unkbase.h>
00014
00015
00016 //----------------------------------------------------------------------------
00017 // External variables
00018 //----------------------------------------------------------------------------
00019 extern long g_cActiveComponents;    // Number of active module components
00020
00021
00022 #ifdef BMWS_TRACKMEMALLOC
00023
00024 //----------------------------------------------------------------------------
00025 // UnkBase object tracking
00026 //----------------------------------------------------------------------------
00027 int CUnkBase::m_scTotalCreated = 0;
00028 int CUnkBase::m_scTotalDeleted = 0;
00029
00030 #endif
00031
00032
00033 //----------------------------------------------------------------------------
00034 //
00035 // CUnkBase constructor
00036 //
00037 // Parameters:       None.
00038 //
00039 //----------------------------------------------------------------------------
00040 CUnkBase::CUnkBase()
00041 {
00042    m_cRef = 0;
00043    g_cActiveComponents++;
00044 #ifdef BMWS_TRACKMEMALLOC
00045    m_scTotalCreated++;
00046 #endif
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // CUnkBase destructor
00053 //
00054 //----------------------------------------------------------------------------
00055 CUnkBase::~CUnkBase()
00056 {
00057    g_cActiveComponents--;
00058 #ifdef BMWS_TRACKMEMALLOC
00059    m_scTotalDeleted++;
00060 #endif
00061 }
00062
00063
00064 //----------------------------------------------------------------------------
00065 // INDUnknown::NDQueryInterface method
00066 //----------------------------------------------------------------------------
00067 STDMETHODIMP CUnkBase::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00068 {
00069    if(IsEqualIID(riid, IID_IUnknown))
00070    {
00071       *ppvObject = (LPUNKNOWN)((INDUnknown*)this);
00072       (*(LPUNKNOWN*)ppvObject)->AddRef();
00073       return S_OK;
00074    } else
00075    {
00076       *ppvObject = NULL;
00077       return E_NOINTERFACE;
00078    }
00079 }
00080
00081
00082 //----------------------------------------------------------------------------
00083 // INDUnknown::NDAddRef method
00084 //----------------------------------------------------------------------------
00085 STDMETHODIMP_(DWORD) CUnkBase::NDAddRef()
00086 {
00087    return ++m_cRef;
00088 }
00089
00090
00091 //----------------------------------------------------------------------------
00092 // INDUnknown::NDRelease method
00093 //----------------------------------------------------------------------------
00094 STDMETHODIMP_(DWORD) CUnkBase::NDRelease()
00095 {
00096    if(--m_cRef)
00097       return m_cRef;
00098
00099    delete this;
00100    return 0;
00101 }
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_unkbase.h File Reference

#include <oaidl.h>

Go to the source code of this file.

Compounds

class | CUnkBase
interface | INDUnknown

Defines

#define | AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_
#define | DECLARE_IUNKNOWN

Define Documentation

#define AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_

Definition at line 11 of file bmws_unkbase.h.

#define DECLARE_IUNKNOWN

Value:

STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject)  \
   {  \
      return GetOuterUnknown()->QueryInterface(riid, ppvObject);  \
   }; \
   STDMETHOD_(ULONG, AddRef)()   \
   {  \
      return GetOuterUnknown()->AddRef(); \
   }; \
   STDMETHOD_(ULONG, Release)()  \
   {  \
      return GetOuterUnknown()->Release();   \
   };

Definition at line 87 of file bmws_unkbase.h.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_unkbase.h Source File

bmws_unkbase.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_unkbase.h
00004 //    Interface and class to encapsulate IUnknown functionality, used as a
00005 //    base for COM object classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
00011 #define AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include <oaidl.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // INDUnknown interface
00027 //    A nondelegating IUnknown interface.
00028 //
00029 //----------------------------------------------------------------------------
00030 interface INDUnknown
00031 {
00032    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject) PURE;
00033    STDMETHOD_(ULONG, NDAddRef)() PURE;
00034    STDMETHOD_(ULONG, NDRelease)() PURE;
00035 };
00036
00037
00038 //----------------------------------------------------------------------------
00039 //
00040 // CUnkBase class
00041 //    Provides an easy base for COM object classes.
00042 //
00043 //----------------------------------------------------------------------------
00044 class CUnkBase : public INDUnknown
00045 {
00046 public:
00047    CUnkBase();
00048    virtual ~CUnkBase();
00049
00050    // INDUnknown methods
00051    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00052    STDMETHOD_(ULONG, NDAddRef)();
00053    STDMETHOD_(ULONG, NDRelease)();
00054
00055 #ifdef BMWS_TRACKMEMALLOC
00056    static int m_scTotalCreated;  // Total number of UnkBase objects created
00057    static int m_scTotalDeleted;  // Total number of UnkBase objects deleted
00058 #endif
00059
00060 protected:
00061
00062
00063    //-------------------------------------------------------------------------
00064    //
00065    // GetOuterUnknown function
00066    //    Retrieves the outer unknown pointer.
00067    //
00068    // Parameters:    None.
00069    //
00070    // Returns:       The IUnknown interface pointer to use.
00071    //
00072    //-------------------------------------------------------------------------
00073    LPUNKNOWN GetOuterUnknown() const
00074    {
00075       return (LPUNKNOWN)((INDUnknown*)this);
00076    }
00077
00078
00079 private:
00080    DWORD m_cRef;        // Object reference count
00081 };
00082
00083
00084 //----------------------------------------------------------------------------
00085 // Macro, which must be used in every CUnkBase-derived class declaration.
00086 //----------------------------------------------------------------------------
00087 #define DECLARE_IUNKNOWN   \
00088    STDMETHOD (QueryInterface)(REFIID riid, LPVOID *ppvObject)  \
00089    {  \
00090       return GetOuterUnknown()->QueryInterface(riid, ppvObject);  \
00091    }; \
00092    STDMETHOD_(ULONG, AddRef)()   \
00093    {  \
00094       return GetOuterUnknown()->AddRef(); \
00095    }; \
00096    STDMETHOD_(ULONG, Release)()  \
00097    {  \
00098       return GetOuterUnknown()->Release();   \
00099    };
00100
00101
00102 #endif // !defined(AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:38:59 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update.cpp File Reference

#include <bmws_update.h>
#include <bmws_registry.h>
#include <bmws_update_res.h>

Go to the source code of this file.

Functions

void | CheckForUpdate (UINT uidURLXML, IUpdateSite *pSite, BOOL bVer, BOOL bExtra)
void | CleanupCheckForUpdate ()

Variables

BOOL | g_bUpdateDone = FALSE
HWND | g_hWnd
CXMLDocument * | g_pUpdateDoc = NULL

Function Documentation

void CheckForUpdate | ( | UINT | uidURLXML,
 |  | IUpdateSite * | pSite,
 |  | BOOL | bVer,
 |  | BOOL | bExtra
 | ) |

Definition at line 105 of file bmws_update.cpp.

References CUpdateInfo::bExtra, CUpdateInfo::bVer, ENSUREALLOC, g_bUpdateDone, CXMLDocument::InitXMLDocument(), CXMLDocument::LoadFromFile(), CUpdateInfo::pSite, and SAFEDELETE.

Referenced by CMainWindow::OnCreate().

00106 {
00107    if(!bVer && !bExtra)
00108       return;
00109    CUpdateInfo* pupdi = new CUpdateInfo();
00110    ENSUREALLOC(pupdi);
00111    pupdi->pSite = pSite;
00112    pupdi->bVer = bVer;
00113    pupdi->bExtra = bExtra;
00114    g_pUpdateDoc = new CXMLDocument();
00115    ENSUREALLOC(g_pUpdateDoc);
00116    g_pUpdateDoc->InitXMLDocument((IXMLDocumentSite*)pupdi);
00117    g_pUpdateDoc->LoadFromFile(CBSTR(uidURLXML));
00118    if(g_bUpdateDone)
00119    {
00120       SAFEDELETE(g_pUpdateDoc);
00121       g_bUpdateDone = FALSE;
00122    }
00123    else
00124       g_bUpdateDone = TRUE;
00125 }

void CleanupCheckForUpdate ( )

Definition at line 138 of file bmws_update.cpp.

References SAFEDELETE.

Referenced by CMainWindow::OnDestroy().

00139 {
00140    SAFEDELETE(g_pUpdateDoc);
00141 }

Variable Documentation

BOOL g_bUpdateDone = FALSE

Definition at line 21 of file bmws_update.cpp.

Referenced by CheckForUpdate(), and CUpdateInfo::XMLDone().

HWND g_hWnd

Definition at line 22 of file bmws_update.cpp.

CXMLDocument* g_pUpdateDoc = NULL

Definition at line 23 of file bmws_update.cpp.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update.cpp Source File

bmws_update.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_update.cpp
00004 //    Functions to support XML-based product update checking over the
00005 //    Internet.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_update.h>
00014 #include <bmws_registry.h>
00015 #include <bmws_update_res.h>
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Global and external variables
00020 //----------------------------------------------------------------------------
00021 BOOL g_bUpdateDone = FALSE;   // Whether the update file has been received
00022 extern HWND g_hWnd;           // Main window handle
00023 CXMLDocument *g_pUpdateDoc = NULL;  // Update XML document
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // XMLDone function
00029 //    Called when the XML document has been fully loaded.
00030 //
00031 // Parameters:
00032 //    pDoc:          The XML document object.
00033 //
00034 // Returns:          None.
00035 //
00036 //----------------------------------------------------------------------------
00037 void CUpdateInfo::XMLDone(CXMLDocument *pDoc)
00038 {
00039    CXMLElementPtr pRootEl;
00040    try
00041    {
00042       pRootEl = pDoc->GetRootElement();
00043       BOOL bOK = TRUE;
00044       CBSTR bstrExtra;
00045       double dAvailVersion = -1;
00046       if(bVer)
00047          dAvailVersion = pRootEl->GetR8Attr(IDS_BMWS_UPDATE_VERATTR, -1.0, TRUE);
00048       if(bExtra)
00049       {
00050          CKey hKeyProduct;
00051          if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00052          {
00053             DWORD dwCurExtraVer = 0;
00054             GetRegDWORDValue(hKeyProduct, IDS_BMWS_UPDATE_REG_EXTRAVER, &dwCurExtraVer);
00055
00056             UINT uExtraVer = pRootEl->GetUINTAttr(IDS_BMWS_UPDATE_EXTRAVERATTR, 0, TRUE);
00057             if(uExtraVer > dwCurExtraVer)
00058             {
00059                SetRegDWORDValue(hKeyProduct, IDS_BMWS_UPDATE_REG_EXTRAVER, uExtraVer);
00060                bstrExtra = pRootEl->GetStrAttr(IDS_BMWS_UPDATE_EXTRAATTR, CBSTR(), TRUE);
00061             }
00062          }
00063       }
00064       pSite->UpdateDone(dAvailVersion, bstrExtra);
00065    }
00066    catch(CExcepEx *pE)
00067    {
00068       pE->Delete();
00069    }
00070    catch(CExcep *pE)
00071    {
00072       pE->Report();
00073       pE->Delete();
00074    }
00075
00076    pRootEl = NULL;
00077    if(g_bUpdateDone)
00078    {
00079       delete pDoc;
00080       g_pUpdateDoc = NULL;
00081       g_bUpdateDone = FALSE;
00082    }
00083    else
00084       g_bUpdateDone = TRUE;
00085    delete this;
00086 }
00087
00088
00089 //----------------------------------------------------------------------------
00090 //
00091 // CheckForUpdate function
00092 //    Downloads a specified XML file from botproductions.com to determine if
00093 //    an updated version of the product is available.
00094 //
00095 // Parameters:
00096 //    uidURLXML:        ID of the string with the URL of the XML file.
00097 //    pSite:            Interface of the caller, to be notified when the check
00098 //                      is complete.
00099 //    bVer:             Whether to gather the VERSION attribute data.
00100 //    bExtra:           Whether to gather the EXTRA attribute data.
00101 //
00102 // Returns:             None.
00103 //
00104 //----------------------------------------------------------------------------
00105 void CheckForUpdate(UINT uidURLXML, IUpdateSite *pSite, BOOL bVer, BOOL bExtra)
00106 {
00107    if(!bVer && !bExtra)
00108       return;
00109    CUpdateInfo* pupdi = new CUpdateInfo();
00110    ENSUREALLOC(pupdi);
00111    pupdi->pSite = pSite;
00112    pupdi->bVer = bVer;
00113    pupdi->bExtra = bExtra;
00114    g_pUpdateDoc = new CXMLDocument();
00115    ENSUREALLOC(g_pUpdateDoc);
00116    g_pUpdateDoc->InitXMLDocument((IXMLDocumentSite*)pupdi);
00117    g_pUpdateDoc->LoadFromFile(CBSTR(uidURLXML));
00118    if(g_bUpdateDone)
00119    {
00120       SAFEDELETE(g_pUpdateDoc);
00121       g_bUpdateDone = FALSE;
00122    }
00123    else
00124       g_bUpdateDone = TRUE;
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // CleanupCheckForUpdate function
00131 //    Deletes the Update XML document, if it has not already been deleted.
00132 //
00133 // Parameters:          None.
00134 //
00135 // Returns:             None.
00136 //
00137 //----------------------------------------------------------------------------
00138 void CleanupCheckForUpdate()
00139 {
00140    SAFEDELETE(g_pUpdateDoc);
00141 }
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update.h File Reference

#include <bmws_string.h>
#include <bmws_xml.h>

Go to the source code of this file.

Compounds

class | CUpdateInfo
class | IUpdateSite

Functions

void | CheckForUpdate (UINT uidURLXML, IUpdateSite *pSite, BOOL bVer, BOOL bExtra)
void | CleanupCheckForUpdate ()

Function Documentation

void CheckForUpdate | ( | UINT | uidURLXML,
 |  | IUpdateSite * | pSite,
 |  | BOOL | bVer,
 |  | BOOL | bExtra
 | ) |

Definition at line 105 of file bmws_update.cpp.

References CUpdateInfo::bExtra, CUpdateInfo::bVer, ENSUREALLOC, g_bUpdateDone, CXMLDocument::InitXMLDocument(), CXMLDocument::LoadFromFile(), CUpdateInfo::pSite, and SAFEDELETE.

Referenced by CMainWindow::OnCreate().

00106 {
00107    if(!bVer && !bExtra)
00108       return;
00109    CUpdateInfo* pupdi = new CUpdateInfo();
00110    ENSUREALLOC(pupdi);
00111    pupdi->pSite = pSite;
00112    pupdi->bVer = bVer;
00113    pupdi->bExtra = bExtra;
00114    g_pUpdateDoc = new CXMLDocument();
00115    ENSUREALLOC(g_pUpdateDoc);
00116    g_pUpdateDoc->InitXMLDocument((IXMLDocumentSite*)pupdi);
00117    g_pUpdateDoc->LoadFromFile(CBSTR(uidURLXML));
00118    if(g_bUpdateDone)
00119    {
00120       SAFEDELETE(g_pUpdateDoc);
00121       g_bUpdateDone = FALSE;
00122    }
00123    else
00124       g_bUpdateDone = TRUE;
00125 }

void CleanupCheckForUpdate ( )

Definition at line 138 of file bmws_update.cpp.

References SAFEDELETE.

Referenced by CMainWindow::OnDestroy().

00139 {
00140    SAFEDELETE(g_pUpdateDoc);
00141 }

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update.h Source File

bmws_update.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_update.h
00004 //    Functions to support XML-based product update checking over the
00005 //    Internet.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #ifndef __BMWS_UPDATE_H_
00011 #define __BMWS_UPDATE_H_
00012
00013
00014 //----------------------------------------------------------------------------
00015 // Includes
00016 //----------------------------------------------------------------------------
00017 #include <bmws_string.h>
00018 #include <bmws_xml.h>
00019
00020
00021 //----------------------------------------------------------------------------
00022 //
00023 // IUpdateSite abstract class
00024 //    Informs the caller that an update check is finished.
00025 //
00026 //----------------------------------------------------------------------------
00027 class IUpdateSite
00028 {
00029 public:
00030    virtual void UpdateDone(double dAvailVersion, CBSTR& bstrExtra) = 0;
00031 };
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CUpdateInfo class
00037 //    Contains data for a specific update request.
00038 //
00039 //----------------------------------------------------------------------------
00040 class CUpdateInfo : public IXMLDocumentSite
00041 {
00042 public:
00043    void XMLDone(CXMLDocument *pDoc);
00044
00045    IUpdateSite *pSite;           // Update finished interface
00046    BOOL bVer;                    // Whether to return the VERSION attribute
00047    BOOL bExtra;                  // Whether to return the EXTRA attribute
00048 };
00049
00050
00051 //----------------------------------------------------------------------------
00052 // BMWS_Update API functions
00053 //----------------------------------------------------------------------------
00054 void CheckForUpdate(UINT uidURLXML, IUpdateSite *pSite, BOOL bVer, BOOL bExtra);
00055 void CleanupCheckForUpdate();
00056
00057
00058 #endif //__BMWS_UPDATE_H_
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_UPDATE_VERATTR 8401
#define | IDS_BMWS_UPDATE_VEREXTRA 8402
#define | IDS_BMWS_UPDATE_EXTRAATTR 8402
#define | IDS_BMWS_UPDATE_EXTRAVERATTR 8403
#define | IDS_BMWS_UPDATE_REG_EXTRAVER 8404

Define Documentation

#define IDS_BMWS_UPDATE_EXTRAATTR 8402

Definition at line 7 of file bmws_update_res.h.

Referenced by CUpdateInfo::XMLDone().

#define IDS_BMWS_UPDATE_EXTRAVERATTR 8403

Definition at line 8 of file bmws_update_res.h.

Referenced by CUpdateInfo::XMLDone().

#define IDS_BMWS_UPDATE_REG_EXTRAVER 8404

Definition at line 9 of file bmws_update_res.h.

Referenced by CUpdateInfo::XMLDone().

#define IDS_BMWS_UPDATE_VERATTR 8401

Definition at line 5 of file bmws_update_res.h.

Referenced by CUpdateInfo::XMLDone().

#define IDS_BMWS_UPDATE_VEREXTRA 8402

Definition at line 6 of file bmws_update_res.h.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update_res.h Source File

bmws_update_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_update.rc
00004 //
00005 #define IDS_BMWS_UPDATE_VERATTR         8401
00006 #define IDS_BMWS_UPDATE_VEREXTRA        8402
00007 #define IDS_BMWS_UPDATE_EXTRAATTR       8402
00008 #define IDS_BMWS_UPDATE_EXTRAVERATTR    8403
00009 #define IDS_BMWS_UPDATE_REG_EXTRAVER    8404
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NEXT_RESOURCE_VALUE        101
00016 #define _APS_NEXT_COMMAND_VALUE         40001
00017 #define _APS_NEXT_CONTROL_VALUE         1000
00018 #define _APS_NEXT_SYMED_VALUE           101
00019 #endif
00020 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update_res_lc.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_UPDATE_E_INVALIDUPDATE 18401

Define Documentation

#define IDS_BMWS_UPDATE_E_INVALIDUPDATE 18401

Definition at line 5 of file bmws_update_res_lc.h.

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_update_res_lc.h Source File

bmws_update_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_update_lc.rc
00004 //
00005 #define IDS_BMWS_UPDATE_E_INVALIDUPDATE 18401
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        101
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg.cpp File Reference

#include <bmws_updatedlg.h>
#include <bmws_hlink.h>
#include <bmws_window.h>
#include <bmws_updatedlg_res.h>
#include <bmws_updatedlg_res_lc.h>

Go to the source code of this file.

Variables

TCHAR | g_szAppTitle [64]
HINSTANCE | g_hInstLC

Variable Documentation

HINSTANCE g_hInstLC

Definition at line 27 of file bmws_updatedlg.cpp.

TCHAR g_szAppTitle[64]

Definition at line 26 of file bmws_updatedlg.cpp.

Referenced by CUpdateDlg::DlgProc().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg.cpp Source File

bmws_updatedlg.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_updatedlg.cpp
00004 //    Class to encapsulate displaying the Update dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_updatedlg.h>
00013 #include <bmws_hlink.h>
00014 #include <bmws_window.h>
00015 #include <bmws_updatedlg_res.h>
00016 #include <bmws_updatedlg_res_lc.h>
00017 #ifdef BMWS_CONTEXTHELP
00018    #include <bmws_helpmgr.h>
00019    #include "..\help\bmws\bmws_updatedlg_popupid.h"
00020 #endif
00021
00022
00023 //----------------------------------------------------------------------------
00024 // Global and external variables
00025 //----------------------------------------------------------------------------
00026 extern TCHAR g_szAppTitle[64];   // The title bar text
00027 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00028 #ifdef BMWS_CONTEXTHELP
00029    extern CHelpMgr *g_pHelp;     // Help manager object
00030 #endif
00031
00032
00033 #ifdef BMWS_CONTEXTHELP
00034    DWORD CUpdateDlg::s_adwPopupHelp[] =
00035    {
00036       IDC_BMWS_UPDATEDLG_AVAILBOX,     IDH_BMWS_UPDATEDLG_AVAILBOX,
00037       IDC_BMWS_UPDATEDLG_URL,          IDH_BMWS_UPDATEDLG_URL,
00038       IDC_BMWS_UPDATEDLG_CHECKNEWVER,  IDH_BMWS_UPDATEDLG_CHECKNEWVER,
00039       IDC_BMWS_UPDATEDLG_CHECKEXTRAS,  IDH_BMWS_UPDATEDLG_CHECKEXTRAS,
00040       IDOK,                            IDH_BMWS_UPDATEDLG_CONTINUE,
00041       0,                               0
00042    };
00043 #endif
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // CUpdateDlg constructor
00049 //
00050 // Parameters:
00051 //    pSite:         Interface of the creator.
00052 //    uidURL:        String resource identifier of the web site for the
00053 //                   product.
00054 //    lpszText:      Text to be placed in the box.
00055 //
00056 //----------------------------------------------------------------------------
00057 CUpdateDlg::CUpdateDlg(IUpdateDlgSite *pSite, UINT uidURL, CTSTR& lpszText, COLORREF color) :
00058                        CDlg(IDD_BMWS_UPDATEDLG)
00059 {
00060    m_lpszText.Assign(lpszText);
00061    for(int k = 0; m_lpszText.m_lpsz[k] != '\0'; k++)
00062       if(m_lpszText.m_lpsz[k] == '|' && m_lpszText.m_lpsz[k+1] == '|')
00063       {
00064          m_lpszText.m_lpsz[k] = '\r';
00065          m_lpszText.m_lpsz[k+1] = '\n';
00066       }
00067 #ifdef BMWS_CONTEXTHELP
00068    m_lpszPopupFile.Assign(IDS_BMWS_UPDATEDLG_POPUPFILE);
00069 #endif
00070    m_pHlinkWndMgr = NULL;
00071    m_pSite = pSite;
00072    m_lpszURL.Assign(uidURL);
00073    m_color = color;
00074 }
00075
00076
00077 //----------------------------------------------------------------------------
00078 //
00079 // DlgProc function
00080 //    Function that handles messages to the update dialog box.
00081 //
00082 // Parameters:
00083 //    uMsg:          Message identifer.
00084 //    wParam:        Message-specific parameter.
00085 //    lParam:        Message-specific parameter.
00086 //
00087 // Returns:          TRUE if the message was handled, otherwise FALSE.
00088 //
00089 //----------------------------------------------------------------------------
00090 INT_PTR CUpdateDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
00091 {
00092    LRESULT lResult;
00093    if(m_pHlinkWndMgr)
00094    {
00095       DWORD dwReturn = m_pHlinkWndMgr->PreprocessMsg(m_hwndDlg, uMsg, wParam, lParam, &lResult);
00096       if(dwReturn == HLINK_PPM_RETURNDIRECT)
00097          return lResult;
00098       if(dwReturn == HLINK_PPM_RETURNNORMAL)
00099       {
00100          SetWindowLong(m_hwndDlg, DWL_MSGRESULT, lResult);
00101          return TRUE;
00102       }
00103    }
00104    switch(uMsg)
00105    {
00106       case WM_INITDIALOG:
00107       {
00108          SetWindowText(m_hwndDlg, g_szAppTitle);
00109          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_URL, m_lpszURL);
00110          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_AVAILBOX, m_lpszText);
00111
00112          BOOL bVer;
00113          BOOL bExtras;
00114          CTSTR lpszCheckVer(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER);
00115          CTSTR lpszCheckExtras(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS);
00116          m_pSite->GetCheckUpdate(&bVer, &bExtras, lpszCheckVer, lpszCheckExtras);
00117          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER, lpszCheckVer);
00118          SendDlgItemMessage(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER, BM_SETCHECK,
00119             bVer ? BST_CHECKED : BST_UNCHECKED, 0);
00120
00121 #ifdef BMWS_UPDATEDLG_NOEXTRAS
00122          ShowWindow(GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS), SW_HIDE);
00123 #else
00124          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS, lpszCheckExtras);
00125          SendDlgItemMessage(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS, BM_SETCHECK,
00126             bExtras ? BST_CHECKED : BST_UNCHECKED, 0);
00127 #endif
00128
00129          m_pHlinkWndMgr = new CHlinkWindowMgr(1, m_color);
00130          m_pHlinkWndMgr->AddWnd(GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_URL), m_lpszURL);
00131          CHWND::CenterWindow(m_hwndDlg);
00132       } return TRUE;
00133
00134       case WM_CTLCOLORSTATIC:
00135          if(HWND(lParam) == GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_AVAILBOX))
00136             return (BOOL)GetSysColorBrush(COLOR_WINDOW);
00137          break;
00138
00139       case WM_COMMAND:
00140          if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
00141          {
00142             if(LOWORD(wParam) == IDOK)
00143                m_pSite->SetCheckUpdate(
00144                   (IsDlgButtonChecked(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER) == BST_CHECKED),
00145                   (IsDlgButtonChecked(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS) == BST_CHECKED));
00146             EndDialog(m_hwndDlg, LOWORD(wParam));
00147             return TRUE;
00148          }
00149          break;
00150
00151 #ifdef BMWS_CONTEXTHELP
00152       case WM_HELP:
00153       case WM_CONTEXTMENU:
00154          g_pHelp->DialogCSHelp(m_hwndDlg, uMsg, wParam, lParam, m_lpszPopupFile, s_adwPopupHelp);
00155          break;
00156 #endif
00157
00158    }
00159    return FALSE;
00160 }
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg.h File Reference

#include <bmws_dlg.h>
#include <bmws_hlink.h>

Go to the source code of this file.

Compounds

class | CUpdateDlg
class | IUpdateDlgSite

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg.h Source File

bmws_updatedlg.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_updatedlg.h
00004 //    Class to encapsulate displaying the Update dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #ifndef __BMWS_UPDATEDLG_H_
00010 #define __BMWS_UPDATEDLG_H_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include <bmws_dlg.h>
00017 #include <bmws_hlink.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // IUpdateDlgSite abstract class
00023 //    Informs the caller that update attributes have changed.
00024 //
00025 //----------------------------------------------------------------------------
00026 class IUpdateDlgSite
00027 {
00028 public:
00029    virtual void GetCheckUpdate(BOOL *pbNewVer, BOOL *pbExtras, CTSTR& lpszNewVerText,
00030       CTSTR& lpszExtrasText) = 0;
00031    virtual void SetCheckUpdate(BOOL bNewVer, BOOL bExtras) = 0;
00032 };
00033
00034
00035 //----------------------------------------------------------------------------
00036 //
00037 // CUpdateDlg class
00038 //    Encapsulates displaying the Update dialog box.
00039 //
00040 //----------------------------------------------------------------------------
00041 class CUpdateDlg : public CDlg
00042 {
00043 public:
00044    CUpdateDlg(IUpdateDlgSite *pSite, UINT uidURL, CTSTR& lpszText, COLORREF color);
00045
00046    INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
00047
00048 #ifdef BMWS_CONTEXTHELP
00049    static DWORD s_adwPopupHelp[];   // Context-sensitive help ID map
00050 #endif
00051
00052 protected:
00053 #ifdef BMWS_CONTEXTHELP
00054    CTSTR m_lpszPopupFile;              // Context-sensitive help file name
00055 #endif
00056    CHlinkWindowMgrPtr m_pHlinkWndMgr;  // Hyperlink control manager
00057    IUpdateDlgSite *m_pSite;            // Update dialog caller interface
00058    CTSTR m_lpszURL;                    // URL for the product
00059    CTSTR m_lpszText;                   // Text for the edit field
00060    COLORREF m_color;                   // Color to use for hyperlink
00061 };
00062
00063
00064 #endif //__BMWS_UPDATE_H_
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg_res.h File Reference

Go to the source code of this file.

Defines

#define IDS_BMWS_UPDATEDLG_POPUPFILE 8901

Define Documentation

#define IDS_BMWS_UPDATEDLG_POPUPFILE 8901

Definition at line 5 of file bmws_updatedlg_res.h.

Referenced by CUpdateDlg::CUpdateDlg().

Generated on Wed May 8 12:39:19 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg_res.h Source File

bmws_updatedlg_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_updatedlg.rc
00004 //
00005 #define IDS_BMWS_UPDATEDLG_POPUPFILE    8901
00006
00007 // Next default values for new objects
00008 //
00009 #ifdef APSTUDIO_INVOKED
00010 #ifndef APSTUDIO_READONLY_SYMBOLS
00011 #define _APS_NEXT_RESOURCE_VALUE        103
00012 #define _APS_NEXT_COMMAND_VALUE         40001
00013 #define _APS_NEXT_CONTROL_VALUE         1000
00014 #define _APS_NEXT_SYMED_VALUE           101
00015 #endif
00016 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDC_BMWS_UPDATEDLG_AVAILBOX 10000
#define | IDC_BMWS_UPDATEDLG_URL 10001
#define | IDC_BMWS_UPDATEDLG_CHECKNEWVER 10002
#define | IDC_BMWS_UPDATEDLG_CHECKEXTRAS 10003
#define | IDD_BMWS_UPDATEDLG 17001
#define | IDC_STATIC -1

Define Documentation

#define IDC_BMWS_UPDATEDLG_AVAILBOX 10000

Definition at line 5 of file bmws_updatedlg_res_lc.h.

Referenced by CUpdateDlg::DlgProc().

#define IDC_BMWS_UPDATEDLG_CHECKEXTRAS 10003

Definition at line 8 of file bmws_updatedlg_res_lc.h.

Referenced by CUpdateDlg::DlgProc().

#define IDC_BMWS_UPDATEDLG_CHECKNEWVER 10002

Definition at line 7 of file bmws_updatedlg_res_lc.h.

Referenced by CUpdateDlg::DlgProc().

#define IDC_BMWS_UPDATEDLG_URL 10001

Definition at line 6 of file bmws_updatedlg_res_lc.h.

Referenced by CUpdateDlg::DlgProc().

#define IDC_STATIC -1

Definition at line 10 of file bmws_updatedlg_res_lc.h.

#define IDD_BMWS_UPDATEDLG 17001

Definition at line 9 of file bmws_updatedlg_res_lc.h.

Referenced by CUpdateDlg::CUpdateDlg().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_updatedlg_res_lc.h Source File

bmws_updatedlg_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_updatedlg_lc.rc
00004 //
00005 #define IDC_BMWS_UPDATEDLG_AVAILBOX     10000
00006 #define IDC_BMWS_UPDATEDLG_URL          10001
00007 #define IDC_BMWS_UPDATEDLG_CHECKNEWVER  10002
00008 #define IDC_BMWS_UPDATEDLG_CHECKEXTRAS  10003
00009 #define IDD_BMWS_UPDATEDLG              17001
00010 #define IDC_STATIC                      -1
00011
00012 // Next default values for new objects
00013 //
00014 #ifdef APSTUDIO_INVOKED
00015 #ifndef APSTUDIO_READONLY_SYMBOLS
00016 #define _APS_NEXT_RESOURCE_VALUE        101
00017 #define _APS_NEXT_COMMAND_VALUE         40001
00018 #define _APS_NEXT_CONTROL_VALUE         1001
00019 #define _APS_NEXT_SYMED_VALUE           102
00020 #endif
00021 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_variant.h File Reference

Go to the source code of this file.

Compounds

class | CVariant

Defines

#define | AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Define Documentation

#define AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 10 of file bmws_variant.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_variant.h Source File

bmws_variant.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_variant.h
00004 //    Class to encapsulate a variant.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00010 #define AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 //
00015 // CVariant class
00016 //    Encapsulates a variant.
00017 //
00018 //----------------------------------------------------------------------------
00019 class CVariant : public tagVARIANT
00020 {
00021 public:
00022
00023    //-------------------------------------------------------------------------
00024    //
00025    // Constructor
00026    //
00027    // Parameters:    None.
00028    //
00029    //-------------------------------------------------------------------------
00030    CVariant()
00031    {
00032       VariantInit(this);
00033    }
00034
00035
00036    //-------------------------------------------------------------------------
00037    //
00038    // Constructor
00039    //
00040    // Parameters:
00041    //    lValue:     Long integer value to assign.
00042    //
00043    //-------------------------------------------------------------------------
00044    CVariant(long lValue)
00045    {
00046       VariantInit(this);
00047       vt = VT_I4;
00048       lVal = lValue;
00049    }
00050
00051
00052    //-------------------------------------------------------------------------
00053    //
00054    // Constructor
00055    //
00056    // Parameters:
00057    //    bstr:       String to assign.
00058    //
00059    //-------------------------------------------------------------------------
00060    CVariant(BSTR bstr)
00061    {
00062       VariantInit(this);
00063       vt = VT_BSTR;
00064       bstrVal = bstr;
00065    }
00066
00067
00068    //-------------------------------------------------------------------------
00069    //
00070    // Destructor
00071    //
00072    //-------------------------------------------------------------------------
00073    ~CVariant()
00074    {
00075       VariantClear(this);
00076    }
00077 };
00078
00079
00080 #endif // !defined(AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_waitcursor.cpp File Reference

#include <bmws_waitcursor.h>

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_waitcursor.cpp Source File

bmws_waitcursor.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_waitcursor.cpp
00004 //    Class to encapsulate showing and hiding of the wait cursor.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_waitcursor.h>
00013
00014
00015 //----------------------------------------------------------------------------
00016 // Initialize static variables
00017 //----------------------------------------------------------------------------
00018 HCURSOR CWaitCursor::s_hcurPrev = NULL;
00019 HCURSOR CWaitCursor::s_hcurWait = LoadCursor(NULL, IDC_WAIT);
00020 int CWaitCursor::s_nWaitCursorCount = 0;
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // DoWaitCursor function
00026 //    Changes the internal count of wait cursors, actually changing the cursor
00027 //    as necessary.
00028 //
00029 // Parameters:
00030 //    nCode:         Amount to increment or decrement the wait cursor count.
00031 //
00032 // Returns:          None.
00033 //
00034 //----------------------------------------------------------------------------
00035 void CWaitCursor::DoWaitCursor(int nCode)
00036 {
00037    s_nWaitCursorCount += nCode;
00038    if(s_nWaitCursorCount > 0)
00039    {
00040       HCURSOR hcurPrev = SetCursor(s_hcurWait);
00041       if((nCode > 0) && (s_nWaitCursorCount == 1))
00042          s_hcurPrev = hcurPrev;
00043    } else
00044    {
00045       s_nWaitCursorCount = 0;
00046       SetCursor(s_hcurPrev);
00047    }
00048 }
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_waitcursor.h File Reference

Go to the source code of this file.

Compounds

class | CWaitCursor

Defines

#define | AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_

Define Documentation

#define AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_

Definition at line 10 of file bmws_waitcursor.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_waitcursor.h Source File

bmws_waitcursor.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_waitcursor.h
00004 //    Class to encapsulate showing and hiding of the wait cursor.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
00010 #define AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CWaitCursor class
00020 //    Encapsulates showing and hiding of the wait cursor.
00021 //
00022 //----------------------------------------------------------------------------
00023 class CWaitCursor
00024 {
00025 public:
00026
00027    //-------------------------------------------------------------------------
00028    //
00029    // Constructor
00030    //
00031    //-------------------------------------------------------------------------
00032    CWaitCursor()
00033    {
00034       DoWaitCursor(1);
00035    }
00036
00037
00038    //-------------------------------------------------------------------------
00039    //
00040    // Destructor
00041    //
00042    //-------------------------------------------------------------------------
00043    ~CWaitCursor()
00044    {
00045       DoWaitCursor(-1);
00046    }
00047
00048 protected:
00049    static void DoWaitCursor(int nCode);
00050    static HCURSOR s_hcurWait;       // Wait cursor handle
00051    static HCURSOR s_hcurPrev;       // Previous cursor handle
00052    static int s_nWaitCursorCount;   // Count of active wait cursors
00053 };
00054
00055
00056 #endif // !defined(AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_)
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window.cpp File Reference

#include <bmws_window.h>
#include <bmws_window_res_lc.h>
#include <bmws_error.h>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 24 of file bmws_window.cpp.

Referenced by CHWND::CreateWindowEx(), and CHWND::RegisterWindowClass().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window.cpp Source File

bmws_window.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_window.cpp
00004 //    Class to encapsulate a basic window. Functions to assist in common
00005 //    window-related tasks.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include <bmws_window.h>
00014 #include <bmws_window_res_lc.h>
00015 #include <bmws_error.h>
00016 #ifdef BMWS_WINDOWPLACEMENT
00017    #include <bmws_registry.h>
00018 #endif
00019
00020
00021 //----------------------------------------------------------------------------
00022 // External variables
00023 //----------------------------------------------------------------------------
00024 extern HINSTANCE g_hInst;     // Application instance handle
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // CreateWindowEx function
00030 //    Creates a window and binds it to this object.
00031 //
00032 // Parameters:
00033 //    dwExStyle:     Extended window style
00034 //    lpClassName:   Registered class name
00035 //    lpWindowName:  Window name
00036 //    dwStyle:       Window style
00037 //    x:             Horizontal position of window
00038 //    y:             Vertical position of window
00039 //    nWidth:        Window width
00040 //    nHeight:       Window height
00041 //    hWndParent:    Handle to parent or owner window
00042 //    hMenu:         Menu handle or child identifier
00043 //    lpParam:       Window-creation data
00044 //
00045 // Returns:          None.
00046 //
00047 // Throws:           Exception if the window could not be created.
00048 //
00049 //----------------------------------------------------------------------------
00050 void CHWND::CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
00051                                  DWORD dwStyle, int x, int y, int nWidth, int nHeight,
00052                                  HWND hwndParent, HMENU hMenu, LPVOID lpParam)
00053 {
00054    m_hWnd = ::CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth,
00055       nHeight, hwndParent, hMenu, g_hInst, lpParam);
00056
00057    if(!m_hWnd)
00058       THROW(new CExcepEx(IDS_BMWS_WINDOW_E_CREATEWND, IDS_BMWS_REMEDY_RESTART,
00059          (UINT_PTR)(LPTSTR)lpClassName, 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00060 }
00061
00062
00063 #ifdef BMWS_WINDOWPLACEMENT
00064
00065 //----------------------------------------------------------------------------
00066 //
00067 // RestoreWindowPlacement function
00068 //    Positions the window according to information in the Registry.
00069 //
00070 // Parameters:
00071 //    hKey:          Registry key to read values from.
00072 //    uidValue:      String resource identifier of the registry value name.
00073 //    nCmdShow:      Specifies how the main window should be showed (according
00074 //                   to WinMain).
00075 //
00076 // Returns:          TRUE if successful, else FALSE.
00077 //
00078 //----------------------------------------------------------------------------
00079 BOOL CHWND::RestoreWindowPlacement(CKey& hKey, UINT uidValue, int nCmdShow)
00080 {
00081    if(!hKey)
00082       return FALSE;
00083
00084    CTSTR lpszValue;
00085    if(uidValue != -1)
00086       lpszValue.Assign(uidValue);
00087
00088    WINDOWPLACEMENT wp;
00089    DWORD dwSize = sizeof(wp);
00090    DWORD dwTemp;
00091
00092    long lResult = RegQueryValueEx(hKey, lpszValue, NULL, &dwTemp, (LPBYTE)&wp, &dwSize);
00093    if((lResult == NOERROR) && (wp.length == sizeof(WINDOWPLACEMENT)))
00094    {
00095       wp.flags = 0;
00096       if(wp.showCmd == SW_SHOWMINIMIZED)
00097          wp.showCmd = SW_SHOWNORMAL;
00098       if((wp.showCmd != SW_SHOWMAXIMIZED) || (nCmdShow != SW_SHOWNORMAL))
00099          wp.showCmd = nCmdShow;
00100       return SetWindowPlacement(m_hWnd, &wp);
00101    }
00102    return FALSE;
00103 }
00104
00105
00106 //----------------------------------------------------------------------------
00107 //
00108 // SaveWindowPlacement function
00109 //    Saves window position information in the registry.
00110 //
00111 // Parameters:
00112 //    hKey:          Registry key to write values in.
00113 //    uidValue:      String resource identifier of the registry value name.
00114 //
00115 // Returns:          None.
00116 //
00117 //----------------------------------------------------------------------------
00118 void CHWND::SaveWindowPlacement(CKey& hKey, UINT uidValue)
00119 {
00120    if(!hKey)
00121       return;
00122
00123    CTSTR lpszValue;
00124    if(uidValue != -1)
00125       lpszValue.Assign(uidValue);
00126
00127    WINDOWPLACEMENT wp;
00128    wp.length = sizeof(WINDOWPLACEMENT);
00129    if(GetWindowPlacement(m_hWnd, &wp))
00130       RegSetValueEx(hKey, lpszValue, 0, REG_BINARY, (LPBYTE)&wp, sizeof(wp));
00131 }
00132
00133 #endif // BMWS_WINDOWPLACEMENT
00134
00135
00136 //----------------------------------------------------------------------------
00137 //
00138 // RegisterWindowClass function
00139 //    Registers a window class with Windows.
00140 //
00141 // Parameters:
00142 //    lpszClassName: Name of the class to register.
00143 //    uiStyle:       Window class style flags.
00144 //    fnWndProc:     Pointer to the window procedure.
00145 //    lpszIcon:      Resource identifier for the window icon.
00146 //    hbrBackground: Brush to paint the background of the window.
00147 //    lpszMenu:      Menu to associate with the class.
00148 //    hCursor:       Cursor for the class. Defaults to NULL.
00149 //
00150 // Returns:          None.
00151 //
00152 // Throws:           Exception if the class could not be registered.
00153 //
00154 //----------------------------------------------------------------------------
00155 void CHWND::RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc,
00156                                 LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu,
00157                                 HCURSOR hCursor)
00158 {
00159    WNDCLASS wc;
00160
00161    wc.style          = uiStyle;
00162    wc.lpfnWndProc    = fnWndProc;
00163    wc.cbClsExtra     = 0;
00164    wc.cbWndExtra     = 0;
00165    wc.hInstance      = g_hInst;
00166    wc.hIcon          = (lpszIcon ? LoadIcon(g_hInst, lpszIcon) : NULL);
00167    wc.hCursor        = (hCursor ? hCursor : LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)));
00168    wc.hbrBackground  = hbrBackground;
00169    wc.lpszMenuName   = lpszMenu;
00170    wc.lpszClassName  = lpszClassName;
00171
00172    if(!RegisterClass(&wc))
00173       THROW(new CExcepEx(IDS_BMWS_WINDOW_E_REGWNDCLASS, IDS_BMWS_REMEDY_RESTART,
00174          (UINT_PTR)(LPTSTR)lpszClassName, 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00175 }
00176
00177
00178 //----------------------------------------------------------------------------
00179 //
00180 // CenterWindow function
00181 //    Centers a window within space of its parent window, or the desktop.
00182 //
00183 // Parameters:
00184 //    hWnd:          Handle to the window to be centered.
00185 //
00186 //----------------------------------------------------------------------------
00187 void CHWND::CenterWindow(HWND hWnd)
00188 {
00189    RECT rcChild;
00190    GetWindowRect(hWnd, &rcChild);
00191    RECT rcArea;
00192    RECT rcCenter;
00193    long lStyle = GetWindowLong(hWnd, GWL_STYLE);
00194    HWND hWndParent = ((lStyle & WS_CHILD) ? GetParent(hWnd) : GetWindow(hWnd, GW_OWNER));
00195
00196    if(!hWndParent || (!(GetWindowLong(hWndParent, GWL_STYLE) & WS_VISIBLE)) ||
00197       (GetWindowLong(hWndParent, GWL_STYLE) & WS_MINIMIZE))
00198    {
00199       hWndParent = GetDesktopWindow();
00200    }
00201
00202    GetWindowRect(hWndParent, &rcCenter);
00203
00204    // find dialog's upper left based on rcCenter
00205    int xLeft = (rcCenter.left + rcCenter.right) / 2 - (rcChild.right - rcChild.left) / 2;
00206    int yTop = (rcCenter.top + rcCenter.bottom) / 2 - (rcChild.bottom - rcChild.top) / 2;
00207
00208    SystemParametersInfo(SPI_GETWORKAREA, 0, &rcArea, 0);
00209
00210    // if the window is outside the window, move it inside
00211    if (xLeft < rcArea.left)
00212       xLeft = rcArea.left;
00213    else if (xLeft + (rcChild.right - rcChild.left) > rcArea.right)
00214       xLeft = rcArea.right - (rcChild.right - rcChild.left);
00215
00216    if (yTop < rcArea.top)
00217       yTop = rcArea.top;
00218    else if (yTop + (rcChild.bottom - rcChild.top) > rcArea.bottom)
00219       yTop = rcArea.bottom - (rcChild.bottom - rcChild.top);
00220
00221    SetWindowPos(hWnd, NULL, xLeft, yTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
00222 }
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window.h File Reference

#include <bmws_string.h>
#include <bmws_pointer.h>

Go to the source code of this file.

Compounds

class | CHWND

Defines

#define | AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Typedefs

typedef CPointer< CHWND > | CHWNDPtr

Define Documentation

#define AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 11 of file bmws_window.h.

Typedef Documentation

typedef CPointer<CHWND> CHWNDPtr

Definition at line 149 of file bmws_window.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window.h Source File

bmws_window.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_window.h
00004 //    Class to encapsulate a basic window. Functions to assist in common
00005 //    window-related tasks.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00011 #define AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include <bmws_string.h>
00022 #include <bmws_pointer.h>
00023 #ifdef BMWS_WINDOWPLACEMENT
00024    #include <bmws_key.h>
00025 #endif
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // CHWND class
00031 //    Encapsulates a basic window.
00032 //
00033 //----------------------------------------------------------------------------
00034 class CHWND : public CRefCount
00035 {
00036 public:
00037
00038    //----------------------------------------------------------------------------
00039    //
00040    // CHWND constructor
00041    //
00042    // Parameters:       None.
00043    //
00044    //----------------------------------------------------------------------------
00045    CHWND()
00046    {
00047       m_hWnd = NULL;
00048    }
00049
00050
00051    //-------------------------------------------------------------------------
00052    //
00053    // CHWND destructor
00054    //
00055    //-------------------------------------------------------------------------
00056    virtual ~CHWND()
00057    {
00058       if(IsWindow(m_hWnd))
00059          DestroyWindow(m_hWnd);
00060    }
00061
00062
00063    //-------------------------------------------------------------------------
00064    //
00065    // HWND operator
00066    //
00067    // Parameters:    None.
00068    //
00069    // Returns:       The window handle.
00070    //
00071    //-------------------------------------------------------------------------
00072    operator HWND() const
00073    {
00074       return m_hWnd;
00075    }
00076
00077
00078    //-------------------------------------------------------------------------
00079    //
00080    // Register function
00081    //    Registers the window class for this window. Overridden by derived
00082    //    windows.
00083    //
00084    // Parameters:       None.
00085    //
00086    // Returns:          None.
00087    //
00088    // Throws:           Exception if the class could not be registered.
00089    //
00090    //-------------------------------------------------------------------------
00091    void Register()
00092    {
00093    }
00094
00095
00096    //-------------------------------------------------------------------------
00097    //
00098    // ShowWindow function
00099    //
00100    // Parameters:
00101    //    nCmdShow:   Specifies how the window is to be shown.
00102    //
00103    // Returns:       Whether the call succeeded.
00104    //
00105    //-------------------------------------------------------------------------
00106    BOOL ShowWindow(int nCmdShow)
00107    {
00108       return IsWindow(m_hWnd) ? ::ShowWindow(m_hWnd, nCmdShow) : FALSE;
00109    }
00110
00111
00112    //-------------------------------------------------------------------------
00113    //
00114    // SendMessage function
00115    //    Sends a message to this window.
00116    //
00117    // Parameters:
00118    //    Msg:        Specifies the message to be sent.
00119    //    wParam:     Specifies additional message-specific information.
00120    //
00121    // Returns:
00122    //    The result of the message processing; it depends on the message sent.
00123    //
00124    //-------------------------------------------------------------------------
00125    LRESULT SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
00126    {
00127       return ::SendMessage(m_hWnd, Msg, wParam, lParam);
00128    }
00129
00130
00131    void CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle,
00132       int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam);
00133
00134 #ifdef BMWS_WINDOWPLACEMENT
00135    BOOL RestoreWindowPlacement(CKey& hKey, UINT uidValue, int nCmdShow);
00136    void SaveWindowPlacement(CKey& hKey, UINT uidValue);
00137 #endif
00138
00139    static void RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc,
00140       LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor = NULL);
00141    static void CenterWindow(HWND hWnd);
00142
00143    HWND m_hWnd;                // Window handle
00144
00145 protected:
00146    CTSTR m_lpszClassName;     // Window class name
00147 };
00148
00149 typedef CPointer<CHWND> CHWNDPtr;
00150
00151
00152 #endif // !defined(AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_WINDOW_E_REGWNDCLASS 18151
#define | IDS_BMWS_WINDOW_E_CREATEWND 18152

Define Documentation

#define IDS_BMWS_WINDOW_E_CREATEWND 18152

Definition at line 6 of file bmws_window_res_lc.h.

Referenced by CHWND::CreateWindowEx().

#define IDS_BMWS_WINDOW_E_REGWNDCLASS 18151

Definition at line 5 of file bmws_window_res_lc.h.

Referenced by CHWND::RegisterWindowClass().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_window_res_lc.h Source File

bmws_window_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_window_lc.rc
00004 //
00005 #define IDS_BMWS_WINDOW_E_REGWNDCLASS     18151
00006 #define IDS_BMWS_WINDOW_E_CREATEWND       18152
00007
00008 // Next default values for new objects
00009 //
00010 #ifdef APSTUDIO_INVOKED
00011 #ifndef APSTUDIO_READONLY_SYMBOLS
00012 #define _APS_NEXT_RESOURCE_VALUE        101
00013 #define _APS_NEXT_COMMAND_VALUE         40001
00014 #define _APS_NEXT_CONTROL_VALUE         1000
00015 #define _APS_NEXT_SYMED_VALUE           101
00016 #endif
00017 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml.cpp File Reference

#include <bmws_xml.h>
#include <bmws_eventhandler.h>
#include <bmws_error.h>
#include <bmws_variant.h>
#include <bmws_xml_res.h>
#include <bmws_xml_res_lc.h>

Go to the source code of this file.

Defines

#define | XMLINTERNALEXCEP(i)

Variables

HWND | g_hWnd
COOMExcep * g_pOOMExcep

Define Documentation

#define XMLINTERNALEXCEP ( i )

Value:

{ THROW(new CXMLExcep(IDS_BMWS_XML_E_INTERNAL, \
   IDS_BMWS_REMEDY_CONTACTBMWS, i, 0, ERROR_ERRORINS_INT), CXMLExcep*); }

Definition at line 30 of file bmws_xml.cpp.

Referenced by CXMLDocument::Abort(), CXMLElement::AltAddChild(), CXMLElement::AltChildOf(), CXMLElement::AltNumChildOf(), CXMLElement::AltSetVTAttr(), CXMLDocument::CreateRootElement(), CXMLElement::DeleteAttr(), CXMLElement::DeleteChild(), CXMLElement::GetTagName(), CXMLElement::SetStrAttr(), and CXMLElement::SetText().

Variable Documentation

HWND g_hWnd

Definition at line 23 of file bmws_xml.cpp.

COOMExcep* g_pOOMExcep

Definition at line 24 of file bmws_xml.cpp.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml.cpp Source File

bmws_xml.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_xml.cpp
00004 //    Classes to encapsulate XML elements and documents.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include <bmws_xml.h>
00013 #include <bmws_eventhandler.h>
00014 #include <bmws_error.h>
00015 #include <bmws_variant.h>
00016 #include <bmws_xml_res.h>
00017 #include <bmws_xml_res_lc.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // External variables
00022 //----------------------------------------------------------------------------
00023 extern HWND g_hWnd;
00024 extern COOMExcep *g_pOOMExcep;
00025
00026
00027 //----------------------------------------------------------------------------
00028 // XML exception macros
00029 //----------------------------------------------------------------------------
00030 #define XMLINTERNALEXCEP(i) { THROW(new CXMLExcep(IDS_BMWS_XML_E_INTERNAL, \
00031    IDS_BMWS_REMEDY_CONTACTBMWS, i, 0, ERROR_ERRORINS_INT), CXMLExcep*); }
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CXMLElement constructor
00037 //
00038 // Parameters:
00039 //    pEl:           Interface of the element.
00040 //
00041 //----------------------------------------------------------------------------
00042 CXMLElement::CXMLElement(IXMLDOMElement *pEl)
00043 {
00044    m_spEl = pEl;
00045    m_spNode.Assign(pEl);
00046 }
00047
00048
00049 //----------------------------------------------------------------------------
00050 //
00051 // GetAttr function
00052 //    Retrieves the value of an attribute of the element.
00053 //
00054 // Parameters:
00055 //    uidAttr:       Resource identifier of the attribute name.
00056 //    pvarValue:     The default string value, if the attribute could not be
00057 //                   found.
00058 //    vt:            Type of value to convert the attribute into.
00059 //    bFailNoExist:  Whether throw an exception if the attribute does not
00060 //                   exist. Defaults to FALSE.
00061 //
00062 // Returns:          TRUE if the attribute was retrieved successfully, FALSE
00063 //                   if it was not.
00064 //
00065 //----------------------------------------------------------------------------
00066 BOOL CXMLElement::GetAttr(UINT uidAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist)
00067 {
00068    return AltGetAttr(CBSTR(uidAttr), pvarValue, vt, bFailNoExist);
00069 }
00070
00071
00072 //----------------------------------------------------------------------------
00073 //
00074 // GetStrAttr function
00075 //    Retrieves the string value of an attribute of the element.
00076 //
00077 // Parameters:
00078 //    uidAttr:       Resource identifier of the attribute name.
00079 //    bstrDefValue:  The default string value, if the attribute could not be
00080 //                   found.
00081 //    bFailNoExist:  Whether throw an exception if the attribute does not
00082 //                   exist. Defaults to FALSE.
00083 //
00084 // Returns:          The string object.
00085 //
00086 //----------------------------------------------------------------------------
00087 CBSTR CXMLElement::GetStrAttr(UINT uidAttr, CBSTR& bstrDefValue, BOOL bFailNoExist)
00088 {
00089    CVariant v;
00090    if(GetAttr(uidAttr, &v, VT_BSTR, bFailNoExist))
00091    {
00092       CBSTR bstrReturn(v.bstrVal);
00093       return bstrReturn;
00094    }
00095    return bstrDefValue;
00096 }
00097
00098
00099 //----------------------------------------------------------------------------
00100 //
00101 // GetI4Attr function
00102 //    Retrieves the long value of an attribute of the element.
00103 //
00104 // Parameters:
00105 //    uidAttr:       Resource identifier of the attribute name.
00106 //    lDefValue:     The default long value, if the attribute could not be
00107 //                   found.
00108 //    bFailNoExist:  Whether throw an exception if the attribute does not
00109 //                   exist. Defaults to FALSE.
00110 //
00111 // Returns:          The long value.
00112 //
00113 //----------------------------------------------------------------------------
00114 long CXMLElement::GetI4Attr(UINT uidAttr, long lDefValue, BOOL bFailNoExist)
00115 {
00116    long lReturn = lDefValue;
00117    CVariant v;
00118    if(GetAttr(uidAttr, &v, VT_I4, bFailNoExist))
00119       lReturn = v.lVal;
00120    return lReturn;
00121 }
00122
00123
00124 //----------------------------------------------------------------------------
00125 //
00126 // GetR8Attr function
00127 //    Retrieves the double value of an attribute of the element.
00128 //
00129 // Parameters:
00130 //    uidAttr:       Resource identifier of the attribute name.
00131 //    dDefValue:     The default double value, if the attribute could not be
00132 //                   found.
00133 //    bFailNoExist:  Whether throw an exception if the attribute does not
00134 //                   exist. Defaults to FALSE.
00135 //
00136 // Returns:          The double value.
00137 //
00138 //----------------------------------------------------------------------------
00139 double CXMLElement::GetR8Attr(UINT uidAttr, double dDefValue, BOOL bFailNoExist)
00140 {
00141    double dReturn = dDefValue;
00142    CVariant v;
00143    if(GetAttr(uidAttr, &v, VT_R8, bFailNoExist))
00144       dReturn = v.dblVal;
00145    return dReturn;
00146 }
00147
00148
00149 //----------------------------------------------------------------------------
00150 //
00151 // GetUINTAttr function
00152 //    Retrieves the UINT value of an attribute of the element.
00153 //
00154 // Parameters:
00155 //    uidAttr:       Resource identifier of the attribute name.
00156 //    uiDefValue:    The default UINT value, if the attribute could not be
00157 //                   found.
00158 //    bFailNoExist:  Whether throw an exception if the attribute does not
00159 //                   exist. Defaults to FALSE.
00160 //
00161 // Returns:          The UINT value.
00162 //
00163 //----------------------------------------------------------------------------
00164 UINT CXMLElement::GetUINTAttr(UINT uidAttr, UINT uiDefValue, BOOL bFailNoExist)
00165 {
00166    UINT uiReturn = uiDefValue;
00167    CVariant v;
00168    if(GetAttr(uidAttr, &v, VT_UINT, bFailNoExist))
00169       uiReturn = v.uintVal;
00170    VariantClear(&v);
00171    return uiReturn;
00172 }
00173
00174
00175 #ifndef BMWS_XML_MINIMAL
00176
00177 //----------------------------------------------------------------------------
00178 //
00179 // NumChildOf function
00180 //    Retrieves the count of child elements of a specific tag name.
00181 //
00182 // Parameters:
00183 //    uidTagName:    Resource identifier of the child tag name.
00184 //
00185 // Returns:          The count of matching child elements.
00186 //
00187 //----------------------------------------------------------------------------
00188 long CXMLElement::NumChildOf(UINT uidTagName)
00189 {
00190    return AltNumChildOf(CBSTR(uidTagName));
00191 }
00192
00193
00194 //----------------------------------------------------------------------------
00195 //
00196 // ChildOf function
00197 //    Retrieves a specified child element of this element.
00198 //
00199 // Parameters:
00200 //    uidTagName:    Resource identifier of the child tag name.
00201 //    lIndex:        Zero-based index of which child to retrieve, if there are
00202 //                   multiple elements of the specified tag name.
00203 //    dwNotFound:    Specifies what to do if the child does not exist.
00204 //
00205 // Returns:          The pointer to child element object.
00206 //
00207 //----------------------------------------------------------------------------
00208 CXMLElement* CXMLElement::ChildOf(UINT uidTagName, long lIndex, DWORD dwNotFound)
00209 {
00210    return AltChildOf(CBSTR(uidTagName), lIndex, dwNotFound);
00211 }
00212
00213
00214 //----------------------------------------------------------------------------
00215 //
00216 // SetStrAttr function
00217 //    Sets the value of a string attribute of the element.
00218 //
00219 // Parameters:
00220 //    uidAttr:       Resource identifier of the attribute name.
00221 //    bstrValue:     The contents of the string attribute.
00222 //    vt:            The type of the data (VT_UINT, VT_I4, VT_R8, or VT_BSTR).
00223 //
00224 // Returns:          None.
00225 //
00226 //----------------------------------------------------------------------------
00227 void CXMLElement::SetStrAttr(UINT uidAttr, CBSTR& bstrValue)
00228 {
00229    CVariant v;
00230    v.vt = VT_BSTR;
00231    v.bstrVal = SysAllocStringLen(bstrValue, SysStringLen(bstrValue));
00232    try
00233    {
00234       CHECKHRCOM(m_spEl->setAttribute(CBSTR(uidAttr), v));
00235    }
00236    catch(CCOMExcep *pE)
00237    {
00238       RETHROWCOM(pE);
00239       XMLINTERNALEXCEP(20003);
00240    }
00241 }
00242
00243
00244 //----------------------------------------------------------------------------
00245 //
00246 // SetVTAttr function
00247 //    Sets the value of a non-string attribute of the element.
00248 //
00249 // Parameters:
00250 //    uidAttr:       Resource identifier of the attribute name.
00251 //    pvValue:       Pointer to the value data.
00252 //    vt:            The type of the data (VT_UINT, VT_I4, or VT_R8).
00253 //
00254 // Returns:          None.
00255 //
00256 //----------------------------------------------------------------------------
00257 void CXMLElement::SetVTAttr(UINT uidAttr, LPVOID pvValue, VARTYPE vt)
00258 {
00259    AltSetVTAttr(CBSTR(uidAttr), pvValue, vt);
00260 }
00261
00262
00263 //----------------------------------------------------------------------------
00264 //
00265 // AddChild function
00266 //    Adds a new child element to this element.
00267 //
00268 // Parameters:
00269 //    uidTagName:    Resource identifier of the new element's tag name.
00270 //    lIndex:        Zero-based index of the element before which to add the
00271 //                   element. The index is of elements of this tag name.
00272 //
00273 // Returns:          A pointer to the new child element object.
00274 //
00275 //----------------------------------------------------------------------------
00276 CXMLElement* CXMLElement::AddChild(UINT uidTagName, long lNewIndex)
00277 {
00278    return AltAddChild(CBSTR(uidTagName), lNewIndex);
00279 }
00280
00281
00282 //----------------------------------------------------------------------------
00283 //
00284 // DeleteChild function
00285 //    Deletes a child element from this element.
00286 //
00287 // Parameters:
00288 //    uidTagName:    Resource identifier of the element's tag name.
00289 //    lIndex:        Zero-based index of the element to delete. The index is
00290 //                   of elements of this tag name.
00291 //
00292 // Returns:          None.
00293 //
00294 //----------------------------------------------------------------------------
00295 void CXMLElement::DeleteChild(UINT uidTagName, long lIndex)
00296 {
00297    try
00298    {
00299       CXMLElementPtr pEl = ChildOf(uidTagName, lIndex, CHILDOF_NULLIFNOTFOUND);
00300       if(pEl)
00301       {
00302          CHECKHRCOM(m_spNode->removeChild(pEl->m_spNode, NULL));
00303       }
00304    }
00305    catch(CCOMExcep *pE)
00306    {
00307       RETHROWCOM(pE);
00308       XMLINTERNALEXCEP(20005);
00309    }
00310 }
00311
00312
00313 //----------------------------------------------------------------------------
00314 //
00315 // DeleteAttr function
00316 //    Deletes the specified attribute from this element.
00317 //
00318 // Parameters:
00319 //    uidAttr:       Resource identifier of the attribute name to remove.
00320 //
00321 // Returns:          None.
00322 //
00323 //----------------------------------------------------------------------------
00324 void CXMLElement::DeleteAttr(UINT uidAttr)
00325 {
00326    try
00327    {
00328       CHECKHRCOM(m_spEl->removeAttribute(CBSTR(uidAttr)));
00329    }
00330    catch(CCOMExcep *pE)
00331    {
00332       RETHROWCOM(pE);
00333       XMLINTERNALEXCEP(20006);
00334    }
00335 }
00336
00337
00338 //----------------------------------------------------------------------------
00339 //
00340 // GetText function
00341 //    Retrieves the inner text of the XML element.
00342 //
00343 // Parameters:       None.
00344 //
00345 // Returns:          The string of inner text.
00346 //
00347 //----------------------------------------------------------------------------
00348 CBSTR CXMLElement::GetText(CBSTR& bstrDefValue, BOOL bFailNoExist)
00349 {
00350    CBSTR bstrReturn;
00351    try
00352    {
00353       CHECKHRCOM(m_spNode->get_text(bstrReturn.Addr()));
00354    }
00355    catch(CCOMExcep *pE)
00356    {
00357       RETHROWCOM(pE);
00358       bstrReturn = bstrDefValue;
00359       if(bFailNoExist)
00360          THROW(new CXMLExcep(IDS_BMWS_XML_E_GETTEXT, IDS_BMWS_REMEDY_RESTART), CXMLExcep*);
00361    }
00362    return bstrReturn;
00363 }
00364
00365
00366 //----------------------------------------------------------------------------
00367 //
00368 // SetText function
00369 //    Sets the inner text of the XML element.
00370 //
00371 // Parameters:
00372 //    bstrText:      The string of text.
00373 //
00374 // Returns:          None.
00375 //
00376 //----------------------------------------------------------------------------
00377 void CXMLElement::SetText(CBSTR& bstrText)
00378 {
00379    _ASSERT(bstrText);
00380
00381    try
00382    {
00383       CHECKHRCOM(m_spNode->put_text(bstrText));
00384    }
00385    catch(CCOMExcep *pE)
00386    {
00387       RETHROWCOM(pE);
00388       XMLINTERNALEXCEP(20008);
00389    }
00390 }
00391
00392
00393 #ifdef BMWS_XML_GETXML
00394
00395 //----------------------------------------------------------------------------
00396 //
00397 // GetXML function
00398 //    Retrieves the inner XML contents of the XML element.
00399 //
00400 // Parameters:       None.
00401 //
00402 // Returns:          The string of inner XML.
00403 //
00404 //----------------------------------------------------------------------------
00405 CBSTR CXMLElement::GetXML(BOOL bFailNoExist)
00406 {
00407    CBSTR bstrReturn;
00408    try
00409    {
00410       CHECKHRCOM(m_spNode->get_xml(bstrReturn.Addr()));
00411    }
00412    catch(CCOMExcep *pE)
00413    {
00414       RETHROWCOM(pE);
00415       if(bFailNoExist)
00416          XMLINTERNALEXCEP(20013);
00417    }
00418    return bstrReturn;
00419 }
00420
00421
00422 //----------------------------------------------------------------------------
00423 //
00424 // SetXML function
00425 //    Sets the inner XML contents of the XML element.
00426 //
00427 // Parameters:
00428 //    bstrXML:       The string of XML.
00429 //
00430 // Returns:          None.
00431 //
00432 //----------------------------------------------------------------------------
00433 void CXMLElement::SetXML(CBSTR& bstrXML)
00434 {
00435    _ASSERT(bstrXML);
00436
00437    /*try
00438    {
00439       CHECKHRCOM(m_spNode->put_text(bstrText));
00440    }
00441    catch(CCOMExcep *pE)
00442    {
00443       RETHROWCOM(pE);
00444       XMLINTERNALEXCEP(20014);
00445    }*/
00446 }
00447
00448 #endif
00449
00450
00451 //----------------------------------------------------------------------------
00452 //
00453 // GetTagName function
00454 //    Retrieves the tag name of the element.
00455 //
00456 // Parameters:       None.
00457 //
00458 // Returns:          The tag name string.
00459 //
00460 //----------------------------------------------------------------------------
00461 CBSTR CXMLElement::GetTagName()
00462 {
00463    CBSTR bstrReturn;
00464    try
00465    {
00466       CHECKHRCOM(m_spEl->get_tagName(bstrReturn.Addr()));
00467    }
00468    catch(CCOMExcep *pE)
00469    {
00470       RETHROWCOM(pE);
00471       XMLINTERNALEXCEP(20009);
00472    }
00473    return bstrReturn;
00474 }
00475
00476
00477 //----------------------------------------------------------------------------
00478 //
00479 // IsTag function
00480 //    Determines whether the element is of a given tag name.
00481 //
00482 // Parameters:
00483 //    uidTagName:    Resource identifier of the tag name.
00484 //
00485 // Returns:          TRUE if this element matches the tag name, else FALSE.
00486 //
00487 //----------------------------------------------------------------------------
00488 BOOL CXMLElement::IsTag(UINT uidTagName)
00489 {
00490    CBSTR bstrCurTag = GetTagName();
00491    return bstrCurTag.Equals(CBSTR(uidTagName));
00492 }
00493
00494 #endif
00495
00496
00497 //----------------------------------------------------------------------------
00498 //
00499 // AltGetAttr function
00500 //    Retrieves the value of an attribute of the element.
00501 //
00502 // Parameters:
00503 //    uidAttr:       The attribute name.
00504 //    pvarValue:     The default string value, if the attribute could not be
00505 //                   found.
00506 //    vt:            Type of value to convert the attribute into.
00507 //    bFailNoExist:  Whether throw an exception if the attribute does not
00508 //                   exist. Defaults to FALSE.
00509 //
00510 // Returns:          TRUE if the attribute was retrieved successfully, FALSE
00511 //                   if it was not.
00512 //
00513 //----------------------------------------------------------------------------
00514 BOOL CXMLElement::AltGetAttr(BSTR bstrAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist)
00515 {
00516    _ASSERT(pvarValue);
00517    VariantInit(pvarValue);
00518    try
00519    {
00520       HRESULT hr = m_spEl->getAttribute(bstrAttr, pvarValue);
00521       CHECKHRCOM(hr);
00522       if(hr == S_OK)
00523       {
00524          if(vt != VT_EMPTY)
00525             CHECKHRCOM(VariantChangeType(pvarValue, pvarValue, 0, vt));
00526          return TRUE;
00527       }
00528    }
00529    catch(CCOMExcep *pCE)
00530    {
00531       VariantClear(pvarValue);
00532       RETHROWCOM(pCE);
00533    }
00534    catch(CExcep *pE)
00535    {
00536       VariantClear(pvarValue);
00537       throw pE;
00538    }
00539    VariantClear(pvarValue);
00540    if(bFailNoExist)
00541       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETATTR, IDS_BMWS_REMEDY_RESTART,
00542          (UINT_PTR)(LPTSTR)CTSTR(bstrAttr), 0, ERROR_ERRORINS_LPTSTR), CXMLExcep*);
00543    return FALSE;
00544 }
00545
00546
00547 #ifndef BMWS_XML_MINIMAL
00548
00549 //----------------------------------------------------------------------------
00550 //
00551 // AltNumChildOf function
00552 //    Retrieves the count of child elements of a specific tag name.
00553 //
00554 // Parameters:
00555 //    bstrTagName:   The child tag name.
00556 //
00557 // Returns:          The count of matching child elements.
00558 //
00559 //----------------------------------------------------------------------------
00560 long CXMLElement::AltNumChildOf(BSTR bstrTagName)
00561 {
00562    _ASSERT(bstrTagName);
00563    long lNumChildren = 0;
00564    try
00565    {
00566       CPtr<IXMLDOMNodeList, &IID_IXMLDOMNodeList> spNodeList;
00567       CHECKHRCOM(m_spNode->selectNodes(bstrTagName, &spNodeList));
00568       CHECKHRCOM(spNodeList->get_length(&lNumChildren));
00569    }
00570    catch(CCOMExcep *pE)
00571    {
00572       RETHROWCOM(pE);
00573       XMLINTERNALEXCEP(20001);
00574    }
00575
00576    return lNumChildren;
00577 }
00578
00579
00580 //----------------------------------------------------------------------------
00581 //
00582 // AltChildOf function
00583 //    Retrieves a specified child element of this element.
00584 //
00585 // Parameters:
00586 //    bstrTagName:   The child tag name.
00587 //    lIndex:        Zero-based index of which child to retrieve, if there are
00588 //                   multiple elements of the specified tag name.
00589 //    dwNotFound:    Specifies what to do if the child does not exist.
00590 //
00591 // Returns:          The pointer to child element object.
00592 //
00593 //----------------------------------------------------------------------------
00594 CXMLElement* CXMLElement::AltChildOf(BSTR bstrTagName, long lIndex, DWORD dwNotFound)
00595 {
00596    CXMLElement *pReturn = NULL;
00597
00598    CTSTR lpszTag(bstrTagName);
00599    CTSTR lpszFormatter(IDS_BMWS_XML_XSLINDEX);
00600    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + lstrlen(lpszTag) + 5);
00601    wsprintf(lpszFinal, lpszFormatter, lpszTag, lIndex);
00602
00603    CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spSubNode;
00604    HRESULT hr = m_spNode->selectSingleNode(CBSTR(lpszFinal), &spSubNode);
00605    if(hr == S_OK)
00606    {
00607       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spSubEl(spSubNode);
00608       pReturn = new CXMLElement(spSubEl);
00609       ENSUREALLOC(pReturn);
00610       hr = S_OK;
00611    } else if(hr == S_FALSE)
00612    {
00613       if(dwNotFound == CHILDOF_CREATEIFNOTFOUND)
00614          pReturn = AltAddChild(bstrTagName, lIndex);
00615       else if(dwNotFound == CHILDOF_FAILIFNOTFOUND)
00616          XMLINTERNALEXCEP(20012);
00617    } else
00618       XMLINTERNALEXCEP(20002);
00619
00620    return pReturn;
00621 }
00622
00623
00624 //----------------------------------------------------------------------------
00625 //
00626 // AltAddChild function
00627 //    Adds a new child element to this element.
00628 //
00629 // Parameters:
00630 //    bstrTagName:   The new element's tag name.
00631 //    lIndex:        Zero-based index of the element before which to add the
00632 //                   element. The index is of elements of this tag name.
00633 //
00634 // Returns:          A pointer to the new child element object.
00635 //
00636 //----------------------------------------------------------------------------
00637 CXMLElement* CXMLElement::AltAddChild(BSTR bstrTagName, long lNewIndex)
00638 {
00639    CXMLElement *pNewEl = NULL;
00640
00641    try
00642    {
00643       CPtr<IXMLDOMDocument, &IID_IXMLDOMDocument> spDoc;
00644       CHECKHRCOM(m_spEl->get_ownerDocument(&spDoc));
00645       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spNewEl;
00646       CHECKHRCOM(spDoc->createElement(bstrTagName, &spNewEl));
00647       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNewNode = spNewEl;
00648
00649       if(lNewIndex == -1)
00650       {
00651          CHECKHRCOM(m_spNode->appendChild(spNewNode, NULL));
00652       } else
00653       {
00654          CXMLElementPtr pBeforeEl(AltChildOf(bstrTagName, lNewIndex, CHILDOF_NULLIFNOTFOUND));
00655          if(pBeforeEl)
00656          {
00657             CPtr<IDispatch, &IID_IDispatch> spBeforeDisp(pBeforeEl->m_spNode);
00658             VARIANT v;
00659             VariantInit(&v);
00660             v.vt = VT_DISPATCH;
00661             v.pdispVal = spBeforeDisp;
00662             CHECKHRCOM(m_spNode->insertBefore(spNewNode, v, NULL));
00663          } else
00664             CHECKHRCOM(m_spNode->appendChild(spNewNode, NULL));
00665       }
00666       pNewEl = new CXMLElement(spNewEl);
00667       ENSUREALLOC(pNewEl);
00668    }
00669    catch(CCOMExcep *pE)
00670    {
00671       RETHROWCOM(pE);
00672       XMLINTERNALEXCEP(20004);
00673    }
00674
00675    return pNewEl;
00676 }
00677
00678
00679 //----------------------------------------------------------------------------
00680 //
00681 // AltSetVTAttr function
00682 //    Sets the value of a non-string attribute of the element.
00683 //
00684 // Parameters:
00685 //    bstrAttr:      The attribute name.
00686 //    pvValue:       Pointer to the value data (or to the VARIANT structure).
00687 //    vt:            The type of the data (VT_UINT, VT_I4, or VT_R8).
00688 //
00689 // Returns:          None.
00690 //
00691 //----------------------------------------------------------------------------
00692 void CXMLElement::AltSetVTAttr(BSTR bstrAttr, LPVOID pvValue, VARTYPE vt)
00693 {
00694    CVariant v;
00695    if(vt != VT_EMPTY)
00696    {
00697       v.vt = vt;
00698       switch(vt)
00699       {
00700          case VT_UINT:
00701             v.uintVal = *((UINT*)pvValue);
00702             break;
00703          case VT_I4:
00704             v.lVal = *((long*)pvValue);
00705             break;
00706          case VT_R8:
00707             v.dblVal = *((double*)pvValue);
00708             break;
00709          default:
00710             _ASSERT(FALSE);
00711       }
00712    } else
00713       VariantCopy(&v, (VARIANT*)pvValue);
00714
00715    try
00716    {
00717       if(vt != VT_EMPTY)
00718          CHECKHRCOM(VariantChangeType(&v, &v, 0, VT_BSTR));
00719       CHECKHRCOM(m_spEl->setAttribute(bstrAttr, v));
00720    }
00721    catch(CCOMExcep *pE)
00722    {
00723       RETHROWCOM(pE);
00724       XMLINTERNALEXCEP(20007);
00725    }
00726 }
00727
00728
00729 #ifdef BMWS_XML_QI
00730
00731 //----------------------------------------------------------------------------
00732 //
00733 // QI function
00734 //    Returns pointers to supported interfaces of the internal element object.
00735 //
00736 // Parameters:
00737 //    riid:          [in] Identifier of the interface being requested.
00738 //    ppvObject:     [out] Address of pointer variable that receives the
00739 //                   interface pointer requested in riid.
00740 //
00741 // Returns:          A standard COM success or error value.
00742 //
00743 //----------------------------------------------------------------------------
00744 HRESULT CXMLElement::QI(REFIID riid, LPVOID *ppvObject)
00745 {
00746    _ASSERT(ppvObject);
00747    return m_spEl->QueryInterface(riid, ppvObject);
00748 }
00749
00750 #endif
00751
00752 #endif
00753
00754
00755 //----------------------------------------------------------------------------
00756 //
00757 // CXMLDocument constructor
00758 //
00759 // Parameters:       None.
00760 //
00761 //----------------------------------------------------------------------------
00762 CXMLDocument::CXMLDocument()
00763 {
00764    m_pSite = NULL;
00765    m_bValidLoaded = FALSE;
00766    m_bPutHandler = FALSE;
00767 #ifndef BMWS_XML_MINIMAL
00768    m_hFile.Assign(INVALID_HANDLE_VALUE, CloseHandle);
00769 #endif
00770 }
00771
00772
00773 //----------------------------------------------------------------------------
00774 //
00775 // CXMLDocument destructor
00776 //
00777 //----------------------------------------------------------------------------
00778 CXMLDocument::~CXMLDocument()
00779 {
00780    if(m_bPutHandler)
00781    {
00782       VARIANT vHandler;
00783       vHandler.vt = VT_NULL;
00784       m_spDoc->put_onreadystatechange(vHandler);
00785    }
00786 }
00787
00788
00789 //----------------------------------------------------------------------------
00790 //
00791 // InitXMLDocument function
00792 //    Creates the MSXML Document object and sets internal variables.
00793 //
00794 // Parameters:
00795 //    pSite:            Interface of the creator, to be notified when the
00796 //                      document is finished loading.
00797 //
00798 // Returns:             None.
00799 //
00800 //----------------------------------------------------------------------------
00801 void CXMLDocument::InitXMLDocument(IXMLDocumentSite *pSite)
00802 {
00803    m_pSite = pSite;
00804    try
00805    {
00806       CHECKHRCOM(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
00807          IID_IXMLDOMDocument, (LPVOID*)&m_spDoc));
00808    }
00809    catch(CCOMExcep *pE)
00810    {
00811       RETHROWCOM(pE);
00812       THROW(new CXMLExcep(IDS_BMWS_XML_E_MSXMLCREATE, IDS_BMWS_REMEDY_IE), CXMLExcep*);
00813    }
00814 }
00815
00816
00817 //----------------------------------------------------------------------------
00818 //
00819 // LoadFromFile function
00820 //    Loads an XML document from a file.
00821 //
00822 // Parameters:
00823 //    bstrFile:      Filename to load.
00824 //    bAsync:        Whether to load asynchronously or not. Defaults to TRUE.
00825 //
00826 // Returns:          A standard COM success or error value.
00827 //
00828 //----------------------------------------------------------------------------
00829 HRESULT CXMLDocument::LoadFromFile(CBSTR& bstrFile, BOOL bAsync)
00830 {
00831    _ASSERT(bstrFile);
00832
00833    Abort();
00834
00835 #ifndef BMWS_XML_MINIMAL
00836    m_hFile.Close();
00837 #endif
00838
00839    m_bstrFile = bstrFile;
00840
00841    VARIANT_BOOL vb;
00842    HRESULT hr;
00843    VARIANT vURL;
00844
00845    m_bValidLoaded = FALSE;
00846
00847    if(m_bPutHandler)
00848    {
00849       VARIANT vHandler;
00850       vHandler.vt = VT_NULL;
00851       m_spDoc->put_onreadystatechange(vHandler);
00852    }
00853
00854    CEventHandler *pHandler = NULL;
00855    if(bAsync)
00856    {
00857       pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00858       ENSUREALLOC(pHandler);
00859    }
00860
00861    try
00862    {
00863       if(bAsync)
00864       {
00865          CVariant vHandler;
00866          vHandler.vt = VT_DISPATCH;
00867          pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00868          CHECKHRCOM(m_spDoc->put_onreadystatechange(vHandler));
00869          m_bPutHandler = TRUE;
00870       }
00871
00872       CHECKHRCOM(m_spDoc->put_async(bAsync ? VARIANT_TRUE : VARIANT_FALSE));
00873
00874       vURL.vt = VT_BSTR;
00875       V_BSTR(&vURL) = m_bstrFile;
00876       hr = m_spDoc->load(vURL, &vb);
00877       CHECKFOROOM(hr);
00878       if(FAILED(hr))
00879          return hr;
00880       if(!bAsync)
00881       {
00882          EventHandler(0, 0);
00883       }
00884    }
00885    catch(CCOMExcep *pE)
00886    {
00887       RETHROWCOM(pE);
00888       THROW(new CXMLExcep(IDS_BMWS_XML_E_MSXMLCREATE, IDS_BMWS_REMEDY_IE), CXMLExcep*);
00889    }
00890
00891    return S_OK;
00892 }
00893
00894
00895 #ifndef BMWS_XML_MINIMAL
00896
00897 //----------------------------------------------------------------------------
00898 //
00899 // SaveToFile function
00900 //    Writes the XML document to a file.
00901 //
00902 // Parameters:
00903 //    bstrFile:      The name of the file to write to. If empty, the loaded
00904 //                   file name will be used.
00905 //
00906 // Returns:          A standard COM success or error value. (S_OK)
00907 //
00908 //----------------------------------------------------------------------------
00909 HRESULT CXMLDocument::SaveToFile(CBSTR& bstrFile)
00910 {
00911    CBSTR theFile = bstrFile;
00912    if(!theFile)
00913       theFile = m_bstrFile;
00914    _ASSERT(theFile);
00915    _ASSERT(m_bValidLoaded);
00916
00917    VARIANT vURL;
00918    vURL.vt = VT_BSTR;
00919    vURL.bstrVal = theFile;
00920
00921    m_hFile.Close();
00922    HRESULT hr = m_spDoc->save(vURL);
00923    CHECKFOROOM(hr);
00924    m_bstrFile = theFile;
00925    m_hFile.Assign(CreateFile(CTSTR(m_bstrFile), GENERIC_READ, FILE_SHARE_READ, NULL,
00926       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
00927    return hr;
00928 }
00929
00930 #endif
00931
00932
00933 //----------------------------------------------------------------------------
00934 //
00935 // Abort function
00936 //    Aborts an asynchronous download in progress.
00937 //
00938 // Parameters:       None.
00939 //
00940 // Returns:          None.
00941 //
00942 //----------------------------------------------------------------------------
00943 void CXMLDocument::Abort()
00944 {
00945    try
00946    {
00947       CHECKHRCOM(m_spDoc->abort());
00948    }
00949    catch(CCOMExcep *pE)
00950    {
00951       RETHROWCOM(pE);
00952       XMLINTERNALEXCEP(20010);
00953    }
00954 }
00955
00956
00957 #ifndef BMWS_XML_MINIMAL
00958
00959 //----------------------------------------------------------------------------
00960 //
00961 // CreateRootElement function
00962 //    Creates a new element, sets it as the root element, and returns it.
00963 //
00964 // Parameters:
00965 //    uidTagName:    String resource identifier of the tag to create.
00966 //
00967 // Returns:          The new root element object.
00968 //
00969 //----------------------------------------------------------------------------
00970 CXMLElement* CXMLDocument::CreateRootElement(UINT uidTagName)
00971 {
00972    CXMLElement *pReturn = NULL;
00973
00974    try
00975    {
00976       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spNewEl;
00977       CHECKHRCOM(m_spDoc->createElement(CBSTR(uidTagName), &spNewEl));
00978       CHECKHRCOM(m_spDoc->putref_documentElement(spNewEl));
00979
00980       pReturn = new CXMLElement(spNewEl);
00981       ENSUREALLOC(pReturn);
00982
00983       CPtr<IXMLDOMProcessingInstruction, &IID_IXMLDOMProcessingInstruction> spPI;
00984       CHECKHRCOM(m_spDoc->createProcessingInstruction(CBSTR(IDS_BMWS_XML_PI_TARGET),
00985          CBSTR(IDS_BMWS_XML_PI_DATA), &spPI));
00986       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNodeDoc(m_spDoc);
00987       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNodePI(spPI);
00988       CPtr<IDispatch, &IID_IDispatch> spDispNewEl(spNewEl);
00989       VARIANT v;
00990       VariantInit(&v);
00991       v.vt = VT_DISPATCH;
00992       v.pdispVal = spDispNewEl;
00993       CHECKHRCOM(spNodeDoc->insertBefore(spNodePI, v, NULL));
00994       m_bValidLoaded = TRUE;
00995    }
00996    catch(CCOMExcep *pE)
00997    {
00998       RETHROWCOM(pE);
00999       XMLINTERNALEXCEP(20011);
01000    }
01001
01002    return pReturn;
01003 }
01004
01005 #endif
01006
01007
01008 //----------------------------------------------------------------------------
01009 //
01010 // GetRootElement function
01011 //    Retrieves the XML document's root element object.
01012 //
01013 // Parameters:       None.
01014 //
01015 // Returns:          The root element object.
01016 //
01017 //----------------------------------------------------------------------------
01018 CXMLElement* CXMLDocument::GetRootElement()
01019 {
01020    if(!m_bValidLoaded)
01021       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETROOTEL, IDS_BMWS_REMEDY_CONTACTBMWS), CXMLExcep*);
01022
01023    CXMLElement *pReturn = NULL;
01024    try
01025    {
01026       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spEl;
01027       CHECKHRCOM(m_spDoc->get_documentElement(&spEl));
01028       pReturn = new CXMLElement(spEl);
01029       ENSUREALLOC(pReturn);
01030    }
01031    catch(CCOMExcep *pE)
01032    {
01033       RETHROWCOM(pE);
01034       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETROOTEL, IDS_BMWS_REMEDY_CONTACTBMWS), CXMLExcep*);
01035    }
01036
01037    return pReturn;
01038 }
01039
01040
01041 #ifndef BMWS_XML_MINIMAL
01042
01043 //----------------------------------------------------------------------------
01044 //
01045 // GetFileName function
01046 //    Retrieves the XML document's file name.
01047 //
01048 // Parameters:
01049 //    ppEl:          Pointer to hold the root element object.
01050 //
01051 // Returns:          String containing the file name.
01052 //
01053 //----------------------------------------------------------------------------
01054 CBSTR CXMLDocument::GetFileName()
01055 {
01056    return m_bstrFile;
01057 }
01058
01059 #endif
01060
01061
01062 //----------------------------------------------------------------------------
01063 //
01064 // IsValidXML function
01065 //    Returns whether the document is valid XML.
01066 //
01067 // Parameters:       None.
01068 //
01069 // Returns:          TRUE if the document is valid XML, else FALSE.
01070 //
01071 //----------------------------------------------------------------------------
01072 BOOL CXMLDocument::IsValidXML()
01073 {
01074    return m_bValidLoaded;
01075 }
01076
01077
01078 //----------------------------------------------------------------------------
01079 //
01080 // IEventHandlerSite::EventHandler method
01081 //    Handler for XML document's onreadystatechange event. When the document
01082 //    is finished loading, check it for validity and call the notification
01083 //    function.
01084 //
01085 // Parameters:
01086 //    dwEventID:     The event identifier (zero).
01087 //    lParam:        Handler parameter (NULL).
01088 //
01089 // Returns:          A standard COM success or error value.
01090 //
01091 //----------------------------------------------------------------------------
01092 void CXMLDocument::EventHandler(DWORD dwEventID, LPARAM lParam)
01093 {
01094    try   // Windows-called code
01095    {
01096       m_bValidLoaded = FALSE;
01097       long lReadyState;
01098       if(SUCCEEDED(m_spDoc->get_readyState(&lReadyState)) && (lReadyState == READYSTATE_COMPLETE))
01099       {
01100          CPtr<IXMLDOMParseError, &IID_IXMLDOMParseError> spXMLError;
01101          LONG lErrorCode = E_FAIL;
01102          CHECKHRCOM(m_spDoc->get_parseError(&spXMLError));
01103          CHECKHRCOM(spXMLError->get_errorCode(&lErrorCode));
01104          if(lErrorCode == 0)
01105             m_bValidLoaded = TRUE;
01106
01107 #ifndef BMWS_XML_MINIMAL
01108          m_hFile.Assign(CreateFile(CTSTR(m_bstrFile), GENERIC_READ, FILE_SHARE_READ, NULL,
01109             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
01110 #endif
01111
01112          if(m_pSite)
01113             m_pSite->XMLDone(this);
01114       }
01115    }
01116    catch(CExcep *pE)
01117    {
01118       pE->Report();
01119       pE->Delete();
01120    }
01121 }
01122
01123
01124 #ifndef BMWS_XML_MINIMAL
01125
01126 #ifdef BMWS_XML_QI
01127
01128 //----------------------------------------------------------------------------
01129 //
01130 // QI function
01131 //    Returns pointers to supported interfaces of the internal document
01132 //    object.
01133 //
01134 // Parameters:
01135 //    riid:          [in] Identifier of the interface being requested.
01136 //    ppvObject:     [out] Address of pointer variable that receives the
01137 //                   interface pointer requested in riid.
01138 //
01139 // Returns:          A standard COM success or error value.
01140 //
01141 //----------------------------------------------------------------------------
01142 HRESULT CXMLDocument::QI(REFIID riid, LPVOID *ppvObject)
01143 {
01144    _ASSERT(ppvObject);
01145    return m_spDoc->QueryInterface(riid, ppvObject);
01146 }
01147
01148 #endif
01149
01150 #endif
Generated on Wed May 8 12:39:00 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml.h File Reference

#include <bmws_pointer.h>
#include <bmws_ptr.h>
#include <bmws_string.h>
#include <bmws_error.h>
#include <bmws_eventhandler.h>
#include <bmws_handle.h>
#include <msxml.h>
#include <ocidl.h>

Go to the source code of this file.

Compounds

class | CXMLDocument
class | CXMLElement
class | CXMLExcep
class | IXMLDocumentSite

Defines

#define | AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
#define | CHILDOF_NULLIFNOTFOUND 0
#define | CHILDOF_CREATEIFNOTFOUND 1
#define | CHILDOF_FAILIFNOTFOUND 2

Typedefs

typedef CPointer< CXMLElement > | CXMLElementPtr
typedef CPointer< CXMLDocument > | CXMLDocumentPtr

Define Documentation

#define AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_

Definition at line 10 of file bmws_xml.h.

#define CHILDOF_CREATEIFNOTFOUND 1

Definition at line 36 of file bmws_xml.h.

Referenced by CXMLElement::AltChildOf().

#define CHILDOF_FAILIFNOTFOUND 2

Definition at line 37 of file bmws_xml.h.

Referenced by CXMLElement::AltChildOf().

#define CHILDOF_NULLIFNOTFOUND 0

Definition at line 35 of file bmws_xml.h.

Referenced by CXMLElement::AltAddChild(), CCompoundXMLDocument::CleanupFiles(), CXMLElement::DeleteChild(), and CCompoundXMLDocument::XMLDone().

Typedef Documentation

typedef CPointer<CXMLDocument> CXMLDocumentPtr

Definition at line 206 of file bmws_xml.h.

typedef CPointer<CXMLElement> CXMLElementPtr

Definition at line 134 of file bmws_xml.h.

Referenced by CCompoundXMLDocument::AddFile().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml.h Source File

bmws_xml.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // bmws_xml.h
00004 //    Classes to encapsulate XML elements and documents.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
00010 #define AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_pointer.h>
00021 #include <bmws_ptr.h>
00022 #include <bmws_string.h>
00023 #include <bmws_error.h>
00024 #include <bmws_eventhandler.h>
00025 #ifndef BMWS_XML_MINIMAL
00026    #include <bmws_handle.h>
00027 #endif
00028 #include <msxml.h>
00029 #include <ocidl.h>
00030
00031
00032 //----------------------------------------------------------------------------
00033 // ChildOf not-found values
00034 //----------------------------------------------------------------------------
00035 #define CHILDOF_NULLIFNOTFOUND      0
00036 #define CHILDOF_CREATEIFNOTFOUND    1
00037 #define CHILDOF_FAILIFNOTFOUND      2
00038
00039
00040 //----------------------------------------------------------------------------
00041 //
00042 // CXMLExcep class
00043 //    Encapsulates exception handling with advanced error handling.
00044 //
00045 //----------------------------------------------------------------------------
00046 class CXMLExcep : public CExcepEx
00047 {
00048 public:
00049
00050    //-------------------------------------------------------------------------
00051    //
00052    // Constructor
00053    //
00054    // Parameters:
00055    //    uidError:         String resource identifier of the error that
00056    //                      occurred.
00057    //    uidRemedy:        String resource identifier of what the user should
00058    //                      do.
00059    //    uidErrorIns:      String resource identifier or string that should be
00060    //                      formatted into the error string. Defaults to 0.
00061    //    uidRemedyIns:     String resource identifier or string that should be
00062    //                      formatted into the remedy string. Defaults to 0.
00063    //    dwFlags:          Specifies whether the insert strings are resource
00064    //                      identifiers or existing string buffers. Defaults to
00065    //                      0.
00066    //
00067    //----------------------------------------------------------------------------
00068    CXMLExcep(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns = 0, UINT_PTR uidRemedyIns = 0,
00069       DWORD dwFlags = 0) : CExcepEx(uidError, uidRemedy, uidErrorIns, uidRemedyIns, dwFlags)
00070    {
00071    }
00072 };
00073
00074
00075 //----------------------------------------------------------------------------
00076 //
00077 // CXMLElement class
00078 //    Encapsulates an XML element (IXMLDOMElement).
00079 //
00080 //----------------------------------------------------------------------------
00081 class CXMLElement : public CRefCount
00082 {
00083 public:
00084    CXMLElement(IXMLDOMElement *pEl);
00085
00086    BOOL GetAttr(UINT uidAttr, VARIANT* pvarValue, VARTYPE vt, BOOL bFailNoExist = FALSE);
00087    CBSTR GetStrAttr(UINT uidAttr, CBSTR& bstrDefValue, BOOL bFailNoExist = FALSE);
00088    long GetI4Attr(UINT uidAttr, long lDefValue, BOOL bFailNoExist = FALSE);
00089    double GetR8Attr(UINT uidAttr, double dDefValue, BOOL bFailNoExist = FALSE);
00090    UINT GetUINTAttr(UINT uidAttr, UINT uiDefValue, BOOL bFailNoExist = FALSE);
00091
00092 #ifndef BMWS_XML_MINIMAL
00093    long NumChildOf(UINT uidTagName);
00094    CXMLElement* ChildOf(UINT uidTagName, long lIndex, DWORD dwNotFound = CHILDOF_FAILIFNOTFOUND);
00095
00096    void SetStrAttr(UINT uidAttr, CBSTR& bstrValue);
00097    void SetVTAttr(UINT uidAttr, LPVOID pvValue, VARTYPE vt);
00098    CXMLElement* AddChild(UINT uidTagName, long lNewIndex);
00099    void DeleteChild(UINT uidTagName, long lIndex);
00100    void DeleteAttr(UINT uidAttr);
00101
00102    CBSTR GetText(CBSTR& bstrDefValue, BOOL bFailNoExist = FALSE);
00103    void SetText(CBSTR& bstrText);
00104
00105 #ifdef BMWS_XML_GETXML
00106    CBSTR GetXML(BOOL bFailNoExist = FALSE);
00107    void SetXML(CBSTR& bstrXML);
00108 #endif
00109
00110    CBSTR GetTagName();
00111    BOOL IsTag(UINT uidTagName);
00112 #endif
00113
00114    BOOL AltGetAttr(BSTR bstrAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist = FALSE);
00115
00116 #ifndef BMWS_XML_MINIMAL
00117    long AltNumChildOf(BSTR bstrTagName);
00118    CXMLElement* AltChildOf(BSTR bstrTagName, long lIndex,
00119       DWORD dwNotFound = CHILDOF_FAILIFNOTFOUND);
00120    CXMLElement* AltAddChild(BSTR bstrTagName, long lNewIndex);
00121    void AltSetVTAttr(BSTR bstrAttr, LPVOID pvValue, VARTYPE vt);
00122
00123 #ifdef BMWS_XML_QI
00124    HRESULT QI(REFIID riid, LPVOID *ppvObject);
00125 #endif
00126
00127 #endif
00128
00129 private:
00130    CPtr<IXMLDOMElement, &IID_IXMLDOMElement> m_spEl;  // Pointer to MSXML element interface
00131    CPtr<IXMLDOMNode, &IID_IXMLDOMNode> m_spNode;      // Pointer to MSXML node interface
00132 };
00133
00134 typedef CPointer<CXMLElement> CXMLElementPtr;
00135
00136
00137 //----------------------------------------------------------------------------
00138 // Forward definition
00139 //----------------------------------------------------------------------------
00140 class CXMLDocument;
00141
00142
00143 //----------------------------------------------------------------------------
00144 //
00145 // IXMLDocumentSite abstract class
00146 //    Enables communication from an XML document to its creator.
00147 //
00148 //----------------------------------------------------------------------------
00149 class IXMLDocumentSite
00150 {
00151 public:
00152    virtual void XMLDone(CXMLDocument *pDoc) = 0;
00153 };
00154
00155
00156 //----------------------------------------------------------------------------
00157 //
00158 // CXMLDocument class
00159 //    Encapsulates an XML document (IXMLDOMDocument).
00160 //
00161 //----------------------------------------------------------------------------
00162 class CXMLDocument : public CRefCount, public IEventHandlerSite
00163 {
00164 public:
00165    CXMLDocument();
00166    virtual ~CXMLDocument();
00167
00168    void InitXMLDocument(IXMLDocumentSite *pSite);
00169
00170    void Abort();
00171    HRESULT LoadFromFile(CBSTR& bstrFile, BOOL bAsync = TRUE);
00172
00173 #ifndef BMWS_XML_MINIMAL
00174    HRESULT SaveToFile(CBSTR& bstrFile);
00175
00176    CXMLElement* CreateRootElement(UINT uidTagName);
00177 #endif
00178
00179    CXMLElement* GetRootElement();
00180    BOOL IsValidXML();
00181
00182 #ifndef BMWS_XML_MINIMAL
00183    CBSTR GetFileName();
00184
00185 #ifdef BMWS_XML_QI
00186    HRESULT QI(REFIID riid, LPVOID *ppvObject);
00187 #endif
00188
00189 #endif
00190
00191    // IEventHandlerSite method
00192    void EventHandler(DWORD dwEventID, LPARAM lParam);
00193
00194
00195 protected:
00196    CPtr<IXMLDOMDocument, &IID_IXMLDOMDocument> m_spDoc;  // Pointer to MSXML document interface
00197    BOOL m_bPutHandler;        // Whether the internal event sink was set
00198    CBSTR m_bstrFile;          // The current file name
00199    IXMLDocumentSite *m_pSite; // Interface of the creator
00200 #ifndef BMWS_XML_MINIMAL
00201    CHandle m_hFile;           // Handle to the loaded file
00202 #endif
00203    BOOL m_bValidLoaded;       // Whether a valid document is loaded
00204 };
00205
00206 typedef CPointer<CXMLDocument> CXMLDocumentPtr;
00207
00208
00209 #endif // !defined(AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_)
Generated on Wed May 8 12:39:01 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml_res.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_XML_XSLINDEX 8501
#define | IDS_BMWS_XML_PI_TARGET 8502
#define | IDS_BMWS_XML_PI_DATA 8503

Define Documentation

#define IDS_BMWS_XML_PI_DATA 8503

Definition at line 7 of file bmws_xml_res.h.

Referenced by CXMLDocument::CreateRootElement().

#define IDS_BMWS_XML_PI_TARGET 8502

Definition at line 6 of file bmws_xml_res.h.

Referenced by CXMLDocument::CreateRootElement().

#define IDS_BMWS_XML_XSLINDEX 8501

Definition at line 5 of file bmws_xml_res.h.

Referenced by CXMLElement::AltChildOf().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml_res.h Source File

bmws_xml_res.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_xml.rc
00004 //
00005 #define IDS_BMWS_XML_XSLINDEX           8501
00006 #define IDS_BMWS_XML_PI_TARGET          8502
00007 #define IDS_BMWS_XML_PI_DATA            8503
00008
00009 // Next default values for new objects
00010 //
00011 #ifdef APSTUDIO_INVOKED
00012 #ifndef APSTUDIO_READONLY_SYMBOLS
00013 #define _APS_NEXT_RESOURCE_VALUE        101
00014 #define _APS_NEXT_COMMAND_VALUE         40001
00015 #define _APS_NEXT_CONTROL_VALUE         1000
00016 #define _APS_NEXT_SYMED_VALUE           101
00017 #endif
00018 #endif
Generated on Wed May 8 12:39:01 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml_res_lc.h File Reference

Go to the source code of this file.

Defines

#define | IDS_BMWS_XML_E_INTERNAL 18501
#define | IDS_BMWS_XML_E_MSXMLCREATE 18502
#define | IDS_BMWS_XML_E_GETROOTEL 18503
#define | IDS_BMWS_XML_E_GETATTR 18504
#define | IDS_BMWS_XML_E_GETTEXT 18505

Define Documentation

#define IDS_BMWS_XML_E_GETATTR 18504

Definition at line 8 of file bmws_xml_res_lc.h.

Referenced by CXMLElement::AltGetAttr().

#define IDS_BMWS_XML_E_GETROOTEL 18503

Definition at line 7 of file bmws_xml_res_lc.h.

Referenced by CXMLDocument::GetRootElement().

#define IDS_BMWS_XML_E_GETTEXT 18505

Definition at line 9 of file bmws_xml_res_lc.h.

Referenced by CXMLElement::GetText().

#define IDS_BMWS_XML_E_INTERNAL 18501

Definition at line 5 of file bmws_xml_res_lc.h.

#define IDS_BMWS_XML_E_MSXMLCREATE 18502

Definition at line 6 of file bmws_xml_res_lc.h.

Referenced by CXMLDocument::InitXMLDocument(), and CXMLDocument::LoadFromFile().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


bmws_xml_res_lc.h Source File

bmws_xml_res_lc.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by bmws_xml_lc.rc
00004 //
00005 #define IDS_BMWS_XML_E_INTERNAL         18501
00006 #define IDS_BMWS_XML_E_MSXMLCREATE      18502
00007 #define IDS_BMWS_XML_E_GETROOTEL        18503
00008 #define IDS_BMWS_XML_E_GETATTR          18504
00009 #define IDS_BMWS_XML_E_GETTEXT          18505
00010
00011 // Next default values for new objects
00012 //
00013 #ifdef APSTUDIO_INVOKED
00014 #ifndef APSTUDIO_READONLY_SYMBOLS
00015 #define _APS_NEXT_RESOURCE_VALUE        101
00016 #define _APS_NEXT_COMMAND_VALUE         40001
00017 #define _APS_NEXT_CONTROL_VALUE         1000
00018 #define _APS_NEXT_SYMED_VALUE           101
00019 #endif
00020 #endif
Generated on Wed May 8 12:39:01 2002 for Solitaire Pack by doxygen 1.2.15


BrowserContainer.cpp File Reference

#include "stdafx.h"
#include <bmws_browsercontainer.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


BrowserContainer.cpp Source File

BrowserContainer.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // BrowserContainer.cpp
00004 //    Includes component source files related the IE browser container object.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_browsercontainer.cpp>
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


Card.cpp File Reference

#include "stdafx.h"
#include "Card.h"
#include "SolpackInternal.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Compounds

class | CCardIndexAction

Defines

#define | ACTION_FACEUP 1
#define | ACTION_CANDRAG 2
#define | ACTION_INDEX 3

Variables

ITypeLib * | g_pTypeLib

Define Documentation

#define ACTION_CANDRAG 2

Definition at line 30 of file Card.cpp.

Referenced by CCard::DoAction(), and CCard::UndoAction().

#define ACTION_FACEUP 1

Definition at line 29 of file Card.cpp.

Referenced by CCard::DoAction(), and CCard::UndoAction().

#define ACTION_INDEX 3

Definition at line 31 of file Card.cpp.

Referenced by CCardIndexAction::CCardIndexAction(), CCard::DoAction(), and CCard::UndoAction().

Variable Documentation

ITypeLib* g_pTypeLib

Definition at line 23 of file Card.cpp.

Referenced by CCard::InitCard().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Card.cpp Source File

Card.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Card.cpp
00004 //    Class to encapsulate an individual playing card.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Card.h"
00014 #include "SolpackInternal.h"
00015 #include <bmws_variant.h>
00016 #include "resource.h"
00017 #include "..\SolpckLC\resource.h"
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Global and external variables
00022 //----------------------------------------------------------------------------
00023 extern ITypeLib *g_pTypeLib;     // The Solpack type library
00024
00025
00026 //----------------------------------------------------------------------------
00027 // Action Types
00028 //----------------------------------------------------------------------------
00029 #define ACTION_FACEUP   1  // data = faceup (true or false)
00030 #define ACTION_CANDRAG  2  // data = candrag (true or false)
00031 #define ACTION_INDEX    3  // uses CCardIndexAction
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CCardIndexAction class
00037 //    Stores information about the moving of a card within a pile.
00038 //
00039 //----------------------------------------------------------------------------
00040 class CCardIndexAction : public CAction
00041 {
00042 public:
00043    CCardIndexAction(IActionSite *pSite, long lSrcIndex, long lDestIndex);
00044    virtual ~CCardIndexAction() {}
00045
00046    friend class CCard;
00047
00048 protected:
00049    long m_lSrcIndex;    // The old index of the card
00050    long m_lDestIndex;   // The new index of the card
00051 };
00052
00053
00054 //----------------------------------------------------------------------------
00055 //
00056 // CCardIndexAction constructor
00057 //
00058 // Parameters:
00059 //    pSite:         Interface of the card that handles the action.
00060 //    lSrcIndex:     The original index of the card.
00061 //    lDestIndex:    The index to which the card is moved.
00062 //
00063 //----------------------------------------------------------------------------
00064 CCardIndexAction::CCardIndexAction(IActionSite *pSite, long lSrcIndex, long lDestIndex) :
00065    CAction(pSite, ACTION_INDEX, 0)
00066 {
00067    // Set initial values for member variables
00068    m_lSrcIndex = lSrcIndex;
00069    m_lDestIndex = lDestIndex;
00070 }
00071
00072
00073 //----------------------------------------------------------------------------
00074 //
00075 // CCard constructor
00076 //
00077 // Parameters:
00078 //    lID:           The ID of the card.
00079 //
00080 //----------------------------------------------------------------------------
00081 CCard::CCard(long lID)
00082 {
00083    // Set initial values for member variables
00084    m_dwEngObjType = ENGOBJ_CARD;
00085    m_pSite = NULL;
00086    m_pPileSite = NULL;
00087    m_lID = lID;
00088    m_bCanDrag = FALSE;
00089    m_bFaceUp = FALSE;
00090    m_lX = 0;
00091    m_lY = 0;
00092    m_lIndex = -1;
00093    ODS("CCard constructor");
00094 }
00095
00096
00097 //----------------------------------------------------------------------------
00098 //
00099 // CCard destructor
00100 //
00101 //----------------------------------------------------------------------------
00102 CCard::~CCard()
00103 {
00104    ODS("CCard destructor");
00105 }
00106
00107
00108 //----------------------------------------------------------------------------
00109 //
00110 // ISolpackCard::get_ID method
00111 //    Retrieves the card's identifier, a number from 1 to 52.
00112 //
00113 // Parameters:
00114 //    p:             [out] Address of a long integer variable that receives
00115 //                   the ID.
00116 //
00117 // Returns:          A standard COM success or error value.
00118 //
00119 //----------------------------------------------------------------------------
00120 STDMETHODIMP CCard::get_ID(long *p)
00121 {
00122    CHECKPTR(p);
00123    *p = m_lID;
00124    return S_OK;
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // ISolpackCard::get_Rank method
00131 //    Retrieves the rank of the card.
00132 //
00133 // Parameters:
00134 //    p:             [out] Address of a long integer variable that receives
00135 //                   the rank.
00136 //
00137 // Returns:          A standard COM success or error value.
00138 //
00139 //----------------------------------------------------------------------------
00140 STDMETHODIMP CCard::get_Rank(long *p)
00141 {
00142    CHECKPTR(p);
00143    *p = (((m_lID - 1) % 13) + 1);
00144    return S_OK;
00145 }
00146
00147
00148 //----------------------------------------------------------------------------
00149 //
00150 // ISolpackCard::get_Suit method
00151 //    Retrieves the suit of the card.
00152 //
00153 // Parameters:
00154 //    p:             [out] Address of a long integer variable that receives
00155 //                   the suit.
00156 //
00157 // Returns:          A standard COM success or error value.
00158 //
00159 //----------------------------------------------------------------------------
00160 STDMETHODIMP CCard::get_Suit(long *p)
00161 {
00162    CHECKPTR(p);
00163    *p = (((m_lID - 1) / 13) + 1);
00164    return S_OK;
00165 }
00166
00167
00168 //----------------------------------------------------------------------------
00169 //
00170 // ISolpackCard::get_CanDrag method
00171 //    Retrieves whether the card can be dragged.
00172 //
00173 // Parameters:
00174 //    pbCanDrag:     [out] Address of a VARIANT_BOOL variable to receive
00175 //                   whether the card can be dragged.
00176 //
00177 // Returns:          A standard COM success or error value.
00178 //
00179 //----------------------------------------------------------------------------
00180 STDMETHODIMP CCard::get_CanDrag(VARIANT_BOOL *pbCanDrag)
00181 {
00182    CHECKPTR(pbCanDrag);
00183    *pbCanDrag = (m_bCanDrag ? VARIANT_TRUE : VARIANT_FALSE);
00184    return S_OK;
00185 }
00186
00187
00188 //----------------------------------------------------------------------------
00189 //
00190 // ISolpackCard::put_CanDrag method
00191 //    Sets whether the card can be dragged.
00192 //
00193 // Parameters:
00194 //    bCanDrag:      [in] A VARIANT_BOOL variable specifying whether the card
00195 //                   can be dragged.
00196 //
00197 // Returns:          A standard COM success or error value.
00198 //
00199 //----------------------------------------------------------------------------
00200 STDMETHODIMP CCard::put_CanDrag(VARIANT_BOOL bCanDrag)
00201 {
00202    BOOL b = (bCanDrag == VARIANT_TRUE);
00203    if(b != m_bCanDrag)
00204    {
00205       try   // COM-called code
00206       {
00207          // Record the action, during which it will be performed
00208          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00209             ACTION_CANDRAG, b);
00210       }
00211       CATCHALL;
00212    }
00213    return S_OK;
00214 }
00215
00216
00217 //----------------------------------------------------------------------------
00218 //
00219 // ISolpackCard::get_FaceUp method
00220 //    Retrieves whether the card is face up.
00221 //
00222 // Parameters:
00223 //    pbFaceUp:      [out] Address of a VARIANT_BOOL variable to receive
00224 //                   whether the card is currently face up.
00225 //
00226 // Returns:          A standard COM success or error value.
00227 //
00228 //----------------------------------------------------------------------------
00229 STDMETHODIMP CCard::get_FaceUp(VARIANT_BOOL *pbFaceUp)
00230 {
00231    CHECKPTR(pbFaceUp);
00232    *pbFaceUp = (m_bFaceUp ? VARIANT_TRUE : VARIANT_FALSE);
00233    return S_OK;
00234 }
00235
00236
00237 //----------------------------------------------------------------------------
00238 //
00239 // ISolpackCard::put_FaceUp method
00240 //    Sets whether the card can be dragged.
00241 //
00242 // Parameters:
00243 //    bFaceUp:       [in] A VARIANT_BOOL variable specifying VARIANT_TRUE to
00244 //                   turn the card face up, or VARIANT_FALSE to turn it face
00245 //                   down.
00246 //
00247 // Returns:          A standard COM success or error value.
00248 //
00249 //----------------------------------------------------------------------------
00250 STDMETHODIMP CCard::put_FaceUp(VARIANT_BOOL bFaceUp)
00251 {
00252    BOOL bUp = (bFaceUp == VARIANT_TRUE);
00253    if(bUp != m_bFaceUp)
00254    {
00255       try   // COM-called code
00256       {
00257          // If the card was turned face up, tell the engine to play sound
00258          if(bUp)
00259             m_pSite->CardFlipped();
00260
00261          // Record the action, during which it will be performed
00262          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00263             ACTION_FACEUP, bUp);
00264       }
00265       CATCHALL;
00266    }
00267    return S_OK;
00268 }
00269
00270
00271 //----------------------------------------------------------------------------
00272 //
00273 // ISolpackCard::get_Pile method
00274 //    Retrieves the pile that currently contains the card.
00275 //
00276 // Parameters:
00277 //    pp:            [out] Address of a pointer to the ISolpackPile interface
00278 //                   of the pile that contains the card.
00279 //
00280 // Returns:          A standard COM success or error value.
00281 //
00282 //----------------------------------------------------------------------------
00283 STDMETHODIMP CCard::get_Pile(ISolpackPile **pp)
00284 {
00285    return m_pPileSite->GetPileInterface(pp);
00286 }
00287
00288
00289 //----------------------------------------------------------------------------
00290 //
00291 // ISolpackCard::get_Index method
00292 //    Retrieves the index of the card within its pile.
00293 //
00294 // Parameters:
00295 //    p:             [out] Address of a long integer variable that receives
00296 //                   the card's zero-based index.
00297 //
00298 // Returns:          A standard COM success or error value.
00299 //
00300 //----------------------------------------------------------------------------
00301 STDMETHODIMP CCard::get_Index(long *p)
00302 {
00303    CHECKPTR(p);
00304    *p = m_lIndex;
00305    return S_OK;
00306 }
00307
00308
00309 //----------------------------------------------------------------------------
00310 //
00311 // ISolpackCard::put_Index method
00312 //    Sets the index of the card within its pile.
00313 //
00314 // Parameters:
00315 //    v:             [in] A long integer value that specifies the card's
00316 //                   zero-based index.
00317 //
00318 // Returns:          A standard COM success or error value.
00319 //
00320 //----------------------------------------------------------------------------
00321 STDMETHODIMP CCard::put_Index(long v)
00322 {
00323    try   // COM-called code
00324    {
00325       if(v != m_lIndex)
00326       {
00327          // Create the action object
00328          CAction *pAction = (CAction*)(new CCardIndexAction((IActionSite*)this,
00329             m_lIndex, v));
00330          ENSUREALLOC(pAction);
00331
00332          // Record the action, during which it will be performed
00333          m_pEngObjSite->EngGetUndoMgr()->RecordAction(pAction);
00334       }
00335    }
00336    CATCHALL;
00337    return S_OK;
00338 }
00339
00340
00341 //----------------------------------------------------------------------------
00342 //
00343 // INDUnknownAndDispatch::NDQueryInterface method
00344 //    Returns pointers to supported interfaces.
00345 //
00346 // Parameters:
00347 //    riid:          [in] Identifier of the interface being requested.
00348 //    ppvObject:     [out] Address of pointer variable that receives the
00349 //                   interface pointer requested in riid.
00350 //
00351 // Returns:          A standard COM success or error value.
00352 //
00353 //----------------------------------------------------------------------------
00354 STDMETHODIMP CCard::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00355 {
00356    if(IsEqualIID(riid, IID_ISolpackCard))
00357    {
00358       *ppvObject = (ISolpackCard*)this;
00359       (*(LPUNKNOWN*)ppvObject)->AddRef();
00360       return S_OK;
00361    } else if(IsEqualIID(riid, IID_IInternalCard))
00362    {
00363       *ppvObject = (CCard*)this;
00364       return S_OK;
00365    } else
00366       return CDispBase::NDQueryInterface(riid, ppvObject);
00367 }
00368
00369
00370 //----------------------------------------------------------------------------
00371 //
00372 // IActionSite::DoAction method
00373 //    Executes the specified action.
00374 //
00375 // Parameters:
00376 //    pAction:       Object containing information on an action.
00377 //
00378 // Returns:          None.
00379 //
00380 //----------------------------------------------------------------------------
00381 void CCard::DoAction(CAction *pAction)
00382 {
00383    switch(pAction->m_dwType)
00384    {
00385       case ACTION_FACEUP:
00386          // Turn the card face up or down, and update the displayed image
00387          m_bFaceUp = (BOOL)(pAction->m_dwData);
00388          UpdateImg();
00389          break;
00390
00391       case ACTION_CANDRAG:
00392          // Set whether or not the card can be dragged
00393          m_bCanDrag = (BOOL)(pAction->m_dwData);
00394          break;
00395
00396       case ACTION_INDEX:
00397       {
00398          // Move the card to its new index
00399          CCardIndexAction *pCIAction = (CCardIndexAction*)pAction;
00400          long lNew = pCIAction->m_lDestIndex;
00401          m_pPileSite->SetCardIndex(this, pCIAction->m_lSrcIndex, &lNew);
00402          pCIAction->m_lDestIndex = lNew;
00403          m_lIndex = lNew;
00404       } break;
00405    }
00406 }
00407
00408
00409 //----------------------------------------------------------------------------
00410 //
00411 // IActionSite::UndoAction method
00412 //    Undoes the specified action.
00413 //
00414 // Parameters:
00415 //    pAction:       Object containing information on an action.
00416 //
00417 // Returns:          None.
00418 //
00419 //----------------------------------------------------------------------------
00420 void CCard::UndoAction(CAction *pAction)
00421 {
00422    switch(pAction->m_dwType)
00423    {
00424       case ACTION_FACEUP:
00425          // Turn the card face up or down, and update the displayed image
00426          m_bFaceUp = !(BOOL)(pAction->m_dwData);
00427          UpdateImg();
00428          break;
00429
00430       case ACTION_CANDRAG:
00431          // Set whether or not the card can be dragged
00432          m_bCanDrag = !(BOOL)(pAction->m_dwData);
00433          break;
00434
00435       case ACTION_INDEX:
00436       {
00437          // Move the card to its previous index
00438          CCardIndexAction *pCIAction = (CCardIndexAction*)pAction;
00439          long lNew = pCIAction->m_lSrcIndex;
00440          m_pPileSite->SetCardIndex(this, pCIAction->m_lDestIndex, &lNew);
00441          m_lIndex = lNew;
00442       } break;
00443    }
00444 }
00445
00446
00447 //----------------------------------------------------------------------------
00448 //
00449 // InitCard function
00450 //    Creates the pile HTML elements and event handlers.
00451 //
00452 // Parameters:
00453 //    pSite:         Interface to receive notifications.
00454 //    pEngObjSite:   Interface of the engine.
00455 //    pHH:           The HTML helper object to use.
00456 //
00457 // Returns:          None.
00458 //
00459 //----------------------------------------------------------------------------
00460 void CCard::InitCard(ICardSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
00461 {
00462    ODS("CCard::InitCard");
00463    InitEngineObj(pEngObjSite, pHH);
00464
00465    // Set member variables' values
00466    _ASSERT(pSite);
00467    m_pSite = pSite;
00468    m_lpszImgFile.Format(TEXT("c%d.gif"), m_lID);
00469
00470    Init(g_pTypeLib, IID_ISolpackCard, (LPDISPATCH)((ISolpackCard*)this));
00471
00472    // Create the Span element
00473    m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_SPAN, IID_IHTMLElement));
00474    CHECKHRCOM(m_spEl->put_className(CBSTR(IDS_CLASS_CARD)));
00475    CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00476
00477    UpdateImg();
00478
00479    // Create and attach handlers for mouse events
00480    SetEventHandlers();
00481 }
00482
00483
00484 //----------------------------------------------------------------------------
00485 //
00486 // SetPile function
00487 //    Specifies the card's containing pile and adds the card element to the
00488 //    pile element.
00489 //
00490 // Parameters:
00491 //    pPileSite:     Interface of the containing pile.
00492 //    spEl:          The parent pile's HTML element, in which the card element
00493 //                   is placed.
00494 //
00495 // Returns:          None.
00496 //
00497 //----------------------------------------------------------------------------
00498 void CCard::SetPile(ICardPileSite *pPileSite, CHTMLElement2Ptr& spEl2Pile)
00499 {
00500    ODS("CCard::SetPile");
00501
00502    _ASSERT(pPileSite);
00503    m_pPileSite = pPileSite;
00504
00505    // Add the card span element to the pile's element
00506    if(spEl2Pile)
00507       CHECKHRCOM(spEl2Pile->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, m_spEl, NULL));
00508 }
00509
00510
00511 //----------------------------------------------------------------------------
00512 //
00513 // GetPile function
00514 //    Retrieves the card's containing pile.
00515 //
00516 // Parameters:       None.
00517 //
00518 // Returns:          The interface of the containing pile.
00519 //
00520 //----------------------------------------------------------------------------
00521 ICardPileSite* CCard::GetPile()
00522 {
00523    return m_pPileSite;
00524 }
00525
00526
00527 //----------------------------------------------------------------------------
00528 //
00529 // GetIndex function
00530 //    Retrieves the index of this card within its pile.
00531 //
00532 // Parameters:       None.
00533 //
00534 // Returns:          The zero-based index of the card in the pile.
00535 //
00536 //----------------------------------------------------------------------------
00537 long CCard::GetIndex()
00538 {
00539    return m_lIndex;
00540 }
00541
00542
00543 //----------------------------------------------------------------------------
00544 //
00545 // SetIndex function
00546 //    Sets the index of this card within its pile.
00547 //
00548 // Parameters:
00549 //    lIndex:        The zero-based index of the card in the pile.
00550 //
00551 // Returns:          None.
00552 //
00553 //----------------------------------------------------------------------------
00554 void CCard::SetIndex(long lIndex)
00555 {
00556    m_lIndex = lIndex;
00557 }
00558
00559
00560 //----------------------------------------------------------------------------
00561 //
00562 // SetPosition function
00563 //    Updates the card's X and Y coordinates, relative to its pile.
00564 //
00565 // Parameters:
00566 //    lX:            The card's new X coordinate.
00567 //    lY:            The card's new Y coordinate.
00568 //
00569 // Returns:          None.
00570 //
00571 //----------------------------------------------------------------------------
00572 void CCard::SetPosition(long lX, long lY)
00573 {
00574    // Only update the HTML element's position if the coordinate changed
00575    if(lX != m_lX)
00576    {
00577       m_lX = lX;
00578       CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00579    }
00580    if(lY != m_lY)
00581    {
00582       m_lY = lY;
00583       CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00584    }
00585 }
00586
00587
00588 //----------------------------------------------------------------------------
00589 //
00590 // GetPosition function
00591 //    Retrieves the card's X and Y coordinates, relative to its pile.
00592 //
00593 // Parameters:       None.
00594 //
00595 // Returns:          A POINT structure containing the card's position.
00596 //
00597 //----------------------------------------------------------------------------
00598 POINT CCard::GetPosition()
00599 {
00600    POINT pt;
00601    pt.x = m_lX;
00602    pt.y = m_lY;
00603    return pt;
00604 }
00605
00606
00607 //----------------------------------------------------------------------------
00608 //
00609 // GetElement function
00610 //    Retrieves the HTML element from its current spot in the HTML DOM and
00611 //    returns it.
00612 //
00613 // Parameters:       None.
00614 //
00615 // Returns:          The HTML element pointer.
00616 //
00617 //----------------------------------------------------------------------------
00618 CHTMLElementPtr& CCard::GetElement()
00619 {
00620    return m_spEl;
00621 }
00622
00623
00624 //----------------------------------------------------------------------------
00625 //
00626 // ToggleFace function
00627 //    Switches the card between face up and face down. Called from a
00628 //    fragment's MoveToPile method.
00629 //
00630 // Parameters:       None.
00631 //
00632 // Returns:          None.
00633 //
00634 //----------------------------------------------------------------------------
00635 void CCard::ToggleFace()
00636 {
00637    m_bFaceUp = !m_bFaceUp;
00638    UpdateImg();
00639 }
00640
00641
00642 //----------------------------------------------------------------------------
00643 //
00644 // UpdateImg function
00645 //    Updates the card HTML element's background image to show the face down
00646 //    or face up image.
00647 //
00648 // Parameters:       None.
00649 //
00650 // Returns:          None.
00651 //
00652 //----------------------------------------------------------------------------
00653 void CCard::UpdateImg()
00654 {
00655    CHECKHRCOM(m_spStyle->put_backgroundImage(CBSTR().Format(CTSTR(IDS_IMGHOLDER), m_bFaceUp ?
00656       m_lpszImgFile : m_pSite->GetFaceDownImg())));
00657 }
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


Card.h File Reference

#include "..\SolpackTLB\SolpackIncl.h"
#include "EngineObj.h"
#include "Action.h"
#include <bmws_dispbase.h>

Go to the source code of this file.

Compounds

class | CCard
class | ICardPileSite
class | ICardSite

Defines

#define | AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Card.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Card.h Source File

Card.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Card.h
00004 //    Class to encapsulate an individual playing card.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\SolpackIncl.h"
00021 #include "EngineObj.h"
00022 #include "Action.h"
00023 #include <bmws_dispbase.h>
00024
00025
00026 //----------------------------------------------------------------------------
00027 // Forward declaration
00028 //----------------------------------------------------------------------------
00029 class CCard;
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // ICardSite abstract class
00035 //    Enables the card to communicate to the engine. Implemented by CEngine.
00036 //
00037 //----------------------------------------------------------------------------
00038 class ICardSite
00039 {
00040 public:
00041    virtual CTSTR& GetFaceDownImg() = 0;
00042    virtual void CardFlipped() = 0;
00043 };
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // ICardPileSite abstract class
00049 //    Enables the card to communicate to the pile containing it. Implemented
00050 //    by CPile.
00051 //
00052 //----------------------------------------------------------------------------
00053 class ICardPileSite
00054 {
00055 public:
00056    virtual HRESULT GetPileInterface(ISolpackPile **pp) = 0;
00057    virtual void SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex) = 0;
00058    virtual void PileSetElCapture() = 0;
00059    virtual void PileReleaseElCapture() = 0;
00060 };
00061
00062
00063 //----------------------------------------------------------------------------
00064 //
00065 // CCard class
00066 //    Encapsulates an individual playing card. Implements the ISolpackCard
00067 //    interface.
00068 //
00069 //----------------------------------------------------------------------------
00070 class CCard : public CDispBase, public CEngineObj, public ISolpackCard, public IActionSite
00071 {
00072 public:
00073    CCard(long lID);
00074    virtual ~CCard();
00075
00076    DECLARE_IUNKNOWN_AND_IDISPATCH;
00077
00078    // ISolpackCard methods
00079    STDMETHOD (get_ID)(long *p);
00080    STDMETHOD (get_Rank)(long *p);
00081    STDMETHOD (get_Suit)(long *p);
00082    STDMETHOD (get_CanDrag)(VARIANT_BOOL *pbCanDrag);
00083    STDMETHOD (put_CanDrag)(VARIANT_BOOL bCanDrag);
00084    STDMETHOD (get_FaceUp)(VARIANT_BOOL *pbFaceUp);
00085    STDMETHOD (put_FaceUp)(VARIANT_BOOL bFaceUp);
00086    STDMETHOD (get_Pile)(ISolpackPile **pp);
00087    STDMETHOD (get_Index)(long *p);
00088    STDMETHOD (put_Index)(long v);
00089
00090    // INDUnknownAndDispatch override
00091    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00092
00093    // IActionSite methods
00094    void DoAction(CAction *pAction);
00095    void UndoAction(CAction *pAction);
00096
00097    void InitCard(ICardSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH);
00098    void SetPile(ICardPileSite *pPileSite, CHTMLElement2Ptr& spEl2Pile);
00099    ICardPileSite* GetPile();
00100    long GetIndex();
00101    void SetIndex(long lIndex);
00102    void SetPosition(long lX, long lY);
00103    POINT GetPosition();
00104    CHTMLElementPtr& GetElement();
00105    void ToggleFace();
00106
00107    BOOL m_bCanDrag;              // Whether the card can be dragged
00108
00109 protected:
00110    void UpdateImg();
00111
00112    // Focus capture on the card handled by its containing pile
00113    void SetElCapture()     { m_pPileSite->PileSetElCapture();     }
00114    void ReleaseElCapture() { m_pPileSite->PileReleaseElCapture(); }
00115
00116    ICardSite *m_pSite;           // Engine interface
00117    ICardPileSite *m_pPileSite;   // Interface of the containing pile
00118
00119    CTSTR m_lpszImgFile;          // Card face image file name
00120
00121    long m_lID;                   // The ID of the card
00122    BOOL m_bFaceUp;               // Whether the card is face up
00123
00124    long m_lIndex;                // Zero-based index of the card in the pile
00125    long m_lX;                    // X-coordinate of the card
00126    long m_lY;                    // Y-coordinate of the card
00127 };
00128
00129
00130 #endif // !defined(AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


COMServer.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SPGameLC\resource.h"
#include <bmws_comserver.cpp>
#include <bmws_dispbase.cpp>
#include <bmws_tlb.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 6 of file COMServer.cpp.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


COMServer.cpp Source File

COMServer.cpp

Go to the documentation of this file.
00001
00002 #include "stdafx.h"
00003 #include "resource.h"
00004 #include "..\SPGameLC\resource.h"
00005
00006 extern HINSTANCE g_hInst;
00007
00008 #include <bmws_comserver.cpp>
00009 #include <bmws_dispbase.cpp>
00010 #include <bmws_tlb.cpp>
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


CPSounds.cpp File Reference

#include "stdafx.h"
#include <bmws_cpsounds.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


CPSounds.cpp Source File

CPSounds.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // CPSounds.cpp
00004 //    Includes component source files related to Control Panel Sounds
00005 //    functionality.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #include "stdafx.h"
00011 #include <bmws_cpsounds.cpp>
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


CPSoundsIDs.h File Reference

Go to the source code of this file.

Defines

#define | AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
#define | CPSOUNDS_SHUFFLE 0
#define | CPSOUNDS_FLIP 1
#define | CPSOUNDS_DROP 2
#define | CPSOUNDS_WON 3

Define Documentation

#define AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file CPSoundsIDs.h.

#define CPSOUNDS_DROP 2

Definition at line 18 of file CPSoundsIDs.h.

Referenced by CEngine::HandleTryDrop().

#define CPSOUNDS_FLIP 1

Definition at line 17 of file CPSoundsIDs.h.

Referenced by CEngine::CardFlipped().

#define CPSOUNDS_SHUFFLE 0

Definition at line 16 of file CPSoundsIDs.h.

#define CPSOUNDS_WON 3

Definition at line 19 of file CPSoundsIDs.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


CPSoundsIDs.h Source File

CPSoundsIDs.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // CPSoundsIDs.h
00004 //    Definitions of Control Panel Sounds indices.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // CPSounds indices
00015 //----------------------------------------------------------------------------
00016 #define CPSOUNDS_SHUFFLE   0
00017 #define CPSOUNDS_FLIP      1
00018 #define CPSOUNDS_DROP      2
00019 #define CPSOUNDS_WON       3
00020
00021
00022 #endif // !defined(AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:02 2002 for Solitaire Pack by doxygen 1.2.15


Deck.cpp File Reference

#include "stdafx.h"
#include "Deck.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Deck.cpp Source File

Deck.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Deck.cpp
00004 //    Class to encapsulate a deck of cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Deck.h"
00014 #include <bmws_variant.h>
00015 #include "resource.h"
00016 #include "..\SolpckLC\resource.h"
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CDeck constructor
00022 //
00023 // Parameters:       None.
00024 //
00025 //----------------------------------------------------------------------------
00026 CDeck::CDeck() : CPile(PILE_DECK)
00027 {
00028    // Signify that the contained pointers are COM interface pointers that
00029    // should be released, not deleted, when destroyed.
00030    m_apDeckCards.SetRelease(TRUE);
00031    ODS("CDeck constructor");
00032 }
00033
00034
00035 //----------------------------------------------------------------------------
00036 //
00037 // CDeck destructor
00038 //
00039 //----------------------------------------------------------------------------
00040 CDeck::~CDeck()
00041 {
00042    ODS("CDeck destructor");
00043 }
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // InitDeck function
00049 //    Creates the cards that belong to the deck.
00050 //
00051 // Parameters:
00052 //    pMsgProcessor: Interface to enable message processing.
00053 //    pSBMgr:        Interface of the status bar, to display card creation
00054 //                   progress.
00055 //    pCardSite:     Interface of the engine, to give to cards.
00056 //
00057 // Returns:          None.
00058 //
00059 //----------------------------------------------------------------------------
00060 void CDeck::InitDeck(IMsgProcessor *pMsgProcessor, IStatusBarMgr *pSBMgr, ICardSite *pCardSite)
00061 {
00062    ODS("CDeck::InitDeck starting");
00063
00064    // Hide the deck pile element while creating the cards
00065    m_pHH->ShowElement(m_spEl, FALSE);
00066
00067    // Prepare arrays and progess bar
00068    m_apDeckCards.SetSize(52);
00069    m_apCards.SetSize(52);
00070    m_abTransferred.SetSize(52);
00071    pSBMgr->SBUpdateTasks(52, 0);
00072
00073    CHTMLElement2Ptr spEl2(m_spEl);
00074    for(int i = 0; i < 52; i++)
00075    {
00076       // Create and initialize cards
00077       CCard *pCard = new CCard(i+1);
00078       ENSUREALLOC(pCard);
00079       m_apDeckCards.SetAt(i, pCard);
00080       pCard->AddRef();
00081       m_apCards.SetAt(i, pCard);
00082       pCard->AddRef();
00083       pCard->InitCard(pCardSite, m_pEngObjSite, m_pHH);
00084       pCard->SetPile((ICardPileSite*)this, spEl2);
00085       pCard->SetIndex(i);
00086
00087       // Update status bar progress
00088       pSBMgr->SBUpdateTasks(0, 1);
00089
00090       // Let Windows process messages to keep program responsive
00091       pMsgProcessor->EmptyMessageQueue(FALSE);
00092    }
00093
00094    // Update pile layout and show pile element
00095    UpdateLayout();
00096    m_pHH->ShowElement(m_spEl, TRUE);
00097
00098    ODS("CDeck::InitDeck finished");
00099 }
00100
00101
00102 //----------------------------------------------------------------------------
00103 //
00104 // ReclaimCards function
00105 //    Returns all cards to the decks they belong to. This is called before
00106 //    each game is dealt.
00107 //
00108 // Parameters:       None.
00109 //
00110 // Returns:          None.
00111 //
00112 //----------------------------------------------------------------------------
00113 void CDeck::ReclaimCards()
00114 {
00115    // Move all cards from the piles they are currently in to this pile
00116    long lRealIndex = PreReceiveCards(-1, m_apDeckCards);
00117    ReceiveCards(lRealIndex, m_apDeckCards);
00118
00119    int cCards = m_apDeckCards.GetSize();
00120    for(int i = 0; i < cCards; i++)
00121    {
00122       // Set each card to be face down, undraggable
00123       CHECKHRCOM(m_apDeckCards[i]->put_CanDrag(VARIANT_FALSE));
00124       CHECKHRCOM(m_apDeckCards[i]->put_FaceUp(VARIANT_FALSE));
00125    }
00126 }
Generated on Wed May 8 12:39:03 2002 for Solitaire Pack by doxygen 1.2.15


Deck.h File Reference

#include "Pile.h"
#include "StatusBarMgr.h"
#include "ProcessMsg.h"

Go to the source code of this file.

Compounds

class | CDeck

Defines

#define | AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Deck.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Deck.h Source File

Deck.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Deck.h
00004 //    Class to encapsulate a deck of cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "Pile.h"
00021 #include "StatusBarMgr.h"
00022 #include "ProcessMsg.h"
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // CDeck class
00028 //    Encapsulates a deck of cards. Extends CPile to create and manage the 52
00029 //    cards that belong to it.
00030 //
00031 //----------------------------------------------------------------------------
00032 class CDeck : public CPile
00033 {
00034 public:
00035    CDeck();
00036    virtual ~CDeck();
00037
00038    void InitDeck(IMsgProcessor *pMsgProcessor, IStatusBarMgr *pSBMgr, ICardSite *pCardSite);
00039    void ReclaimCards();
00040
00041 protected:
00042    CPtrArray<CCard*, CCard*> m_apDeckCards;  // Cards created by this deck
00043 };
00044
00045
00046 #endif // !defined(AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:03 2002 for Solitaire Pack by doxygen 1.2.15


DispBase.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include <bmws_unkbase.cpp>
#include <bmws_dispbase.cpp>
#include <bmws_tlb.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 12 of file DispBase.cpp.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


DispBase.cpp Source File

DispBase.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // DispBase.cpp
00004 //    Includes component source files related to implementing COM objects.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include "resource.h"
00011
00012 extern HINSTANCE g_hInst;
00013
00014 #include <bmws_unkbase.cpp>
00015 #include <bmws_dispbase.cpp>
00016 #include <bmws_tlb.cpp>
Generated on Wed May 8 12:39:03 2002 for Solitaire Pack by doxygen 1.2.15


Engine.cpp File Reference

#include "stdafx.h"
#include "Engine.h"
#include "GameData.h"
#include "CPSoundsIDs.h"
#include <shlwapi.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | ENG_UNINIT 0
#define | ENG_INITTING 1
#define | ENG_INACTIVE 2
#define | ENG_STARTGAME 3
#define | ENG_STOPGAME 4
#define | ENG_IDLE 5
#define | ENG_PILECLICKED 6
#define | ENG_SETUPFRAG 7
#define | ENG_DROPFRAG 8
#define | ENG_HANDLECMD 9
#define | ENG_DEAL 10
#define | ENG_AUTOPLAY 11
#define | ENG_GAMEWON 12
#define | ENG_MOUSEDOWN 0x20000000
#define | ENG_ANIM 0x40000000
#define | ENG_UNDO 0x80000000
#define | ENG_FLAGS 0xe0000000
#define | ENGSTATE (m_dwState & ~ENG_FLAGS)
#define | MS_IDLE 0
#define | MS_WAITALL 1
#define | MS_PILE_LBD 2
#define | MS_PILE_CLICKED 3
#define | MS_CARD_LBD 4
#define | MS_DRAGGING 5
#define | MS_CARD_LBDNODRAG 6
#define | MS_TRYDROP 7
#define | MS_CARD_RBD 8
#define | MS_CARD_AUTOPLAY 9
#define | ENGEVENT_BODYCLICK 0
#define | ACTION_SCORE 1
#define | ACTION_ENABLECMD 2
#define | ACTION_DISABLECMD 3

Variables

ITypeLib * | g_pTypeLib
HINSTANCE | g_hInstLC

Define Documentation

#define ACTION_DISABLECMD 3

Definition at line 119 of file Engine.cpp.

Referenced by CEngine::DoAction(), and CEngine::UndoAction().

#define ACTION_ENABLECMD 2

Definition at line 118 of file Engine.cpp.

Referenced by CEngine::DoAction(), and CEngine::UndoAction().

#define ACTION_SCORE 1

Definition at line 117 of file Engine.cpp.

Referenced by CEngine::DoAction(), and CEngine::UndoAction().

#define ENG_ANIM 0x40000000

Definition at line 45 of file Engine.cpp.

Referenced by CEngine::AnimStateChange(), CEngine::EventHandler(), CEngine::MouseUp(), and CEngine::SetState().

#define ENG_AUTOPLAY 11

Definition at line 42 of file Engine.cpp.

Referenced by CEngine::TryCommand().

#define ENG_DEAL 10

Definition at line 41 of file Engine.cpp.

Referenced by CEngine::DealGame().

#define ENG_DROPFRAG 8

Definition at line 39 of file Engine.cpp.

Referenced by CEngine::MouseUp().

#define ENG_FLAGS 0xe0000000

Definition at line 47 of file Engine.cpp.

Referenced by CEngine::HandlePileClicked(), CEngine::HandleTryDrop(), and CEngine::MouseUp().

#define ENG_GAMEWON 12

Definition at line 43 of file Engine.cpp.

Referenced by CEngine::PlayCPSound().

#define ENG_HANDLECMD 9

Definition at line 40 of file Engine.cpp.

Referenced by CEngine::HandleCommand().

#define ENG_IDLE 5

Definition at line 36 of file Engine.cpp.

Referenced by CEngine::DealGame(), CEngine::HandleCommand(), CEngine::HandlePileClicked(), CEngine::HandleTryDrop(), CEngine::MouseDown(), CEngine::MouseUp(), CEngine::PlayGame(), CEngine::SetState(), and CEngine::TryCommand().

#define ENG_INACTIVE 2

Definition at line 33 of file Engine.cpp.

Referenced by CEngine::InitEngine().

#define ENG_INITTING 1

Definition at line 32 of file Engine.cpp.

#define ENG_MOUSEDOWN 0x20000000

Definition at line 44 of file Engine.cpp.

Referenced by CEngine::MouseDown(), CEngine::SetMouseState(), and CEngine::SetState().

#define ENG_PILECLICKED 6

Definition at line 37 of file Engine.cpp.

Referenced by CEngine::CardFlipped(), and CEngine::MouseUp().

#define ENG_SETUPFRAG 7

Definition at line 38 of file Engine.cpp.

#define ENG_STARTGAME 3

Definition at line 34 of file Engine.cpp.

Referenced by CEngine::PlayGame().

#define ENG_STOPGAME 4

Definition at line 35 of file Engine.cpp.

Referenced by CEngine::StopPlayGame().

#define ENG_UNDO 0x80000000

Definition at line 46 of file Engine.cpp.

Referenced by CEngine::MouseDown(), CEngine::SetState(), and CEngine::TryCommand().

#define ENG_UNINIT 0

Definition at line 31 of file Engine.cpp.

Referenced by CEngine::CEngine(), and CEngine::Uninit().

#define ENGEVENT_BODYCLICK 0

Definition at line 111 of file Engine.cpp.

Referenced by CEngine::EventHandler(), and CEngine::PlayGame().

#define ENGSTATE (m_dwState & ~ENG_FLAGS)

Definition at line 53 of file Engine.cpp.

Referenced by CEngine::CardFlipped(), and CEngine::MouseDown().

#define MS_CARD_AUTOPLAY 9

Definition at line 68 of file Engine.cpp.

Referenced by CEngine::MouseUp().

#define MS_CARD_LBD 4

Definition at line 63 of file Engine.cpp.

Referenced by CEngine::MouseDown(), CEngine::MouseMove(), and CEngine::MouseUp().

#define MS_CARD_LBDNODRAG 6

Definition at line 65 of file Engine.cpp.

Referenced by CEngine::MouseDown(), CEngine::MouseMove(), and CEngine::MouseUp().

#define MS_CARD_RBD 8

Definition at line 67 of file Engine.cpp.

Referenced by CEngine::MouseDown(), and CEngine::MouseUp().

#define MS_DRAGGING 5

Definition at line 64 of file Engine.cpp.

Referenced by CEngine::CancelMouseEvent(), CEngine::MouseDown(), CEngine::MouseMove(), and CEngine::MouseUp().

#define MS_IDLE 0

Definition at line 59 of file Engine.cpp.

Referenced by CEngine::CancelMouseEvent(), CEngine::CEngine(), CEngine::MouseDown(), CEngine::MouseUp(), and CEngine::SetMouseState().

#define MS_PILE_CLICKED 3

Definition at line 62 of file Engine.cpp.

Referenced by CEngine::MouseUp().

#define MS_PILE_LBD 2

Definition at line 61 of file Engine.cpp.

Referenced by CEngine::MouseDown(), and CEngine::MouseUp().

#define MS_TRYDROP 7

Definition at line 66 of file Engine.cpp.

Referenced by CEngine::MouseUp().

#define MS_WAITALL 1

Definition at line 60 of file Engine.cpp.

Referenced by CEngine::MouseDown(), and CEngine::MouseUp().

Variable Documentation

HINSTANCE g_hInstLC

Definition at line 25 of file Engine.cpp.

ITypeLib* g_pTypeLib

Definition at line 24 of file Engine.cpp.

Referenced by CEngine::InitEngine().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Engine.cpp Source File

Engine.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Engine.cpp
00004 //    Class to encapsulate the Solitaire Pack engine.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Engine.h"
00014 #include "GameData.h"
00015 #include "CPSoundsIDs.h"
00016 #include <shlwapi.h>
00017 #include "resource.h"
00018 #include "..\SolpckLC\resource.h"
00019
00020
00021 //----------------------------------------------------------------------------
00022 // Global and external variables
00023 //----------------------------------------------------------------------------
00024 extern ITypeLib *g_pTypeLib;     // The Solpack type library
00025 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00026
00027
00028 //----------------------------------------------------------------------------
00029 // Engine state (m_dwState)
00030 //----------------------------------------------------------------------------
00031 #define ENG_UNINIT      0           // Engine has not been initialized
00032 #define ENG_INITTING    1           // Engine is being initialized
00033 #define ENG_INACTIVE    2           // Initialized but inactive
00034 #define ENG_STARTGAME   3           // A game is being initialized
00035 #define ENG_STOPGAME    4           // A game is being uninitialized
00036 #define ENG_IDLE        5           // A game is active
00037 #define ENG_PILECLICKED 6           // Game's PileClicked is being called
00038 #define ENG_SETUPFRAG   7           // Game's SetupFragment is being called
00039 #define ENG_DROPFRAG    8           // Game's DropFragment is being called
00040 #define ENG_HANDLECMD   9           // Game's HandleCommand is being called
00041 #define ENG_DEAL        10          // Game's Deal is being processed
00042 #define ENG_AUTOPLAY    11          // Game's AutoPlay is being processed
00043 #define ENG_GAMEWON     12          // Game has been won
00044 #define ENG_MOUSEDOWN   0x20000000  // Mouse actions are taking place
00045 #define ENG_ANIM        0x40000000  // Card(s) are being animated
00046 #define ENG_UNDO        0x80000000  // The engine is in an undo/redo operation
00047 #define ENG_FLAGS       0xe0000000
00048
00049
00050 //----------------------------------------------------------------------------
00051 // State macro: retrieves state without flags
00052 //----------------------------------------------------------------------------
00053 #define ENGSTATE        (m_dwState & ~ENG_FLAGS)
00054
00055
00056 //----------------------------------------------------------------------------
00057 // Mouse state (m_dwMouseState)
00058 //----------------------------------------------------------------------------
00059 #define MS_IDLE            0  // No mouse operation
00060 #define MS_WAITALL         1  // Waiting for all buttons to be released
00061 #define MS_PILE_LBD        2  // Left button is down on a pile
00062 #define MS_PILE_CLICKED    3  // Left button has been released without drag
00063 #define MS_CARD_LBD        4  // Left button is down on a card
00064 #define MS_DRAGGING        5  // A fragment is being dragged
00065 #define MS_CARD_LBDNODRAG  6  // Left button pressed on card, but can't drag
00066 #define MS_TRYDROP         7  // A fragment has been dropped
00067 #define MS_CARD_RBD        8  // Right button is down on a card
00068 #define MS_CARD_AUTOPLAY   9  // Right button has been released
00069
00070
00071 //----------------------------------------------------------------------------
00072 // State strings, used during debugging
00073 //----------------------------------------------------------------------------
00074 #ifdef _DEBUG
00075 LPTSTR szEngSNames[] =
00076 {
00077    TEXT("ENG_UNINIT"),
00078    TEXT("ENG_INITTING"),
00079    TEXT("ENG_INACTIVE"),
00080    TEXT("ENG_STARTGAME"),
00081    TEXT("ENG_STOPGAME"),
00082    TEXT("ENG_IDLE"),
00083    TEXT("ENG_PILECLICKED"),
00084    TEXT("ENG_SETUPFRAG"),
00085    TEXT("ENG_DROPFRAG"),
00086    TEXT("ENG_HANDLECMD"),
00087    TEXT("ENG_DEAL"),
00088    TEXT("ENG_AUTOPLAY"),
00089    TEXT("ENG_GAMEWON")
00090 };
00091
00092 LPTSTR szMSNames[] =
00093 {
00094    TEXT("MS_IDLE"),
00095    TEXT("MS_WAITALL"),
00096    TEXT("MS_PILE_LBD"),
00097    TEXT("MS_PILE_CLICKED"),
00098    TEXT("MS_CARD_LBD"),
00099    TEXT("MS_DRAGGING"),
00100    TEXT("MS_CARD_LBDNODRAG"),
00101    TEXT("MS_TRYDROP"),
00102    TEXT("MS_CARD_RBD"),
00103    TEXT("MS_CARD_AUTOPLAY")
00104 };
00105 #endif
00106
00107
00108 //----------------------------------------------------------------------------
00109 // Event handler IDs
00110 //----------------------------------------------------------------------------
00111 #define ENGEVENT_BODYCLICK    0     // The mouse was released over the body
00112
00113
00114 //----------------------------------------------------------------------------
00115 // Action Types
00116 //----------------------------------------------------------------------------
00117 #define ACTION_SCORE       1  // data = offset
00118 #define ACTION_ENABLECMD   2  // data = cmd id
00119 #define ACTION_DISABLECMD  3  // data = cmd id
00120
00121
00122 //----------------------------------------------------------------------------
00123 //
00124 // CEngine constructor
00125 //
00126 // Parameters:       None.
00127 //
00128 //----------------------------------------------------------------------------
00129 CEngine::CEngine()
00130 {
00131    // Set initial values for member variables
00132    m_pMsgProcessor = NULL;
00133    m_pSite = NULL;
00134    m_pSBMgr = NULL;
00135    m_pLibMgr = NULL;
00136    m_pHH = NULL;
00137    m_pShatter = NULL;
00138    m_bUsingMasterDeck = FALSE;
00139    m_apPiles.SetSize(0, 8);
00140    m_pFragment = NULL;
00141    SetState(ENG_UNINIT);
00142    SetMouseState(MS_IDLE);
00143    m_lButton = 0;
00144    m_pPileSrc = NULL;
00145    m_pCardSrc = NULL;
00146    m_ptDrag.x = m_ptDrag.y = 0;
00147    m_uDeactivateMsg = 0;
00148    m_wDeactivateParam = 0;
00149    m_lDeactivateParam = 0;
00150
00151    // Signify that the contained pointers are COM interface pointers that
00152    // should be released, not deleted, when destroyed.
00153    m_apPiles.SetRelease(TRUE);
00154    m_apDecks.SetRelease(TRUE);
00155
00156    ODS("CEngine constructor");
00157 }
00158
00159
00160 //----------------------------------------------------------------------------
00161 //
00162 // CEngine destructor
00163 //
00164 //----------------------------------------------------------------------------
00165 CEngine::~CEngine()
00166 {
00167    ODS("CEngine destructor");
00168 }
00169
00170
00171 //----------------------------------------------------------------------------
00172 //
00173 // ISolpackApp::get_CardWidth method
00174 //    Retrieves the width of a card, in pixels.
00175 //
00176 // Parameters:
00177 //    p:             [out] Address of a long integer variable that receives
00178 //                   the width, in pixels.
00179 //
00180 // Returns:          A standard COM success or error value.
00181 //
00182 //----------------------------------------------------------------------------
00183 STDMETHODIMP CEngine::get_CardWidth(long *p)
00184 {
00185    CHECKPTR(p);
00186    *p = CARDWIDTH;
00187    return S_OK;
00188 }
00189
00190
00191 //----------------------------------------------------------------------------
00192 //
00193 // ISolpackApp::get_CardHeight method
00194 //    Retrieves the height of a card, in pixels.
00195 //
00196 // Parameters:
00197 //    p:             [out] Address of a long integer variable that receives
00198 //                   the height, in pixels.
00199 //
00200 // Returns:          A standard COM success or error value.
00201 //
00202 //----------------------------------------------------------------------------
00203 STDMETHODIMP CEngine::get_CardHeight(long *p)
00204 {
00205    CHECKPTR(p);
00206    *p = CARDHEIGHT;
00207    return S_OK;
00208 }
00209
00210
00211 //----------------------------------------------------------------------------
00212 //
00213 // ISolpackApp::get_Score method
00214 //    Retrieves the score of the current game.
00215 //
00216 // Parameters:
00217 //    p:             [out] Address of a long integer variable that receives
00218 //                   the current score.
00219 //
00220 // Returns:          A standard COM success or error value.
00221 //
00222 //----------------------------------------------------------------------------
00223 STDMETHODIMP CEngine::get_Score(long *p)
00224 {
00225    CHECKPTR(p);
00226    *p = m_lScore;
00227    return S_OK;
00228 }
00229
00230
00231 //----------------------------------------------------------------------------
00232 //
00233 // ISolpackApp::put_Score method
00234 //    Sets the score of the current game.
00235 //
00236 // Parameters:
00237 //    v:             [in] A long integer value that specifies the new score.
00238 //
00239 // Returns:          A standard COM success or error value.
00240 //
00241 //----------------------------------------------------------------------------
00242 STDMETHODIMP CEngine::put_Score(long v)
00243 {
00244    if(v != m_lScore)
00245    {
00246       try   // COM-called code
00247       {
00248          // Record the action, during which it will be performed
00249          m_undoMgr.RecordAction((IActionSite*)this, ACTION_SCORE, (DWORD)(v - m_lScore));
00250       }
00251       CATCHALL;
00252    }
00253    return S_OK;
00254 }
00255
00256
00257 //----------------------------------------------------------------------------
00258 //
00259 // ISolpackApp::get_WindowWidth method
00260 //    Retrieves the width of the available window space, in pixels.
00261 //
00262 // Parameters:
00263 //    p:             [out] Address of a long integer variable that receives
00264 //                   the width, in pixels.
00265 //
00266 // Returns:          A standard COM success or error value.
00267 //
00268 //----------------------------------------------------------------------------
00269 STDMETHODIMP CEngine::get_WindowWidth(long *p)
00270 {
00271    CHECKPTR(p);
00272    *p = 0;
00273    try   // COM-called code
00274    {
00275       // Retrieve the visible width of the tableau HTML element
00276       CHTMLElementPtr spEl(TRUE, m_pHH->GetNamedEl(IDS_EL_TABLEAU, IID_IHTMLElement));
00277       CHECKHRCOM(spEl->get_offsetWidth(p));
00278    }
00279    CATCHALL;
00280    return S_OK;
00281 }
00282
00283
00284 //----------------------------------------------------------------------------
00285 //
00286 // ISolpackApp::get_WindowHeight method
00287 //    Retrieves the height of the available window space, in pixels.
00288 //
00289 // Parameters:
00290 //    p:             [out] Address of a long integer variable that receives
00291 //                   the height, in pixels.
00292 //
00293 // Returns:          A standard COM success or error value.
00294 //
00295 //----------------------------------------------------------------------------
00296 STDMETHODIMP CEngine::get_WindowHeight(long *p)
00297 {
00298    CHECKPTR(p);
00299    *p = 0;
00300    try   // COM-called code
00301    {
00302       // Retrieve the visible height of the tableau HTML element
00303       CHTMLElementPtr spEl(TRUE, m_pHH->GetNamedEl(IDS_EL_TABLEAU, IID_IHTMLElement));
00304       CHECKHRCOM(spEl->get_offsetHeight(p));
00305    }
00306    CATCHALL;
00307    return S_OK;
00308 }
00309
00310
00311 //----------------------------------------------------------------------------
00312 //
00313 // ISolpackApp::get_SpacingX method
00314 //    Retrieves the recommended horizontal space, in pixels, between two
00315 //    piles.
00316 //
00317 // Parameters:
00318 //    p:             [out] Address of a long integer variable that receives
00319 //                   the width, in pixels.
00320 //
00321 // Returns:          A standard COM success or error value.
00322 //
00323 //----------------------------------------------------------------------------
00324 STDMETHODIMP CEngine::get_SpacingX(long *p)
00325 {
00326    CHECKPTR(p);
00327    *p = PILESPACINGX;
00328    return S_OK;
00329 }
00330
00331
00332 //----------------------------------------------------------------------------
00333 //
00334 // ISolpackApp::get_SpacingY method
00335 //    Retrieves the recommended vertical space, in pixels, between two piles.
00336 //
00337 // Parameters:
00338 //    p:             [out] Address of a long integer variable that receives
00339 //                   the height, in pixels.
00340 //
00341 // Returns:          A standard COM success or error value.
00342 //
00343 //----------------------------------------------------------------------------
00344 STDMETHODIMP CEngine::get_SpacingY(long *p)
00345 {
00346    CHECKPTR(p);
00347    *p = PILESPACINGY;
00348    return S_OK;
00349 }
00350
00351
00352 //----------------------------------------------------------------------------
00353 //
00354 // ISolpackApp::get_Fragment method
00355 //    Retrieves the fragment used to transfer cards.
00356 //
00357 // Parameters:
00358 //    pp:            [out] Address of a pointer to the ISolpackFragment
00359 //                   interface of the fragment.
00360 //
00361 // Returns:          A standard COM success or error value.
00362 //
00363 //----------------------------------------------------------------------------
00364 STDMETHODIMP CEngine::get_Fragment(ISolpackFragment **pp)
00365 {
00366    return m_pFragment->QueryInterface(IID_ISolpackFragment, (LPVOID*)pp);
00367 }
00368
00369
00370 //----------------------------------------------------------------------------
00371 //
00372 // ISolpackApp::CreatePile method
00373 //    Creates and returns a pile of the specified type.
00374 //
00375 // Parameters:
00376 //    lType:         [in] Long integer value specifying the type of pile to
00377 //                   create, taken from the SOLPACKPILETYPE enumeration.
00378 //    ppPile:        [out] Address of a pointer to the ISolpackPile interface
00379 //                   of the new pile.
00380 //
00381 // Returns:          A standard COM success or error value.
00382 //
00383 //----------------------------------------------------------------------------
00384 STDMETHODIMP CEngine::CreatePile(long lType, ISolpackPile **ppPile)
00385 {
00386    // Can only create piles when initializing game
00387    if(ENGSTATE != ENG_STARTGAME)
00388       return E_ACCESSDENIED;
00389
00390    // Check for valid out parameter and pile type
00391    CHECKPTR(ppPile);
00392    if((lType < PILE_DECK) || (lType > PILE_TALON3))
00393       return E_INVALIDARG;
00394
00395    try   // COM-called code
00396    {
00397       CPile *pNew = NULL;
00398       if(lType == PILE_DECK)
00399       {
00400          // Create a new deck if we've already used initial deck
00401          if(m_bUsingMasterDeck)
00402             pNew = (CPile*)AddDeck();
00403          else
00404          {
00405             // Use the initial deck
00406             pNew = (CPile*)m_apDecks[0];
00407             m_bUsingMasterDeck = TRUE;
00408          }
00409       } else
00410       {
00411          // Create and initialize the pile
00412          pNew = new CPile(lType);
00413          ENSUREALLOC(pNew);
00414          m_apPiles.Add(pNew);
00415          pNew->AddRef();
00416          pNew->InitPile((IPileSite*)this, (IEngineObjSite*)this, m_pHH);
00417 //       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00418       }
00419       CHECKHRCOM(pNew->QueryInterface(IID_ISolpackPile, (LPVOID*)ppPile));
00420    }
00421    CATCHALL;
00422    return S_OK;
00423 }
00424
00425
00426 //----------------------------------------------------------------------------
00427 //
00428 // ISolpackApp::CreateGameData method
00429 //    Creates and returns an object to store game-specific variable data.
00430 //
00431 // Parameters:
00432 //    ppGameData:    [out] Address of a pointer to the ISolpackGameData
00433 //                   interface of the new GameData object.
00434 //
00435 // Returns:          A standard COM success or error value.
00436 //
00437 //----------------------------------------------------------------------------
00438 STDMETHODIMP CEngine::CreateGameData(ISolpackGameData **ppGameData)
00439 {
00440    // Can only create piles when initializing game
00441    if(ENGSTATE != ENG_STARTGAME)
00442       return E_ACCESSDENIED;
00443    CHECKPTR(ppGameData);
00444
00445    try   // COM-called code
00446    {
00447       // Create and initialize the game data object
00448       CGameData *pNew = new CGameData((IUndoMgrOwner*)this);
00449       ENSUREALLOC(pNew);
00450       pNew->InitGameData();
00451       CHECKHRCOM(pNew->QueryInterface(IID_ISolpackGameData, (LPVOID*)ppGameData));
00452    }
00453    CATCHALL;
00454
00455    return S_OK;
00456 }
00457
00458
00459 //----------------------------------------------------------------------------
00460 //
00461 // ISolpackApp::AddGameCommand method
00462 //    Adds a custom command to be made available to the user.
00463 //
00464 // Parameters:
00465 //    lID:           [in] A game-defined long integer value specifying the ID
00466 //                   representing the command.
00467 //    bstrText:      [in] A string value containing the name of the custom
00468 //                   command.
00469 //    bstrHelpText:  [in] A string value containing help information
00470 //                   corresponding to command.
00471 //
00472 // Returns:          A standard COM success or error value.
00473 //
00474 //----------------------------------------------------------------------------
00475 STDMETHODIMP CEngine::AddGameCommand(long lID, BSTR bstrText, BSTR bstrHelpText)
00476 {
00477    // Can only add commands when initializing game
00478    if(ENGSTATE != ENG_STARTGAME)
00479       return E_ACCESSDENIED;
00480
00481    try   // COM-called code
00482    {
00483       // Add the command to the game command manager
00484       return m_gameCommandMgr.AddGameCommand(lID, bstrText, bstrHelpText);
00485    }
00486    CATCHALL;
00487 }
00488
00489
00490 //----------------------------------------------------------------------------
00491 //
00492 // ISolpackApp::EnableGameCommand method
00493 //    Enables or disables the user interface for a custom game command.
00494 //
00495 // Parameters:
00496 //    lID:           [in] A game-defined long integer value specifying the ID
00497 //                   of the command to change.
00498 //    bEnable:       [in] A VARIANT_BOOL variable specifying whether to enable
00499 //                   the command (VARIANT_TRUE) or disable it (VARIANT_FALSE).
00500 //
00501 // Returns:          A standard COM success or error value.
00502 //
00503 //----------------------------------------------------------------------------
00504 STDMETHODIMP CEngine::EnableGameCommand(long lID, VARIANT_BOOL bEnable)
00505 {
00506    try   // COM-called code
00507    {
00508       // Check if the ID is valid
00509       int iIndex = m_gameCommandMgr.GetCommandIndex(lID);
00510       if(lID == -1)
00511          return E_INVALIDARG;
00512
00513       // Record the action, during which it will be performed
00514       m_undoMgr.RecordAction((IActionSite*)this, (bEnable == VARIANT_TRUE ? ACTION_ENABLECMD :
00515          ACTION_DISABLECMD), lID);
00516    }
00517    CATCHALL;
00518    return S_OK;
00519 }
00520
00521
00522 //----------------------------------------------------------------------------
00523 //
00524 // ISolpackApp::GameWon method
00525 //    Indicates that the user has won the Solitaire game.
00526 //
00527 // Parameters:       None.
00528 //
00529 // Returns:          A standard COM success or error value.
00530 //
00531 //----------------------------------------------------------------------------
00532 STDMETHODIMP CEngine::GameWon()
00533 {
00534    try   // COM-called code
00535    {
00536       // Play fanfare and update state
00537       PlayCPSound(CPSOUNDS_WON);
00538       SetState(ENG_GAMEWON);
00539
00540       // Clear all actions
00541       m_undoMgr.Clear(NULL);
00542       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00543
00544       // Shatter the image "anim.gif"
00545       CTSTR lpszModule(TRUE, MAX_PATH);
00546       GetModuleFileName(g_hInstLC, lpszModule, MAX_PATH);
00547       PathRemoveFileSpec(lpszModule);
00548       PathAppend(lpszModule, TEXT("anim.gif"));
00549       m_pShatter->DoAnimation((UINT)-1, CBSTR(lpszModule), 493, 317, CBSTR(IDS_SHATTERCOLOR));
00550    }
00551    CATCHALL;
00552
00553    return S_OK;
00554 }
00555
00556
00557 //----------------------------------------------------------------------------
00558 //
00559 // INDUnknownAndDispatch::NDQueryInterface method
00560 //    Returns pointers to supported interfaces.
00561 //
00562 // Parameters:
00563 //    riid:          [in] Identifier of the interface being requested.
00564 //    ppvObject:     [out] Address of pointer variable that receives the
00565 //                   interface pointer requested in riid.
00566 //
00567 // Returns:          A standard COM success or error value.
00568 //
00569 //----------------------------------------------------------------------------
00570 STDMETHODIMP CEngine::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00571 {
00572    if(IsEqualIID(riid, IID_ISolpackApp))
00573    {
00574       *ppvObject = (ISolpackApp*)this;
00575       (*(LPUNKNOWN*)ppvObject)->AddRef();
00576       return S_OK;
00577    } else
00578       return CDispBase::NDQueryInterface(riid, ppvObject);
00579 }
00580
00581
00582 //----------------------------------------------------------------------------
00583 //
00584 // InitEngine function
00585 //    Binds the engine object to a HTML document and parent object.
00586 //
00587 // Parameters:
00588 //    pMsgProcessor: Interface to enable message processing.
00589 //    pSite:         Interface to receive notifications.
00590 //    pSBMgr:        Interface to access and manipulate the status bar.
00591 //    pLibMgr:       The game library manager object to use.
00592 //    pHH:           The HTML helper object to use.
00593 //
00594 // Returns:          None.
00595 //
00596 //----------------------------------------------------------------------------
00597 void CEngine::InitEngine(IMsgProcessor *pMsgProcessor, IEngineSite *pSite, IStatusBarMgr *pSBMgr,
00598                          CLibMgr *pLibMgr, CHTMLHelper *pHH)
00599 {
00600    ODS("CEngine::InitEngine starting");
00601    SetState(m_dwState);
00602
00603    // Set member variables' values
00604    _ASSERT(pSite);
00605    m_pMsgProcessor = pMsgProcessor;
00606    m_pSite = pSite;
00607    m_pSBMgr = pSBMgr;
00608    m_pLibMgr = pLibMgr;
00609    m_pHH = pHH;
00610
00611    // c54.gif is the card back image
00612    m_lpszFaceDownImg.Assign(TEXT("c54.gif"));
00613
00614    Init(g_pTypeLib, IID_ISolpackApp, (LPDISPATCH)((ISolpackApp*)this));
00615
00616    // Set up the DirectAnimation 3D shatter object
00617    m_pShatter = new C3DShatter(m_pHH, IDS_EL_DAVC);
00618    ENSUREALLOC(m_pShatter);
00619
00620    // Set up the game command manager
00621    m_gameCommandMgr.Init((IGameCommandMgrSite*)this, m_pHH);
00622
00623    // Create the initial deck
00624    m_pSBMgr->SBSetText(CTSTR(IDS_STATUS_INITDECK));
00625    AddDeck();
00626    m_pSBMgr->SBSetText(CTSTR());
00627
00628    // Create and initialize the fragment object
00629    m_pFragment = new CFragment();
00630    ENSUREALLOC(m_pFragment);
00631    m_pFragment->AddRef();
00632    m_pFragment->InitPile((IPileSite*)this, (IEngineObjSite*)this, m_pHH);
00633    m_pFragment->InitFragment(m_pMsgProcessor, (IFragmentSite*)this);
00634
00635    SetState(ENG_INACTIVE);
00636    ODS("CEngine::InitEngine finished");
00637 }
00638
00639
00640 //----------------------------------------------------------------------------
00641 //
00642 // Uninit function
00643 //    Releases any HTML document-specific resources, such as event handlers.
00644 //
00645 // Parameters:       None.
00646 //
00647 // Returns:          None.
00648 //
00649 //----------------------------------------------------------------------------
00650 void CEngine::Uninit()
00651 {
00652    SetState(ENG_UNINIT);
00653
00654    // Release the 3D shatter object
00655    if(m_pShatter)
00656       m_pShatter->EndAnimation();
00657    SAFEDELETE(m_pShatter);
00658
00659    // Stop any game that may be playing
00660    StopPlayGame();
00661
00662    // Free the game command manager and fragment
00663    m_gameCommandMgr.Uninit();
00664    SAFERELEASE(m_pFragment);
00665
00666    m_pHH = NULL;
00667 }
00668
00669
00670 //----------------------------------------------------------------------------
00671 //
00672 // PlayGame function
00673 //    Shows the engine UI (the tableau), and creates and runs the specified
00674 //    game.
00675 //
00676 // Parameters:
00677 //    iLibIndex:     Zero-based index of the library containing the game.
00678 //    iGameIndex:    Zero-based index of the game within its library.
00679 //
00680 // Returns:          None.
00681 //
00682 //----------------------------------------------------------------------------
00683 void CEngine::PlayGame(int iLibIndex, int iGameIndex)
00684 {
00685    _ASSERT(m_pHH);
00686    ODS("CEngine::PlayGame started");
00687    SetState(ENG_STARTGAME);
00688
00689    // Retrieve the game, game info, and title
00690    m_spGame.Assign(TRUE, m_pLibMgr->GetGame(iLibIndex, iGameIndex));
00691    CSolpackGameInfoPtr spInfo;
00692    CHECKHRCOM(m_spGame->get_Info(&spInfo));
00693    CBSTR bstr;
00694    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00695
00696    // Set the status bar text
00697    m_pSBMgr->SBSetText(CTSTR().Format(CTSTR(IDS_STATUS_INITGAME), CTSTR(bstr)));
00698    m_lScore = 0;
00699
00700    // Show the engine UI
00701    m_pHH->ShowElementEx(IDS_EL_ENGINE, TRUE);
00702
00703    // Create event handler for clicking the body
00704    CEventHandler *pHandler = NULL;
00705    CVariant v;
00706    CHTMLElementPtr spBody(TRUE, m_pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00707
00708    // Body mouse up handler
00709    pHandler = new CEventHandler((IEventHandlerSite*)this, ENGEVENT_BODYCLICK, 0);
00710    ENSUREALLOC(pHandler);
00711    v.vt = VT_DISPATCH;
00712    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00713    CHECKHRCOM(spBody->put_onmouseup(v));
00714
00715    // Initialize the game
00716    CHECKHRCOM(m_spGame->Initialize((ISolpackApp*)this));
00717    m_pSite->SetScore(m_lScore);
00718
00719    SetState(ENG_IDLE);
00720
00721    // Deal the initial game
00722    DealGame();
00723
00724    ODS("CEngine::PlayGame finished");
00725 }
00726
00727
00728 //----------------------------------------------------------------------------
00729 //
00730 // StopPlayGame function
00731 //    Uninitializes and releases the current game, and hides the engine UI
00732 //    (the tableau).
00733 //
00734 // Parameters:       None.
00735 //
00736 // Returns:          None.
00737 //
00738 //----------------------------------------------------------------------------
00739 void CEngine::StopPlayGame()
00740 {
00741    if(!m_pHH)
00742       return;
00743
00744    DWORD dwOldState = m_dwState;
00745    SetState(ENG_STOPGAME);
00746
00747    // Release the body clicked event handler
00748    CVariant v;
00749    v.vt = VT_NULL;
00750    CHTMLElementPtr spBody(TRUE, m_pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00751    spBody->put_onmouseup(v);
00752
00753    // Hide the engine UI
00754    m_pHH->ShowElementEx(IDS_EL_ENGINE, FALSE);
00755
00756    // Clean up the game
00757    m_undoMgr.Clear(NULL);
00758    if(m_spGame)
00759       CHECKHRCOM(m_spGame->Uninitialize());
00760    CleanupGame();
00761
00762    // Release all objects that the game created
00763    m_bUsingMasterDeck = FALSE;
00764    m_apPiles.SetSize(1);
00765    m_apDecks.SetSize(1);
00766    m_gameCommandMgr.Clear();
00767    m_spGame.Release();
00768    SetState(dwOldState);
00769 }
00770
00771
00772 //----------------------------------------------------------------------------
00773 //
00774 // UpdateTooltips function
00775 //    Informs all pile objects that the tooltip setting has changed.
00776 //
00777 // Parameters:       None.
00778 //
00779 // Returns:          None.
00780 //
00781 //----------------------------------------------------------------------------
00782 void CEngine::UpdateTooltips()
00783 {
00784    // Updates the tooltip settings for each created pile
00785    int cPiles = m_apPiles.GetSize();
00786    for(int i = 0; i < cPiles; i++)
00787       m_apPiles[i]->TooltipPrefChanged();
00788 }
00789
00790
00791 //----------------------------------------------------------------------------
00792 //
00793 // RecalcLayout function
00794 //    Called when the size of the WebBrowser control has changed. Informs the
00795 //    current game, if any, that window dimensions have changed.
00796 //
00797 // Parameters:       None.
00798 //
00799 // Returns:          None.
00800 //
00801 //----------------------------------------------------------------------------
00802 void CEngine::RecalcLayout()
00803 {
00804    if(m_spGame)
00805    {
00806       // While the game is re-laying itself out, don't record actions
00807       BOOL bOld = m_undoMgr.SetCanRecord(FALSE);
00808       m_spGame->RecalcLayout();
00809       m_undoMgr.SetCanRecord(bOld);
00810    }
00811 }
00812
00813
00814 //----------------------------------------------------------------------------
00815 //
00816 // DealGame function
00817 //    Deals a new game of the current game.
00818 //
00819 // Parameters:       None.
00820 //
00821 // Returns:          None.
00822 //
00823 //----------------------------------------------------------------------------
00824 void CEngine::DealGame()
00825 {
00826    if(m_dwState == ENG_IDLE)
00827    {
00828       // Clean up existing game, deal new game, and reset the undo manager
00829       SetState(ENG_DEAL);
00830       CleanupGame();
00831       CHECKHRCOM(m_spGame->Deal());
00832       m_undoMgr.Init();
00833       SetState(ENG_IDLE);
00834    }
00835 }
00836
00837
00838 //----------------------------------------------------------------------------
00839 //
00840 // HandlePileClicked function
00841 //    Called when the engine should call its game's PileClicked method.
00842 //
00843 // Parameters:       None.
00844 //
00845 // Returns:          None.
00846 //
00847 //----------------------------------------------------------------------------
00848 void CEngine::HandlePileClicked()
00849 {
00850    // Call the game's PileClicked method
00851    _ASSERT(m_pPileSrc);
00852    CHECKHRCOM(m_spGame->PileClicked(m_pPileSrc, m_pCardSrc));
00853    SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
00854 }
00855
00856
00857 //----------------------------------------------------------------------------
00858 //
00859 // HandleTryDrop function
00860 //    Called when the engine should try to find a drop destination.
00861 //
00862 // Parameters:       None.
00863 //
00864 // Returns:          None.
00865 //
00866 //----------------------------------------------------------------------------
00867 void CEngine::HandleTryDrop()
00868 {
00869    _ASSERT(m_pPileSrc);
00870
00871    // Assume the drop is invalid
00872    VARIANT_BOOL bValid = VARIANT_FALSE;
00873
00874    // First try to drop the fragment on the pile, if any, directly below the
00875    // mouse cursor
00876    int i;
00877    int cPiles = m_apPiles.GetSize();
00878    for(i = 0; i < cPiles && bValid != VARIANT_TRUE; i++)
00879    {
00880       if(m_apPiles[i] != m_pPileSrc)
00881       {
00882          if(m_apPiles[i]->PtInPile(m_ptDrag))
00883          {
00884             CHECKHRCOM(m_spGame->DropFragment((ISolpackFragment*)m_pFragment,
00885                (ISolpackPile*)m_apPiles[i], &bValid));
00886          }
00887       }
00888    }
00889
00890    // If we didn't drop successfully, then try the piles whose regions
00891    // intersect with the fragment's region
00892    if(bValid != VARIANT_TRUE)
00893    {
00894       // Get the bounding region of the fragment
00895       m_pFragment->UpdateLayout();
00896       HRGN hRgnFrag = m_pFragment->GetPileRgn();
00897
00898       for(int i = 0; i < cPiles && bValid != VARIANT_TRUE; i++)
00899       {
00900          if(m_apPiles[i] != m_pPileSrc)
00901          {
00902             if(m_apPiles[i]->RgnInPile(hRgnFrag))
00903             {
00904                CHECKHRCOM(m_spGame->DropFragment((ISolpackFragment*)m_pFragment,
00905                   (ISolpackPile*)m_apPiles[i], &bValid));
00906             }
00907          }
00908       }
00909    }
00910
00911    // Play sound on drop, or cancel drop if not dropped
00912    if(bValid == VARIANT_TRUE)
00913       PlayCPSound(CPSOUNDS_DROP);
00914    else
00915       CancelDrag(m_pPileSrc);
00916
00917    SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
00918 }
00919
00920
00921 //----------------------------------------------------------------------------
00922 //
00923 // TryCommand function
00924 //    Called when the engine is about to be deactivated. Attempts to hurry up
00925 //    pending operation and stores the finalization message.
00926 //
00927 // Parameters:
00928 //    uMsg:          Message identifer. If -1,
00929 //    wParam:        Message-specific parameter.
00930 //    lParam:        Message-specific parameter.
00931 //
00932 // Returns:          TRUE if the message was processed or can be processed
00933 //                   immediately, or FALSE if the engine is storing the
00934 //                   message.
00935 //
00936 //----------------------------------------------------------------------------
00937 BOOL CEngine::TryCommand(UINT uMsg, WPARAM wParam, LPARAM lParam)
00938 {
00939    if(m_pShatter)
00940       m_pShatter->EndAnimation();
00941
00942    // If the engine is busy doing something, such as animating, cancel
00943    // animation and store the message to be processed when the engine becomes
00944    // idle
00945    if(m_dwState != ENG_IDLE)
00946    {
00947       if(m_pFragment)
00948          m_pFragment->SetCancelAnim(TRUE);
00949       m_uDeactivateMsg = uMsg;
00950       m_wDeactivateParam = wParam;
00951       m_lDeactivateParam = lParam;
00952       return FALSE;
00953    }
00954
00955    switch(LOWORD(wParam))
00956    {
00957       case IDM_GAME_DEAL:
00958          // Deal a new game
00959          DealGame();
00960          break;
00961
00962       case IDM_GAME_AUTOPLAY:
00963          // Autoplay the current game
00964          SetState(ENG_AUTOPLAY);
00965          CHECKHRCOM(m_spGame->AutoPlay());
00966          SetState(ENG_IDLE);
00967          break;
00968
00969       case IDM_GAME_UNDO:
00970          // Undo, if possible
00971          if(!(m_dwState & ENG_UNDO) && m_undoMgr.CanUndo())
00972          {
00973             SetState(m_dwState | ENG_UNDO);
00974             m_undoMgr.Undo();
00975             SetState(m_dwState & ~ENG_UNDO);
00976          }
00977          break;
00978
00979       case IDM_GAME_REDO:
00980          // Redo, if possible
00981          if(!(m_dwState & ENG_UNDO) && m_undoMgr.CanRedo())
00982          {
00983             SetState(m_dwState | ENG_UNDO);
00984             m_undoMgr.Redo();
00985             SetState(m_dwState & ~ENG_UNDO);
00986          }
00987          break;
00988    }
00989
00990    return TRUE;
00991 }
00992
00993
00994 //----------------------------------------------------------------------------
00995 //
00996 // IGameCommandMgrSite::HandleCommand method
00997 //    When the user chose a custom command, inform the game object.
00998 //
00999 // Parameters:
01000 //    lID:           A game-defined ID of the command the user chose.
01001 //
01002 // Returns:          None.
01003 //
01004 //----------------------------------------------------------------------------
01005 void CEngine::HandleCommand(long lID)
01006 {
01007    if(m_dwState != ENG_IDLE)
01008       return;
01009    SetState(ENG_HANDLECMD);
01010    CHECKHRCOM(m_spGame->HandleCommand(lID));
01011    SetState(ENG_IDLE);
01012 }
01013
01014
01015 //----------------------------------------------------------------------------
01016 //
01017 // IPileSite::GetShowTooltips method
01018 //    Retrieves whether to show pile tooltips.
01019 //
01020 // Parameters:       None.
01021 //
01022 // Returns:          TRUE if tooltips are to be displayed, else FALSE.
01023 //
01024 //----------------------------------------------------------------------------
01025 BOOL CEngine::GetShowTooltips()
01026 {
01027    return m_pSite->GetShowTooltips();
01028 }
01029
01030
01031 //----------------------------------------------------------------------------
01032 //
01033 // IPileSite::GetAnim method
01034 //    Retrieves whether to animate cards.
01035 //
01036 // Parameters:       None.
01037 //
01038 // Returns:          TRUE if cards are to be animated, else FALSE.
01039 //
01040 //----------------------------------------------------------------------------
01041 BOOL CEngine::GetAnim()
01042 {
01043    return m_pSite->GetAnim();
01044 }
01045
01046
01047 //----------------------------------------------------------------------------
01048 //
01049 // IPileSite::PlayCPSound method
01050 //    Plays the specified Control Panel sound.
01051 //
01052 // Parameters:
01053 //    uIndex:        Zero-based index of the sound to play.
01054 //
01055 // Returns:          None.
01056 //
01057 //----------------------------------------------------------------------------
01058 void CEngine::PlayCPSound(UINT uIndex)
01059 {
01060    // If we've already won, don't play any sound
01061    if(m_dwState != ENG_GAMEWON)
01062       m_pSite->PlayCPSound(uIndex);
01063 }
01064
01065
01066 //----------------------------------------------------------------------------
01067 //
01068 // ICardSite::GetFaceDownImg method
01069 //    Retrieves the image file used to display a face down card.
01070 //
01071 // Parameters:       None.
01072 //
01073 // Returns:          The image file used to display a face down card.
01074 //
01075 //----------------------------------------------------------------------------
01076 CTSTR& CEngine::GetFaceDownImg()
01077 {
01078    return m_lpszFaceDownImg;
01079 }
01080
01081
01082 //----------------------------------------------------------------------------
01083 //
01084 // ICardSite::CardFlipped method
01085 //    When a card has been turned face up, plays a sound if the engine is in a
01086 //    PileClicked handler.
01087 //
01088 // Parameters:       None.
01089 //
01090 // Returns:          None.
01091 //
01092 //----------------------------------------------------------------------------
01093 void CEngine::CardFlipped()
01094 {
01095    if(ENGSTATE == ENG_PILECLICKED)
01096       PlayCPSound(CPSOUNDS_FLIP);
01097 }
01098
01099
01100 //----------------------------------------------------------------------------
01101 //
01102 // IFragmentSite::AnimStateChange method
01103 //    Called by the fragment when the animation state has changed.
01104 //
01105 // Parameters:
01106 //    bAnim:         TRUE if animation is beginning, or FALSE if it is ending.
01107 //
01108 // Returns:          None.
01109 //
01110 //----------------------------------------------------------------------------
01111 void CEngine::AnimStateChange(BOOL bAnim)
01112 {
01113    if(bAnim)
01114       m_dwState |= ENG_ANIM;
01115    else
01116       m_dwState &= ~ENG_ANIM;
01117 }
01118
01119
01120 //----------------------------------------------------------------------------
01121 //
01122 // IEventHandlerSite::EventHandler method
01123 //    Handles events that are trapped via a CEventHandler object.
01124 //
01125 // Parameters:
01126 //    dwEventID:     The type of event that occurred (ENGEVENT_*)
01127 //    lParam:        Unused.
01128 //
01129 // Returns:          None.
01130 //
01131 //----------------------------------------------------------------------------
01132 void CEngine::EventHandler(DWORD dwEventID, LPARAM lParam)
01133 {
01134    try   // Windows-called code
01135    {
01136       // Cancel the event from bubbling
01137       CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
01138       CHECKHRCOM(spEventObj->put_cancelBubble(VARIANT_TRUE));
01139
01140       // We only handle one event here
01141       if(dwEventID == ENGEVENT_BODYCLICK)
01142       {
01143          // Cancel any animation when the user clicks the page
01144          if(m_dwState & ENG_ANIM)
01145             m_pFragment->SetCancelAnim(TRUE);
01146       }
01147    }
01148    catch(CExcep *pE)
01149    {
01150       pE->Report();
01151       pE->Delete();
01152    }
01153 }
01154
01155
01156 //----------------------------------------------------------------------------
01157 //
01158 // IEngineObjSite::MouseDown method
01159 //    Called when a mouse button has been pressed on a pile or card.
01160 //
01161 // Parameters:
01162 //    pObj:          The pile or card which was clicked.
01163 //    lCurButton:    Value specifiying which mouse buttons are down.
01164 //
01165 // Returns:          TRUE if the object should capture focus, else FALSE.
01166 //
01167 //----------------------------------------------------------------------------
01168 BOOL CEngine::MouseDown(CEngineObj *pObj, long lCurButton)
01169 {
01170    SetState(m_dwState | ENG_MOUSEDOWN);
01171
01172    // Figure out which button was just pressed down
01173    long lNewButton = lCurButton - m_lButton;
01174    m_lButton = lCurButton;
01175
01176    if((ENGSTATE != ENG_IDLE) || (m_dwState & ENG_UNDO))
01177    {
01178       SetMouseState(MS_WAITALL);
01179       return TRUE;
01180    }
01181
01182    // If the event came from a pile object
01183    if(pObj->GetType() == ENGOBJ_PILE)
01184    {
01185       if(m_dwMouseState != MS_IDLE)
01186       {
01187          // Clicking any other buttons while dragging cancels the drag
01188          if(m_dwMouseState != MS_DRAGGING)
01189             SetMouseState(MS_WAITALL);
01190          return FALSE;
01191       }
01192
01193       if(lNewButton != 1)  // Only lbutton down on pile does anything
01194       {
01195          SetMouseState(MS_WAITALL);
01196          return TRUE;
01197       }
01198
01199       m_pPileSrc = (CPile*)pObj;
01200       SetMouseState(MS_PILE_LBD);
01201       return TRUE;
01202    }
01203
01204    // Otherwise, the event came from a card
01205    // Set the new mouse state based on the old state and the button
01206    switch(m_dwMouseState)
01207    {
01208       case MS_IDLE:
01209          m_pCardSrc = (CCard*)pObj;
01210          m_pPileSrc = (CPile*)(m_pCardSrc->GetPile());
01211          if(lNewButton == 1)  // left button
01212          {
01213             // Store the coordinate
01214             CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01215             CHECKHRCOM(spEvent->get_clientX(&m_ptDrag.x));
01216             CHECKHRCOM(spEvent->get_clientY(&m_ptDrag.y));
01217             SetMouseState(MS_CARD_LBD);
01218          } else if(lNewButton == 2) // right button
01219          {
01220             SetMouseState(MS_CARD_RBD);
01221          } else   // some other button
01222          {
01223             SetMouseState(MS_WAITALL);
01224          }
01225          return TRUE;
01226          break;
01227       case MS_PILE_LBD:
01228       case MS_CARD_LBD:
01229       case MS_CARD_LBDNODRAG:
01230       case MS_CARD_RBD:
01231          // Clicking from any of these states cancels the action
01232          SetMouseState(MS_WAITALL);
01233          break;
01234    }
01235    return FALSE;
01236 }
01237
01238
01239 //----------------------------------------------------------------------------
01240 //
01241 // IEngineObjSite::MouseMove method
01242 //    Called when the mouse moves over an element.
01243 //
01244 // Parameters:       None yet.
01245 //
01246 // Returns:          None.
01247 //
01248 //----------------------------------------------------------------------------
01249 void CEngine::MouseMove()
01250 {
01251    switch(m_dwMouseState)
01252    {
01253       case MS_CARD_LBD:
01254       {
01255          _ASSERT(m_pCardSrc);
01256          ODS("Trying to start a drag");
01257          if(m_pCardSrc->m_bCanDrag)
01258          {
01259             // Add cards to the fragment
01260             CHECKHRCOM(m_spGame->SetupFragment(m_pPileSrc, m_pCardSrc,
01261                (ISolpackFragment*)m_pFragment));
01262             SetMouseState(MS_DRAGGING);
01263
01264             // Store the coordinate
01265             CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01266             POINT pt;
01267             CHECKHRCOM(spEvent->get_clientX(&pt.x));
01268             CHECKHRCOM(spEvent->get_clientY(&pt.y));
01269             m_pFragment->MoveBy(pt.x - m_ptDrag.x, pt.y - m_ptDrag.y);
01270             m_ptDrag.x = pt.x;
01271             m_ptDrag.y = pt.y;
01272          } else
01273          {
01274             // Card can't be dragged
01275             SetMouseState(MS_CARD_LBDNODRAG);
01276          }
01277       } break;
01278
01279       case MS_DRAGGING:
01280          // Update the position of the fragment and store the new coordinate
01281          POINT pt;
01282          CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01283          CHECKHRCOM(spEvent->get_clientX(&pt.x));
01284          CHECKHRCOM(spEvent->get_clientY(&pt.y));
01285          m_pFragment->MoveBy(pt.x - m_ptDrag.x, pt.y - m_ptDrag.y);
01286          m_ptDrag.x = pt.x;
01287          m_ptDrag.y = pt.y;
01288          break;
01289    }
01290    return;
01291 }
01292
01293
01294 //----------------------------------------------------------------------------
01295 //
01296 // IEngineObjSite::MouseUp method
01297 //    Called when a mouse button has been released.
01298 //
01299 // Parameters:
01300 //    bOverEl:       Whether the mouse is being released over the same element
01301 //                   as that which has the focus
01302 //    lButton:       Value specifiying which mouse button was released.
01303 //
01304 // Returns:          TRUE if the object should release mouse focus, else
01305 //                   FALSE.
01306 //
01307 //----------------------------------------------------------------------------
01308 BOOL CEngine::MouseUp(BOOL bOverEl, long lButton)
01309 {
01310    m_lButton &= ~lButton;
01311
01312    // Cancel any animation
01313    if(m_dwState & ENG_ANIM)
01314       m_pFragment->SetCancelAnim(TRUE);
01315
01316    if(m_dwMouseState == MS_IDLE)
01317       return FALSE;
01318
01319    // Handle left button up
01320    if(lButton == 1)
01321    {
01322       switch(m_dwMouseState)
01323       {
01324          case MS_PILE_LBD:
01325          case MS_CARD_LBD:
01326          case MS_CARD_LBDNODRAG:
01327             if(bOverEl)
01328             {
01329                // Pile was clicked
01330                SetMouseState(MS_PILE_CLICKED);
01331                SetState((m_dwState & ENG_FLAGS) | ENG_PILECLICKED);
01332                HandlePileClicked();
01333             }
01334             SetMouseState(MS_IDLE);
01335             break;
01336          case MS_DRAGGING:
01337             // Drag has ended
01338             SetMouseState(MS_TRYDROP);
01339             SetState((m_dwState & ENG_FLAGS) | ENG_DROPFRAG);
01340             HandleTryDrop();
01341             SetMouseState(MS_WAITALL);
01342             break;
01343       }
01344    } else
01345    {
01346       if(m_dwMouseState == MS_DRAGGING)
01347       {
01348          // Drag was cancelled by another click
01349          SetMouseState(MS_TRYDROP);
01350          CancelDrag(m_pPileSrc);
01351          SetMouseState(MS_WAITALL);
01352       }
01353       if(lButton == 2)
01354       {
01355          if(m_dwMouseState == MS_CARD_RBD)
01356          {
01357             if(bOverEl)
01358             {
01359                // Right button was clicked; auto play card
01360                _ASSERT(m_pCardSrc);
01361                SetMouseState(MS_CARD_AUTOPLAY);
01362                SetState((m_dwState & ENG_FLAGS) | ENG_PILECLICKED);
01363                CHECKHRCOM(m_spGame->AutoPlayCard((ISolpackCard*)m_pCardSrc));
01364                SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
01365             }
01366             SetMouseState(MS_IDLE);
01367          }
01368       }
01369    }
01370
01371    if(m_dwMouseState == MS_WAITALL)
01372    {
01373       // If we were waiting for all buttons to be released, and they have
01374       // been, back to idle state
01375       if(m_lButton == 0)
01376          SetMouseState(MS_IDLE);
01377       else
01378          return FALSE;
01379    }
01380    return TRUE;
01381 }
01382
01383
01384 //----------------------------------------------------------------------------
01385 //
01386 // IEngineObjSite::CancelMouseEvent method
01387 //    Called when an event occurred that should cancel any mouse operation.
01388 //
01389 // Parameters:       None.
01390 //
01391 // Returns:          None.
01392 //
01393 //----------------------------------------------------------------------------
01394 void CEngine::CancelMouseEvent()
01395 {
01396    if(m_dwMouseState == MS_IDLE)
01397       return;
01398
01399    // Cancel any drag
01400    if(m_dwMouseState == MS_DRAGGING)
01401       CancelDrag(m_pPileSrc);
01402
01403    SetMouseState(MS_IDLE);
01404 }
01405
01406
01407 //----------------------------------------------------------------------------
01408 //
01409 // IUndoMgrOwner::GetUndoMgr method
01410 //    Retrieve's the engine's undo manager.
01411 //
01412 // Parameters:       None.
01413 //
01414 // Returns:          A pointer to the undo manager.
01415 //
01416 //----------------------------------------------------------------------------
01417 CUndoMgr* CEngine::GetUndoMgr()
01418 {
01419    return &m_undoMgr;
01420 }
01421
01422
01423 //----------------------------------------------------------------------------
01424 //
01425 // IActionSite::DoAction method
01426 //    Executes the specified action.
01427 //
01428 // Parameters:
01429 //    pAction:       Object containing information on an action.
01430 //
01431 // Returns:          None.
01432 //
01433 //----------------------------------------------------------------------------
01434 void CEngine::DoAction(CAction *pAction)
01435 {
01436    switch(pAction->m_dwType)
01437    {
01438       // Updates the score
01439       case ACTION_SCORE:
01440       {
01441          m_lScore += (long)pAction->m_dwData;
01442          m_pSite->SetScore(m_lScore);
01443       } break;
01444
01445       // Enables or disables the command
01446       case ACTION_ENABLECMD:
01447       case ACTION_DISABLECMD:
01448          m_gameCommandMgr.EnableGameCommand((long)pAction->m_dwData,
01449             pAction->m_dwType == ACTION_ENABLECMD);
01450          break;
01451    }
01452 }
01453
01454
01455 //----------------------------------------------------------------------------
01456 //
01457 // IActionSite::UndoAction method
01458 //    Undoes the specified action.
01459 //
01460 // Parameters:
01461 //    pAction:       Object containing information on an action.
01462 //
01463 // Returns:          None.
01464 //
01465 //----------------------------------------------------------------------------
01466 void CEngine::UndoAction(CAction *pAction)
01467 {
01468    switch(pAction->m_dwType)
01469    {
01470       // Updates the score
01471       case ACTION_SCORE:
01472       {
01473          m_lScore -= (long)pAction->m_dwData;
01474          m_pSite->SetScore(m_lScore);
01475       } break;
01476
01477       // Enables or disables the command
01478       case ACTION_ENABLECMD:
01479       case ACTION_DISABLECMD:
01480          m_gameCommandMgr.EnableGameCommand((long)pAction->m_dwData,
01481             pAction->m_dwType == ACTION_DISABLECMD);
01482          break;
01483    }
01484 }
01485
01486
01487 //----------------------------------------------------------------------------
01488 //
01489 // AddDeck function
01490 //    Creates a new deck and adds it to the array of decks.
01491 //
01492 // Parameters:       None.
01493 //
01494 // Returns:          A pointer to the deck that was created.
01495 //
01496 //----------------------------------------------------------------------------
01497 CDeck* CEngine::AddDeck()
01498 {
01499    // Create, initialize, and store the deck
01500    CDeck *pDeck = new CDeck();
01501    ENSUREALLOC(pDeck);
01502    m_apDecks.Add(pDeck);
01503    pDeck->AddRef();
01504    pDeck->InitPile((IPileSite*)this, (IEngineObjSite*)this, m_pHH);
01505    pDeck->InitDeck(m_pMsgProcessor, m_pSBMgr, (ICardSite*)this);
01506    m_apPiles.Add((CPile*)pDeck);
01507    pDeck->AddRef();
01508    return pDeck;
01509 }
01510
01511
01512 //----------------------------------------------------------------------------
01513 //
01514 // CleanupGame function
01515 //    Clears all piles of their cards and returns them to their deck.
01516 //
01517 // Parameters:       None.
01518 //
01519 // Returns:          None.
01520 //
01521 //----------------------------------------------------------------------------
01522 void CEngine::CleanupGame()
01523 {
01524    // Clear all actions
01525    m_undoMgr.Clear(NULL);
01526
01527    // Empty all piles of their cards
01528    int i;
01529    int c = m_apPiles.GetSize();
01530    for(i = 0; i < c; i++)
01531       m_apPiles[i]->ClearCards();
01532
01533    m_pFragment->ClearCards();
01534
01535    // Move all cards back to their decks
01536    c = m_apDecks.GetSize();
01537    for(i = 0; i < c; i++)
01538       m_apDecks[i]->ReclaimCards();
01539 }
01540
01541
01542 //----------------------------------------------------------------------------
01543 //
01544 // SetMouseState function
01545 //    Changes the current mouse state.
01546 //
01547 // Parameters:
01548 //    dwNewState:    The new mouse state (MS_*).
01549 //
01550 // Returns:          None.
01551 //
01552 //----------------------------------------------------------------------------
01553 void CEngine::SetState(DWORD dwNewState)
01554 {
01555    // Print state change message
01556 #ifdef _DEBUG
01557    ODS2(TEXT("EngState switch to: "));
01558    ODS2(szEngSNames[dwNewState & ~(ENG_UNDO | ENG_ANIM | ENG_MOUSEDOWN)]);
01559    if(dwNewState & ENG_UNDO)
01560       ODS2(TEXT(" & ENG_UNDO"));
01561    if(dwNewState & ENG_ANIM)
01562       ODS2(TEXT(" & ENG_ANIM"));
01563    if(dwNewState & ENG_MOUSEDOWN)
01564       ODS2(TEXT(" & ENG_MOUSEDOWN"));
01565    ODS2(TEXT("\n"));
01566 #endif
01567
01568    // If we just went idle, push a new turn and process any message that we
01569    // received while busy
01570    m_dwState = dwNewState;
01571    if(m_dwState == ENG_IDLE)
01572    {
01573       m_undoMgr.PushNewTurn();
01574       m_pFragment->SetCancelAnim(FALSE);
01575       if(m_uDeactivateMsg > 0)
01576       {
01577          m_pSite->PostMsg(m_uDeactivateMsg, m_wDeactivateParam, m_lDeactivateParam);
01578          m_uDeactivateMsg = 0;
01579          m_wDeactivateParam = 0;
01580          m_lDeactivateParam = 0;
01581       }
01582    }
01583 }
01584
01585
01586 //----------------------------------------------------------------------------
01587 //
01588 // SetMouseState function
01589 //    Changes the current mouse state.
01590 //
01591 // Parameters:
01592 //    dwNewState:    The new mouse state (MS_*).
01593 //
01594 // Returns:          None.
01595 //
01596 //----------------------------------------------------------------------------
01597 void CEngine::SetMouseState(DWORD dwNewState)
01598 {
01599    // Print state change message
01600 #ifdef _DEBUG
01601    ODS2(TEXT("MS switch to: "));
01602    ODS2(szMSNames[dwNewState]);
01603    ODS2(TEXT("\n"));
01604 #endif
01605
01606    m_dwMouseState = dwNewState;
01607
01608    // Clear any storing of drag source piles and cards if we just went idle
01609    if(m_dwMouseState == MS_IDLE)
01610    {
01611       m_pPileSrc = NULL;
01612       m_pCardSrc = NULL;
01613       m_lButton = 0;
01614       SetState(m_dwState & ~ENG_MOUSEDOWN);
01615    }
01616 }
01617
01618
01619 //----------------------------------------------------------------------------
01620 //
01621 // CancelDrag function
01622 //    Cancels the current drag operation.
01623 //
01624 // Parameters:
01625 //    pPile:         Temporary. The pile to which cards should be returned.
01626 //
01627 // Returns:          None.
01628 //
01629 //----------------------------------------------------------------------------
01630 void CEngine::CancelDrag(CPile *pPile)
01631 {
01632    // Tell the game we've cancelled
01633    CHECKHRCOM(m_spGame->CancelMove());
01634
01635    // Move the fragment back
01636    m_pFragment->CancelAdditions();
01637 }
Generated on Wed May 8 12:39:03 2002 for Solitaire Pack by doxygen 1.2.15


Engine.h File Reference

#include "..\SolpackTLB\SolpackIncl.h"
#include "ProcessMsg.h"
#include "StatusBarMgr.h"
#include "LibMgr.h"
#include "GameCommandMgr.h"
#include "Pile.h"
#include "Deck.h"
#include "Fragment.h"
#include "UndoMgr.h"
#include "Action.h"
#include <bmws_dispbase.h>
#include <bmws_htmlhelpers.h>
#include <bmws_3dshatter.h>

Go to the source code of this file.

Compounds

class | CEngine
class | IEngineSite

Defines

#define | AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
#define | PILESPACINGX 10
#define | PILESPACINGY 10

Define Documentation

#define AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Engine.h.

#define PILESPACINGX 10

Definition at line 38 of file Engine.h.

#define PILESPACINGY 10

Definition at line 39 of file Engine.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Engine.h Source File

Engine.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Engine.h
00004 //    Class to encapsulate the Solitaire Pack engine.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\SolpackIncl.h"
00021 #include "ProcessMsg.h"
00022 #include "StatusBarMgr.h"
00023 #include "LibMgr.h"
00024 #include "GameCommandMgr.h"
00025 #include "Pile.h"
00026 #include "Deck.h"
00027 #include "Fragment.h"
00028 #include "UndoMgr.h"
00029 #include "Action.h"
00030 #include <bmws_dispbase.h>
00031 #include <bmws_htmlhelpers.h>
00032 #include <bmws_3dshatter.h>
00033
00034
00035 //----------------------------------------------------------------------------
00036 // Engine state values
00037 //----------------------------------------------------------------------------
00038 #define PILESPACINGX    10
00039 #define PILESPACINGY    10
00040
00041
00042 //----------------------------------------------------------------------------
00043 //
00044 // IEngineSite abstract class
00045 //    Enables the main window to receive notifications from the engine.
00046 //
00047 //----------------------------------------------------------------------------
00048 class IEngineSite
00049 {
00050 public:
00051    virtual void SetScore(long lScore) = 0;
00052    virtual BOOL GetShowTooltips() = 0;
00053    virtual BOOL GetAnim() = 0;
00054    virtual void PlayCPSound(UINT uIndex) = 0;
00055    virtual void PostMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
00056 };
00057
00058
00059 //----------------------------------------------------------------------------
00060 //
00061 // CEngine class
00062 //    Encapsulates the Solitaire Pack engine. This object, a member of the
00063 //    main window, handles all game playing operations.
00064 //
00065 //----------------------------------------------------------------------------
00066 class CEngine : public CDispBase, public ISolpackApp, public IEngineObjSite,
00067                 public IGameCommandMgrSite, public IPileSite, public ICardSite,
00068                 public IFragmentSite, public IEventHandlerSite, public IUndoMgrOwner,
00069                 public IActionSite
00070 {
00071 public:
00072    CEngine();
00073    virtual ~CEngine();
00074
00075    DECLARE_IUNKNOWN_AND_IDISPATCH;
00076
00077    // ISolpackApp methods
00078    STDMETHOD (get_CardWidth)(long *p);
00079    STDMETHOD (get_CardHeight)(long *p);
00080    STDMETHOD (get_Score)(long *p);
00081    STDMETHOD (put_Score)(long v);
00082    STDMETHOD (get_WindowWidth)(long *p);
00083    STDMETHOD (get_WindowHeight)(long *p);
00084    STDMETHOD (get_SpacingX)(long *p);
00085    STDMETHOD (get_SpacingY)(long *p);
00086    STDMETHOD (get_Fragment)(ISolpackFragment **pp);
00087    STDMETHOD (CreatePile)(long lType, ISolpackPile **ppPile);
00088    STDMETHOD (CreateGameData)(ISolpackGameData **ppGameData);
00089    STDMETHOD (AddGameCommand)(long lID, BSTR bstrText, BSTR bstrHelpText);
00090    STDMETHOD (EnableGameCommand)(long lID, VARIANT_BOOL bEnable);
00091    STDMETHOD (GameWon)();
00092
00093    // INDUnknownAndDispatch override
00094    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00095
00096    void InitEngine(IMsgProcessor *pMsgProcessor, IEngineSite *pSite, IStatusBarMgr *pSBMgr,
00097       CLibMgr *pLibMgr, CHTMLHelper *pHH);
00098    void Uninit();
00099    void PlayGame(int iLibIndex, int iGameIndex);
00100    void StopPlayGame();
00101    void UpdateTooltips();
00102    void RecalcLayout();
00103    void DealGame();
00104    void HandlePileClicked();
00105    void HandleTryDrop();
00106    BOOL TryCommand(UINT uMsg, WPARAM wParam, LPARAM lParam);
00107
00108    // IEngineObjSite methods
00109    BOOL MouseDown(CEngineObj *pObj, long lCurButton);
00110    void MouseMove();
00111    BOOL MouseUp(BOOL bOverEl, long lButton);
00112    void CancelMouseEvent();
00113    CUndoMgr* EngGetUndoMgr() { return GetUndoMgr(); }
00114
00115    // IUndoMgrOwner method
00116    CUndoMgr* GetUndoMgr();
00117
00118    // IGameCommandMgrSite method
00119    void HandleCommand(long lID);
00120
00121    // IPileSite methods
00122    BOOL GetShowTooltips();
00123    BOOL GetAnim();
00124    void PlayCPSound(UINT uIndex);
00125
00126    // ICardSite method
00127    CTSTR& GetFaceDownImg();
00128    void CardFlipped();
00129
00130    // IFragmentSite method
00131    void AnimStateChange(BOOL bAnim);
00132
00133    // IEventHandlerSite method
00134    void EventHandler(DWORD dwEventID, LPARAM lParam);
00135
00136    // IActionSite methods
00137    void DoAction(CAction *pAction);
00138    void UndoAction(CAction *pAction);
00139
00140 protected:
00141    CDeck* AddDeck();
00142    void CleanupGame();
00143    void SetState(DWORD dwNewState);
00144    void SetMouseState(DWORD dwNewState);
00145    void CancelDrag(CPile *pPile);
00146
00147    IMsgProcessor *m_pMsgProcessor;     // Message processor interface
00148    IEngineSite *m_pSite;               // Main window interface
00149    IStatusBarMgr *m_pSBMgr;            // Status bar interface
00150    CLibMgr *m_pLibMgr;                 // Library manager object
00151    CHTMLHelper *m_pHH;                 // HTML helper object
00152    long m_dwState;                     // The current state of the engine
00153
00154    CTSTR m_lpszFaceDownImg;            // Image file of face down cards
00155    C3DShatter *m_pShatter;             // 3D Shatter component
00156    long m_lScore;                      // The game's score
00157    CSolpackGamePtr m_spGame;           // The current game object
00158
00159    BOOL m_bUsingMasterDeck;               // Whether the master deck has been given to a game
00160    CPtrArray<CDeck*, CDeck*> m_apDecks;   // Array of created deck objects
00161    CPtrArray<CPile*, CPile*> m_apPiles;   // Array of created pile objects
00162    CFragment *m_pFragment;                // The fragment object
00163
00164    CGameCommandMgr m_gameCommandMgr;   // The game command manager object
00165
00166    // Mouse event variables:
00167    DWORD m_dwMouseState;               // The current mouse state
00168    long m_lButton;                     // Which mouse button(s) are currently down
00169    CPile *m_pPileSrc;                  // If a pile initiated events, the pile object
00170    CCard *m_pCardSrc;                  // If a card initiated events, the card object
00171    POINT m_ptDrag;                     // Current drag point
00172
00173    UINT m_uDeactivateMsg;              // Message to post when current action is finished
00174    WPARAM m_wDeactivateParam;          // Parameter for message
00175    LPARAM m_lDeactivateParam;          // Parameter for message
00176
00177    CUndoMgr m_undoMgr;                 // The undo manager object
00178 };
00179
00180
00181 #endif // !defined(AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:03 2002 for Solitaire Pack by doxygen 1.2.15


EngineObj.cpp File Reference

#include "stdafx.h"
#include "EngineObj.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | EOEVENT_MOUSEDOWN 0
#define | EOEVENT_MOUSEUP 1
#define | EOEVENT_MOUSEMOVE 2
#define | EOEVENT_LOSECAPTURE 3

Define Documentation

#define EOEVENT_LOSECAPTURE 3

Definition at line 26 of file EngineObj.cpp.

Referenced by CEngineObj::EventHandler(), and CEngineObj::SetEventHandlers().

#define EOEVENT_MOUSEDOWN 0

Definition at line 23 of file EngineObj.cpp.

Referenced by CEngineObj::EventHandler(), and CEngineObj::SetEventHandlers().

#define EOEVENT_MOUSEMOVE 2

Definition at line 25 of file EngineObj.cpp.

Referenced by CEngineObj::EventHandler(), and CEngineObj::SetEventHandlers().

#define EOEVENT_MOUSEUP 1

Definition at line 24 of file EngineObj.cpp.

Referenced by CEngineObj::EventHandler(), and CEngineObj::SetEventHandlers().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


EngineObj.cpp Source File

EngineObj.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // EngineObj.cpp
00004 //    Class to encapsulate common functionality shared between pile and card
00005 //    objects.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include "stdafx.h"
00014 #include "EngineObj.h"
00015 #include <bmws_variant.h>
00016 #include "resource.h"
00017 #include "..\SolpckLC\resource.h"
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Element event handler codes
00022 //----------------------------------------------------------------------------
00023 #define EOEVENT_MOUSEDOWN     0  // Mouse button down
00024 #define EOEVENT_MOUSEUP       1  // Mouse button released
00025 #define EOEVENT_MOUSEMOVE     2  // Mouse was moved
00026 #define EOEVENT_LOSECAPTURE   3  // Mouse capture was lost
00027
00028
00029 //----------------------------------------------------------------------------
00030 //
00031 // CEngineObj constructor
00032 //
00033 // Parameters:       None.
00034 //
00035 //----------------------------------------------------------------------------
00036 CEngineObj::CEngineObj()
00037 {
00038    // Set initial values for member variables
00039    m_pEngObjSite = NULL;
00040    m_pHH = NULL;
00041 }
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CEngineObj destructor
00047 //
00048 //----------------------------------------------------------------------------
00049 CEngineObj::~CEngineObj()
00050 {
00051    if(m_spEl)
00052    {
00053       // Release all event handlers
00054       CVariant v;
00055       v.vt = VT_NULL;
00056
00057       m_spEl->put_onmousedown(v);
00058       m_spEl->put_onmouseup(v);
00059       m_spEl->put_onmousemove(v);
00060       CHTMLElement2Ptr(m_spEl)->put_onlosecapture(v);
00061    }
00062 }
00063
00064
00065 //----------------------------------------------------------------------------
00066 //
00067 // InitEngineObj function
00068 //    Sets up the object.
00069 //
00070 // Parameters:
00071 //    pEngObjSite:   Interface of the engine.
00072 //    pHH:           The HTML helper object to use.
00073 //
00074 // Returns:          None.
00075 //
00076 //----------------------------------------------------------------------------
00077 void CEngineObj::InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
00078 {
00079    // Set member variables' values
00080    m_pEngObjSite = pEngObjSite;
00081    m_pHH = pHH;
00082 }
00083
00084
00085 //----------------------------------------------------------------------------
00086 //
00087 // GetType function
00088 //    Retrieves the type of engine object this is.
00089 //
00090 // Parameters:       None.
00091 //
00092 // Returns:          The ENGOBJ_* type value.
00093 //
00094 //----------------------------------------------------------------------------
00095 DWORD CEngineObj::GetType()
00096 {
00097    return m_dwEngObjType;
00098 }
00099
00100
00101 //----------------------------------------------------------------------------
00102 //
00103 // IEventHandlerSite::EventHandler method
00104 //    Handles events that are trapped via a CEventHandler object.
00105 //
00106 // Parameters:
00107 //    dwEventID:     The type of event that occurred (EOEVENT_*)
00108 //    lParam:        Unused.
00109 //
00110 // Returns:          None.
00111 //
00112 //----------------------------------------------------------------------------
00113 void CEngineObj::EventHandler(DWORD dwEventID, LPARAM lParam)
00114 {
00115    try   // Windows-called code
00116    {
00117       // Cancel the event from bubbling
00118       CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
00119       CHECKHRCOM(spEventObj->put_cancelBubble(VARIANT_TRUE));
00120
00121       long lButton;
00122       CHECKHRCOM(spEventObj->get_button(&lButton));
00123
00124       switch(dwEventID)
00125       {
00126          case EOEVENT_MOUSEDOWN:
00127             // Tell the engine a mouse button was pressed
00128             if(m_pEngObjSite->MouseDown(this, lButton))
00129                SetElCapture();
00130             break;
00131
00132          case EOEVENT_MOUSEUP:
00133          {
00134             // Determine whether the mouse was released over this object's
00135             // element or one of its children
00136             CHTMLElementPtr spEl;
00137             CHECKHRCOM(spEventObj->get_srcElement(&spEl));
00138             VARIANT_BOOL vbContains;
00139             CHECKHRCOM(m_spEl->contains(spEl, &vbContains));
00140
00141             // Tell the engine a mouse button was released
00142             if(m_pEngObjSite->MouseUp(vbContains == VARIANT_TRUE, lButton))
00143                ReleaseElCapture();
00144          } break;
00145
00146          case EOEVENT_MOUSEMOVE:
00147             // Tell the engine the mouse was moved
00148             m_pEngObjSite->MouseMove();
00149             break;
00150
00151          case EOEVENT_LOSECAPTURE:
00152             // Tell the engine that we've lost focus for some reason
00153             m_pEngObjSite->CancelMouseEvent();
00154             break;
00155       }
00156    }
00157    catch(CExcep *pE)
00158    {
00159       pE->Report();
00160       pE->Delete();
00161    }
00162 }
00163
00164
00165 //----------------------------------------------------------------------------
00166 //
00167 // SetEventHandlers function
00168 //    Creates event handlers for the object's HTML element.
00169 //
00170 // Parameters:       None.
00171 //
00172 // Returns:          None.
00173 //
00174 //----------------------------------------------------------------------------
00175 void CEngineObj::SetEventHandlers()
00176 {
00177    _ASSERT(m_spEl);
00178
00179    // Create event handlers for the element
00180    CEventHandler *pHandler = NULL;
00181    CVariant v;
00182
00183    // Mouse button down handler
00184    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEDOWN, 0);
00185    ENSUREALLOC(pHandler);
00186    v.vt = VT_DISPATCH;
00187    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00188    CHECKHRCOM(m_spEl->put_onmousedown(v));
00189    VariantClear(&v);
00190
00191    // Mouse button up handler
00192    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEUP, 0);
00193    ENSUREALLOC(pHandler);
00194    v.vt = VT_DISPATCH;
00195    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00196    CHECKHRCOM(m_spEl->put_onmouseup(v));
00197    VariantClear(&v);
00198
00199    // Mouse move handler
00200    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEMOVE, 0);
00201    ENSUREALLOC(pHandler);
00202    v.vt = VT_DISPATCH;
00203    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00204    CHECKHRCOM(m_spEl->put_onmousemove(v));
00205    VariantClear(&v);
00206
00207    // Lose focus handler
00208    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_LOSECAPTURE, 0);
00209    ENSUREALLOC(pHandler);
00210    v.vt = VT_DISPATCH;
00211    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00212    CHECKHRCOM(CHTMLElement2Ptr(m_spEl)->put_onlosecapture(v));
00213    VariantClear(&v);
00214 }
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


EngineObj.h File Reference

#include "UndoMgr.h"
#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class | CEngineObj
class | IEngineObjSite

Defines

#define | AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
#define | ENGOBJ_PILE 0
#define | ENGOBJ_CARD 1

Define Documentation

#define AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 11 of file EngineObj.h.

#define ENGOBJ_CARD 1

Definition at line 29 of file EngineObj.h.

Referenced by CCard::CCard().

#define ENGOBJ_PILE 0

Definition at line 28 of file EngineObj.h.

Referenced by CPile::CPile(), and CEngine::MouseDown().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


EngineObj.h Source File

EngineObj.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // EngineObj.h
00004 //    Class to encapsulate common functionality shared between pile and card
00005 //    objects.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00011 #define AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include "UndoMgr.h"
00022 #include <bmws_htmlhelpers.h>
00023
00024
00025 //----------------------------------------------------------------------------
00026 // Types of engine objects (m_dwEngObjType)
00027 //----------------------------------------------------------------------------
00028 #define ENGOBJ_PILE  0
00029 #define ENGOBJ_CARD  1
00030
00031
00032 //----------------------------------------------------------------------------
00033 // Forward declaration
00034 //----------------------------------------------------------------------------
00035 class CEngineObj;
00036
00037
00038 //----------------------------------------------------------------------------
00039 //
00040 // IEngineObjSite abstract class
00041 //    Enables cards and piles to tell the engine of mouse events. Implemented
00042 //    by the CEngine class.
00043 //
00044 //----------------------------------------------------------------------------
00045 class IEngineObjSite
00046 {
00047 public:
00048    virtual BOOL MouseDown(CEngineObj *pObj, long lCurButton) = 0;
00049    virtual void MouseMove() = 0;
00050    virtual BOOL MouseUp(BOOL bOverEl, long lButton) = 0;
00051    virtual void CancelMouseEvent() = 0;
00052    virtual CUndoMgr* EngGetUndoMgr() = 0;
00053 };
00054
00055
00056 //----------------------------------------------------------------------------
00057 //
00058 // CEngineObj class
00059 //    Encapsulates functionality shared between pile and card objects. Handles
00060 //    all mouse events and forwards them to the engine.
00061 //
00062 //----------------------------------------------------------------------------
00063 class CEngineObj : public IEventHandlerSite
00064 {
00065 public:
00066    CEngineObj();
00067    virtual ~CEngineObj();
00068
00069    void InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH);
00070    DWORD GetType();
00071
00072    // IEventHandlerSite method
00073    void EventHandler(DWORD dwEventID, LPARAM lParam);
00074
00075 protected:
00076    void SetEventHandlers();
00077    virtual void SetElCapture() = 0;
00078    virtual void ReleaseElCapture() = 0;
00079
00080    IEngineObjSite *m_pEngObjSite;   // Interface of the engine
00081    CHTMLHelper *m_pHH;              // HTML helper object
00082
00083    CHTMLElementPtr m_spEl;          // HTML element that is the pile/card
00084    CHTMLStylePtr m_spStyle;         // HTML style object for the pile/card element
00085
00086    DWORD m_dwEngObjType;            // What type of object this is
00087 };
00088
00089
00090 #endif // !defined(AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


Event.cpp File Reference

#include "stdafx.h"
#include <bmws_eventsink.cpp>
#include <bmws_eventhandler.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Event.cpp Source File

Event.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Event.cpp
00004 //    Includes component source files related to event sinks and event
00005 //    handlers.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #include "stdafx.h"
00011 #include <bmws_eventsink.cpp>
00012 #include <bmws_eventhandler.cpp>
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


Fragment.cpp File Reference

#include "stdafx.h"
#include "Fragment.h"
#include "SolpackInternal.h"
#include <math.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Compounds

struct | tagDPAIR

Defines

#define | STEPDISTANCE 15
#define | ACTION_FRAGMENT 1001

Typedefs

typedef tagDPAIR | DPAIR

Variables

ITypeLib * | g_pTypeLib

Define Documentation

#define ACTION_FRAGMENT 1001

Definition at line 35 of file Fragment.cpp.

Referenced by CFragmentAction::CFragmentAction(), CFragment::DoAction(), and CFragment::UndoAction().

#define STEPDISTANCE 15

Definition at line 29 of file Fragment.cpp.

Referenced by CFragment::Animate().

Typedef Documentation

typedef struct tagDPAIR DPAIR

Variable Documentation

ITypeLib* g_pTypeLib

Definition at line 23 of file Fragment.cpp.

Referenced by CFragment::InitFragment().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Fragment.cpp Source File

Fragment.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Fragment.cpp
00004 //    Class to encapsulate the fragment used to transfer cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Fragment.h"
00014 #include "SolpackInternal.h"
00015 #include <math.h>
00016 #include "resource.h"
00017 #include "..\SolpckLC\resource.h"
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Global and external variables
00022 //----------------------------------------------------------------------------
00023 extern ITypeLib *g_pTypeLib;     // The Solpack type library
00024
00025
00026 //----------------------------------------------------------------------------
00027 // Animation step value (pixels per step)
00028 //----------------------------------------------------------------------------
00029 #define STEPDISTANCE    15
00030
00031
00032 //----------------------------------------------------------------------------
00033 // Action Types
00034 //----------------------------------------------------------------------------
00035 #define ACTION_FRAGMENT    1001
00036
00037
00038 //----------------------------------------------------------------------------
00039 // DPAIR structure
00040 //    A pair of double coordinates.
00041 //----------------------------------------------------------------------------
00042 typedef struct tagDPAIR
00043 {
00044    double x;
00045    double y;
00046 } DPAIR;
00047
00048
00049 //----------------------------------------------------------------------------
00050 //
00051 // CFragmentAction constructor
00052 //
00053 // Parameters:
00054 //    pSite:         Interface of the fragment that handles the action.
00055 //
00056 //----------------------------------------------------------------------------
00057 CFragmentAction::CFragmentAction(IActionSite *pSite) : CAction(pSite, ACTION_FRAGMENT, 0)
00058 {
00059    // Set initial values for member variables
00060    m_pPileDest = FALSE;
00061    m_bAnimate = TRUE;
00062    m_bToggleFace = FALSE;
00063    m_lIndex = -1;
00064    m_cCards = 0;
00065    m_apAdditions.SetSize(0, 8);
00066    m_bMovedOnce = FALSE;
00067 }
00068
00069
00070 //----------------------------------------------------------------------------
00071 //
00072 // CFragment constructor
00073 //
00074 // Parameters:       None.
00075 //
00076 //----------------------------------------------------------------------------
00077 CFragment::CFragment() : CPile(PILE_FRAGMENT)
00078 {
00079    // Set initial values for member variables
00080    m_pSite = NULL;
00081    m_bCancelAnim = FALSE;
00082    m_pCurAction = NULL;
00083
00084    // Signify that the contained pointers are COM interface pointers that
00085    // should be released, not deleted, when destroyed.
00086    m_apSources.SetRelease(TRUE);
00087    ODS("CFragment constructor");
00088 }
00089
00090
00091 //----------------------------------------------------------------------------
00092 //
00093 // CFragment destructor
00094 //
00095 //----------------------------------------------------------------------------
00096 CFragment::~CFragment()
00097 {
00098    SAFEDELETE(m_pCurAction);
00099    ODS("CFragment destructor");
00100 }
00101
00102
00103 //----------------------------------------------------------------------------
00104 //
00105 // ISolpackFragment::AddToFragment method
00106 //    Adds the specified card or pile to the fragment.
00107 //
00108 // Parameters:
00109 //    pObj:          [in] A pointer to the IDispatch interface of the card or
00110 //                   pile to add to the fragment.
00111 //
00112 // Returns:          A standard COM success or error value.
00113 //
00114 //----------------------------------------------------------------------------
00115 STDMETHODIMP CFragment::AddToFragment(IDispatch *pObj)
00116 {
00117    if(!pObj)
00118       return E_INVALIDARG;
00119
00120    try   // COM-called code
00121    {
00122       CPile *pPile = NULL;
00123       CCard *pCard = NULL;
00124       CFragmentAdd *pFA = NULL;
00125       int cCards = 0;
00126       if(SUCCEEDED(pObj->QueryInterface(IID_IInternalPile, (LPVOID*)&pPile)))
00127       {
00128          ODS("Add pile to fragment");
00129
00130          // Create and initialize object to hold information about this addition
00131          pFA = new CFragmentAddPile();
00132          ENSUREALLOC(pFA);
00133          CFragmentAddPile *pFAP = (CFragmentAddPile*)pFA;
00134          pFAP->m_pPileSrc = pPile;
00135          pFAP->m_cCards = pPile->GetNumCards();
00136          pFAP->m_lIndexDest = m_apCards.GetSize();
00137          cCards = pFAP->m_cCards;
00138       } else if(SUCCEEDED(pObj->QueryInterface(IID_IInternalCard, (LPVOID*)&pCard)))
00139       {
00140          ODS("Add card to fragment");
00141
00142          // Create and initialize object to hold information about this addition
00143          pFA = new CFragmentAddCard();
00144          ENSUREALLOC(pFA);
00145          CFragmentAddCard *pFAC = (CFragmentAddCard*)pFA;
00146          pFAC->m_pCardSrc = pCard;
00147          pFAC->m_lIndexSrc = pCard->GetIndex();
00148          pPile = (CPile*)(pCard->GetPile());
00149          pFAC->m_pPileSrc = pPile;
00150          cCards = 1;
00151       } else
00152          return E_INVALIDARG; // not a pile or a card
00153
00154       // If this is the first addition to the fragment, create a new action to
00155       // store addition objects
00156       if(!m_pCurAction)
00157       {
00158          m_pCurAction = new CFragmentAction((IActionSite*)this);
00159          ENSUREALLOC(m_pCurAction);
00160       }
00161
00162       // Further initialize the the addition object
00163       pFA->Setup(m_apCards, m_lX, m_lY, (ICardPileSite*)this, CHTMLElement2Ptr(m_spEl));
00164
00165       // Add the addition object to the current action
00166       m_pCurAction->m_apAdditions.Add(pFA);
00167       m_pCurAction->m_cCards += cCards;
00168       TryAddPile(pPile);
00169       UpdateLayout();
00170    }
00171    CATCHALL;
00172
00173    return S_OK;
00174 }
00175
00176
00177 //----------------------------------------------------------------------------
00178 //
00179 // ISolpackFragment::MoveToPile method
00180 //    Moves the cards in the fragment to the specified pile.
00181 //
00182 // Parameters:
00183 //    pDest:         [in] A pointer to the ISolpackPile interface of the pile
00184 //                   to add the fragment's cards to.
00185 //    lIndex:        [in] The zero-based index at which to insert the first
00186 //                   card; -1 to append the cards to the end of the pile.
00187 //    bAnimate:      [in] A VARIANT_BOOL variable that specifies whether to
00188 //                   animate the cards from their current position to their
00189 //                   destination position.
00190 //    bToggleFace:   [in] A VARIANT_BOOL variable that specifies whether to
00191 //                   toggle the card's FaceUp property at the end of the
00192 //                   transfer.
00193 //
00194 // Returns:          A standard COM success or error value.
00195 //
00196 //----------------------------------------------------------------------------
00197 STDMETHODIMP CFragment::MoveToPile(ISolpackPile *pDest, long lIndex, VARIANT_BOOL bAnimate,
00198                                    VARIANT_BOOL bToggleFace)
00199 {
00200    if(!pDest)
00201       return E_INVALIDARG;
00202
00203    try   // COM-called code
00204    {
00205       // If there are no cards in the fragment, simply return
00206       int cCards = m_apCards.GetSize();
00207       if(cCards == 0)
00208          return S_FALSE;
00209
00210       CPile *pPile = NULL;
00211       if(FAILED(pDest->QueryInterface(IID_IInternalPile, (LPVOID*)&pPile)))
00212          return E_INVALIDARG;
00213
00214       // Store target pile and animation information in action object
00215       m_pCurAction->m_pPileDest = pPile;
00216       m_pCurAction->m_lIndex = lIndex;
00217       m_pCurAction->m_bAnimate = (bAnimate == VARIANT_TRUE);
00218       m_pCurAction->m_bToggleFace = (bToggleFace == VARIANT_TRUE);
00219       m_pCurAction->m_cCards = cCards;
00220
00221       // Record action, during which the transfer and optional animatino will
00222       // occur
00223       m_pEngObjSite->EngGetUndoMgr()->RecordAction(m_pCurAction);
00224       m_pCurAction = NULL;
00225    }
00226    CATCHALL;
00227
00228    return S_OK;
00229 }
00230
00231
00232 //----------------------------------------------------------------------------
00233 //
00234 // INDUnknownAndDispatch::NDQueryInterface method
00235 //    Returns pointers to supported interfaces.
00236 //
00237 // Parameters:
00238 //    riid:          [in] Identifier of the interface being requested.
00239 //    ppvObject:     [out] Address of pointer variable that receives the
00240 //                   interface pointer requested in riid.
00241 //
00242 // Returns:          A standard COM success or error value.
00243 //
00244 //----------------------------------------------------------------------------
00245 STDMETHODIMP CFragment::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00246 {
00247    if(IsEqualIID(riid, IID_ISolpackFragment))
00248    {
00249       *ppvObject = (ISolpackFragment*)this;
00250       (*(LPUNKNOWN*)ppvObject)->AddRef();
00251       return S_OK;
00252    } else
00253       return CPile::NDQueryInterface(riid, ppvObject);
00254 }
00255
00256
00257 //----------------------------------------------------------------------------
00258 //
00259 // IActionSite::DoAction method
00260 //    Executes the specified action.
00261 //
00262 // Parameters:
00263 //    pAction:       Object containing information on an action.
00264 //
00265 // Returns:          None.
00266 //
00267 //----------------------------------------------------------------------------
00268 void CFragment::DoAction(CAction *pAction)
00269 {
00270    if(pAction->m_dwType == ACTION_FRAGMENT)
00271    {
00272       CFragmentAction *pFAction = (CFragmentAction*)pAction;
00273       if(pFAction->m_bMovedOnce)
00274       {
00275          // If we haven't moved this pile yet (that is, if this is NOT a redo
00276          // operation), perform first-time movement setup
00277          CHTMLElement2Ptr spEl2(m_spEl);
00278          int cAdditions = pFAction->m_apAdditions.GetSize();
00279          for(int i = 0; i < cAdditions; i++)
00280          {
00281             // Actually add each pile/cards to the fragment
00282             pFAction->m_apAdditions[i]->Setup(m_apCards, m_lX, m_lY, (ICardPileSite*)this,
00283                spEl2);
00284             TryAddPile(pFAction->m_apAdditions[i]->m_pPileSrc);
00285          }
00286          UpdateLayout();
00287       }
00288
00289       // Move the fragment to the specified target pile
00290       FragToPile((CFragmentAction*)pAction);
00291    } else
00292       CPile::DoAction(pAction);  // The Pile class handles any other actions
00293 }
00294
00295
00296 //----------------------------------------------------------------------------
00297 //
00298 // IActionSite::UndoAction method
00299 //    Undoes the specified action.
00300 //
00301 // Parameters:
00302 //    pAction:       Object containing information on an action.
00303 //
00304 // Returns:          None.
00305 //
00306 //----------------------------------------------------------------------------
00307 void CFragment::UndoAction(CAction *pAction)
00308 {
00309    if(pAction->m_dwType == ACTION_FRAGMENT)
00310       // Move the cards from the target pile back into the fragment, and then
00311       // back to their source pile(s)
00312       PileToFrag((CFragmentAction*)pAction);
00313    else
00314       CPile::UndoAction(pAction);
00315 }
00316
00317
00318 //----------------------------------------------------------------------------
00319 //
00320 // InitFragment function
00321 //    Sets up the fragment's HTML element. InitPile must be called first.
00322 //
00323 // Parameters:
00324 //    pMsgProcessor: Interface to enable message processing.
00325 //    pSite:         Engine interface used by the fragment.
00326 //
00327 // Returns:          None.
00328 //
00329 //----------------------------------------------------------------------------
00330 void CFragment::InitFragment(IMsgProcessor *pMsgProcessor, IFragmentSite *pSite)
00331 {
00332    _ASSERT(m_pHH);
00333    _ASSERT(pSite);
00334    m_pFragSite = pSite;
00335    m_pMsgProcessor = pMsgProcessor;
00336    ODS("CFragment::InitFragment");
00337
00338    Init(g_pTypeLib, IID_ISolpackFragment, (LPDISPATCH)((ISolpackFragment*)this));
00339
00340    // Initialize the fragment HTML element
00341    m_spEl.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_FRAGMENT, IID_IHTMLElement));
00342    CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00343    CHECKHRCOM(m_spStyle->put_pixelLeft(0));
00344    CHECKHRCOM(m_spStyle->put_pixelTop(0));
00345 }
00346
00347
00348 //----------------------------------------------------------------------------
00349 //
00350 // CancelAnim function
00351 //    Called by the engine when the fragment should cancel any animation.
00352 //
00353 // Parameters:
00354 //    bCancelAnim:   TRUE if animations should be canceled, else FALSE.
00355 //
00356 // Returns:          None.
00357 //
00358 //----------------------------------------------------------------------------
00359 void CFragment::SetCancelAnim(BOOL bCancelAnim)
00360 {
00361    m_bCancelAnim = bCancelAnim;
00362 }
00363
00364
00365 //----------------------------------------------------------------------------
00366 //
00367 // MoveBy function
00368 //    Moves the fragment by the specified amount.
00369 //
00370 // Parameters:
00371 //    dx:            The horizontal distance to move the cards.
00372 //    dy:            The vertical distance to move the cards.
00373 //
00374 // Returns:          None.
00375 //
00376 //----------------------------------------------------------------------------
00377 void CFragment::MoveBy(long dx, long dy)
00378 {
00379    // Only update the HTML element's position if the coordinate changed
00380    if(dx != 0)
00381    {
00382       m_lX += dx;
00383       CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00384    }
00385    if(dy != 0)
00386    {
00387       m_lY += dy;
00388       CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00389    }
00390 }
00391
00392
00393 //----------------------------------------------------------------------------
00394 //
00395 // GetPileRgn function
00396 //    Retrieves the region representing the pile's shape.
00397 //
00398 // Parameters:       None.
00399 //
00400 // Returns:          The pile's region handle.
00401 //
00402 //----------------------------------------------------------------------------
00403 HRGN CFragment::GetPileRgn()
00404 {
00405    return m_hRgn;
00406 }
00407
00408
00409 //----------------------------------------------------------------------------
00410 //
00411 // CancelAdditions function
00412 //    Moves all cards in the fragment back to their source piles.
00413 //
00414 // Parameters:       None.
00415 //
00416 // Returns:          None.
00417 //
00418 //----------------------------------------------------------------------------
00419 void CFragment::CancelAdditions()
00420 {
00421    // If we haven't added any additions, just return
00422    if(!m_pCurAction)
00423       return;
00424
00425    // Move all cards from the fragment back to their source pile
00426    PileToFrag(m_pCurAction);
00427    SAFEDELETE(m_pCurAction);
00428
00429    // Reset fragment position
00430    m_lX = 0;
00431    m_lY = 0;
00432    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00433    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00434    UpdateLayout();
00435 }
00436
00437
00438 //----------------------------------------------------------------------------
00439 //
00440 // FragToPile function
00441 //    Moves the cards in the fragment to the specified pile.
00442 //
00443 // Parameters:
00444 //    pAction:       Object containing information on the cards to move.
00445 //
00446 // Returns:          None.
00447 //
00448 //----------------------------------------------------------------------------
00449 void CFragment::FragToPile(CFragmentAction *pAction)
00450 {
00451    _ASSERT(pAction);
00452    _ASSERT(pAction->m_pPileDest);
00453
00454    pAction->m_bMovedOnce = TRUE;
00455
00456    int cAdditions = pAction->m_apAdditions.GetSize();
00457
00458    // Have all the source piles remove the cards that were transferred
00459    int i;
00460    for(i = 0; i < cAdditions; i++)
00461       pAction->m_apAdditions[i]->ClearSrc();
00462
00463    int cCards = m_apCards.GetSize();
00464    if(cCards == 0)
00465       return;
00466
00467    // Prepare the destination pile to receive the cards
00468    if(pAction->m_lIndex > pAction->m_pPileDest->GetNumCards())
00469       pAction->m_lIndex = -1;
00470    pAction->m_lIndex = pAction->m_pPileDest->PreReceiveCards(pAction->m_lIndex, m_apCards);
00471
00472    // Check whether to animate cards
00473    BOOL bEmptyQueue = TRUE;
00474    if(pAction->m_bAnimate && m_pSite->GetAnim())
00475    {
00476       // All cards go to the same destination pile in this case
00477       // Set their indices according to the destination index
00478       CArray<CPile*, CPile*> apDests;
00479       CArray<long, long> alIndices;
00480       apDests.SetSize(cCards);
00481       alIndices.SetSize(cCards);
00482       for(i = 0; i < cCards; i++)
00483       {
00484          apDests.SetAt(i, pAction->m_pPileDest);
00485          long l = pAction->m_lIndex + i;
00486          alIndices.SetAt(i, l);
00487       }
00488
00489       // Perform the animation
00490       Animate(apDests, alIndices);
00491       bEmptyQueue = !m_bCancelAnim;
00492    }
00493
00494    // Actually transfer the cards to the target pile
00495    pAction->m_pPileDest->ReceiveCards(pAction->m_lIndex, m_apCards);
00496    if(bEmptyQueue)
00497       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00498
00499    // Toggle the cards' FaceUp property, if desired
00500    if(pAction->m_bToggleFace)
00501       for(i = 0; i < cCards; i++)
00502          m_apCards[i]->ToggleFace();
00503
00504    // Update the layout of the piles from which cards came
00505    int cPiles = m_apSources.GetSize();
00506    for(i = 0; i < cPiles; i++)
00507       m_apSources[i]->UpdateLayout();
00508
00509    m_apCards.SetSize(0);
00510
00511    // Reposition the fragment
00512    m_lX = 0;
00513    m_lY = 0;
00514    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00515    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00516    UpdateLayout();
00517
00518    m_apSources.SetSize(0);
00519 }
00520
00521
00522 //----------------------------------------------------------------------------
00523 //
00524 // PileToFrag function
00525 //    Moves the cards from the fragment back to their source piles. If the
00526 //    fragment's cards were moved to a pile, they are moved back to the
00527 //    fragment first.
00528 //
00529 // Parameters:
00530 //    pAction:       Object containing information on the cards to move.
00531 //
00532 // Returns:          None.
00533 //
00534 //----------------------------------------------------------------------------
00535 void CFragment::PileToFrag(CFragmentAction *pAction)
00536 {
00537    // If there are no cards to be moved, return
00538    int cCards = pAction->m_cCards;
00539    if(cCards == 0)
00540       return;
00541
00542    int cAdditions = pAction->m_apAdditions.GetSize();
00543
00544    int i;
00545    CPile *pSrc = pAction->m_pPileDest;
00546    if(pSrc)
00547    {
00548       // Note: pSrc would be null if this method is called from
00549       // CancelAdditions (that is, drag is cancelled before being dropped)
00550
00551       // Move the cards from their target pile back into the fragment
00552       pSrc->TransferCards(pAction->m_lIndex, cCards, m_apCards);
00553       pSrc->ClearTransferred();
00554       pSrc->UpdateLayout();
00555
00556       // Toggle the cards' FaceUp property, if desired
00557       if(pAction->m_bToggleFace)
00558          for(i = 0; i < cCards; i++)
00559             m_apCards[i]->ToggleFace();
00560
00561       // Add all the cards to the fragment pile
00562       CHTMLElement2Ptr spEl2(m_spEl);
00563       for(i = 0; i < cCards; i++)
00564       {
00565          m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00566          POINT pt = m_apCards[i]->GetPosition();
00567          m_apCards[i]->SetIndex(i);
00568          m_apCards[i]->SetPosition(pt.x + pSrc->m_lX - m_lX, pt.y + pSrc->m_lY - m_lY);
00569       }
00570    }
00571
00572    UpdateLayout();
00573
00574    // Have source piles remove cards that were transferred
00575    for(i = cAdditions - 1; i >= 0; i--)
00576       pAction->m_apAdditions[i]->m_pPileSrc->ClearTransferred();
00577
00578    // Prepare source piles to receive cards
00579    for(i = 0; i < cAdditions; i++)
00580       pAction->m_apAdditions[i]->DoPreReceive(m_apCards);
00581
00582    // Check whether to animate cards
00583    BOOL bEmptyQueue = !m_bCancelAnim;
00584    if(pAction->m_bAnimate && m_pSite->GetAnim())
00585    {
00586       // Here, destination piles are the pile from which the card first came
00587       // Index is that which it originally had
00588       CArray<CPile*, CPile*> apDests;
00589       CArray<long, long> alIndices;
00590       apDests.SetSize(cCards);
00591       alIndices.SetSize(cCards);
00592       long lIndexCur = 0;
00593       for(i = 0; i < cAdditions; i++)
00594          pAction->m_apAdditions[i]->SetDestAndIndex(apDests, alIndices, lIndexCur);
00595
00596       // Perform the animation
00597       Animate(apDests, alIndices);
00598       bEmptyQueue = !m_bCancelAnim;
00599    }
00600
00601    if(bEmptyQueue)
00602       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00603
00604    // Actually transfer the cards back to their original pile
00605    for(i = cAdditions - 1; i >= 0; i--)
00606       pAction->m_apAdditions[i]->DoReceive(m_apCards);
00607
00608    m_apCards.SetSize(0);
00609    m_abTransferred.SetSize(0);
00610    m_apSources.SetSize(0);
00611
00612    // Reposition the fragment
00613    m_lX = 0;
00614    m_lY = 0;
00615    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00616    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00617    UpdateLayout();
00618 }
00619
00620
00621 //----------------------------------------------------------------------------
00622 //
00623 // TryAddPile function
00624 //    Attempts to add the specified pile to the array of source piles.
00625 //
00626 // Parameters:
00627 //    pPile:         A pile who has one or more cards added to this fragment.
00628 //
00629 // Returns:          None.
00630 //
00631 //----------------------------------------------------------------------------
00632 void CFragment::TryAddPile(CPile *pPile)
00633 {
00634    // If the pile is already in the array of source piles, return
00635    int cPiles = m_apSources.GetSize();
00636    for(int i = 0; i < cPiles; i++)
00637       if(m_apSources[i] == pPile)
00638          return;
00639
00640    // Pile is not in the array; add it
00641    m_apSources.Add(pPile);
00642    pPile->AddRef();
00643 }
00644
00645
00646 //----------------------------------------------------------------------------
00647 //
00648 // Animate function
00649 //    Animates the the cards in the fragment to the specified pile.
00650 //
00651 // Parameters:
00652 //    apDests:       Array of destination piles for each card.
00653 //    lIndex:        The zero-based index at which to insert the first
00654 //                   card; -1 to append the cards to the end of the pile.
00655 //
00656 // Returns:          None.
00657 //
00658 //----------------------------------------------------------------------------
00659 void CFragment::Animate(CArray<CPile*, CPile*>& apDests, CArray<long, long>& apIndices)
00660 {
00661    // If there are no cards being animated, return
00662    int cCards = m_apCards.GetSize();
00663    if(cCards == 0)
00664       return;
00665
00666    // Tell the engine we are starting an animation
00667    m_pFragSite->AnimStateChange(TRUE);
00668
00669    // Create and size arrays used to hold calculated values for each card
00670    int i;
00671    CArray<SIZE, SIZE&> aAbsDeltaCard;
00672    CArray<DPAIR, DPAIR&> aStepDeltaCard;
00673    CArray<DPAIR, DPAIR&> aptCardCur;
00674    CArray<POINT, POINT&> aptCardDest;
00675    CArray<POINT, POINT&> aptCardSrc;
00676    CArray<int, int> acSteps;
00677    aAbsDeltaCard.SetSize(cCards);
00678    aptCardCur.SetSize(cCards);
00679    aStepDeltaCard.SetSize(cCards);
00680    aptCardDest.SetSize(cCards);
00681    aptCardSrc.SetSize(cCards);
00682    acSteps.SetSize(cCards);
00683    int cMaxSteps = 0;
00684
00685    // Calculate the delta X and Y that each card must travel
00686    for(i = 0; i < cCards; i++)
00687    {
00688       // delta = (pile dest coord + card dest offset) - (this frag coord + cur card offset)
00689       aptCardDest[i] = apDests[i]->GetCardSpot(/*i +*/ apIndices[i]);
00690       aptCardSrc[i] = m_apCards[i]->GetPosition();
00691       aAbsDeltaCard[i].cx = (apDests[i]->m_lX + aptCardDest[i].x) - (m_lX + aptCardSrc[i].x);
00692       aAbsDeltaCard[i].cy = (apDests[i]->m_lY + aptCardDest[i].y) - (m_lY + aptCardSrc[i].y);
00693       acSteps[i] = (int)ceil(fabs(sqrt(pow(aAbsDeltaCard[i].cx, 2) +
00694          pow(aAbsDeltaCard[i].cy, 2))) / STEPDISTANCE);
00695       if(acSteps[i] > cMaxSteps)
00696          cMaxSteps = acSteps[i];
00697       aptCardCur[i].x = aptCardSrc[i].x;
00698       aptCardCur[i].y = aptCardSrc[i].y;
00699    }
00700
00701    // Calculate the card steps
00702    for(i = 0; i < cCards; i++)
00703    {
00704       aStepDeltaCard[i].x = (double)(aAbsDeltaCard[i].cx) / acSteps[i];
00705       aStepDeltaCard[i].y = (double)(aAbsDeltaCard[i].cy) / acSteps[i];
00706    }
00707
00708    // Perform each step of the animation
00709    for(int j = 0; j < cMaxSteps-1 && !m_bCancelAnim; j++)
00710    {
00711       // Animate each individual card
00712       for(i = 0; i < cCards; i++)
00713       {
00714          if(j == acSteps[i])
00715          {
00716             // On the last step, move card to its final position to avoid
00717             // the card being a few pixels off due to rounding errors
00718             m_apCards[i]->SetPosition((apDests[i]->m_lX) + aptCardDest[i].x,
00719                (apDests[i]->m_lY) + aptCardDest[i].y);
00720          } else if(j < acSteps[i])
00721          {
00722             // Adjust the card's position
00723             aptCardCur[i].x += aStepDeltaCard[i].x;
00724             aptCardCur[i].y += aStepDeltaCard[i].y;
00725             m_apCards[i]->SetPosition((long)aptCardCur[i].x, (long)aptCardCur[i].y);
00726          }
00727       }
00728
00729       // Process messages so that the animation can actually be seen
00730       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00731    }
00732
00733    // Tell the engine we're done animating
00734    m_pFragSite->AnimStateChange(FALSE);
00735 }
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


Fragment.h File Reference

#include "Pile.h"
#include "FragmentAdd.h"
#include "ProcessMsg.h"

Go to the source code of this file.

Compounds

class | CFragment
class | CFragmentAction
class | IFragmentSite

Defines

#define | AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Fragment.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


Fragment.h Source File

Fragment.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Fragment.h
00004 //    Class to encapsulate the fragment used to transfer cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "Pile.h"
00021 #include "FragmentAdd.h"
00022 #include "ProcessMsg.h"
00023
00024
00025 //----------------------------------------------------------------------------
00026 // Forward Declaration
00027 //----------------------------------------------------------------------------
00028 class CFragment;
00029
00030
00031 //----------------------------------------------------------------------------
00032 //
00033 // IFragmentSite abstract class
00034 //    Enables the fragment to notify the engine of animations.
00035 //
00036 //----------------------------------------------------------------------------
00037 class IFragmentSite
00038 {
00039 public:
00040    virtual void AnimStateChange(BOOL bAnim) = 0;
00041 };
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CFragmentAction class
00047 //    Stores information about the addition of a pile to the fragment.
00048 //
00049 //----------------------------------------------------------------------------
00050 class CFragmentAction : public CAction
00051 {
00052 public:
00053    CFragmentAction(IActionSite *pSite);
00054    virtual ~CFragmentAction() {}
00055
00056    void AddPile(CPile *pPile);
00057    void AddCard(CPile *pCard);
00058
00059    friend class CFragment;
00060
00061 protected:
00062    CPtrArray<CFragmentAdd*, CFragmentAdd*> m_apAdditions;   // Info on card and pile additions
00063
00064    CPile *m_pPileDest;  // Destination pile
00065    long m_lIndex;       // Index in destination pile
00066    BOOL m_bAnimate;     // Whether to animate cards
00067    BOOL m_bToggleFace;  // Whether to animate card face
00068    long m_cCards;       // The total number of cards moved
00069    BOOL m_bMovedOnce;   // Whether a call to DoAction is a Redo, as opposed to first time
00070 };
00071
00072
00073 //----------------------------------------------------------------------------
00074 //
00075 // CFragment class
00076 //    Encapsulates the fragment used to transfer cards. Extends CPile and
00077 //    implements ISolpackFragment. The engine has one fragment that it gives
00078 //    out to games.
00079 //
00080 //----------------------------------------------------------------------------
00081 class CFragment : public CPile, public ISolpackFragment
00082 {
00083 public:
00084    CFragment();
00085    virtual ~CFragment();
00086
00087    DECLARE_IUNKNOWN_AND_IDISPATCH;
00088
00089    // ISolpackFragment methods
00090    STDMETHOD (AddToFragment)(IDispatch *pObj);
00091    STDMETHOD (MoveToPile)(ISolpackPile *pDest, long lIndex, VARIANT_BOOL bAnimate,
00092       VARIANT_BOOL bToggleFace);
00093
00094    // ISolpackPile methods
00095    STDMETHOD (get_Type)(long *p)
00096       { return CPile::get_Type(p); }
00097    STDMETHOD (get_X)(long *p)
00098       { return CPile::get_X(p); }
00099    STDMETHOD (put_X)(long v)
00100       { return CPile::put_X(v); }
00101    STDMETHOD (get_Y)(long *p)
00102       { return CPile::get_Y(p); }
00103    STDMETHOD (put_Y)(long v)
00104       { return CPile::put_Y(v); }
00105    STDMETHOD (get_Width)(long *p)
00106       { return CPile::get_Width(p); }
00107    STDMETHOD (get_Height)(long *p)
00108       { return CPile::get_Height(p); }
00109    STDMETHOD (get_NumCards)(long *p)
00110       { return CPile::get_NumCards(p); }
00111    STDMETHOD (get_CommentTooltip)(BSTR *pbstrText)
00112       { return E_NOTIMPL; }
00113    STDMETHOD (put_CommentTooltip)(BSTR bstrText)
00114       { return E_NOTIMPL; }
00115    STDMETHOD (get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow)
00116       { return E_NOTIMPL; }
00117    STDMETHOD (put_ShowNumCardsTooltip)(VARIANT_BOOL bShow)
00118       { return E_NOTIMPL; }
00119    STDMETHOD (get_BaseType)(long *p)
00120       { return E_NOTIMPL; }
00121    STDMETHOD (put_BaseType)(long v)
00122       { return E_NOTIMPL; }
00123    STDMETHOD (Shuffle)()
00124       { return E_NOTIMPL; }
00125    STDMETHOD (GetCard)(long lIndex, ISolpackCard **ppCard)
00126       { return CPile::GetCard(lIndex, ppCard); }
00127    STDMETHOD (WidthWith)(long lNumCards, long *plWidth)
00128       { return CPile::WidthWith(lNumCards, plWidth); }
00129    STDMETHOD (HeightWith)(long lNumCards, long *plHeight)
00130       { return CPile::HeightWith(lNumCards, plHeight); }
00131
00132    // INDUnknownAndDispatch override
00133    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00134
00135    // IActionSite methods
00136    void DoAction(CAction *pAction);
00137    void UndoAction(CAction *pAction);
00138
00139    void InitFragment(IMsgProcessor *pMsgProcessor, IFragmentSite *pSite);
00140    void SetCancelAnim(BOOL bCancelAnim);
00141    void MoveBy(long dx, long dy);
00142    HRGN GetPileRgn();
00143    void CancelAdditions();
00144    void FragToPile(CFragmentAction *pAction);
00145    void PileToFrag(CFragmentAction *pAction);
00146
00147 protected:
00148    void TryAddPile(CPile *pPile);
00149    void Animate(CArray<CPile*, CPile*>& apDests, CArray<long, long>& alIndices);
00150
00151    IFragmentSite *m_pFragSite;            // Engine interface
00152    IMsgProcessor *m_pMsgProcessor;        // Interface to enable message processing
00153    BOOL m_bCancelAnim;                    // Whether to cancel animations
00154    CPtrArray<CPile*, CPile*> m_apSources; // Source piles
00155    CFragmentAction *m_pCurAction;         // Current fragment action object
00156 };
00157
00158
00159 #endif // !defined(AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


FragmentAdd.cpp File Reference

#include "stdafx.h"
#include "FragmentAdd.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


FragmentAdd.cpp Source File

FragmentAdd.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // FragmentAdd.cpp
00004 //    Classes to hold data for the addition of cards or piles to a fragment.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "FragmentAdd.h"
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // DoPreReceive function
00019 //    Calls the contained pile's PreReceiveCards function.
00020 //
00021 // Parameters:
00022 //    apCards:       The fragment's array of cards.
00023 //
00024 // Returns:          None.
00025 //
00026 //----------------------------------------------------------------------------
00027 void CFragmentAddPile::DoPreReceive(CPtrArray<CCard*, CCard*>& apCards)
00028 {
00029    m_pPileSrc->PreReceiveCards(0, apCards, m_lIndexDest, m_cCards);
00030 }
00031
00032
00033 //----------------------------------------------------------------------------
00034 //
00035 // DoReceive function
00036 //    Calls the contained pile's ReceiveCards function.
00037 //
00038 // Parameters:
00039 //    apCards:       The fragment's array of cards.
00040 //
00041 // Returns:          None.
00042 //
00043 //----------------------------------------------------------------------------
00044 void CFragmentAddPile::DoReceive(CPtrArray<CCard*, CCard*>& apCards)
00045 {
00046    m_pPileSrc->ReceiveCards(0, apCards, m_lIndexDest, m_cCards);
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // ClearSrc function
00053 //    Clears the source pile of transferred cards.
00054 //
00055 // Parameters:       None.
00056 //
00057 // Returns:          None.
00058 //
00059 //----------------------------------------------------------------------------
00060 void CFragmentAddPile::ClearSrc()
00061 {
00062    m_pPileSrc->ClearCards();
00063 }
00064
00065
00066 //----------------------------------------------------------------------------
00067 //
00068 // SetDestAndIndex function
00069 //    Sets the destination pile and destination index during an undo
00070 //    operation.
00071 //
00072 // Parameters:
00073 //    apDests:       Array to receive the fragment cards' destination piles.
00074 //    alIndices:     Array to receive the fragment cards' destination indices.
00075 //    lIndex:        The index at which to start putting this object's data.
00076 //
00077 // Returns:          None.
00078 //
00079 //----------------------------------------------------------------------------
00080 void CFragmentAddPile::SetDestAndIndex(CArray<CPile*, CPile*>& apDests,
00081                                        CArray<long, long>& alIndices, long& lIndex)
00082 {
00083    for(int j = 0; j < m_cCards; j++)
00084    {
00085       apDests.SetAt(lIndex, m_pPileSrc);
00086       alIndices.SetAt(lIndex, j);
00087       lIndex++;
00088    }
00089 }
00090
00091
00092 //----------------------------------------------------------------------------
00093 //
00094 // Setup function
00095 //    Transfers the contained card(s) from the source pile to the fragment and
00096 //    initializes the new cards.
00097 //
00098 // Parameters:
00099 //    apCards:       The fragment's array of cards, to which cards are added.
00100 //    lFragX:        The x-coordinate of the fragment.
00101 //    lFragY:        The y-coordinate of the fragment.
00102 //    pSite:         The ICardPileSite interface to give to the card.
00103 //    spEl2:         The fragment's HTML element to give to the card.
00104 //
00105 // Returns:          None.
00106 //
00107 //----------------------------------------------------------------------------
00108 void CFragmentAddPile::Setup(CPtrArray<CCard*, CCard*>& apCards, long lFragX, long lFragY,
00109                              ICardPileSite *pSite, CHTMLElement2Ptr& spEl2)
00110 {
00111    // Transfer cards to the fragment
00112    int cCardsOld = apCards.GetSize();
00113    m_pPileSrc->TransferCards(apCards);
00114    int cCardsNew = apCards.GetSize();
00115
00116    // Set up each card in the fragment
00117    for(int j = cCardsOld; j < cCardsNew; j++)
00118    {
00119       apCards[j]->SetPile(pSite, spEl2);
00120       apCards[j]->SetIndex(j);
00121       POINT pt = apCards[j]->GetPosition();
00122       apCards[j]->SetPosition(pt.x + m_pPileSrc->m_lX - lFragX,
00123          pt.y + m_pPileSrc->m_lY - lFragY);
00124    }
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // DoPreReceive function
00131 //    Calls the contained pile's PreReceiveCards function.
00132 //
00133 // Parameters:
00134 //    apCards:       The fragment's array of cards.
00135 //
00136 // Returns:          None.
00137 //
00138 //----------------------------------------------------------------------------
00139 void CFragmentAddCard::DoPreReceive(CPtrArray<CCard*, CCard*>& apCards)
00140 {
00141    m_pPileSrc->PreReceiveCards(m_lIndexSrc, apCards, m_lIndexDest, 1);
00142 }
00143
00144
00145 //----------------------------------------------------------------------------
00146 //
00147 // DoReceive function
00148 //    Calls the contained pile's ReceiveCards function.
00149 //
00150 // Parameters:
00151 //    apCards:       The fragment's array of cards.
00152 //
00153 // Returns:          None.
00154 //
00155 //----------------------------------------------------------------------------
00156 void CFragmentAddCard::DoReceive(CPtrArray<CCard*, CCard*>& apCards)
00157 {
00158    m_pPileSrc->ReceiveCards(m_lIndexSrc, apCards, m_lIndexDest, 1);
00159 }
00160
00161
00162 //----------------------------------------------------------------------------
00163 //
00164 // ClearSrc function
00165 //    Clears the source pile of transferred cards.
00166 //
00167 // Parameters:       None.
00168 //
00169 // Returns:          None.
00170 //
00171 //----------------------------------------------------------------------------
00172 void CFragmentAddCard::ClearSrc()
00173 {
00174    m_pPileSrc->ClearTransferred();
00175 }
00176
00177
00178 //----------------------------------------------------------------------------
00179 //
00180 // SetDestAndIndex function
00181 //    Sets the destination pile and destination index during an undo
00182 //    operation.
00183 //
00184 // Parameters:
00185 //    apDests:       Array to receive the fragment cards' destination piles.
00186 //    alIndices:     Array to receive the fragment cards' destination indices.
00187 //    lIndex:        The index at which to start putting this object's data.
00188 //
00189 // Returns:          None.
00190 //
00191 //----------------------------------------------------------------------------
00192 void CFragmentAddCard::SetDestAndIndex(CArray<CPile*, CPile*>& apDests,
00193                                        CArray<long, long>& alIndices, long& lIndex)
00194 {
00195    apDests.SetAt(lIndex, m_pPileSrc);
00196    alIndices.SetAt(lIndex, m_lIndexSrc);
00197    lIndex++;
00198 }
00199
00200
00201 //----------------------------------------------------------------------------
00202 //
00203 // Setup function
00204 //    Transfers the contained card(s) from the source pile to the fragment and
00205 //    initializes the new cards.
00206 //
00207 // Parameters:
00208 //    apCards:       The fragment's array of cards, to which cards are added.
00209 //    lFragX:        The x-coordinate of the fragment.
00210 //    lFragY:        The y-coordinate of the fragment.
00211 //    pSite:         The ICardPileSite interface to give to the card.
00212 //    spEl2:         The fragment's HTML element to give to the card.
00213 //
00214 // Returns:          None.
00215 //
00216 //----------------------------------------------------------------------------
00217 void CFragmentAddCard::Setup(CPtrArray<CCard*, CCard*>& apCards, long lFragX, long lFragY,
00218                              ICardPileSite *pSite, CHTMLElement2Ptr& spEl2)
00219 {
00220    // Transfer the card to the fragment
00221    int cCardsOld = apCards.GetSize();
00222    m_pPileSrc->TransferCards(m_lIndexSrc, 1, apCards);
00223    m_lIndexDest = cCardsOld;
00224
00225    // Set up the card in the fragment
00226    m_pCardSrc->SetPile(pSite, spEl2);
00227    m_pCardSrc->SetIndex(cCardsOld);
00228    POINT pt = m_pCardSrc->GetPosition();
00229    m_pCardSrc->SetPosition(pt.x + m_pPileSrc->m_lX - lFragX, pt.y + m_pPileSrc->m_lY - lFragY);
00230 }
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


FragmentAdd.h File Reference

#include "Pile.h"

Go to the source code of this file.

Compounds

class | CFragmentAdd
class | CFragmentAddCard
class | CFragmentAddPile

Defines

#define | AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file FragmentAdd.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


FragmentAdd.h Source File

FragmentAdd.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // FragmentAdd.h
00004 //    Classes to hold data for the addition of cards or piles to a fragment.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "Pile.h"
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CFragmentAdd class
00026 //    Base class to hold common data for the addition of a card or a pile to a
00027 //    fragment.
00028 //
00029 //----------------------------------------------------------------------------
00030 class CFragmentAdd
00031 {
00032 public:
00033    virtual void DoPreReceive(CPtrArray<CCard*, CCard*>& apCards) = 0;
00034    virtual void DoReceive(CPtrArray<CCard*, CCard*>& apCards) = 0;
00035    virtual void ClearSrc() = 0;
00036    virtual void SetDestAndIndex(CArray<CPile*, CPile*>& apDests, CArray<long, long>& alIndices,
00037       long& lIndex) = 0;
00038    virtual void Setup(CPtrArray<CCard*, CCard*>& apCards, long lFragX, long lFragY,
00039       ICardPileSite *pSite, CHTMLElement2Ptr& spEl2) = 0;
00040
00041    CPile *m_pPileSrc;   // The pile, or the pile containing the card
00042    long m_lIndexDest;   // The index in the fragment where the card (or first card) was placed
00043 };
00044
00045
00046 //----------------------------------------------------------------------------
00047 //
00048 // CFragmentAddPile class
00049 //    Stores information about the addition of a pile to the fragment.
00050 //
00051 //----------------------------------------------------------------------------
00052 class CFragmentAddPile : public CFragmentAdd
00053 {
00054 public:
00055    void DoPreReceive(CPtrArray<CCard*, CCard*>& apCards);
00056    void DoReceive(CPtrArray<CCard*, CCard*>& apCards);
00057    void ClearSrc();
00058    void SetDestAndIndex(CArray<CPile*, CPile*>& apDests, CArray<long, long>& alIndices,
00059       long& lIndex);
00060    void Setup(CPtrArray<CCard*, CCard*>& apCards, long lFragX, long lFragY, ICardPileSite *pSite,
00061       CHTMLElement2Ptr& spEl2);
00062
00063    long m_cCards;       // The number of cards in the source pile
00064 };
00065
00066
00067 //----------------------------------------------------------------------------
00068 //
00069 // CFragmentAddCard class
00070 //    Stores information about the addition of a card to the fragment.
00071 //
00072 //----------------------------------------------------------------------------
00073 class CFragmentAddCard : public CFragmentAdd
00074 {
00075 public:
00076    void DoPreReceive(CPtrArray<CCard*, CCard*>& apCards);
00077    void DoReceive(CPtrArray<CCard*, CCard*>& apCards);
00078    void ClearSrc();
00079    void SetDestAndIndex(CArray<CPile*, CPile*>& apDests, CArray<long, long>& alIndices,
00080       long& lIndex);
00081    void Setup(CPtrArray<CCard*, CCard*>& apCards, long lFragX, long lFragY, ICardPileSite *pSite,
00082       CHTMLElement2Ptr& spEl2);
00083
00084    CCard *m_pCardSrc;   // The card that was added
00085    long m_lIndexSrc;    // The card's index in its source pile
00086 };
00087
00088
00089 #endif // !defined(AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:04 2002 for Solitaire Pack by doxygen 1.2.15


GameBase.cpp File Reference

#include "stdafx.h"
#include <bmws_variant.h>
#include "GameBase.h"
#include "..\SPGameLC\resource.h"

Go to the source code of this file.

Variables

HINSTANCE | g_hInstLC
ITypeLib * | g_pTypeLib

Variable Documentation

HINSTANCE g_hInstLC

Definition at line 22 of file GameBase.cpp.

ITypeLib* g_pTypeLib

Definition at line 23 of file GameBase.cpp.

Referenced by CGameBase::InitGame().

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


GameBase.cpp Source File

GameBase.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameBase.cpp
00004 //    Class which encapsulates generic game operations, used by all derived
00005 //    game classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include "stdafx.h"
00014 #include <bmws_variant.h>
00015 #include "GameBase.h"
00016 #include "..\SPGameLC\resource.h"
00017
00018
00019 //----------------------------------------------------------------------------
00020 // External variables
00021 //----------------------------------------------------------------------------
00022 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00023 extern ITypeLib *g_pTypeLib;  // The Solpack type library
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CGameBase constructor
00029 //
00030 // Parameters:
00031 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00032 //    pInfo:         The information object for this game.
00033 //
00034 //----------------------------------------------------------------------------
00035 CGameBase::CGameBase(UINT uGameID, CGameInfo *pInfo)
00036 {
00037    // Set initial values for member variables
00038    m_uGameID = uGameID;
00039    m_pGameInfo = pInfo;
00040    m_pGameInfo->AddRef();
00041    m_bPlaying = FALSE;
00042    m_lCardWidth = 0;
00043    m_lCardHeight = 0;
00044    m_lWindowWidth = 0;
00045    m_lWindowHeight = 0;
00046    m_lSpacingX = 0;
00047    m_lSpacingY = 0;
00048    ODS("CGameBase constructor");
00049 }
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CGameBase destructor
00055 //
00056 //----------------------------------------------------------------------------
00057 CGameBase::~CGameBase()
00058 {
00059    SAFERELEASE(m_pGameInfo);
00060    ODS("CGameBase destructor");
00061 }
00062
00063
00064 //----------------------------------------------------------------------------
00065 //
00066 // ISolpackGame::get_Info method
00067 //    Retrieves the static information about the game.
00068 //
00069 // Parameters:
00070 //    ppInfo:        [out] Address of a pointer to the ISolpackGameInfo
00071 //                   interface of the object containing informatino about this
00072 //                   game.
00073 //
00074 // Returns:          A standard COM success or error value.
00075 //
00076 //----------------------------------------------------------------------------
00077 STDMETHODIMP CGameBase::get_Info(ISolpackGameInfo **ppInfo)
00078 {
00079    ODS("CGameBase::get_Info");
00080    return m_pGameInfo->QueryInterface(IID_ISolpackGameInfo, (LPVOID*)ppInfo);
00081 }
00082
00083
00084 //----------------------------------------------------------------------------
00085 //
00086 // ISolpackGame::Initialize method
00087 //    Sets up decks and piles for the game.
00088 //
00089 // Parameters:
00090 //    pApp:          [in] A pointer to the ISolpackApp interface of the
00091 //                   Solpack engine object.
00092 //
00093 // Returns:          A standard COM success or error value.
00094 //
00095 //----------------------------------------------------------------------------
00096 STDMETHODIMP CGameBase::Initialize(ISolpackApp *pApp)
00097 {
00098    ODS("CGameBase::Initialize");
00099    if(!pApp)
00100       return E_INVALIDARG;
00101
00102    Uninitialize();
00103
00104    try   // COM-called code
00105    {
00106       // Store engine pointer, retrieve engine metrics, and create deck
00107       m_spApp.Assign(pApp);
00108       GetMetrics();
00109       CreateDeck(&m_spDeck);
00110    }
00111    CATCHALL;
00112    return S_OK;
00113 }
00114
00115
00116 //----------------------------------------------------------------------------
00117 //
00118 // ISolpackGame::Uninitialize method
00119 //    Releases all created objects and prepares for destruction.
00120 //
00121 // Parameters:       None.
00122 //
00123 // Returns:          A standard COM success or error value.
00124 //
00125 //----------------------------------------------------------------------------
00126 STDMETHODIMP CGameBase::Uninitialize()
00127 {
00128    m_spDragSrc.Release();
00129    m_spDeck.Release();
00130    m_spApp.Release();
00131    ODS("CGameBase::Uninitialize");
00132    m_bPlaying = FALSE;
00133    return S_OK;
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // ISolpackGame::Deal method
00140 //    Deals out a game of Solitaire.
00141 //
00142 // Parameters:       None.
00143 //
00144 // Returns:          A standard COM success or error value.
00145 //
00146 //----------------------------------------------------------------------------
00147 STDMETHODIMP CGameBase::Deal()
00148 {
00149    ODS("CGameBase::Deal");
00150    if(!m_spApp)
00151       return E_FAIL;
00152
00153    try   // COM-called code
00154    {
00155       // Reset score to zero
00156       CHECKHRCOM(m_spApp->put_Score(0));
00157       m_bPlaying = TRUE;
00158    }
00159    CATCHALL;
00160    return S_OK;
00161 }
00162
00163
00164 //----------------------------------------------------------------------------
00165 //
00166 // ISolpackGame::AutoPlay method
00167 //    Plays all possible cards to foundations.
00168 //
00169 // Parameters:       None.
00170 //
00171 // Returns:          A standard COM success or error value.
00172 //
00173 //----------------------------------------------------------------------------
00174 STDMETHODIMP CGameBase::AutoPlay()
00175 {
00176    ODS("CGameBase::AutoPlay");
00177    if(!m_bPlaying)
00178       return E_FAIL;
00179    return S_OK;
00180 }
00181
00182
00183 //----------------------------------------------------------------------------
00184 //
00185 // ISolpackGame::AutoPlayCard method
00186 //    Plays the specified card to a foundation, if possible.
00187 //
00188 // Parameters:
00189 //    pCard:         [in] A pointer to the ISolpackCard interface of the card
00190 //                   to autoplay.
00191 //
00192 // Returns:          A standard COM success or error value.
00193 //
00194 //----------------------------------------------------------------------------
00195 STDMETHODIMP CGameBase::AutoPlayCard(ISolpackCard *pCard)
00196 {
00197    ODS("CGameBase::AutoPlayCard");
00198    if(!m_bPlaying)
00199       return E_FAIL;
00200    if(!pCard)
00201       return E_INVALIDARG;
00202    return S_OK;
00203 }
00204
00205
00206 //----------------------------------------------------------------------------
00207 //
00208 // ISolpackGame::HandleCommand method
00209 //    Handles a custom game command previously added via
00210 //    ISolpackApp::AddGameCommand.
00211 //
00212 // Parameters:
00213 //    lID:           A game-defined long integer value specifying the ID of
00214 //                   the command the user chose.
00215 //
00216 // Returns:          A standard COM success or error value.
00217 //
00218 //----------------------------------------------------------------------------
00219 STDMETHODIMP CGameBase::HandleCommand(long lID)
00220 {
00221    ODS("CGameBase::HandleCommand");
00222    if(!m_bPlaying)
00223       return E_FAIL;
00224    return S_OK;
00225 }
00226
00227
00228 //----------------------------------------------------------------------------
00229 //
00230 // ISolpackGame::PileClicked method
00231 //    Informs the game that a pile was single-clicked.
00232 //
00233 // Parameters:
00234 //    pPile:         [in] A pointer to the ISolpackPile interface of the pile
00235 //                   the user clicked.
00236 //    pCard:         [in] A pointer to the ISolpackCard interface of the
00237 //                   specific card that the user clicked. This will be NULL if
00238 //                   the pile is empty, or if the user clicked on an area
00239 //                   within the pile boundaries but outside of any specific
00240 //                   card.
00241 //
00242 // Returns:          A standard COM success or error value.
00243 //
00244 //----------------------------------------------------------------------------
00245 STDMETHODIMP CGameBase::PileClicked(ISolpackPile *pPile, ISolpackCard *pCard)
00246 {
00247    ODS("CGameBase::PileClicked");
00248    if(!m_bPlaying)
00249       return E_FAIL;
00250    if(!pPile)
00251       return E_INVALIDARG;
00252    return S_OK;
00253 }
00254
00255
00256 //----------------------------------------------------------------------------
00257 //
00258 // ISolpackGame::SetupFragment method
00259 //    Informs the game that a pile was single-clicked.
00260 //
00261 // Parameters:
00262 //    pPileSrc:      [in] A pointer to the ISolpackPile interface of the pile
00263 //                   from which the user is dragging.
00264 //    pCardSrc:      [in] A pointer to the ISolpackCard interface of the
00265 //                   specific card that the user wants to drag.
00266 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00267 //                   fragment to hold cards to drag.
00268 //
00269 // Returns:          A standard COM success or error value.
00270 //
00271 //----------------------------------------------------------------------------
00272 STDMETHODIMP CGameBase::SetupFragment(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00273                                       ISolpackFragment *pFrag)
00274 {
00275    ODS("CGameBase::SetupFragment");
00276    if(!m_bPlaying)
00277       return E_FAIL;
00278    if(!pPileSrc || !pCardSrc || !pFrag)
00279       return E_INVALIDARG;
00280    return S_OK;
00281 }
00282
00283
00284 //----------------------------------------------------------------------------
00285 //
00286 // ISolpackGame::DropFragment method
00287 //    If possible, drops the cards from the specified fragment onto the
00288 //    specified pile.
00289 //
00290 // Parameters:
00291 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00292 //                   fragment containing the card(s) being dragged.
00293 //    pPileDest:     [in] A pointer to the ISolpackPile interface of the pile
00294 //                   onto which the user has dropped the fragment.
00295 //    pbValid:       [in] The address of a VARIANT_BOOL variable that receives
00296 //                   whether the cards were dropped.
00297 //
00298 // Returns:          A standard COM success or error value.
00299 //
00300 //----------------------------------------------------------------------------
00301 STDMETHODIMP CGameBase::DropFragment(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00302                                      VARIANT_BOOL *pbValid)
00303 {
00304    ODS("CGameBase::DropFragment");
00305    if(!m_bPlaying)
00306       return E_FAIL;
00307    CHECKPTR(pbValid);
00308    if(!pFrag || !pPileDest)
00309       return E_INVALIDARG;
00310    *pbValid = VARIANT_FALSE;
00311    return S_OK;
00312 }
00313
00314
00315 //----------------------------------------------------------------------------
00316 //
00317 // ISolpackGame::CancelMove method
00318 //    Informs the game that the user has canceled the drag operation.
00319 //
00320 // Parameters:       None.
00321 //
00322 // Returns:          A standard COM success or error value.
00323 //
00324 //----------------------------------------------------------------------------
00325 STDMETHODIMP CGameBase::CancelMove()
00326 {
00327    ODS("CGameBase::CancelMove");
00328    if(!m_bPlaying)
00329       return E_FAIL;
00330    m_spDragSrc.Release();
00331    return S_OK;
00332 }
00333
00334
00335 //----------------------------------------------------------------------------
00336 //
00337 // ISolpackGame::RecalcLayout method
00338 //    Informs the game that an engine property, such as card or window
00339 //    dimensions, has changed.
00340 //
00341 // Parameters:       None.
00342 //
00343 // Returns:          A standard COM success or error value.
00344 //
00345 //----------------------------------------------------------------------------
00346 STDMETHODIMP CGameBase::RecalcLayout()
00347 {
00348    ODS("CGameBase::RecalcLayout");
00349    if(!m_spApp)
00350       return E_FAIL;
00351
00352    try   // COM-called code
00353    {
00354       GetMetrics();
00355       UpdateLayout();
00356    }
00357    CATCHALL;
00358    return S_OK;
00359 }
00360
00361
00362 //----------------------------------------------------------------------------
00363 //
00364 // INDUnknownAndDispatch::NDQueryInterface method
00365 //    Returns pointers to supported interfaces.
00366 //
00367 // Parameters:
00368 //    riid:          [in] Identifier of the interface being requested.
00369 //    ppvObject:     [out] Address of pointer variable that receives the
00370 //                   interface pointer requested in riid.
00371 //
00372 // Returns:          A standard COM success or error value.
00373 //
00374 //----------------------------------------------------------------------------
00375 STDMETHODIMP CGameBase::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00376 {
00377    if(IsEqualIID(riid, IID_ISolpackGame))
00378    {
00379       *ppvObject = (ISolpackGame*)this;
00380       (*(LPUNKNOWN*)ppvObject)->AddRef();
00381       return S_OK;
00382    } else
00383       return CDispBase::NDQueryInterface(riid, ppvObject);
00384 }
00385
00386
00387 //----------------------------------------------------------------------------
00388 //
00389 // InitGame function
00390 //    Sets up the game object.
00391 //
00392 // Parameters:       None.
00393 //
00394 // Returns:          None.
00395 //
00396 //----------------------------------------------------------------------------
00397 void CGameBase::InitGame()
00398 {
00399    Init(g_pTypeLib, IID_ISolpackGame, (LPDISPATCH)((ISolpackGame*)this));
00400 }
00401
00402
00403 //----------------------------------------------------------------------------
00404 //
00405 // CreateDeck function
00406 //    Creates a deck and positions it off screen.
00407 //
00408 // Parameters:
00409 //    ppPile:        Address to receive the deck interface pointer.
00410 //
00411 // Returns:          None.
00412 //
00413 //----------------------------------------------------------------------------
00414 void CGameBase::CreateDeck(ISolpackPile **ppPile)
00415 {
00416    _ASSERT(m_spApp);
00417    CHECKHRCOM(m_spApp->CreatePile(PILE_DECK, ppPile));
00418    CHECKHRCOM((*ppPile)->put_X(-m_lCardWidth-5));
00419    CHECKHRCOM((*ppPile)->put_Y(-m_lCardHeight-5));
00420 }
00421
00422
00423 //----------------------------------------------------------------------------
00424 //
00425 // GetMetrics function
00426 //    Refreshes all engine metrics.
00427 //
00428 // Parameters:       None.
00429 //
00430 // Returns:          None.
00431 //
00432 //----------------------------------------------------------------------------
00433 void CGameBase::GetMetrics()
00434 {
00435    _ASSERT(m_spApp);
00436    CHECKHRCOM(m_spApp->get_CardWidth(&m_lCardWidth));
00437    CHECKHRCOM(m_spApp->get_CardHeight(&m_lCardHeight));
00438    CHECKHRCOM(m_spApp->get_WindowWidth(&m_lWindowWidth));
00439    CHECKHRCOM(m_spApp->get_WindowHeight(&m_lWindowHeight));
00440    CHECKHRCOM(m_spApp->get_SpacingX(&m_lSpacingX));
00441    CHECKHRCOM(m_spApp->get_SpacingY(&m_lSpacingY));
00442 }
00443
00444
00445 //----------------------------------------------------------------------------
00446 //
00447 // ObjectsEqual function
00448 //    Determines whether two interface pointers refer to the same object, by
00449 //    checking their unknown pointers. If either or both pointers is NULL, the
00450 //    objects are not equal.
00451 //
00452 // Parameters:
00453 //    pUnk1:         The first interface pointer.
00454 //    pUnk2:         The second interface pointer.
00455 //
00456 // Returns:          TRUE if the interface pointers refer to the same object,
00457 //                   FALSE if they do not.
00458 //
00459 //----------------------------------------------------------------------------
00460 BOOL CGameBase::ObjectsEqual(IUnknown *pUnk1, IUnknown *pUnk2)
00461 {
00462    if(!pUnk1 || !pUnk2)
00463       return FALSE;
00464
00465    CUnknownPtr spUnk1(pUnk1);
00466    CUnknownPtr spUnk2(pUnk2);
00467    return (((IUnknown*)spUnk1) == ((IUnknown*)spUnk2));
00468 }
00469
00470
00471 //----------------------------------------------------------------------------
00472 //
00473 // IncrScore function
00474 //    Increases the game's score by the specified amount.
00475 //
00476 // Parameters:
00477 //    lIncr:         The long integer value to store.
00478 //
00479 // Returns:          None.
00480 //
00481 //----------------------------------------------------------------------------
00482 void CGameBase::IncrScore(long lIncr)
00483 {
00484    _ASSERT(m_spApp);
00485    long lScore;
00486    CHECKHRCOM(m_spApp->get_Score(&lScore));
00487    lScore += lIncr;
00488    CHECKHRCOM(m_spApp->put_Score(lScore));
00489 }
00490
00491
00492 //----------------------------------------------------------------------------
00493 //
00494 // GetCardFromData function
00495 //    Extracts a card object from the specified GameData object.
00496 //
00497 // Parameters:
00498 //    pGameData:     A game data object whose data is a card object.
00499 //
00500 // Returns:          The ISolpackCard interface pointer of the contained card.
00501 //
00502 //----------------------------------------------------------------------------
00503 CSolpackCardPtr CGameBase::GetCardFromData(ISolpackGameData *pGameData)
00504 {
00505    _ASSERT(pGameData);
00506
00507    CVariant v;
00508    CHECKHRCOM(pGameData->get_Data(&v));
00509
00510    if(v.vt != VT_DISPATCH)
00511       return NULL;
00512
00513    CSolpackCardPtr spCard;
00514    CHECKHRCOM(v.pdispVal->QueryInterface(IID_ISolpackCard, (LPVOID*)&spCard));
00515    return spCard;
00516 }
00517
00518
00519 //----------------------------------------------------------------------------
00520 //
00521 // PutCardInData function
00522 //    Stores a card object in the specified GameData object.
00523 //
00524 // Parameters:
00525 //    pGameData:     A game data object in which to store the card.
00526 //    pCard:         The card to store. Can be NULL, to signify no card.
00527 //
00528 // Returns:          None.
00529 //
00530 //----------------------------------------------------------------------------
00531 void CGameBase::PutCardInData(ISolpackGameData *pGameData, ISolpackCard *pCard)
00532 {
00533    _ASSERT(pGameData);
00534
00535    HRESULT hr = E_FAIL;
00536    CVariant v;
00537    if(pCard)
00538    {
00539       v.vt = VT_DISPATCH;
00540       CHECKHRCOM(pCard->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
00541    }
00542    CHECKHRCOM(pGameData->put_Data(v));
00543 }
00544
00545
00546 //----------------------------------------------------------------------------
00547 //
00548 // GetLongFromData function
00549 //    Extracts a long integer value from the specified GameData object.
00550 //
00551 // Parameters:
00552 //    pGameData:     A game data object whose data is a long integer.
00553 //
00554 // Returns:          The contained long integer value.
00555 //
00556 //----------------------------------------------------------------------------
00557 long CGameBase::GetLongFromData(ISolpackGameData *pGameData)
00558 {
00559    _ASSERT(pGameData);
00560
00561    CVariant v;
00562    CHECKHRCOM(pGameData->get_Data(&v));
00563    return v.lVal;
00564 }
00565
00566
00567 //----------------------------------------------------------------------------
00568 //
00569 // PutLongInData function
00570 //    Stores a long integer value in the specified GameData object.
00571 //
00572 // Parameters:
00573 //    pGameData:     A game data object in which to store the value.
00574 //    l:             The long integer value to store.
00575 //
00576 // Returns:          None.
00577 //
00578 //----------------------------------------------------------------------------
00579 void CGameBase::PutLongInData(ISolpackGameData *pGameData, long l)
00580 {
00581    _ASSERT(pGameData);
00582
00583    CVariant v;
00584    v.vt = VT_I4;
00585    v.lVal = l;
00586    CHECKHRCOM(pGameData->put_Data(v));
00587 }
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameBase.h File Reference

#include "GameInfo.h"
#include "SolpackArrays.h"

Go to the source code of this file.

Compounds

class | CGameBase

Defines

#define | AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
#define | ENSUREBASE(x) { HRESULT _hr = (x); if(FAILED(_hr)) return _hr; }

Define Documentation

#define AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 11 of file GameBase.h.

#define ENSUREBASE ( x ) { HRESULT _hr = (x); if(FAILED(_hr)) return _hr; }

Definition at line 29 of file GameBase.h.

Generated on Wed May 8 12:39:20 2002 for Solitaire Pack by doxygen 1.2.15


GameBase.h Source File

GameBase.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameBase.h
00004 //    Class which encapsulates generic game operations, used by all derived
00005 //    game classes.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00011 #define AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include "GameInfo.h"
00022 #include "SolpackArrays.h"
00023
00024
00025 //----------------------------------------------------------------------------
00026 // Helper macro used by derived game classes to ensure that the base class
00027 // function succeeded.
00028 //----------------------------------------------------------------------------
00029 #define ENSUREBASE(x) { HRESULT _hr = (x); if(FAILED(_hr)) return _hr; }
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // CGameBase class
00035 //    Encapsulates generic game operations, used by all derived game classes.
00036 //    Implements the ISolpackGame interface.
00037 //
00038 //----------------------------------------------------------------------------
00039 class CGameBase : public CDispBase, public ISolpackGame
00040 {
00041 public:
00042    CGameBase(UINT uGameID, CGameInfo *pInfo);
00043    virtual ~CGameBase();
00044
00045    DECLARE_IUNKNOWN_AND_IDISPATCH;
00046
00047    // ISolpackGame methods
00048    STDMETHOD (get_Info)(ISolpackGameInfo **ppInfo);
00049    STDMETHOD (Initialize)(ISolpackApp *pApp);
00050    STDMETHOD (Uninitialize)();
00051    STDMETHOD (Deal)();
00052    STDMETHOD (AutoPlay)();
00053    STDMETHOD (AutoPlayCard)(ISolpackCard *pCard);
00054    STDMETHOD (HandleCommand)(long lID);
00055    STDMETHOD (PileClicked)(ISolpackPile *pPile, ISolpackCard *pCard);
00056    STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00057       ISolpackFragment *pFrag);
00058    STDMETHOD (DropFragment)(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00059       VARIANT_BOOL *pbValid);
00060    STDMETHOD (CancelMove)();
00061    STDMETHOD (RecalcLayout)();
00062
00063    // INDUnknownAndDispatch override
00064    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00065
00066    virtual void InitGame();
00067
00068 protected:
00069    void CreateDeck(ISolpackPile **ppPile);
00070    void GetMetrics();
00071    virtual void UpdateLayout() {}
00072    BOOL ObjectsEqual(IUnknown *pUnk1, IUnknown *pUnk2);
00073    void IncrScore(long lIncr);
00074
00075    CSolpackCardPtr GetCardFromData(ISolpackGameData *pGameData);
00076    void PutCardInData(ISolpackGameData *pGameData, ISolpackCard *pCard);
00077    long GetLongFromData(ISolpackGameData *pGameData);
00078    void PutLongInData(ISolpackGameData *pGameData, long l);
00079
00080    CSolpackAppPtr m_spApp;       // The Solpack engine
00081    CSolpackPilePtr m_spDeck;     // The game's deck object; additional can be created if needed
00082    CSolpackPilePtr m_spDragSrc;  // The drag source pile
00083    BOOL m_bPlaying;              // Whether a game has been dealt
00084
00085    UINT m_uGameID;               // The game identifier, taken from GameIDs.h
00086    CGameInfo *m_pGameInfo;       // The game information object
00087
00088    // Engine metrics
00089    long m_lCardWidth;            // Width of a card
00090    long m_lCardHeight;           // Height of a card
00091    long m_lWindowWidth;          // Width of the window
00092    long m_lWindowHeight;         // Height of the window
00093    long m_lSpacingX;             // Recommended horizontal spacing between piles
00094    long m_lSpacingY;             // Recommended vertical spacing between piles
00095 };
00096
00097
00098 #endif // !defined(AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameCommandMgr.cpp File Reference

#include "stdafx.h"
#include "GameCommandMgr.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameCommandMgr.cpp Source File

GameCommandMgr.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameCommandMgr.cpp
00004 //    Class to manage the display of custom game commmands.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameCommandMgr.h"
00014 #include <bmws_variant.h>
00015 #include "resource.h"
00016 #include "..\SolpckLC\resource.h"
00017
00018
00019 //----------------------------------------------------------------------------
00020 //
00021 // CGameCommand constructor
00022 //
00023 // Parameters:       None.
00024 //
00025 //----------------------------------------------------------------------------
00026 CGameCommand::CGameCommand()
00027 {
00028    // Set initial values for member variables
00029    m_lID = 0;
00030    m_bEnabled = FALSE;
00031 }
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CGameCommand destructor
00037 //
00038 //----------------------------------------------------------------------------
00039 CGameCommand::~CGameCommand()
00040 {
00041    // Clean up link
00042    if(m_bEnabled)
00043       ReleaseLink();
00044 }
00045
00046
00047 //----------------------------------------------------------------------------
00048 //
00049 // Init function
00050 //    Sets up the HTML UI for the game command.
00051 //
00052 // Parameters:
00053 //    pSite:         Interface to give to the event handler object.
00054 //    pHH:           The HTML helper object to use.
00055 //    lIndex:        The zero-based index of this game command object.
00056 //    bstrText:      A string value containing the name of the custom command.
00057 //    bstrHelpText:  A string value containing help information corresponding
00058 //                   to command.
00059 //
00060 // Returns:          None.
00061 //
00062 //----------------------------------------------------------------------------
00063 void CGameCommand::Init(IEventHandlerSite *pSite, CHTMLHelper *pHH, long lIndex, BSTR bstrText,
00064                         BSTR bstrHelpText)
00065 {
00066    // Set member variables
00067    m_bstrText = bstrText;
00068    m_bstrHelpText = bstrHelpText;
00069
00070    // Add the table cell for the command
00071    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(TRUE, pHH->GetNamedEl(IDS_EL_COMMANDROW,
00072       IID_IHTMLTableRow));
00073    CDispatchPtr spDispCell;
00074    CHECKHRCOM(spRow->insertCell(-1, &spDispCell));
00075
00076    m_spCell.Assign(spDispCell);
00077
00078    // Create the link
00079    Enable(pSite, TRUE, pHH, lIndex);
00080 }
00081
00082
00083 //----------------------------------------------------------------------------
00084 //
00085 // Enable function
00086 //    Enables or disables the user interface for the game command.
00087 //
00088 // Parameters:
00089 //    pSite:         Interface to give to the event handler object.
00090 //    bEnable:       A VARIANT_BOOL variable specifying whether to enable
00091 //                   the command (VARIANT_TRUE) or disable it (VARIANT_FALSE).
00092 //    pHH:           The HTML helper object to use.
00093 //    lIndex:        The zero-based index of this game command object.
00094 //
00095 // Returns:          A standard COM success or error value.
00096 //
00097 //----------------------------------------------------------------------------
00098 void CGameCommand::Enable(IEventHandlerSite *pSite, BOOL bEnable, CHTMLHelper *pHH, long lIndex)
00099 {
00100    if(bEnable == m_bEnabled)
00101       return;
00102
00103    // If we're disabling the link, release it
00104    if(m_bEnabled)
00105       ReleaseLink();
00106
00107    // Empty the contents of the command cell element
00108    pHH->SetElTextWithEl(m_spCell, CBSTR());
00109    m_bEnabled = bEnable;
00110
00111    if(m_bEnabled)
00112    {
00113       // Create the link element
00114       m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_A, IID_IHTMLElement));
00115       CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA(m_spEl);
00116       CHECKHRCOM(spA->put_href(CBSTR(TEXT(""))));
00117       CHECKHRCOM(m_spEl->put_innerHTML(m_bstrText));
00118       CHECKHRCOM(m_spEl->put_title(m_bstrHelpText));
00119
00120       // Add the link element to the HTML table cell
00121       CHTMLElement2Ptr spCell2(m_spCell);
00122       CHECKHRCOM(spCell2->insertAdjacentElement(CBSTR(TEXT("beforeEnd")), m_spEl, NULL));
00123
00124       // Create event handlers for the link
00125       CEventHandler *pHandler = NULL;
00126       CVariant v;
00127
00128       // Mouse clicked handler
00129       pHandler = new CEventHandler(pSite, 0, lIndex);
00130       ENSUREALLOC(pHandler);
00131       v.vt = VT_DISPATCH;
00132       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00133       CHECKHRCOM(m_spEl->put_onclick(v));
00134    } else
00135    {
00136       // Set the text of the disabled command
00137       pHH->SetElTextWithEl(m_spCell, m_bstrText);
00138    }
00139 }
00140
00141
00142 //----------------------------------------------------------------------------
00143 //
00144 // ReleaseLink function
00145 //    Frees the event handler and the link object.
00146 //
00147 // Parameters:
00148 //    bEnable:       A VARIANT_BOOL variable specifying whether to enable
00149 //                   the command (VARIANT_TRUE) or disable it (VARIANT_FALSE).
00150 //
00151 // Returns:          A standard COM success or error value.
00152 //
00153 //----------------------------------------------------------------------------
00154 void CGameCommand::ReleaseLink()
00155 {
00156    if(m_spEl)
00157    {
00158       // Free the mouse clicked event handler
00159       CVariant v;
00160       v.vt = VT_NULL;
00161       m_spEl->put_onclick(v);
00162       m_spEl.Release();
00163    }
00164 }
00165
00166
00167 //----------------------------------------------------------------------------
00168 //
00169 // CGameCommandMgr constructor
00170 //
00171 // Parameters:       None.
00172 //
00173 //----------------------------------------------------------------------------
00174 CGameCommandMgr::CGameCommandMgr()
00175 {
00176    // Set initial values for member variables
00177    m_pSite = NULL;
00178    m_pHH = NULL;
00179 }
00180
00181
00182 //----------------------------------------------------------------------------
00183 //
00184 // CGameCommandMgr destructor
00185 //
00186 //----------------------------------------------------------------------------
00187 CGameCommandMgr::~CGameCommandMgr()
00188 {
00189 }
00190
00191
00192 //----------------------------------------------------------------------------
00193 //
00194 // Init function
00195 //    Binds the game command manager to a HTML document.
00196 //
00197 // Parameters:
00198 //    pSite:         Interface to notify of user actions.
00199 //    pHH:           The HTML helper object to use.
00200 //
00201 // Returns:          None.
00202 //
00203 //----------------------------------------------------------------------------
00204 void CGameCommandMgr::Init(IGameCommandMgrSite *pSite, CHTMLHelper *pHH)
00205 {
00206    // Set member variables' values
00207    _ASSERT(pSite);
00208    m_pSite = pSite;
00209    m_pHH = pHH;
00210 }
00211
00212
00213 //----------------------------------------------------------------------------
00214 //
00215 // Uninit function
00216 //    Releases any HTML document-specific resources, such as event handlers.
00217 //
00218 // Parameters:       None.
00219 //
00220 // Returns:          None.
00221 //
00222 //----------------------------------------------------------------------------
00223 void CGameCommandMgr::Uninit()
00224 {
00225    Clear();
00226    m_pHH = NULL;
00227 }
00228
00229
00230 //----------------------------------------------------------------------------
00231 //
00232 // Clear function
00233 //    Removes all custom game commands.
00234 //
00235 // Parameters:       None.
00236 //
00237 // Returns:          None.
00238 //
00239 //----------------------------------------------------------------------------
00240 void CGameCommandMgr::Clear()
00241 {
00242    // If there are no commands, return
00243    int cCmds = m_apCommands.GetSize();
00244    if(cCmds == 0)
00245       return;
00246
00247    // Delete command objects
00248    m_apCommands.SetSize(0);
00249
00250    // Delete the command HTML cell elements
00251    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(TRUE, m_pHH->GetNamedEl(IDS_EL_COMMANDROW,
00252       IID_IHTMLTableRow));
00253    for(int i = 0; i < cCmds; i++)
00254       CHECKHRCOM(spRow->deleteCell(0));
00255
00256    // Hide the command bar
00257    CPtr<IHTMLTableRow2, &IID_IHTMLTableRow2> spRow2(TRUE,
00258       m_pHH->GetNamedEl(IDS_EL_COMMANDBARHOLDER, IID_IHTMLTableRow2));
00259    CVariant v;
00260    v.vt = VT_NULL;
00261    CHECKHRCOM(spRow2->put_height(v));
00262 }
00263
00264
00265 //----------------------------------------------------------------------------
00266 //
00267 // AddGameCommand function
00268 //    Adds a custom command to be made available to the user.
00269 //
00270 // Parameters:
00271 //    lID:           A game-defined long integer value specifying the ID
00272 //                   representing the command.
00273 //    bstrText:      A string value containing the name of the custom command.
00274 //    bstrHelpText:  A string value containing help information corresponding
00275 //                   to command.
00276 //
00277 // Returns:          A standard COM success or error value.
00278 //
00279 //----------------------------------------------------------------------------
00280 HRESULT CGameCommandMgr::AddGameCommand(long lID, BSTR bstrText, BSTR bstrHelpText)
00281 {
00282    // lID must be unique, and bstrText must not be NULL
00283    if(!bstrText || (GetCommandIndex(lID) != -1))
00284       return E_INVALIDARG;
00285
00286    // Create and initialize the game command object
00287    CGameCommand *pCmd = new CGameCommand();
00288    ENSUREALLOC(pCmd);
00289    m_apCommands.Add(pCmd);
00290    pCmd->m_lID = lID;
00291    pCmd->Init((IEventHandlerSite*)this, m_pHH, m_apCommands.GetSize()-1, bstrText, bstrHelpText);
00292
00293    // If this is the first command, make the command bar visibles
00294    if(m_apCommands.GetSize() == 1)
00295    {
00296       CPtr<IHTMLTableRow2, &IID_IHTMLTableRow2> spRow2(TRUE,
00297          m_pHH->GetNamedEl(IDS_EL_COMMANDBARHOLDER, IID_IHTMLTableRow2));
00298       CVariant v;
00299       v.vt = VT_BSTR;
00300       v.bstrVal = CBSTR(TEXT("20px")).Detach();
00301       CHECKHRCOM(spRow2->put_height(v));
00302    }
00303
00304    return S_OK;
00305 }
00306
00307
00308 //----------------------------------------------------------------------------
00309 //
00310 // EnableGameCommand function
00311 //    Enables or disables the user interface for a custom game command.
00312 //
00313 // Parameters:
00314 //    lID:           A game-defined long integer value specifying the ID of
00315 //                   the command to change.
00316 //    bEnable:       TRUE to enable the command, or FALSE or disable it.
00317 //
00318 // Returns:          None.
00319 //
00320 //----------------------------------------------------------------------------
00321 void CGameCommandMgr::EnableGameCommand(long lID, BOOL bEnable)
00322 {
00323    int iIndex = GetCommandIndex(lID);
00324    _ASSERT(iIndex != -1);
00325
00326    m_apCommands[iIndex]->Enable((IEventHandlerSite*)this, bEnable, m_pHH, iIndex);
00327 }
00328
00329
00330 //----------------------------------------------------------------------------
00331 //
00332 // IEventHandlerSite::EventHandler method
00333 //    Handles events that are trapped via a CEventHandler object.
00334 //
00335 // Parameters:
00336 //    dwEventID:     0 in all cases.
00337 //    lParam:        The zero-based index of the command.
00338 //
00339 // Returns:          None.
00340 //
00341 //----------------------------------------------------------------------------
00342 void CGameCommandMgr::EventHandler(DWORD dwEventID, LPARAM lParam)
00343 {
00344    _ASSERT(dwEventID == 0); // Link clicked is the only event we handle
00345
00346    try   // Windows-called code
00347    {
00348       // Cancel the event
00349       m_pHH->CancelEvent();
00350
00351       // Tell the engine what happened
00352       m_pSite->HandleCommand(m_apCommands[lParam]->m_lID);
00353    }
00354    catch(CExcep *pE)
00355    {
00356       pE->Report();
00357       pE->Delete();
00358    }
00359 }
00360
00361
00362 //----------------------------------------------------------------------------
00363 //
00364 // GetCommandIndex function
00365 //    Determines whether a command with the specified ID has already been
00366 //    added to the manager.
00367 //
00368 // Parameters:
00369 //    lID:           The ID of the command to check for.
00370 //
00371 // Returns:          The index of the custom game command.
00372 //
00373 //----------------------------------------------------------------------------
00374 int CGameCommandMgr::GetCommandIndex(long lID)
00375 {
00376    // Try to find a match
00377    int cCmds = m_apCommands.GetSize();
00378    for(int i = 0; i < cCmds; i++)
00379       if(m_apCommands[i]->m_lID == lID)
00380          return i;
00381
00382    // No match found
00383    return -1;
00384 }
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameCommandMgr.h File Reference

#include <bmws_array.h>
#include <bmws_eventhandler.h>
#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class | CGameCommand
class | CGameCommandMgr
class | IGameCommandMgrSite

Defines

#define | AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameCommandMgr.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameCommandMgr.h Source File

GameCommandMgr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameCommandMgr.h
00004 //    Classes to manage the display of custom game commmands.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_array.h>
00021 #include <bmws_eventhandler.h>
00022 #include <bmws_htmlhelpers.h>
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // CGameCommand class
00028 //    Contains information for a single custom game command.
00029 //
00030 //----------------------------------------------------------------------------
00031 class CGameCommand
00032 {
00033 public:
00034    CGameCommand();
00035    virtual ~CGameCommand();
00036
00037    void Init(IEventHandlerSite *pSite, CHTMLHelper *pHH, long lIndex,
00038       BSTR bstrText, BSTR bstrHelpText);
00039    void Enable(IEventHandlerSite *pSite, BOOL bEnable, CHTMLHelper *pHH, long lIndex);
00040
00041    long m_lID;                // The identifier of the command
00042
00043 protected:
00044    void ReleaseLink();
00045
00046    BOOL m_bEnabled;           // Whether the command is currently enabled
00047    CHTMLElementPtr m_spCell;  // Cell containing the HTML link
00048    CHTMLElementPtr m_spEl;    // The link element of the command
00049    CBSTR m_bstrText;          // The text of the command
00050    CBSTR m_bstrHelpText;      // Help text for the command
00051 };
00052
00053
00054 //----------------------------------------------------------------------------
00055 //
00056 // IGameCommandMgrSite abstract class
00057 //    Enables the game command manager to tell the engine when a command has
00058 //    occurred.
00059 //
00060 //----------------------------------------------------------------------------
00061 class IGameCommandMgrSite
00062 {
00063 public:
00064    virtual void HandleCommand(long lID) = 0;
00065 };
00066
00067
00068 //----------------------------------------------------------------------------
00069 //
00070 // CGameCommandMgr class
00071 //    Manages the display of custom game commands (those added by
00072 //    ISolpackApp::AddGameCommmand).
00073 //
00074 //----------------------------------------------------------------------------
00075 class CGameCommandMgr : public IEventHandlerSite
00076 {
00077 public:
00078    CGameCommandMgr();
00079    virtual ~CGameCommandMgr();
00080
00081    void Init(IGameCommandMgrSite *pSite, CHTMLHelper *pHH);
00082    void Uninit();
00083    void Clear();
00084
00085    HRESULT AddGameCommand(long lID, BSTR bstrText, BSTR bstrHelpText);
00086    void EnableGameCommand(long lID, BOOL bEnable);
00087    int GetCommandIndex(long lID);
00088
00089    // IEventHandlerSite method
00090    void EventHandler(DWORD dwEventID, LPARAM lParam);
00091
00092 protected:
00093    IGameCommandMgrSite *m_pSite; // Engine interface
00094    CHTMLHelper *m_pHH;           // HTML helper object
00095    CPtrArray<CGameCommand*, CGameCommand*> m_apCommands; // Array of command objects
00096 };
00097
00098
00099 #endif // !defined(AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameData.cpp File Reference

#include "stdafx.h"
#include "GameData.h"
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Compounds

class | CGameDataAction

Variables

ITypeLib * | g_pTypeLib

Variable Documentation

ITypeLib* g_pTypeLib

Definition at line 21 of file GameData.cpp.

Referenced by CGameData::InitGameData().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameData.cpp Source File

GameData.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameData.cpp
00004 //    Class to encapsulate game-specific variable data.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameData.h"
00014 #include "resource.h"
00015 #include "..\SolpckLC\resource.h"
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Global and external variables
00020 //----------------------------------------------------------------------------
00021 extern ITypeLib *g_pTypeLib;     // The Solpack type library
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CGameDataAction class
00027 //    Stores information about the change of a game data object.
00028 //
00029 //----------------------------------------------------------------------------
00030 class CGameDataAction : public CAction
00031 {
00032 public:
00033    CGameDataAction(IActionSite *pSite);
00034    virtual ~CGameDataAction() {}
00035
00036    friend class CGameData;
00037
00038 protected:
00039    CVariant m_varOld;   // The old game data
00040    CVariant m_varNew;   // The new game data
00041 };
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CGameDataAction constructor
00047 //
00048 // Parameters:
00049 //    pSite:         Interface of the card that handles the action.
00050 //
00051 //----------------------------------------------------------------------------
00052 CGameDataAction::CGameDataAction(IActionSite *pSite) : CAction(pSite, 0, 0)
00053 {
00054 }
00055
00056
00057 //----------------------------------------------------------------------------
00058 //
00059 // CGameData constructor
00060 //
00061 // Parameters:
00062 //    pUndoMgrOwner: Engine interface used to retrieve the undo manager.
00063 //
00064 //----------------------------------------------------------------------------
00065 CGameData::CGameData(IUndoMgrOwner *pUndoMgrOwner)
00066 {
00067    // Set initial values for member variables
00068    m_pUndoMgrOwner = pUndoMgrOwner;
00069    ODS("CGameData constructor");
00070 }
00071
00072
00073 //----------------------------------------------------------------------------
00074 //
00075 // CGameData destructor
00076 //
00077 //----------------------------------------------------------------------------
00078 CGameData::~CGameData()
00079 {
00080    ODS("CGameData destructor");
00081 }
00082
00083
00084 //----------------------------------------------------------------------------
00085 //
00086 // ISolpackGameData::get_Data method
00087 //    Retrieves the contained data.
00088 //
00089 // Parameters:
00090 //    p:             [out] Address of a VARIANT variable that receives the
00091 //                   contained data.
00092 //
00093 // Returns:          A standard COM success or error value.
00094 //
00095 //----------------------------------------------------------------------------
00096 STDMETHODIMP CGameData::get_Data(VARIANT *p)
00097 {
00098    CHECKPTR(p);
00099    return VariantCopy(p, &m_var);
00100 }
00101
00102
00103 //----------------------------------------------------------------------------
00104 //
00105 // ISolpackGameData::put_Data method
00106 //    Sets the contained data.
00107 //
00108 // Parameters:
00109 //    v:             [in] A VARIANT_BOOL variable specifying whether the card
00110 //                   can be dragged.
00111 //
00112 // Returns:          A standard COM success or error value.
00113 //
00114 //----------------------------------------------------------------------------
00115 STDMETHODIMP CGameData::put_Data(VARIANT v)
00116 {
00117    try   // COM-called code
00118    {
00119       // Create and initialize the action object
00120       CGameDataAction *pAction = new CGameDataAction((IActionSite*)this);
00121       ENSUREALLOC(pAction);
00122       VariantCopy(&pAction->m_varOld, &m_var);
00123       VariantCopy(&pAction->m_varNew, &v);
00124
00125       // Record the action, during which it will be performed
00126       m_pUndoMgrOwner->GetUndoMgr()->RecordAction(pAction);
00127    }
00128    CATCHALL;
00129    return S_OK;
00130 }
00131
00132
00133 //----------------------------------------------------------------------------
00134 //
00135 // INDUnknownAndDispatch::NDQueryInterface method
00136 //    Returns pointers to supported interfaces.
00137 //
00138 // Parameters:
00139 //    riid:          [in] Identifier of the interface being requested.
00140 //    ppvObject:     [out] Address of pointer variable that receives the
00141 //                   interface pointer requested in riid.
00142 //
00143 // Returns:          A standard COM success or error value.
00144 //
00145 //----------------------------------------------------------------------------
00146 STDMETHODIMP CGameData::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00147 {
00148    if(IsEqualIID(riid, IID_ISolpackGameData))
00149    {
00150       *ppvObject = (ISolpackGameData*)this;
00151       (*(LPUNKNOWN*)ppvObject)->AddRef();
00152       return S_OK;
00153    } else
00154       return CDispBase::NDQueryInterface(riid, ppvObject);
00155 }
00156
00157
00158 //----------------------------------------------------------------------------
00159 //
00160 // IActionSite::DoAction method
00161 //    Executes the specified action.
00162 //
00163 // Parameters:
00164 //    pAction:       Object containing information on an action.
00165 //
00166 // Returns:          None.
00167 //
00168 //----------------------------------------------------------------------------
00169 void CGameData::DoAction(CAction *pAction)
00170 {
00171    // Copy the new data into this object
00172    CGameDataAction *pGDAction = (CGameDataAction*)pAction;
00173    VariantClear(&m_var);
00174    VariantCopy(&m_var, &pGDAction->m_varNew);
00175 }
00176
00177
00178 //----------------------------------------------------------------------------
00179 //
00180 // IActionSite::UndoAction method
00181 //    Undoes the specified action.
00182 //
00183 // Parameters:
00184 //    pAction:       Object containing information on an action.
00185 //
00186 // Returns:          None.
00187 //
00188 //----------------------------------------------------------------------------
00189 void CGameData::UndoAction(CAction *pAction)
00190 {
00191    // Copy the old data back into this object
00192    CGameDataAction *pGDAction = (CGameDataAction*)pAction;
00193    VariantClear(&m_var);
00194    VariantCopy(&m_var, &pGDAction->m_varOld);
00195 }
00196
00197
00198 //----------------------------------------------------------------------------
00199 //
00200 // InitGameData function
00201 //    Initializes the game data object.
00202 //
00203 // Parameters:       None.
00204 //
00205 // Returns:          None.
00206 //
00207 //----------------------------------------------------------------------------
00208 void CGameData::InitGameData()
00209 {
00210    ODS("CGameData::InitGameData");
00211
00212    Init(g_pTypeLib, IID_ISolpackGameData, (LPDISPATCH)((ISolpackGameData*)this));
00213 }
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameData.h File Reference

#include "..\SolpackTLB\SolpackIncl.h"
#include "Action.h"
#include "UndoMgr.h"
#include <bmws_dispbase.h>
#include <bmws_variant.h>

Go to the source code of this file.

Compounds

class | CGameData

Defines

#define | AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameData.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameData.h Source File

GameData.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameData.h
00004 //    Class to encapsulate game-specific variable data.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\SolpackIncl.h"
00021 #include "Action.h"
00022 #include "UndoMgr.h"
00023 #include <bmws_dispbase.h>
00024 #include <bmws_variant.h>
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // CGameData class
00030 //    Encapsulates game-specific data.
00031 //
00032 //----------------------------------------------------------------------------
00033 class CGameData : public CDispBase, public ISolpackGameData, public IActionSite
00034 {
00035 public:
00036    CGameData(IUndoMgrOwner *pUndoMgrOwner);
00037    virtual ~CGameData();
00038
00039    DECLARE_IUNKNOWN_AND_IDISPATCH;
00040
00041    // ISolpackGameData methods
00042    STDMETHOD (get_Data)(VARIANT *p);
00043    STDMETHOD (put_Data)(VARIANT v);
00044
00045    // INDUnknownAndDispatch override
00046    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00047
00048    // IActionSite methods
00049    void DoAction(CAction *pAction);
00050    void UndoAction(CAction *pAction);
00051
00052    void InitGameData();
00053
00054 protected:
00055    IUndoMgrOwner *m_pUndoMgrOwner;  // Engine interface for retrieving undo manager
00056    CVariant m_var;                  // Contained data
00057 };
00058
00059
00060 #endif // !defined(AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameIDs.h File Reference

Go to the source code of this file.

Defines

#define | AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
#define | GAME_SPIDER 1
#define | GAME_LABELLELUCIE 2

Define Documentation

#define AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameIDs.h.

#define GAME_LABELLELUCIE 2

Definition at line 14 of file GameIDs.h.

#define GAME_SPIDER 1

Definition at line 13 of file GameIDs.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameIDs.h Source File

GameIDs.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameIDs.h
00004 //    Definitions of Game IDs
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 #define GAME_SPIDER              1
00014 #define GAME_LABELLELUCIE        2
00015
00016
00017 #endif // !defined(AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameInfo.cpp File Reference

#include "stdafx.h"
#include "GameInfo.h"
#include "..\SPGameLC\resource.h"

Go to the source code of this file.

Variables

HINSTANCE | g_hInstLC
ITypeLib * | g_pTypeLib

Variable Documentation

HINSTANCE g_hInstLC

Definition at line 20 of file GameInfo.cpp.

ITypeLib* g_pTypeLib

Definition at line 21 of file GameInfo.cpp.

Referenced by CGameInfo::InitGameInfo().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameInfo.cpp Source File

GameInfo.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameInfo.cpp
00004 //    Class which implements the game information object.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameInfo.h"
00014 #include "..\SPGameLC\resource.h"
00015
00016
00017 //----------------------------------------------------------------------------
00018 // External variables
00019 //----------------------------------------------------------------------------
00020 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00021 extern ITypeLib *g_pTypeLib;  // The Solpack type library
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CGameInfo constructor
00027 //
00028 // Parameters:
00029 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00030 //    lDifficulty:   The game's difficulty ranking, from SOLPACKDIFFICULTY.
00031 //    pfnCreate:     Pointer to the function to create games of this type.
00032 //
00033 //----------------------------------------------------------------------------
00034 CGameInfo::CGameInfo(UINT uGameID, long lDifficulty, CREATEGAMEFN pfnCreate)
00035 {
00036    // Set initial values for member variables
00037    m_uGameID = uGameID;
00038    m_lDifficulty = lDifficulty;
00039    m_pfnCreate = pfnCreate;
00040    ODS("CGameInfo constructor");
00041 }
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CGameInfo destructor
00047 //
00048 //----------------------------------------------------------------------------
00049 CGameInfo::~CGameInfo()
00050 {
00051    ODS("CGameInfo destructor");
00052 }
00053
00054
00055 //----------------------------------------------------------------------------
00056 //
00057 // ISolpackGameInfo::get_Title method
00058 //    Retrieves the name of the Solitaire game.
00059 //
00060 // Parameters:
00061 //    p:             [out] Address of a string variable that receives the game
00062 //                   title.
00063 //
00064 // Returns:          A standard COM success or error value.
00065 //
00066 //----------------------------------------------------------------------------
00067 STDMETHODIMP CGameInfo::get_Title(BSTR *p)
00068 {
00069    CHECKPTR(p);
00070    *p = NULL;
00071    try   // COM-called code
00072    {
00073       *p = CBSTR(m_bstrTitle).Detach();
00074    }
00075    CATCHALL;
00076    return S_OK;
00077 }
00078
00079
00080 //----------------------------------------------------------------------------
00081 //
00082 // ISolpackGameInfo::get_Rules method
00083 //    Retrieves the rules of the game.
00084 //
00085 // Parameters:
00086 //    p:             [out] Address of a string variable that receives the game
00087 //                   rules.
00088 //
00089 // Returns:          A standard COM success or error value.
00090 //
00091 //----------------------------------------------------------------------------
00092 STDMETHODIMP CGameInfo::get_Rules(BSTR *p)
00093 {
00094    CHECKPTR(p);
00095    *p = NULL;
00096    try   // COM-called code
00097    {
00098       // Load the rules text from the localized resource module
00099       HRSRC hRes = FindResource(g_hInstLC, MAKEINTRESOURCE(m_uGameID), TEXT("INSTR"));
00100       if(!hRes)
00101          throw new CExcep(999);
00102       DWORD dwLen = SizeofResource(g_hInstLC, hRes);
00103       HGLOBAL h = LoadResource(g_hInstLC, hRes);
00104       if(!h)
00105          throw new CExcep(998);
00106       LPVOID lpvData = LockResource(h);
00107       if(!lpvData)
00108          throw new CExcep(997);
00109       CTSTR lpsz(TRUE, dwLen+1);
00110       lstrcpyn(lpsz, (LPCTSTR)lpvData, dwLen+1);
00111       *p = CBSTR(lpsz);
00112    }
00113    CATCHALL;
00114    return S_OK;
00115 }
00116
00117
00118 //----------------------------------------------------------------------------
00119 //
00120 // ISolpackGameInfo::get_Difficulty method
00121 //    Retrieves the game's difficulty ranking.
00122 //
00123 // Parameters:
00124 //    p:             [out] Address of a long integer variable that receives
00125 //                   the difficulty ranking, from the SOLPACKDIFFICULTY
00126 //                   enumeration.
00127 //
00128 // Returns:          A standard COM success or error value.
00129 //
00130 //----------------------------------------------------------------------------
00131 STDMETHODIMP CGameInfo::get_Difficulty(long *p)
00132 {
00133    CHECKPTR(p);
00134    *p = m_lDifficulty;
00135    return S_OK;
00136 }
00137
00138
00139 //----------------------------------------------------------------------------
00140 //
00141 // INDUnknownAndDispatch::NDQueryInterface method
00142 //    Returns pointers to supported interfaces.
00143 //
00144 // Parameters:
00145 //    riid:          [in] Identifier of the interface being requested.
00146 //    ppvObject:     [out] Address of pointer variable that receives the
00147 //                   interface pointer requested in riid.
00148 //
00149 // Returns:          A standard COM success or error value.
00150 //
00151 //----------------------------------------------------------------------------
00152 STDMETHODIMP CGameInfo::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00153 {
00154    if(IsEqualIID(riid, IID_ISolpackGameInfo))
00155    {
00156       *ppvObject = (ISolpackGameInfo*)this;
00157       (*(LPUNKNOWN*)ppvObject)->AddRef();
00158       return S_OK;
00159    } else
00160       return CDispBase::NDQueryInterface(riid, ppvObject);
00161 }
00162
00163
00164 //----------------------------------------------------------------------------
00165 //
00166 // InitGameInfo function
00167 //    Sets up the game information object.
00168 //
00169 // Parameters:       None.
00170 //
00171 // Returns:          None.
00172 //
00173 //----------------------------------------------------------------------------
00174 void CGameInfo::InitGameInfo()
00175 {
00176    Init(g_pTypeLib, IID_ISolpackGameInfo, (LPDISPATCH)((ISolpackGameInfo*)this));
00177
00178    // Load the game title
00179    m_bstrTitle.Assign(m_uGameID + IDS_TITLEBASE);
00180 }
00181
00182
00183 //----------------------------------------------------------------------------
00184 //
00185 // Create function
00186 //    Creates an instance of the corresponding game.
00187 //
00188 // Parameters:       None.
00189 //
00190 // Returns:          A pointer to the newly created game.
00191 //
00192 //----------------------------------------------------------------------------
00193 CGameBase* CGameInfo::CreateGame()
00194 {
00195    return (m_pfnCreate)(m_uGameID, this);
00196 }
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameInfo.h File Reference

#include <bmws_dispbase.h>
#include "..\SolpackTLB\SolpackIncl.h"

Go to the source code of this file.

Compounds

class | CGameInfo

Defines

#define | AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Typedefs

typedef CGameBase *(* | CREATEGAMEFN )(UINT, CGameInfo *)

Define Documentation

#define AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameInfo.h.

Typedef Documentation

typedef CGameBase*(* CREATEGAMEFN)(UINT, CGameInfo*)

Definition at line 34 of file GameInfo.h.

Referenced by CGameInfo::CGameInfo().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameInfo.h Source File

GameInfo.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameInfo.h
00004 //    Class which implements the game information object.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_dispbase.h>
00021 #include "..\SolpackTLB\SolpackIncl.h"
00022
00023
00024 //----------------------------------------------------------------------------
00025 // Forward declaration
00026 //----------------------------------------------------------------------------
00027 class CGameInfo;
00028 class CGameBase;
00029
00030
00031 //----------------------------------------------------------------------------
00032 // CREATEGAMEFN function type
00033 //----------------------------------------------------------------------------
00034 typedef CGameBase* (*CREATEGAMEFN)(UINT, CGameInfo*);
00035
00036
00037 //----------------------------------------------------------------------------
00038 //
00039 // CGameInfo class
00040 //    Implements the game information object.
00041 //
00042 //----------------------------------------------------------------------------
00043 class CGameInfo : public CDispBase, public ISolpackGameInfo
00044 {
00045 public:
00046    CGameInfo(UINT uGameID, long lDifficulty, CREATEGAMEFN pfnCreate);
00047    virtual ~CGameInfo();
00048
00049    DECLARE_IUNKNOWN_AND_IDISPATCH;
00050
00051    // ISolpackGameInfo methods
00052    STDMETHOD (get_Title)(BSTR *p);
00053    STDMETHOD (get_Rules)(BSTR *p);
00054    STDMETHOD (get_Difficulty)(long *p);
00055
00056    // INDUnknownAndDispatch override
00057    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00058
00059    void InitGameInfo();
00060    CGameBase* CreateGame();
00061
00062 protected:
00063    UINT m_uGameID;            // The game identifier, taken from GameIDs.h
00064    long m_lDifficulty;        // The difficulty ranking, from the SOLPACKDIFFICULTY enumeration
00065    CBSTR m_bstrTitle;         // The title of the game
00066    CREATEGAMEFN m_pfnCreate;  // Pointer to the function used to create this game
00067 };
00068
00069
00070 #endif // !defined(AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:05 2002 for Solitaire Pack by doxygen 1.2.15


GameLaBelleLucie.cpp File Reference

#include "stdafx.h"
#include "GameLaBelleLucie.h"
#include "..\SPGameLC\resource.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameLaBelleLucie.cpp Source File

GameLaBelleLucie.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameLaBelleLucie.cpp
00004 //    Class which implements the game La Belle Lucie.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameLaBelleLucie.h"
00014 #include "..\SPGameLC\resource.h"
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CGameLaBelleLucie constructor
00020 //
00021 // Parameters:
00022 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00023 //    pInfo:         The information object for this game.
00024 //
00025 //----------------------------------------------------------------------------
00026 CGameLaBelleLucie::CGameLaBelleLucie(UINT uGameID, CGameInfo *pInfo) : CGameBase(uGameID, pInfo)
00027 {
00028    // Set up member variables
00029    m_cCardsDealing = 0;
00030
00031    // Signify that the contained pointers are COM interface pointers that
00032    // should be released, not deleted, when destroyed.
00033    m_apPiles.SetRelease(TRUE);
00034    m_apFoundations.SetRelease(TRUE);
00035    m_apTopCards.SetRelease(TRUE);
00036
00037    ODS("CGameLaBelleLucie constructor");
00038 }
00039
00040
00041 //----------------------------------------------------------------------------
00042 //
00043 // CGameLaBelleLucie destructor
00044 //
00045 //----------------------------------------------------------------------------
00046 CGameLaBelleLucie::~CGameLaBelleLucie()
00047 {
00048    ODS("CGameLaBelleLucie destructor");
00049 }
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // ISolpackGame::Initialize method
00055 //    Sets up decks and piles for the game.
00056 //
00057 // Parameters:
00058 //    pApp:          [in] A pointer to the ISolpackApp interface of the
00059 //                   Solpack engine object.
00060 //
00061 // Returns:          A standard COM success or error value.
00062 //
00063 //----------------------------------------------------------------------------
00064 STDMETHODIMP CGameLaBelleLucie::Initialize(ISolpackApp *pApp)
00065 {
00066    ENSUREBASE(CGameBase::Initialize(pApp));
00067    ODS("CGameLaBelleLucie::Initialize");
00068
00069    try   // COM-called code
00070    {
00071       CHECKHRCOM(m_spApp->CreateGameData(&m_pNumRounds));
00072       PutLongInData(m_pNumRounds, 0);
00073
00074       int i;
00075
00076       // Create and set up tableau piles
00077       m_apPiles.SetSize(18);
00078       m_apTopCards.SetSize(18);
00079       for(i = 0; i < 18; i++)
00080       {
00081          CHECKHRCOM(m_spApp->CreatePile(PILE_TABLEAURIGHT, &m_apPiles[i]));
00082          CHECKHRCOM(m_apPiles[i]->put_BaseType(BASE_NONE));
00083          CHECKHRCOM(m_spApp->CreateGameData(&m_apTopCards[i]));
00084          PutCardInData(m_apTopCards[i], NULL);
00085       }
00086
00087       // Create and set up foundations
00088       m_apFoundations.SetSize(4);
00089       for(i = 0; i < 4; i++)
00090       {
00091          CHECKHRCOM(m_spApp->CreatePile(PILE_STACK, &m_apFoundations[i]));
00092          CHECKHRCOM(m_apFoundations[i]->put_BaseType(BASE_FOUNDATION));
00093          CHECKHRCOM(m_apFoundations[i]->put_CommentTooltip
00094             (CBSTR(IDS_COMMENT_ACEKINGFOUNDATION)));
00095       }
00096
00097       // Add the "Next Deal" command
00098       CHECKHRCOM(m_spApp->AddGameCommand(0, CBSTR(IDS_CMD_LABELLELUCIE_REDEAL),
00099          CBSTR(IDS_CMDHELP_LABELLELUCIE_REDEAL)));
00100       GetMetrics();
00101
00102       // Position the piles
00103       UpdateLayout();
00104    }
00105    CATCHALL;
00106    return S_OK;
00107 }
00108
00109
00110 //----------------------------------------------------------------------------
00111 //
00112 // ISolpackGame::Uninitialize method
00113 //    Releases all created objects and prepares for destruction.
00114 //
00115 // Parameters:       None.
00116 //
00117 // Returns:          A standard COM success or error value.
00118 //
00119 //----------------------------------------------------------------------------
00120 STDMETHODIMP CGameLaBelleLucie::Uninitialize()
00121 {
00122    CGameBase::Uninitialize();
00123    ODS("CGameLaBelleLucie::Uninitialize");
00124
00125    m_apPiles.SetSize(0);
00126    m_apFoundations.SetSize(0);
00127    m_apTopCards.SetSize(0);
00128    m_pNumRounds.Release();
00129    return S_OK;
00130 }
00131
00132
00133 //----------------------------------------------------------------------------
00134 //
00135 // ISolpackGame::Deal method
00136 //    Deals out a game of Solitaire.
00137 //
00138 // Parameters:       None.
00139 //
00140 // Returns:          A standard COM success or error value.
00141 //
00142 //----------------------------------------------------------------------------
00143 STDMETHODIMP CGameLaBelleLucie::Deal()
00144 {
00145    ENSUREBASE(CGameBase::Deal());
00146    ODS("CGameLaBelleLucie::Deal");
00147
00148    try   // COM-called code
00149    {
00150       // Reset the game and deal
00151       PutLongInData(m_pNumRounds, 0);
00152       CHECKHRCOM(m_spApp->EnableGameCommand(0, VARIANT_TRUE));
00153       DealRound();
00154    }
00155    CATCHALL;
00156
00157    return S_OK;
00158 }
00159
00160
00161 //----------------------------------------------------------------------------
00162 //
00163 // ISolpackGame::AutoPlay method
00164 //    Plays all possible cards to foundations.
00165 //
00166 // Parameters:       None.
00167 //
00168 // Returns:          A standard COM success or error value.
00169 //
00170 //----------------------------------------------------------------------------
00171 STDMETHODIMP CGameLaBelleLucie::AutoPlay()
00172 {
00173    ENSUREBASE(CGameBase::AutoPlay());
00174    ODS("CGameLaBelleLucie::AutoPlay");
00175
00176    try   // COM-called code
00177    {
00178       BOOL bAutoPlayed = FALSE;
00179       int i = 0;
00180
00181       // Go through each pile, checking to see if the top card can be
00182       // autoplayed. If so, autoplay it and then start over at the first pile.
00183       // Stop when no piles are autoplayable.
00184
00185       do
00186       {
00187          CSolpackCardPtr spCard = GetCardFromData(m_apTopCards[i]);
00188          if(spCard)
00189          {
00190             if(InternalAutoPlayCard(i, spCard))
00191             {
00192                // Card was autoplayed, start over
00193                bAutoPlayed = TRUE;
00194                i = 0;
00195             } else
00196                i++;  // Go on to next pile
00197          } else
00198             i++;  // No card in this pile, go on to next
00199       } while(i < 18);
00200
00201       if(bAutoPlayed)
00202          UpdatePilePositions();
00203    }
00204    CATCHALL;
00205
00206    return S_OK;
00207 }
00208
00209
00210 //----------------------------------------------------------------------------
00211 //
00212 // ISolpackGame::AutoPlayCard method
00213 //    Plays the specified card to a foundation, if possible.
00214 //
00215 // Parameters:
00216 //    pCard:         [in] A pointer to the ISolpackCard interface of the card
00217 //                   to autoplay.
00218 //
00219 // Returns:          A standard COM success or error value.
00220 //
00221 //----------------------------------------------------------------------------
00222 STDMETHODIMP CGameLaBelleLucie::AutoPlayCard(ISolpackCard *pCard)
00223 {
00224    ENSUREBASE(CGameBase::AutoPlayCard(pCard));
00225    ODS("CGameLaBelleLucie::AutoPlayCard");
00226
00227    try   // COM-called code
00228    {
00229       // Find if the card is the top card of one of the piles. If so, try to
00230       // autoplay it. Otherwise it can't be autoplayed.
00231
00232       for(int i = 0; i < 18; i++)
00233       {
00234          if(ObjectsEqual(pCard, GetCardFromData(m_apTopCards[i])))
00235          {
00236             if(InternalAutoPlayCard(i, pCard))
00237                UpdatePilePositions();
00238             break;
00239          }
00240       }
00241    }
00242    CATCHALL;
00243
00244    return S_OK;
00245 }
00246
00247
00248 //----------------------------------------------------------------------------
00249 //
00250 // ISolpackGame::HandleCommand method
00251 //    Handles a custom game command previously added via
00252 //    ISolpackApp::AddGameCommand.
00253 //
00254 // Parameters:
00255 //    lID:           A game-defined long integer value specifying the ID of
00256 //                   the command the user chose.
00257 //
00258 // Returns:          A standard COM success or error value.
00259 //
00260 //----------------------------------------------------------------------------
00261 STDMETHODIMP CGameLaBelleLucie::HandleCommand(long lID)
00262 {
00263    ENSUREBASE(CGameBase::HandleCommand(lID));
00264    ODS("CGameLaBelleLucie::HandleCommand");
00265
00266    // Command ID zero is the only command we registered
00267    if(lID != 0)
00268       return E_INVALIDARG;
00269
00270    try   // COM-called code
00271    {
00272       // Add the contents of all the piles to the fragment, and move the
00273       // fragment back to the deck pile. Then deal another round.
00274
00275       CSolpackFragmentPtr spFrag;
00276       CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00277
00278       for(int i = 0; i < 18; i++)
00279       {
00280          CHECKHRCOM(spFrag->AddToFragment(m_apPiles[i]));
00281       }
00282       CHECKHRCOM(spFrag->MoveToPile(m_spDeck, -1, VARIANT_FALSE, VARIANT_TRUE));
00283
00284       DealRound();
00285    }
00286    CATCHALL;
00287
00288    return S_OK;
00289 }
00290
00291
00292 //----------------------------------------------------------------------------
00293 //
00294 // ISolpackGame::SetupFragment method
00295 //    Informs the game that a pile was single-clicked.
00296 //
00297 // Parameters:
00298 //    pPileSrc:      [in] A pointer to the ISolpackPile interface of the pile
00299 //                   from which the user is dragging.
00300 //    pCardSrc:      [in] A pointer to the ISolpackCard interface of the
00301 //                   specific card that the user wants to drag.
00302 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00303 //                   fragment to hold cards to drag.
00304 //
00305 // Returns:          A standard COM success or error value.
00306 //
00307 //----------------------------------------------------------------------------
00308 STDMETHODIMP CGameLaBelleLucie::SetupFragment(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00309                                               ISolpackFragment *pFrag)
00310 {
00311    ENSUREBASE(CGameBase::SetupFragment(pPileSrc, pCardSrc, pFrag));
00312    ODS("CGameLaBelleLucie::SetupFragment");
00313
00314    try   // COM-called code
00315    {
00316       // In order to be dragged, the source pile must be a tableau pile and
00317       // the card must be the top card. If this is true, add the card to the
00318       // fragment.
00319
00320       for(int i = 0; i < 18; i++)
00321       {
00322          if(ObjectsEqual(pPileSrc, m_apPiles[i]))
00323          {
00324             if(ObjectsEqual(pCardSrc, GetCardFromData(m_apTopCards[i])))
00325             {
00326                CHECKHRCOM(pFrag->AddToFragment(pCardSrc));
00327
00328                // Keep track of what pile the dragged card came from
00329                m_spDragSrc.Assign(pPileSrc);
00330                return S_OK;
00331             }
00332             break;
00333          }
00334       }
00335    }
00336    CATCHALL;
00337
00338    return S_OK;
00339 }
00340
00341
00342 //----------------------------------------------------------------------------
00343 //
00344 // ISolpackGame::DropFragment method
00345 //    If possible, drops the cards from the specified fragment onto the
00346 //    specified pile.
00347 //
00348 // Parameters:
00349 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00350 //                   fragment containing the card(s) being dragged.
00351 //    pPileDest:     [in] A pointer to the ISolpackPile interface of the pile
00352 //                   onto which the user has dropped the fragment.
00353 //    pbValid:       [in] The address of a VARIANT_BOOL variable that receives
00354 //                   whether the cards were dropped.
00355 //
00356 // Returns:          A standard COM success or error value.
00357 //
00358 //----------------------------------------------------------------------------
00359 STDMETHODIMP CGameLaBelleLucie::DropFragment(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00360                                              VARIANT_BOOL *pbValid)
00361 {
00362    ENSUREBASE(CGameBase::DropFragment(pFrag, pPileDest, pbValid));
00363    ODS("CGameLaBelleLucie::DropFragment");
00364
00365    try   // COM-called code
00366    {
00367       // We can only handle fragments containing one card (this should always
00368       // be the case)
00369       long lNumCards;
00370       CHECKHRCOM(pFrag->get_NumCards(&lNumCards));
00371       if(lNumCards != 1)
00372          return S_OK;
00373
00374       // Get the card the fragment contains
00375       CSolpackCardPtr spCardFrag;
00376       CHECKHRCOM(pFrag->GetCard(0, &spCardFrag));
00377
00378       // Find out which pile the card came from, and if the destination pile
00379       // is a tableau pile
00380       int iSrc = -1;
00381       int iDest = -1;
00382       int i;
00383       for(i = 0; i < 18 && (iSrc == -1 || iDest == -1); i++)
00384       {
00385          if(ObjectsEqual(m_spDragSrc, m_apPiles[i]))
00386             iSrc = i;
00387          if(ObjectsEqual(pPileDest, m_apPiles[i]))
00388             iDest = i;
00389       }
00390
00391       if(iDest != -1)
00392       {
00393          // The destination pile is a tableau pile. The card must be droppable
00394          // on the pile's top card
00395          CSolpackCardPtr spTopCard = GetCardFromData(m_apTopCards[iDest]);
00396          if(spTopCard)
00397          {
00398             // Suits must be equal
00399             long lSuitFrag = 0;
00400             long lSuitDest = 0;
00401             CHECKHRCOM(spCardFrag->get_Suit(&lSuitFrag));
00402             CHECKHRCOM(spTopCard->get_Suit(&lSuitDest));
00403             if(lSuitFrag == lSuitDest)
00404             {
00405                // Rank of the dropped card must be one less than the existing
00406                // card
00407                long lRankFrag = 0;
00408                long lRankDest = 0;
00409                CHECKHRCOM(spCardFrag->get_Rank(&lRankFrag));
00410                CHECKHRCOM(spTopCard->get_Rank(&lRankDest));
00411                if(lRankFrag + 1 == lRankDest)
00412                {
00413                   // Reassign draggable properties
00414                   *pbValid = VARIANT_TRUE;
00415                   CHECKHRCOM(spTopCard->put_CanDrag(VARIANT_FALSE));
00416                   CHECKHRCOM(pFrag->MoveToPile(m_apPiles[iDest], -1, VARIANT_TRUE,
00417                      VARIANT_FALSE));
00418                   CHECKHRCOM(spCardFrag->put_CanDrag(VARIANT_TRUE));
00419                   PutCardInData(m_apTopCards[iDest], spCardFrag);
00420                }
00421             }
00422          }
00423       } else
00424       {
00425          // Is the destination a foundation pile?
00426          for(i = 0; i < 4; i++)
00427          {
00428             if(ObjectsEqual(pPileDest, m_apFoundations[i]))
00429             {
00430                iDest = i;
00431                break;
00432             }
00433          }
00434          // Is it a foundation and can we play the card there?
00435          if((iDest != -1) && IsCardPlayable(iSrc, &iDest))
00436          {
00437             // Process the scoring of the card
00438             ScoreCard(pFrag, iDest, spCardFrag);
00439             *pbValid = VARIANT_TRUE;
00440          }
00441       }
00442
00443       // If we've moved the card, perform adjustments
00444       if(*pbValid == VARIANT_TRUE)
00445       {
00446          AdjustSrcPile(iSrc);
00447          m_spDragSrc.Release();
00448          UpdatePilePositions();
00449       }
00450    }
00451    CATCHALL;
00452
00453    return S_OK;
00454 }
00455
00456
00457 //----------------------------------------------------------------------------
00458 //
00459 // Create function
00460 //    Creates an instance of the game object.
00461 //
00462 // Parameters:
00463 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00464 //    pInfo:         The information object for this game.
00465 //
00466 // Returns:          A pointer to the newly created game object.
00467 //
00468 //----------------------------------------------------------------------------
00469 CGameBase* CGameLaBelleLucie::Create(UINT uGameID, CGameInfo *pInfo)
00470 {
00471    return (CGameBase*)(new CGameLaBelleLucie(uGameID, pInfo));
00472 }
00473
00474
00475 //----------------------------------------------------------------------------
00476 //
00477 // UpdateLayout function
00478 //    Positions pile objects appropriately.
00479 //
00480 // Parameters:
00481 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00482 //    pInfo:         The information object for this game.
00483 //
00484 // Returns:          A pointer to the newly created game object.
00485 //
00486 //----------------------------------------------------------------------------
00487 void CGameLaBelleLucie::UpdateLayout()
00488 {
00489    // Set the piles' Y coordinates, which are independent of the contents of
00490    // the piles
00491
00492    int i;
00493    for(i = 0; i < 18; i++)
00494       CHECKHRCOM(m_apPiles[i]->put_Y(m_lSpacingY + ((i%4) * (m_lSpacingY + m_lCardHeight))));
00495
00496    for(i = 0; i < 4; i++)
00497       CHECKHRCOM(m_apFoundations[i]->put_Y(m_lSpacingY + (i * (m_lSpacingY + m_lCardHeight))));
00498
00499    // Set the X coordinates, dependent on contents
00500    UpdatePilePositions();
00501 }
00502
00503
00504 //----------------------------------------------------------------------------
00505 //
00506 // DealRound function
00507 //    Deals cards from the deck to the tableau.
00508 //
00509 // Parameters:       None.
00510 //
00511 // Returns:          None.
00512 //
00513 //----------------------------------------------------------------------------
00514 void CGameLaBelleLucie::DealRound()
00515 {
00516    // If this is the third redeal, disable the game command because the user
00517    // can only redeal 3 times
00518    long lCurRound = GetLongFromData(m_pNumRounds);
00519    if(lCurRound == 3)
00520       CHECKHRCOM(m_spApp->EnableGameCommand(0, VARIANT_FALSE));
00521
00522    // Increment the deal count
00523    PutLongInData(m_pNumRounds, lCurRound + 1);
00524
00525    // Shuffle the deck
00526    CHECKHRCOM(m_spDeck->Shuffle());
00527
00528    // Position the piles before dealing
00529    long lNumCards = 0;
00530    CHECKHRCOM(m_spDeck->get_NumCards(&lNumCards));
00531    m_cCardsDealing = lNumCards;
00532    UpdatePilePositions();
00533
00534    CSolpackFragmentPtr spFrag;
00535    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00536
00537    // Go through each tableau pile
00538    long lTotal = 0;
00539    for(long l = 0; l < 18; l++)
00540    {
00541       CSolpackCardPtr spTopCard;
00542       if(lTotal < lNumCards)
00543       {
00544          // Deal cards in sets of 3, as long as there are more cards
00545          long m;
00546          for(m = 0; m < 3 && lTotal < lNumCards; m++, lTotal++)
00547          {
00548             CSolpackCardPtr spCard;
00549             CHECKHRCOM(m_spDeck->GetCard(m, &spCard));
00550             CHECKHRCOM(spFrag->AddToFragment(spCard));
00551          }
00552          CHECKHRCOM(spFrag->MoveToPile(m_apPiles[l], -1, VARIANT_TRUE, VARIANT_TRUE));
00553          CHECKHRCOM(m_apPiles[l]->GetCard(m-1, &spTopCard));
00554          CHECKHRCOM(spTopCard->put_CanDrag(VARIANT_TRUE));
00555       }
00556       PutCardInData(m_apTopCards[l], spTopCard);
00557    }
00558
00559    // Finalize pile positions
00560    m_cCardsDealing = 0;
00561    UpdatePilePositions();
00562 }
00563
00564
00565 //----------------------------------------------------------------------------
00566 //
00567 // IsCardPlayable function
00568 //    Determines if the specified card can be played to a foundation.
00569 //
00570 // Parameters:
00571 //    iPileIndex:    The index of the pile whose top card is to be tested.
00572 //    piTryDest:     Pointer that specifies the index of a foundation pile to
00573 //                   test specifically. If points to -1, it will be filled in
00574 //                   with the index of the pile that accepts the card.
00575 //
00576 // Returns:          TRUE if the card can be played, else FALSE.
00577 //
00578 //----------------------------------------------------------------------------
00579 BOOL CGameLaBelleLucie::IsCardPlayable(int iPileIndex, int *piTryDest)
00580 {
00581    _ASSERT(piTryDest);
00582    BOOL bCanMove = FALSE;
00583    if(*piTryDest == -1)
00584    {
00585       // Go through the foundations to see if the card can be played to one of
00586       // them
00587       for(int i = 0; i < 4 && !bCanMove; i++)
00588       {
00589          int iTemp = i;
00590          bCanMove = IsCardPlayable(iPileIndex, &iTemp);
00591          if(bCanMove)
00592             *piTryDest = i;
00593       }
00594    } else
00595    {
00596       //See if the card can be played to the specified foundation
00597       CSolpackCardPtr spCard = GetCardFromData(m_apTopCards[iPileIndex]);
00598       if(!spCard)
00599          return FALSE;
00600
00601       long lRankSrc = 0;
00602       CHECKHRCOM(spCard->get_Rank(&lRankSrc));
00603
00604       long lNumCards = 0;
00605       CHECKHRCOM(m_apFoundations[*piTryDest]->get_NumCards(&lNumCards));
00606       if(lNumCards == 0)
00607       {
00608          // The foundation is empty, so the card can be moved if its an ace
00609          if(lRankSrc == RANK_ACE)
00610             bCanMove = TRUE;
00611       } else
00612       {
00613          // The foundation has card(s) in it
00614          CSolpackCardPtr spFoundTop;
00615          CHECKHRCOM(m_apFoundations[*piTryDest]->GetCard(lNumCards - 1, &spFoundTop));
00616
00617          // The card must be of the same suit
00618          long lSuitSrc = 0;
00619          long lSuitDest = 0;
00620          CHECKHRCOM(spCard->get_Suit(&lSuitSrc));
00621          CHECKHRCOM(spFoundTop->get_Suit(&lSuitDest));
00622          if(lSuitSrc == lSuitDest)
00623          {
00624             // The card's rank must be one higher than the foundation's top
00625             // card
00626             long lRankDest = 0;
00627             CHECKHRCOM(spFoundTop->get_Rank(&lRankDest));
00628             if(lRankDest + 1 == lRankSrc)
00629                bCanMove = TRUE;
00630          }
00631       }
00632    }
00633    return bCanMove;
00634 }
00635
00636
00637 //----------------------------------------------------------------------------
00638 //
00639 // InternalAutoPlayCard function
00640 //    Plays the specified card to a foundation, if possible.
00641 //
00642 // Parameters:
00643 //    iPileIndex:    The index of the pile whose top card is to be autoplayed.
00644 //    pCard:         The card to autoplay.
00645 //
00646 // Returns:          TRUE if the card was autoplayed, else FALSE.
00647 //
00648 //----------------------------------------------------------------------------
00649 BOOL CGameLaBelleLucie::InternalAutoPlayCard(int iPileIndex, ISolpackCard *pCard)
00650 {
00651    // If the card can be played to any foundation, find out which one
00652    int iDest = -1;
00653    if(!IsCardPlayable(iPileIndex, &iDest))
00654       return FALSE;
00655
00656    CSolpackFragmentPtr spFrag;
00657    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00658
00659    // Move the card and process its scoring
00660    CHECKHRCOM(spFrag->AddToFragment(pCard));
00661    ScoreCard(spFrag, iDest, pCard);
00662    AdjustSrcPile(iPileIndex);
00663
00664    return TRUE;
00665 }
00666
00667
00668 //----------------------------------------------------------------------------
00669 //
00670 // ScoreCard function
00671 //    Moves the fragment to the specified foundation and adjusts the score.
00672 //
00673 // Parameters:
00674 //    pFrag:         The fragment containing the card.
00675 //    iFoundIndex:   The index of the foundation to move the card to.
00676 //    pCard:         The card to score.
00677 //
00678 // Returns:          TRUE if the card was autoplayed, else FALSE.
00679 //
00680 //----------------------------------------------------------------------------
00681 void CGameLaBelleLucie::ScoreCard(ISolpackFragment *pFrag, int iFoundIndex, ISolpackCard *pCard)
00682 {
00683    // Increment the score
00684    IncrScore(1);
00685
00686    // Move the card to the specified foundation and disable dragging of it
00687    CHECKHRCOM(pCard->put_CanDrag(VARIANT_FALSE));
00688    CHECKHRCOM(pFrag->MoveToPile(m_apFoundations[iFoundIndex], -1, VARIANT_TRUE, VARIANT_FALSE));
00689
00690    // Check to see if we've won
00691    long lScore = 0;
00692    CHECKHRCOM(m_spApp->get_Score(&lScore));
00693    if(lScore == 52)
00694       CHECKHRCOM(m_spApp->GameWon());
00695 }
00696
00697
00698 //----------------------------------------------------------------------------
00699 //
00700 // AdjustSrcPile function
00701 //    Updates the pile's cached top card.
00702 //
00703 // Parameters:
00704 //    iPileIndex:    The index of the pile to adjust.
00705 //
00706 // Returns:          TRUE if the card was autoplayed, else FALSE.
00707 //
00708 //----------------------------------------------------------------------------
00709 void CGameLaBelleLucie::AdjustSrcPile(int iPileIndex)
00710 {
00711    // Get the new top card for the specified foundation pile and store it
00712    CSolpackCardPtr spNewTop;
00713    long lNumCards = 0;
00714    CHECKHRCOM(m_apPiles[iPileIndex]->get_NumCards(&lNumCards));
00715    if(lNumCards > 0)
00716    {
00717       // The new top card can be dragged
00718       CHECKHRCOM(m_apPiles[iPileIndex]->GetCard(lNumCards - 1, &spNewTop));
00719       CHECKHRCOM(spNewTop->put_CanDrag(VARIANT_TRUE));
00720    }
00721    PutCardInData(m_apTopCards[iPileIndex], spNewTop);
00722 }
00723
00724
00725 //----------------------------------------------------------------------------
00726 //
00727 // UpdatePilePositions function
00728 //    Repositions the tableau piles when their contents change.
00729 //
00730 // Parameters:       None.
00731 //
00732 // Returns:          None.
00733 //
00734 //----------------------------------------------------------------------------
00735 void CGameLaBelleLucie::UpdatePilePositions()
00736 {
00737    // Get the widths of a full foundation, and of fans with 1, 2, or 3 cards
00738    long lWidthFound = 0;
00739    CHECKHRCOM(m_apFoundations[0]->WidthWith(13, &lWidthFound));
00740    long alWidthFan[3];
00741    CHECKHRCOM(m_apPiles[0]->WidthWith(1, &alWidthFan[0]));
00742    CHECKHRCOM(m_apPiles[0]->WidthWith(2, &alWidthFan[1]));
00743    CHECKHRCOM(m_apPiles[0]->WidthWith(3, &alWidthFan[2]));
00744
00745    // 1. Go through each row of tableau piles and determine which one needs
00746    //    the most width.
00747    // 2. Determine the new x-spacing of each row
00748    // 3. Position each pile accordingly
00749    // Note: If we are currently dealing, assume piles have 3 cards
00750
00751    int i, j;
00752    long alWidthsReq[4];
00753    long acPiles[4];
00754    long acNonZeroPiles[4];
00755    long alPileWidths[4];
00756    long alNumCards[18];
00757    long alWidths[18];
00758    long lWidthReq = 0;
00759    for(i = 0; i < 4; i++)
00760    {
00761       alWidthsReq[i] = lWidthFound + (2*m_lSpacingX);
00762       alPileWidths[i] = 0;
00763       acNonZeroPiles[i] = 0;
00764       acPiles[i] = ((i == 0 || i == 1) ? 5 : 4);
00765       for(j = 0; j < acPiles[i]; j++)
00766       {
00767          int iCardIndex = j*4 + i;
00768          if(m_cCardsDealing > 0)
00769          {
00770             if(m_cCardsDealing > iCardIndex*3)
00771             {
00772                alNumCards[iCardIndex] = (m_cCardsDealing >= (iCardIndex+1)*3 ?
00773                   3 : m_cCardsDealing % 3);
00774                alWidths[iCardIndex] = alWidthFan[alNumCards[iCardIndex]-1];
00775                alWidthsReq[i] += alWidths[iCardIndex] + m_lSpacingX;
00776                alPileWidths[i] += alWidths[iCardIndex];
00777                acNonZeroPiles[i]++;
00778             } else
00779             {
00780                alNumCards[iCardIndex] = 0;
00781                alWidths[iCardIndex] = 0;
00782             }
00783          } else
00784          {
00785             CHECKHRCOM(m_apPiles[iCardIndex]->get_NumCards(&alNumCards[iCardIndex]));
00786             if(alNumCards[iCardIndex] > 0)
00787             {
00788                CHECKHRCOM(m_apPiles[iCardIndex]->get_Width(&alWidths[iCardIndex]));
00789                alWidthsReq[i] += alWidths[iCardIndex] + m_lSpacingX;
00790                alPileWidths[i] += alWidths[iCardIndex];
00791                acNonZeroPiles[i]++;
00792             } else
00793                alWidths[iCardIndex] = 0;
00794          }
00795       }
00796       if(alWidthsReq[i] > lWidthReq)
00797          lWidthReq = alWidthsReq[i];
00798    }
00799
00800    long lWidthTableau = lWidthReq - lWidthFound - m_lSpacingX;
00801    long lLeft = (m_lWindowWidth < lWidthReq ? 0 :
00802       ((m_lWindowWidth - lWidthReq) / 2));
00803
00804    // Position piles
00805    for(i = 0; i < 4; i++)
00806    {
00807       int newSpcX = (lWidthTableau - alPileWidths[i]) / (acNonZeroPiles[i] + 1);
00808       long lCurX = lLeft + m_lSpacingX;
00809       CHECKHRCOM(m_apFoundations[i]->put_X(lCurX));
00810       lCurX += lWidthFound;
00811       for(j = 0; j < acPiles[i]; j++)
00812       {
00813          int iCardIndex = j*4 + i;
00814          if(alWidths[iCardIndex] > 0)
00815          {
00816             lCurX += newSpcX;
00817             CHECKHRCOM(m_apPiles[iCardIndex]->put_X(lCurX));
00818             lCurX += alWidths[iCardIndex];
00819          } else
00820          {
00821             CHECKHRCOM(m_apPiles[iCardIndex]->put_X(-10-m_lCardWidth));
00822          }
00823       }
00824    }
00825 }
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameLaBelleLucie.h File Reference

#include "GameBase.h"

Go to the source code of this file.

Compounds

class | CGameLaBelleLucie

Defines

#define | AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameLaBelleLucie.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameLaBelleLucie.h Source File

GameLaBelleLucie.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameLaBelleLucie.h
00004 //    Class which implements the game La Belle Lucie.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "GameBase.h"
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CGameLaBelleLucie class
00026 //    Implements the game La Belle Lucie.
00027 //
00028 //----------------------------------------------------------------------------
00029 class CGameLaBelleLucie : public CGameBase
00030 {
00031 public:
00032    CGameLaBelleLucie(UINT uGameID, CGameInfo *pInfo);
00033    virtual ~CGameLaBelleLucie();
00034
00035    // ISolpackGame overrides
00036    STDMETHOD (Initialize)(ISolpackApp *pApp);
00037    STDMETHOD (Uninitialize)();
00038    STDMETHOD (Deal)();
00039    STDMETHOD (AutoPlay)();
00040    STDMETHOD (AutoPlayCard)(ISolpackCard *pCard);
00041    STDMETHOD (HandleCommand)(long lID);
00042    STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00043       ISolpackFragment *pFrag);
00044    STDMETHOD (DropFragment)(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00045       VARIANT_BOOL *pbValid);
00046
00047    static CGameBase* Create(UINT uGameID, CGameInfo *pInfo);
00048
00049 protected:
00050    void UpdateLayout();
00051    void DealRound();
00052    BOOL IsCardPlayable(int iPileIndex, int *piTryDest);
00053    BOOL InternalAutoPlayCard(int iPileIndex, ISolpackCard *pCard);
00054    void ScoreCard(ISolpackFragment *pFrag, int iFoundIndex, ISolpackCard *pCard);
00055    void AdjustSrcPile(int iPileIndex);
00056    void UpdatePilePositions();
00057
00058    CSolpackPileArray m_apPiles;           // The tableau piles
00059    CSolpackPileArray m_apFoundations;     // The foundation piles
00060    CSolpackGameDataArray m_apTopCards;    // Holds top cards of each pile
00061    CSolpackGameDataPtr m_pNumRounds;      // Holds number of rounds that have been dealt
00062    long m_cCardsDealing;                  // Number of card being dealt; 0 if not dealing
00063 };
00064
00065
00066 #endif // !defined(AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameLib.cpp File Reference

#include "stdafx.h"
#include "GameLib.h"
#include "GameSpider.h"
#include "GameLaBelleLucie.h"
#include "resource.h"
#include "..\SPGameLC\resource.h"

Go to the source code of this file.

Compounds

struct | CGameLib

Variables

HINSTANCE | g_hInstLC
ITypeLib * | g_pTypeLib

Variable Documentation

HINSTANCE g_hInstLC

Definition at line 24 of file GameLib.cpp.

Referenced by DllMain(), and InitModule().

ITypeLib* g_pTypeLib

Definition at line 25 of file GameLib.cpp.

Referenced by CGameLib::CreateInstance(), DllMain(), and CGameLib::InitGameLib().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameLib.cpp Source File

GameLib.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameLib.cpp
00004 //    Class which implements the game libary COM object. This is the only COM
00005 //    object exposed directly.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 //----------------------------------------------------------------------------
00011 // Includes
00012 //----------------------------------------------------------------------------
00013 #include "stdafx.h"
00014 #include "GameLib.h"
00015 #include "GameSpider.h"
00016 #include "GameLaBelleLucie.h"
00017 #include "resource.h"
00018 #include "..\SPGameLC\resource.h"
00019
00020
00021 //----------------------------------------------------------------------------
00022 // Global and external variables
00023 //----------------------------------------------------------------------------
00024 extern HINSTANCE g_hInstLC;   // Localized resources module handle
00025 extern ITypeLib *g_pTypeLib;  // The Solpack type library
00026
00027
00028 //----------------------------------------------------------------------------
00029 // Game creation functions and difficulties
00030 //----------------------------------------------------------------------------
00031 struct CGameLib::tagGAMEDATA CGameLib::s_aGameData[] =
00032 {
00033    { CGameSpider::Create,           DIFFICULTY_MEDIUM },
00034    { CGameLaBelleLucie::Create,     DIFFICULTY_HARD   }
00035 };
00036
00037
00038 //----------------------------------------------------------------------------
00039 //
00040 // CGameLib constructor
00041 //
00042 // Parameters:       None.
00043 //
00044 //----------------------------------------------------------------------------
00045 CGameLib::CGameLib()
00046 {
00047    // Set up member variables
00048    m_apGameInfo.SetRelease(TRUE);
00049    ODS("CGameLib constructor");
00050 }
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // CGameLib destructor
00056 //
00057 //----------------------------------------------------------------------------
00058 CGameLib::~CGameLib()
00059 {
00060    ODS("CGameLib destructor");
00061 }
00062
00063
00064 //----------------------------------------------------------------------------
00065 //
00066 // ISolpackGameLib::get_Author method
00067 //    Retrieves the name of the person or company who developed the game
00068 //    library.
00069 //
00070 // Parameters:
00071 //    p:             [out] Address of a string variable that receives the
00072 //                   author name.
00073 //
00074 // Returns:          A standard COM success or error value.
00075 //
00076 //----------------------------------------------------------------------------
00077 STDMETHODIMP CGameLib::get_Author(BSTR *p)
00078 {
00079    CHECKPTR(p);
00080    *p = NULL;
00081    try   // COM-called code
00082    {
00083       *p = CBSTR(IDS_COMPANY).Detach();
00084    }
00085    CATCHALL;
00086    return S_OK;
00087 }
00088
00089
00090 //----------------------------------------------------------------------------
00091 //
00092 // ISolpackGameLib::get_Email method
00093 //    Retrieves the e-mail address of the author.
00094 //
00095 // Parameters:
00096 //    p:             [out] Address of a string variable that receives the
00097 //                   author's e-mail address.
00098 //
00099 // Returns:          A standard COM success or error value.
00100 //
00101 //----------------------------------------------------------------------------
00102 STDMETHODIMP CGameLib::get_Email(BSTR *p)
00103 {
00104    CHECKPTR(p);
00105    *p = NULL;
00106    try   // COM-called code
00107    {
00108       *p = CBSTR(IDS_EMAIL).Detach();
00109    }
00110    CATCHALL;
00111    return S_OK;
00112 }
00113
00114
00115 //----------------------------------------------------------------------------
00116 //
00117 // ISolpackGameLib::get_WebSite method
00118 //    Retrieves the web site address of the author.
00119 //
00120 // Parameters:
00121 //    p:             [out] Address of a string variable that receives the
00122 //                   author's web site address.
00123 //
00124 // Returns:          A standard COM success or error value.
00125 //
00126 //----------------------------------------------------------------------------
00127 STDMETHODIMP CGameLib::get_WebSite(BSTR *p)
00128 {
00129    CHECKPTR(p);
00130    *p = NULL;
00131    try   // COM-called code
00132    {
00133       *p = CBSTR(IDS_WEBSITE).Detach();
00134    }
00135    CATCHALL;
00136    return S_OK;
00137 }
00138
00139
00140 //----------------------------------------------------------------------------
00141 //
00142 // ISolpackGameLib::get_NumGames method
00143 //    Retrieves the count of games implemented in the game library.
00144 //
00145 // Parameters:
00146 //    p:             [out] Address of a long integer variable that receives
00147 //                   the count of games.
00148 //
00149 // Returns:          A standard COM success or error value.
00150 //
00151 //----------------------------------------------------------------------------
00152 STDMETHODIMP CGameLib::get_NumGames(long *p)
00153 {
00154    CHECKPTR(p);
00155    *p = m_apGameInfo.GetSize();
00156    return S_OK;
00157 }
00158
00159
00160 //----------------------------------------------------------------------------
00161 //
00162 // ISolpackGameLib::GetGame method
00163 //    Creates and returns an instance of the specified game object.
00164 //
00165 // Parameters:
00166 //    lIndex:        [in] Long integer value specifying the zero-based index
00167 //                   of the game to create.
00168 //    ppGame:        [out] Address of a pointer to the ISolpackGame interface
00169 //                   of the game.
00170 //
00171 // Returns:          A standard COM success or error value.
00172 //
00173 //----------------------------------------------------------------------------
00174 STDMETHODIMP CGameLib::GetGame(long lIndex, ISolpackGame **ppGame)
00175 {
00176    // Ensure parameter is in range
00177    if((lIndex < 0) || (lIndex > m_apGameInfo.GetSize()))
00178       return E_INVALIDARG;
00179    CHECKPTR(ppGame);
00180    *ppGame = NULL;
00181
00182    try   // COM-called code
00183    {
00184       // Create the game object
00185       CGameBase *pNew = NULL;
00186       pNew = m_apGameInfo[lIndex]->CreateGame();
00187       ENSUREALLOC(pNew);
00188       pNew->AddRef();
00189       HRESULT hr = pNew->QueryInterface(IID_ISolpackGame, (LPVOID*)ppGame);
00190       SAFERELEASE(pNew);
00191       CHECKHRCOM(hr);
00192    }
00193    CATCHALL;
00194
00195    return S_OK;
00196 }
00197
00198
00199 //----------------------------------------------------------------------------
00200 //
00201 // ISolpackGameLib::GetGameInfo method
00202 //    Retrieves static information about the specified game.
00203 //
00204 // Parameters:
00205 //    lIndex:        [in] Long integer value specifying the zero-based index
00206 //                   of the game whose information to retrieve.
00207 //    ppGameInfo:    [out] Address of a pointer to the ISolpackGameInfo
00208 //                   interface of the game information object.
00209 //
00210 // Returns:          A standard COM success or error value.
00211 //
00212 //----------------------------------------------------------------------------
00213 STDMETHODIMP CGameLib::GetGameInfo(long lIndex, ISolpackGameInfo **ppGameInfo)
00214 {
00215    // Ensure parameter is in range
00216    if((lIndex < 0) || (lIndex > m_apGameInfo.GetSize()))
00217       return E_INVALIDARG;
00218    CHECKPTR(ppGameInfo);
00219
00220    return m_apGameInfo[lIndex]->QueryInterface(IID_ISolpackGameInfo, (LPVOID*)ppGameInfo);
00221 }
00222
00223
00224 //----------------------------------------------------------------------------
00225 //
00226 // INDUnknownAndDispatch::NDQueryInterface method
00227 //    Returns pointers to supported interfaces.
00228 //
00229 // Parameters:
00230 //    riid:          [in] Identifier of the interface being requested.
00231 //    ppvObject:     [out] Address of pointer variable that receives the
00232 //                   interface pointer requested in riid.
00233 //
00234 // Returns:          A standard COM success or error value.
00235 //
00236 //----------------------------------------------------------------------------
00237 STDMETHODIMP CGameLib::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00238 {
00239    if(IsEqualIID(riid, IID_ISolpackGameLib))
00240    {
00241       *ppvObject = (ISolpackGameLib*)this;
00242       (*(LPUNKNOWN*)ppvObject)->AddRef();
00243       return S_OK;
00244    } else
00245       return CDispBase::NDQueryInterface(riid, ppvObject);
00246 }
00247
00248
00249 //----------------------------------------------------------------------------
00250 //
00251 // CreateInstance function
00252 //    Creates an object of this type (CGameLib).
00253 //
00254 // Parameters:
00255 //    ppvObj:        [out] Address of pointer variable that receives an
00256 //                   IUnknown interface pointer of the newly-created object.
00257 //    pTypeLib:      [in] Type library used by this object.
00258 //
00259 // Returns:          A standard COM success or error value.
00260 //
00261 //----------------------------------------------------------------------------
00262 HRESULT CGameLib::CreateInstance(IUnknown **ppObj, ITypeLib *pTypeLib)
00263 {
00264    if(!ppObj)
00265       return E_POINTER;
00266
00267    // Store the type library pointer to be used by other objects
00268    g_pTypeLib = pTypeLib;
00269    g_pTypeLib->AddRef();
00270
00271    // Create the game library
00272    CGameLib *pNew = new CGameLib();
00273    if(!pNew)
00274       return E_OUTOFMEMORY;
00275
00276    // Set up the game library, appropriately handling any errors
00277    try
00278    {
00279       pNew->InitGameLib();
00280    }
00281    catch(COOMExcep *pE)
00282    {
00283       delete pNew;
00284       pE->Delete();
00285       return E_OUTOFMEMORY;
00286    }
00287    catch(CCOMExcep *pE)
00288    {
00289       delete pNew;
00290       HRESULT hr = pE->m_hr;
00291       pE->Delete();
00292       return hr;
00293    }
00294    catch(CExcep *pE)
00295    {
00296       delete pNew;
00297       pE->Delete();
00298       return E_FAIL;
00299    }
00300
00301    return pNew->QueryInterface(IID_IUnknown, (LPVOID*)ppObj);
00302 }
00303
00304
00305 //----------------------------------------------------------------------------
00306 //
00307 // InitGameLib function
00308 //    Sets up the game library object.
00309 //
00310 // Parameters:       None.
00311 //
00312 // Returns:          None.
00313 //
00314 //----------------------------------------------------------------------------
00315 void CGameLib::InitGameLib()
00316 {
00317    Init(g_pTypeLib, IID_ISolpackGameLib, (LPDISPATCH)((ISolpackGameLib*)this));
00318
00319    // Create and initialize the game info objects
00320    int cGames = ARRAYSIZE(s_aGameData);
00321    m_apGameInfo.SetSize(cGames);
00322    for(int i = 0; i < cGames; i++)
00323    {
00324       CGameInfo *pInfo = new CGameInfo(i+1, s_aGameData[i].lDifficulty,
00325          s_aGameData[i].pfnCreate);
00326       ENSUREALLOC(pInfo);
00327       pInfo->AddRef();
00328       m_apGameInfo.SetAt(i, pInfo);
00329       pInfo->InitGameInfo();
00330    }
00331 }
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameLib.h File Reference

#include <bmws_dispbase.h>
#include <bmws_array.h>
#include "..\SolpackTLB\SolpackIncl.h"
#include "GameInfo.h"

Go to the source code of this file.

Compounds

struct | CGameLib
struct | tagGAMEDATA

Defines

#define | AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 11 of file GameLib.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameLib.h Source File

GameLib.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameLib.h
00004 //    Class which implements the game libary COM object. This is the only COM
00005 //    object exposed directly.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #if !defined(AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00011 #define AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00012
00013 #if _MSC_VER > 1000
00014 #pragma once
00015 #endif // _MSC_VER > 1000
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Includes
00020 //----------------------------------------------------------------------------
00021 #include <bmws_dispbase.h>
00022 #include <bmws_array.h>
00023 #include "..\SolpackTLB\SolpackIncl.h"
00024 #include "GameInfo.h"
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // CGameLib class
00030 //    Implements the game library COM object.
00031 //
00032 //----------------------------------------------------------------------------
00033 class CGameLib : public CDispBase, public ISolpackGameLib
00034 {
00035 public:
00036    CGameLib();
00037    virtual ~CGameLib();
00038
00039    DECLARE_IUNKNOWN_AND_IDISPATCH;
00040
00041    // ISolpackGameLib methods
00042    STDMETHOD (get_Author)(BSTR *p);
00043    STDMETHOD (get_Email)(BSTR *p);
00044    STDMETHOD (get_WebSite)(BSTR *p);
00045    STDMETHOD (get_NumGames)(long *p);
00046    STDMETHOD (GetGame)(long lIndex, ISolpackGame **ppGame);
00047    STDMETHOD (GetGameInfo)(long lIndex, ISolpackGameInfo **ppGameInfo);
00048
00049    // INDUnknownAndDispatch override
00050    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00051
00052    static HRESULT CreateInstance(IUnknown **ppObj, ITypeLib *pTypeLib);
00053
00054    void InitGameLib();
00055
00056    //-------------------------------------------------------------------------
00057    // Game creation functions and difficulties
00058    //-------------------------------------------------------------------------
00059    static struct tagGAMEDATA
00060    {
00061       CREATEGAMEFN pfnCreate;    // Game creation pointer
00062       long lDifficulty;          // Difficulty ranking
00063    } s_aGameData[];
00064
00065 protected:
00066    CPtrArray<CGameInfo*, CGameInfo*> m_apGameInfo; // Game information objects
00067 };
00068
00069
00070 #endif // !defined(AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameMenu.cpp File Reference

#include "stdafx.h"
#include "GameMenu.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | GMEVENT_INSTR 0
#define | GMEVENT_PLAY 1

Variables

HWND | g_hWnd

Define Documentation

#define GMEVENT_INSTR 0

Definition at line 28 of file GameMenu.cpp.

Referenced by CGameMenu::EventHandler(), and CGameMenu::Init().

#define GMEVENT_PLAY 1

Definition at line 29 of file GameMenu.cpp.

Referenced by CGameMenu::EventHandler(), and CGameMenu::Init().

Variable Documentation

HWND g_hWnd

Definition at line 22 of file GameMenu.cpp.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameMenu.cpp Source File

GameMenu.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameMenu.cpp
00004 //    Class to encapsulate displaying and operating the Game Menu.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameMenu.h"
00014 #include <bmws_variant.h>
00015 #include "resource.h"
00016 #include "..\SolpckLC\resource.h"
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Global and external variables
00021 //----------------------------------------------------------------------------
00022 extern HWND g_hWnd;        // Main window handle
00023
00024
00025 //----------------------------------------------------------------------------
00026 // Game menu element event handler codes
00027 //----------------------------------------------------------------------------
00028 #define GMEVENT_INSTR      0     // Game Instructions
00029 #define GMEVENT_PLAY       1     // Play
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // CGameMenu constructor
00035 //
00036 // Parameters:       None.
00037 //
00038 //----------------------------------------------------------------------------
00039 CGameMenu::CGameMenu()
00040 {
00041    // Set initial values for member variables
00042    m_pSite = NULL;
00043    m_pSBMgr = NULL;
00044    m_pLibMgr = NULL;
00045    m_pHH = NULL;
00046    m_bActive = FALSE;
00047    m_iActiveLibIndex = 0;
00048    m_iActiveGameIndex = 0;
00049 }
00050
00051
00052 //----------------------------------------------------------------------------
00053 //
00054 // CGameMenu destructor
00055 //
00056 //----------------------------------------------------------------------------
00057 CGameMenu::~CGameMenu()
00058 {
00059 }
00060
00061
00062 //----------------------------------------------------------------------------
00063 //
00064 // Init function
00065 //    Binds the menu object to a HTML document and parent object.
00066 //
00067 // Parameters:
00068 //    pMsgProcessor: Interface to enable message processing.
00069 //    pSite:         Interface to notify of user actions.
00070 //    pSBMgr:        Interface to access and manipulate the status bar.
00071 //    pLibMgr:       The game library manager object to use.
00072 //    pHH:           The HTML helper object to use.
00073 //
00074 // Returns:          None.
00075 //
00076 //----------------------------------------------------------------------------
00077 void CGameMenu::Init(IMsgProcessor *pMsgProcessor, IGameMenuSite *pSite, IStatusBarMgr *pSBMgr,
00078                      CLibMgr *pLibMgr, CHTMLHelper *pHH)
00079 {
00080    // Set member variables' values
00081    _ASSERT(pSite);
00082    m_pSite = pSite;
00083    m_pSBMgr = pSBMgr;
00084    m_pLibMgr = pLibMgr;
00085    m_pHH = pHH;
00086
00087    int i;
00088
00089    // Create mouse clicked handlers for the game info pane links
00090    CEventHandler *pHandler = NULL;
00091    CVariant v;
00092
00093    // Game Instructions link
00094    pHandler = new CEventHandler((IEventHandlerSite*)this, GMEVENT_INSTR, 0);
00095    ENSUREALLOC(pHandler);
00096    v.vt = VT_DISPATCH;
00097    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00098    CHECKHRCOM(CHTMLElementPtr(TRUE,
00099       m_pHH->GetNamedEl(IDS_EL_MENUINSTR, IID_IHTMLElement))->put_onclick(v));
00100    VariantClear(&v);
00101
00102    // Play link
00103    pHandler = new CEventHandler((IEventHandlerSite*)this, GMEVENT_PLAY, 0);
00104    ENSUREALLOC(pHandler);
00105    v.vt = VT_DISPATCH;
00106    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00107    CHECKHRCOM(CHTMLElementPtr(TRUE,
00108       m_pHH->GetNamedEl(IDS_EL_MENUPLAY, IID_IHTMLElement))->put_onclick(v));
00109    VariantClear(&v);
00110
00111    // Load difficulty strings
00112    m_alpszDiff.SetSize(3);
00113    for(i = 0; i < 3; i++)
00114       m_alpszDiff[i].Assign(IDS_DIFFICULTY_EASY + i);
00115
00116    // Load strings for menu item images (spade.gif, etc.)
00117    m_alpszImgs.SetSize(4);
00118    for(i = 0; i < 4; i++)
00119       m_alpszImgs[i].Assign(IDS_IMG_SPADE + i);
00120
00121    Refresh(pMsgProcessor);
00122
00123    m_pHH->ShowElementEx(IDS_EL_MENUPANE, TRUE);
00124 }
00125
00126
00127 //----------------------------------------------------------------------------
00128 //
00129 // Uninit function
00130 //    Releases any HTML document-specific resources, such as event handlers.
00131 //
00132 // Parameters:       None.
00133 //
00134 // Returns:          None.
00135 //
00136 //----------------------------------------------------------------------------
00137 void CGameMenu::Uninit()
00138 {
00139    CVariant v;
00140    v.vt = VT_NULL;
00141    CHECKHRCOM(CHTMLElementPtr(TRUE,
00142       m_pHH->GetNamedEl(IDS_EL_MENUINSTR, IID_IHTMLElement))->put_onclick(v));
00143    CHECKHRCOM(CHTMLElementPtr(TRUE,
00144       m_pHH->GetNamedEl(IDS_EL_MENUPLAY, IID_IHTMLElement))->put_onclick(v));
00145
00146    m_apItems.SetSize(0);
00147    m_pHH = NULL;
00148 }
00149
00150
00151 //----------------------------------------------------------------------------
00152 //
00153 // Show function
00154 //    Shows or hides the game menu.
00155 //
00156 // Parameters:
00157 //    bShow:         TRUE to show the menu, or FALSE to hide it.
00158 //
00159 // Returns:          None.
00160 //
00161 //----------------------------------------------------------------------------
00162 void CGameMenu::Show(BOOL bShow)
00163 {
00164    if(!m_pHH)
00165       return;
00166
00167    // Show or hide the game menu
00168    m_bActive = bShow;
00169    m_pHH->ShowElementEx(IDS_EL_GAMEMENU, bShow);
00170 }
00171
00172
00173 //----------------------------------------------------------------------------
00174 //
00175 // GetActiveLib function
00176 //    Retrieves the index of the library containing the selected game.
00177 //
00178 // Parameters:       None.
00179 //
00180 // Returns:          The index of the library containing the selected game.
00181 //
00182 //----------------------------------------------------------------------------
00183 int CGameMenu::GetActiveLib()
00184 {
00185    return m_iActiveLibIndex;
00186 }
00187
00188
00189 //----------------------------------------------------------------------------
00190 //
00191 // GetActiveGame function
00192 //    Retrieves the index of the selected game within its library.
00193 //
00194 // Parameters:       None.
00195 //
00196 // Returns:          The index of the selected game.
00197 //
00198 //----------------------------------------------------------------------------
00199 int CGameMenu::GetActiveGame()
00200 {
00201    return m_iActiveGameIndex;
00202 }
00203
00204
00205 //----------------------------------------------------------------------------
00206 //
00207 // IGameMenuItemSite::ItemClicked method
00208 //    Called when a menu item is clicked.
00209 //
00210 // Parameters:
00211 //    pItem:         The menu item that was clicked.
00212 //    iLibIndex:     Zero-based index of the library containing the game.
00213 //    iGameIndex:    Zero-based index of the game within its library.
00214 //
00215 // Returns:          None.
00216 //
00217 //----------------------------------------------------------------------------
00218 void CGameMenu::ItemClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex)
00219 {
00220    m_iActiveLibIndex = iLibIndex;
00221    m_iActiveGameIndex = iGameIndex;
00222    FillGameInfo();
00223    m_pSite->ActiveGameChanged();
00224 }
00225
00226
00227 //----------------------------------------------------------------------------
00228 //
00229 // IGameMenuItemSite::ItemDblClicked method
00230 //    Called when a menu item is double clicked.
00231 //
00232 // Parameters:
00233 //    pItem:         The menu item that was double clicked.
00234 //    iLibIndex:     Zero-based index of the library containing the game.
00235 //    iGameIndex:    Zero-based index of the game within its library.
00236 //
00237 // Returns:          None.
00238 //
00239 //----------------------------------------------------------------------------
00240 void CGameMenu::ItemDblClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex)
00241 {
00242    m_pSite->GameSelected(iLibIndex, iGameIndex);
00243 }
00244
00245
00246 //----------------------------------------------------------------------------
00247 //
00248 // IEventHandlerSite::EventHandler method
00249 //    Handles events that are trapped via a CEventHandler object.
00250 //
00251 // Parameters:
00252 //    dwEventID:     The type of event that occurred (GMIEVENT_*)
00253 //    lParam:        Unused.
00254 //
00255 // Returns:          None.
00256 //
00257 //----------------------------------------------------------------------------
00258 void CGameMenu::EventHandler(DWORD dwEventID, LPARAM lParam)
00259 {
00260    try   // Windows-called code
00261    {
00262       // Cancel the event from bubbling
00263       m_pHH->CancelEvent();
00264
00265       switch(dwEventID)
00266       {
00267          case GMEVENT_INSTR:
00268             m_pSite->ToggleShowRules();
00269             break;
00270          case GMEVENT_PLAY:
00271             m_pSite->GameSelected(m_iActiveLibIndex, m_iActiveGameIndex);
00272             break;
00273       }
00274    }
00275    catch(CExcep *pE)
00276    {
00277       pE->Report();
00278       pE->Delete();
00279    }
00280 }
00281
00282
00283 //----------------------------------------------------------------------------
00284 //
00285 // Refresh function
00286 //    Recreates the game menu.
00287 //
00288 // Parameters:
00289 //    pMsgProcessor: Interface to enable message processing.
00290 //
00291 // Returns:          None.
00292 //
00293 //----------------------------------------------------------------------------
00294 void CGameMenu::Refresh(IMsgProcessor *pMsgProcessor)
00295 {
00296    int i;
00297    int cItemsOld = m_apItems.GetSize();
00298    m_apItems.SetSize(0);
00299
00300    // Get number of total games
00301    int cTotalGames = m_pLibMgr->GetNumGames(-1);
00302    m_apItems.SetSize(cTotalGames);
00303    m_pHH->ShowElementEx(IDS_EL_MENUPANE, cTotalGames > 0);
00304
00305    // Retrieve the HTML element that gets filled with menu items
00306    CPtr<IHTMLTable, &IID_IHTMLTable> spTable(TRUE, m_pHH->GetNamedEl(IDS_EL_MENUHOLDER,
00307       IID_IHTMLTable));
00308
00309    // Clear the table
00310    for(i = 0; i < cItemsOld; i++)
00311    {
00312       CHECKHRCOM(spTable->deleteRow(0));
00313    }
00314
00315    // Setup the progress bar
00316    int cGamesSoFar = 0;
00317    m_pSBMgr->SBUpdateTasks(cTotalGames, 0);
00318    m_pSBMgr->SBSetText(CTSTR(IDS_STATUS_INITMENU));
00319
00320    // Process each registered game library
00321    int cLibs = m_pLibMgr->GetNumLibs();
00322    for(i = 0; i < cLibs; i++)
00323    {
00324       // Process each game in each library
00325       int cGames = m_pLibMgr->GetNumGames(i);
00326       for(int j = 0; j < cGames; j++)
00327       {
00328          // Create the game menu item for the game
00329          CGameMenuItem *pItem = new CGameMenuItem((IGameMenuItemSite*)this, m_pHH, i, j);
00330          ENSUREALLOC(pItem);
00331          m_apItems.SetAt(cGamesSoFar, pItem);
00332
00333          // Retrieve the game's title, which is used as the text of the link
00334          CPtr<ISolpackGameInfo, &IID_ISolpackGameInfo> spInfo(TRUE, m_pLibMgr->GetGameInfo(i,
00335             j));
00336          CBSTR bstr;
00337          CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00338          pItem->Init(spTable, CTSTR(bstr), m_alpszImgs[(cGamesSoFar)%4]);
00339
00340          cGamesSoFar++;
00341
00342          // Update status bar progress
00343          m_pSBMgr->SBUpdateTasks(0, 1);
00344
00345          // Let Windows process messages to keep program responsive
00346          pMsgProcessor->EmptyMessageQueue(TRUE);
00347       }
00348    }
00349
00350    // Clear the status bar message
00351    m_pSBMgr->SBSetText(CTSTR());
00352
00353    if(cTotalGames > 0)
00354    {
00355       FillGameInfo();
00356       m_pSite->ActiveGameChanged();
00357    }
00358 }
00359
00360
00361 //----------------------------------------------------------------------------
00362 //
00363 // FillGameInfo function
00364 //    Fills the game/library information pane based on the current library
00365 //    and game indices.
00366 //
00367 // Parameters:       None.
00368 //
00369 // Returns:          None.
00370 //
00371 //----------------------------------------------------------------------------
00372 void CGameMenu::FillGameInfo()
00373 {
00374    if(m_iActiveLibIndex >= m_pLibMgr->GetNumLibs())
00375       return;
00376
00377    CBSTR bstr;
00378    long l;
00379    CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA;
00380
00381    // Get the library that contains this game
00382    CPtr<ISolpackGameLib, &IID_ISolpackGameLib> spLib(TRUE, m_pLibMgr->GetLib(m_iActiveLibIndex));
00383
00384    CHECKHRCOM(spLib->get_Author(bstr.Addr()));
00385    m_pHH->SetElText(IDS_EL_MENULIBAUTHOR, bstr);
00386    bstr = NULL;
00387
00388    // Set the e-mail link
00389    CHECKHRCOM(spLib->get_Email(bstr.Addr()));
00390    m_pHH->SetElText(IDS_EL_MENULIBEMAIL, bstr);
00391    CTSTR lpszEmailHolder(IDS_MAILTOPROTOCOL);
00392    CTSTR lpszEmail(bstr);
00393    CTSTR lpszEmailTotal(TRUE, lpszEmail.Len() + lstrlen(lpszEmailHolder) + 1);
00394    wsprintf(lpszEmailTotal, lpszEmailHolder, lpszEmail);
00395    spA.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_MENULIBEMAIL, IID_IHTMLAnchorElement));
00396    CHECKHRCOM(spA->put_href(CBSTR(lpszEmailTotal)));
00397    bstr = NULL;
00398
00399    // Set the web site link
00400    CHECKHRCOM(spLib->get_WebSite(bstr.Addr()));
00401    m_pHH->SetElText(IDS_EL_MENULIBWEBSITE, bstr);
00402    spA.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_MENULIBWEBSITE, IID_IHTMLAnchorElement));
00403    CHECKHRCOM(spA->put_href(bstr));
00404    bstr = NULL;
00405
00406    // Get the game info for this game
00407    CPtr<ISolpackGameInfo, &IID_ISolpackGameInfo> spInfo(TRUE,
00408       m_pLibMgr->GetGameInfo(m_iActiveLibIndex, m_iActiveGameIndex));
00409
00410    // Set the game title
00411    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00412    m_pHH->SetElText(IDS_EL_MENUGAME, bstr);
00413
00414    // Set the difficulty string
00415    CHECKHRCOM(spInfo->get_Difficulty(&l));
00416    if(l < DIFFICULTY_EASY || l > DIFFICULTY_HARD)
00417       l = DIFFICULTY_MEDIUM;
00418    m_pHH->SetElText(IDS_EL_MENUDIFFICULTY, CBSTR(m_alpszDiff[l-1]));
00419 }
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameMenu.h File Reference

#include "ProcessMsg.h"
#include "StatusBarMgr.h"
#include "GameMenuItem.h"
#include "LibMgr.h"
#include <bmws_htmlhelpers.h>
#include <bmws_stringarray.h>

Go to the source code of this file.

Compounds

class | CGameMenu
class | IGameMenuSite

Defines

#define | AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameMenu.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameMenu.h Source File

GameMenu.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameMenu.h
00004 //    Class to encapsulate displaying and operating the Game Menu.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "ProcessMsg.h"
00021 #include "StatusBarMgr.h"
00022 #include "GameMenuItem.h"
00023 #include "LibMgr.h"
00024 #include <bmws_htmlhelpers.h>
00025 #include <bmws_stringarray.h>
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // IGameMenuSite abstract class
00031 //    Enables the main window to handle game menu notifications.
00032 //
00033 //----------------------------------------------------------------------------
00034 class IGameMenuSite
00035 {
00036 public:
00037    virtual void GameSelected(int iLibIndex, int iGameIndex) = 0;
00038    virtual void ToggleShowRules() = 0;
00039    virtual void ActiveGameChanged() = 0;
00040 };
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CGameMenu class
00046 //    Encapsulates displaying and operating the Game Menu.
00047 //
00048 //----------------------------------------------------------------------------
00049 class CGameMenu : public IGameMenuItemSite, public IEventHandlerSite
00050 {
00051 public:
00052    CGameMenu();
00053    virtual ~CGameMenu();
00054
00055    void Init(IMsgProcessor *pMsgProcessor, IGameMenuSite *pSite, IStatusBarMgr *pSBMgr,
00056       CLibMgr *pLibMgr, CHTMLHelper *pHH);
00057    void Uninit();
00058    void Show(BOOL bShow);
00059    void Refresh(IMsgProcessor *pMsgProcessor);
00060    int GetActiveLib();
00061    int GetActiveGame();
00062
00063    // IGameMenuItemSite methods
00064    void ItemClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex);
00065    void ItemDblClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex);
00066
00067    // IEventHandlerSite method
00068    void EventHandler(DWORD dwEventID, LPARAM lParam);
00069
00070 protected:
00071    void FillGameInfo();
00072
00073    IGameMenuSite *m_pSite;    // Main window interface
00074    IStatusBarMgr *m_pSBMgr;   // Status bar interface
00075    CLibMgr *m_pLibMgr;        // Library manager object
00076    CHTMLHelper *m_pHH;        // HTML helper object
00077    BOOL m_bActive;            // Whether the menu is currently activated
00078
00079    CTSTRArray m_alpszImgs;    // Image file names
00080    CPtrArray<CGameMenuItem*, CGameMenuItem*> m_apItems;  // Game menu item objects
00081
00082    CTSTRArray m_alpszDiff;    // Difficulty strings
00083    int m_iActiveLibIndex;     // Library index for active item
00084    int m_iActiveGameIndex;    // Game index for active item
00085 };
00086
00087
00088 #endif // !defined(AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameMenuItem.cpp File Reference

#include "stdafx.h"
#include "GameMenuItem.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | GMIEVENT_CLICKED 0
#define | GMIEVENT_DBLCLICKED 1

Define Documentation

#define GMIEVENT_CLICKED 0

Definition at line 22 of file GameMenuItem.cpp.

Referenced by CGameMenuItem::EventHandler(), and CGameMenuItem::Init().

#define GMIEVENT_DBLCLICKED 1

Definition at line 23 of file GameMenuItem.cpp.

Referenced by CGameMenuItem::EventHandler(), and CGameMenuItem::Init().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameMenuItem.cpp Source File

GameMenuItem.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameMenuItem.cpp
00004 //    Class to encapsulate a single game listed in the Game Menu.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameMenuItem.h"
00014 #include <bmws_variant.h>
00015 #include "resource.h"
00016 #include "..\SolpckLC\resource.h"
00017
00018
00019 //----------------------------------------------------------------------------
00020 // Game menu item element event handler codes
00021 //----------------------------------------------------------------------------
00022 #define GMIEVENT_CLICKED      0     // Link was clicked
00023 #define GMIEVENT_DBLCLICKED   1     // Link was double clicked
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CGameMenuItem constructor
00029 //
00030 // Parameters:
00031 //    pSite:         Interface to notify of user actions.
00032 //    pHH:           The HTML helper object to use.
00033 //    iLibIndex:     Zero-based index of the library containing this game.
00034 //    iGameIndex:    Zero-based index of this game within its library.
00035 //
00036 //----------------------------------------------------------------------------
00037 CGameMenuItem::CGameMenuItem(IGameMenuItemSite *pSite, CHTMLHelper *pHH, int iLibIndex,
00038                              int iGameIndex)
00039 {
00040    // Initialize member variables
00041    _ASSERT(pSite);
00042    m_pSite = pSite;
00043    m_pHH = pHH;
00044    m_iLibIndex = iLibIndex;
00045    m_iGameIndex = iGameIndex;
00046 }
00047
00048
00049 //----------------------------------------------------------------------------
00050 //
00051 // CGameMenuItem destructor
00052 //
00053 //----------------------------------------------------------------------------
00054 CGameMenuItem::~CGameMenuItem()
00055 {
00056    if(m_spEl)
00057    {
00058       // Clear event handlers
00059       CVariant v;
00060       v.vt = VT_NULL;
00061       m_spEl->put_onclick(v);
00062       m_spEl->put_ondblclick(v);
00063    }
00064 }
00065
00066
00067 //----------------------------------------------------------------------------
00068 //
00069 // Init function
00070 //    Creates the HTML UI for the menu item.
00071 //
00072 // Parameters:
00073 //    spTable:       The HTML table element in which to add the menu item.
00074 //    lpszGameTitle: The display name for the game.
00075 //    lpszImg:       The image to display.
00076 //
00077 // Returns:          None.
00078 //
00079 //----------------------------------------------------------------------------
00080 void CGameMenuItem::Init(CPtr<IHTMLTable, &IID_IHTMLTable>& spTable, CTSTR& lpszGameTitle,
00081                          CTSTR& lpszImg)
00082 {
00083    // A game menu item creates a row in the menu TABLE element. This row,
00084    // containing one cell, then contains a link (an A element) containing an
00085    // IMG and a SPAN with the title.
00086
00087    // Add the table row and cell
00088    CDispatchPtr spDispRow;
00089    CHECKHRCOM(spTable->insertRow(-1, &spDispRow));
00090
00091    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(spDispRow);
00092    CDispatchPtr spDispCell;
00093    CHECKHRCOM(spRow->insertCell(-1, &spDispCell));
00094
00095    CHTMLElement2Ptr spEl2Cell(spDispCell);
00096
00097    // Create the link element
00098    m_spEl.Assign(TRUE, m_pHH->CreateElement(IDS_TAG_A, IID_IHTMLElement));
00099    CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA(m_spEl);
00100    CHECKHRCOM(spA->put_href(CBSTR(TEXT(""))));
00101
00102    // Set the link's contents
00103    CTSTR lpszCellFormatter(IDS_MENUCELL);
00104    CTSTR lpszCell(TRUE, lpszCellFormatter.Len() + lpszImg.Len() + lpszGameTitle.Len() + 8);
00105    wsprintf(lpszCell, lpszCellFormatter, lpszImg, lpszGameTitle);
00106    CHECKHRCOM(m_spEl->put_innerHTML(CBSTR(lpszCell)));
00107
00108    // Add the link element to the HTML table cell
00109    CHECKHRCOM(spEl2Cell->insertAdjacentElement(CBSTR(TEXT("beforeEnd")), m_spEl, NULL));
00110
00111    // Create event handlers for the link
00112    CEventHandler *pHandler = NULL;
00113    CVariant v;
00114
00115    // Mouse clicked handler
00116    pHandler = new CEventHandler((IEventHandlerSite*)this, GMIEVENT_CLICKED, 0);
00117    ENSUREALLOC(pHandler);
00118    v.vt = VT_DISPATCH;
00119    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00120    CHECKHRCOM(m_spEl->put_onclick(v));
00121    VariantClear(&v);
00122
00123    // Mouse double clicked handler
00124    pHandler = new CEventHandler((IEventHandlerSite*)this, GMIEVENT_DBLCLICKED, 0);
00125    ENSUREALLOC(pHandler);
00126    v.vt = VT_DISPATCH;
00127    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00128    CHECKHRCOM(m_spEl->put_ondblclick(v));
00129    VariantClear(&v);
00130 }
00131
00132
00133 //----------------------------------------------------------------------------
00134 //
00135 // IEventHandlerSite::EventHandler method
00136 //    Handles events that are trapped via a CEventHandler object.
00137 //
00138 // Parameters:
00139 //    dwEventID:     The type of event that occurred (GMIEVENT_*)
00140 //    lParam:        Unused.
00141 //
00142 // Returns:          None.
00143 //
00144 //----------------------------------------------------------------------------
00145 void CGameMenuItem::EventHandler(DWORD dwEventID, LPARAM lParam)
00146 {
00147    try   // Windows-called code
00148    {
00149       // Cancel the event from bubbling
00150       m_pHH->CancelEvent();
00151
00152       switch(dwEventID)
00153       {
00154          case GMIEVENT_CLICKED:
00155             // Tell the menu that a game link was clicked
00156             m_pSite->ItemClicked(this, m_iLibIndex, m_iGameIndex);
00157             break;
00158
00159          case GMIEVENT_DBLCLICKED:
00160             // Tell the menu that a game link was double clicked
00161             m_pSite->ItemDblClicked(this, m_iLibIndex, m_iGameIndex);
00162             break;
00163       }
00164    }
00165    catch(CExcep *pE)
00166    {
00167       pE->Report();
00168       pE->Delete();
00169    }
00170 }
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameMenuItem.h File Reference

#include <bmws_eventhandler.h>
#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class | CGameMenuItem
class | IGameMenuItemSite

Defines

#define | AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameMenuItem.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameMenuItem.h Source File

GameMenuItem.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameMenuItem.h
00004 //    Class to encapsulate a single game listed in the Game Menu.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_eventhandler.h>
00021 #include <bmws_htmlhelpers.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 // Forward declaration
00026 //----------------------------------------------------------------------------
00027 class CGameMenuItem;
00028
00029
00030 //----------------------------------------------------------------------------
00031 //
00032 // IGameMenuItemSite abstract class
00033 //    Enables the game menu to handle menu item notifications.
00034 //
00035 //----------------------------------------------------------------------------
00036 class IGameMenuItemSite
00037 {
00038 public:
00039    virtual void ItemClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex) = 0;
00040    virtual void ItemDblClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex) = 0;
00041 };
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // CGameMenuItem class
00047 //    Encapsulates a single game listed in the Game Menu. Handles HTML element
00048 //    events by sending them to the game menu.
00049 //
00050 //----------------------------------------------------------------------------
00051 class CGameMenuItem : public IEventHandlerSite
00052 {
00053 public:
00054    CGameMenuItem(IGameMenuItemSite *pSite, CHTMLHelper *pHH, int iLibIndex, int iGameIndex);
00055    virtual ~CGameMenuItem();
00056
00057    void Init(CPtr<IHTMLTable, &IID_IHTMLTable>& spTable, CTSTR& lpszGameTitle, CTSTR& lpszImg);
00058
00059    // IEventHandlerSite method
00060    void EventHandler(DWORD dwEventID, LPARAM lParam);
00061
00062 protected:
00063    IGameMenuItemSite *m_pSite;   // Game Menu object interface
00064    CHTMLHelper *m_pHH;           // HTML helper object
00065    int m_iLibIndex;              // Index of the game library to which this game belongs
00066    int m_iGameIndex;             // Index within the library of this game
00067    CHTMLElementPtr m_spEl;       // Link element
00068 };
00069
00070
00071 #endif // !defined(AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:06 2002 for Solitaire Pack by doxygen 1.2.15


GameSpider.cpp File Reference

#include "stdafx.h"
#include "GameSpider.h"
#include "..\SPGameLC\resource.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameSpider.cpp Source File

GameSpider.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameSpider.cpp
00004 //    Class which implements the game Spider.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "GameSpider.h"
00014 #include "..\SPGameLC\resource.h"
00015
00016
00017 //----------------------------------------------------------------------------
00018 //
00019 // CGameSpider constructor
00020 //
00021 // Parameters:
00022 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00023 //    pInfo:         The information object for this game.
00024 //
00025 //----------------------------------------------------------------------------
00026 CGameSpider::CGameSpider(UINT uGameID, CGameInfo *pInfo) : CGameBase(uGameID, pInfo)
00027 {
00028    ODS("CGameSpider constructor");
00029
00030    // Signify that the contained pointers are COM interface pointers that
00031    // should be released, not deleted, when destroyed.
00032    m_apPiles.SetRelease(TRUE);
00033    m_apFoundations.SetRelease(TRUE);
00034    m_apTopCards.SetRelease(TRUE);
00035    m_apBottomCards.SetRelease(TRUE);
00036 }
00037
00038
00039 //----------------------------------------------------------------------------
00040 //
00041 // CGameSpider destructor
00042 //
00043 //----------------------------------------------------------------------------
00044 CGameSpider::~CGameSpider()
00045 {
00046    ODS("CGameSpider destructor");
00047 }
00048
00049
00050 //----------------------------------------------------------------------------
00051 //
00052 // ISolpackGame::Initialize method
00053 //    Sets up decks and piles for the game.
00054 //
00055 // Parameters:
00056 //    pApp:          [in] A pointer to the ISolpackApp interface of the
00057 //                   Solpack engine object.
00058 //
00059 // Returns:          A standard COM success or error value.
00060 //
00061 //----------------------------------------------------------------------------
00062 STDMETHODIMP CGameSpider::Initialize(ISolpackApp *pApp)
00063 {
00064    ENSUREBASE(CGameBase::Initialize(pApp));
00065    ODS("CGameSpider::Initialize");
00066
00067    try   // COM-called code
00068    {
00069       CHECKHRCOM(m_spApp->CreateGameData(&m_pNumPilesGone));
00070       PutLongInData(m_pNumPilesGone, 0);
00071
00072       CreateDeck(&m_spDeck2);
00073       CHECKHRCOM(m_spApp->CreatePile(PILE_STACK, &m_spStock));
00074
00075       int i;
00076
00077       // Create and sest up tableau piles
00078       m_apPiles.SetSize(10);
00079       m_apTopCards.SetSize(10);
00080       m_apBottomCards.SetSize(10);
00081       for(i = 0; i < 10; i++)
00082       {
00083          CHECKHRCOM(m_spApp->CreatePile(PILE_TABLEAUDOWN, &m_apPiles[i]));
00084          CHECKHRCOM(m_spApp->CreateGameData(&m_apTopCards[i]));
00085          CHECKHRCOM(m_spApp->CreateGameData(&m_apBottomCards[i]));
00086          PutCardInData(m_apTopCards[i], NULL);
00087          PutCardInData(m_apBottomCards[i], NULL);
00088       }
00089
00090       // Create and set up foundations
00091       m_apFoundations.SetSize(8);
00092       for(i = 0; i < 8; i++)
00093       {
00094          CHECKHRCOM(m_spApp->CreatePile(PILE_STACK, &m_apFoundations[i]));
00095          CHECKHRCOM(m_apFoundations[i]->put_BaseType(BASE_NONE));
00096       }
00097
00098       // Position the piles
00099       UpdateLayout();
00100    }
00101    CATCHALL;
00102    return S_OK;
00103 }
00104
00105
00106 //----------------------------------------------------------------------------
00107 //
00108 // ISolpackGame::Uninitialize method
00109 //    Releases all created objects and prepares for destruction.
00110 //
00111 // Parameters:       None.
00112 //
00113 // Returns:          A standard COM success or error value.
00114 //
00115 //----------------------------------------------------------------------------
00116 STDMETHODIMP CGameSpider::Uninitialize()
00117 {
00118    CGameBase::Uninitialize();
00119    ODS("CGameSpider::Uninitialize");
00120
00121    m_spDeck2.Release();
00122    m_spStock.Release();
00123    m_apPiles.SetSize(0);
00124    m_apFoundations.SetSize(0);
00125    m_apTopCards.SetSize(0);
00126    m_apBottomCards.SetSize(0);
00127    m_pNumPilesGone.Release();
00128    return S_OK;
00129 }
00130
00131
00132 //----------------------------------------------------------------------------
00133 //
00134 // ISolpackGame::Deal method
00135 //    Deals out a game of Solitaire.
00136 //
00137 // Parameters:       None.
00138 //
00139 // Returns:          A standard COM success or error value.
00140 //
00141 //----------------------------------------------------------------------------
00142 STDMETHODIMP CGameSpider::Deal()
00143 {
00144    ENSUREBASE(CGameBase::Deal());
00145    ODS("CGameSpider::Deal");
00146
00147    try   // COM-called code
00148    {
00149       // Reset the game
00150       PutLongInData(m_pNumPilesGone, 0);
00151
00152       // Combine the two decks and shuffle
00153       CSolpackFragmentPtr spFrag;
00154       CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00155       CHECKHRCOM(spFrag->AddToFragment(m_spDeck2));
00156       CHECKHRCOM(spFrag->MoveToPile(m_spDeck, -1, VARIANT_FALSE, VARIANT_FALSE));
00157       CHECKHRCOM(m_spDeck->Shuffle());
00158
00159       // Deal the ten piles
00160       for(int i = 0; i < 54; i++)
00161       {
00162          long l = i % 10;
00163          CSolpackCardPtr spCard;
00164          CHECKHRCOM(m_spDeck->GetCard(0, &spCard));
00165
00166          CHECKHRCOM(spFrag->AddToFragment(spCard));
00167          if(i >= 44)
00168          {
00169             DealCard(l, spCard);
00170             PutCardInData(m_apBottomCards[l], spCard);
00171          }
00172          CHECKHRCOM(spFrag->MoveToPile(m_apPiles[l], -1, VARIANT_TRUE,
00173             (i >= 44 ? VARIANT_TRUE : VARIANT_FALSE)));
00174       }
00175
00176       // Move the remainder of the deck to the stock
00177       CHECKHRCOM(spFrag->AddToFragment(m_spDeck));
00178       CHECKHRCOM(spFrag->MoveToPile(m_spStock, -1, VARIANT_FALSE, VARIANT_FALSE));
00179
00180       // Set the stock's tooltip
00181       CHECKHRCOM(m_spStock->put_CommentTooltip(CBSTR(IDS_COMMENT_SPIDERSTOCK)));
00182       CHECKHRCOM(m_spStock->put_ShowNumCardsTooltip(VARIANT_TRUE));
00183    }
00184    CATCHALL;
00185
00186    return S_OK;
00187 }
00188
00189
00190 //----------------------------------------------------------------------------
00191 //
00192 // ISolpackGame::PileClicked method
00193 //    Informs the game that a pile was single-clicked.
00194 //
00195 // Parameters:
00196 //    pPile:         [in] A pointer to the ISolpackPile interface of the pile
00197 //                   the user clicked.
00198 //    pCard:         [in] A pointer to the ISolpackCard interface of the
00199 //                   specific card that the user clicked. This will be NULL if
00200 //                   the pile is empty, or if the user clicked on an area
00201 //                   within the pile boundaries but outside of any specific
00202 //                   card.
00203 //
00204 // Returns:          A standard COM success or error value.
00205 //
00206 //----------------------------------------------------------------------------
00207 STDMETHODIMP CGameSpider::PileClicked(ISolpackPile *pPile, ISolpackCard *pCard)
00208 {
00209    ENSUREBASE(CGameBase::PileClicked(pPile, pCard));
00210    ODS("CGameSpider::PileClicked");
00211
00212    try   // COM-called code
00213    {
00214       if(ObjectsEqual(m_spStock, pPile))
00215       {
00216          // The stock was clicked
00217          CSolpackFragmentPtr spFrag;
00218          CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00219
00220          // Deal a row of cards from the stock to the tableau
00221          long lNumCards;
00222          CHECKHRCOM(m_spStock->get_NumCards(&lNumCards));
00223          for(int i = 0; i < 10 && i < lNumCards; i++)
00224          {
00225             CSolpackCardPtr spCard;
00226             CHECKHRCOM(m_spStock->GetCard(lNumCards - i - 1, &spCard));
00227             CHECKHRCOM(spFrag->AddToFragment(spCard));
00228             if(!DealCard(i, spCard))
00229                PutCardInData(m_apBottomCards[i], spCard);
00230             CHECKHRCOM(spFrag->MoveToPile(m_apPiles[i], -1, VARIANT_TRUE, VARIANT_TRUE));
00231             CheckPile(i);
00232          }
00233          if(lNumCards <= 10)
00234          {
00235             // There are no more cards left in the stock, so remove tooltips
00236             CHECKHRCOM(m_spStock->put_CommentTooltip(NULL));
00237             CHECKHRCOM(m_spStock->put_ShowNumCardsTooltip(VARIANT_FALSE));
00238          }
00239          return S_OK;
00240       }
00241
00242       if(!pCard)
00243          return S_OK;   // Some empty pile was clicked, return
00244
00245       // If the card is already face up, return
00246       VARIANT_BOOL bFaceUp = VARIANT_FALSE;
00247       CHECKHRCOM(pCard->get_FaceUp(&bFaceUp));
00248       if(bFaceUp == VARIANT_TRUE)
00249          return S_OK;
00250
00251       // Find out whether the card clicked is the top card of a pile
00252       int cTops = m_apTopCards.GetSize();
00253       for(int i = 0; i < cTops; i++)
00254       {
00255          CSolpackCardPtr spCardTop = GetCardFromData(m_apTopCards[i]);
00256          if(ObjectsEqual(spCardTop, pCard))
00257          {
00258             // Turn the card face up
00259             CHECKHRCOM(spCardTop->put_FaceUp(VARIANT_TRUE));
00260             CHECKHRCOM(spCardTop->put_CanDrag(VARIANT_TRUE));
00261             PutCardInData(m_apBottomCards[i], spCardTop);
00262             return S_OK;
00263          }
00264       }
00265    }
00266    CATCHALL;
00267
00268    return S_OK;
00269 }
00270
00271
00272 //----------------------------------------------------------------------------
00273 //
00274 // ISolpackGame::SetupFragment method
00275 //    Informs the game that a pile was single-clicked.
00276 //
00277 // Parameters:
00278 //    pPileSrc:      [in] A pointer to the ISolpackPile interface of the pile
00279 //                   from which the user is dragging.
00280 //    pCardSrc:      [in] A pointer to the ISolpackCard interface of the
00281 //                   specific card that the user wants to drag.
00282 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00283 //                   fragment to hold cards to drag.
00284 //
00285 // Returns:          A standard COM success or error value.
00286 //
00287 //----------------------------------------------------------------------------
00288 STDMETHODIMP CGameSpider::SetupFragment(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00289                                       ISolpackFragment *pFrag)
00290 {
00291    ENSUREBASE(CGameBase::SetupFragment(pPileSrc, pCardSrc, pFrag));
00292    ODS("CGameSpider::SetupFragment");
00293
00294    try   // COM-called code
00295    {
00296       // In order to be dragged, the source pile must be a tableau pile and
00297       // the card must be between the pile's top card and its "bottom" card,
00298       // inclusive. If the top card was passed, just add that card. Otherwise
00299       // add the entire draggable chunk to the fragment.
00300
00301       for(int i = 0; i < 10; i++)
00302       {
00303          if(ObjectsEqual(pCardSrc, GetCardFromData(m_apTopCards[i])))
00304          {
00305             // Some top card was dragged
00306             CHECKHRCOM(pFrag->AddToFragment(pCardSrc));
00307             m_spDragSrc.Assign(pPileSrc);
00308             return S_OK;
00309          }
00310          if(ObjectsEqual(pPileSrc, m_apPiles[i]))
00311          {
00312             // Some non-top card was dragged.
00313             long lIndexBottom = 0;
00314             long lIndexDrag = 0;
00315             CHECKHRCOM(GetCardFromData(m_apBottomCards[i])->get_Index(&lIndexBottom));
00316             CHECKHRCOM(pCardSrc->get_Index(&lIndexDrag));
00317
00318             // Find out if the card is within the draggable chunk
00319             if(lIndexDrag >= lIndexBottom)
00320             {
00321                long lIndexTop;
00322                CHECKHRCOM(GetCardFromData(m_apTopCards[i])->get_Index(&lIndexTop));
00323                for(int j = lIndexBottom; j <= lIndexTop; j++)
00324                {
00325                   CSolpackCardPtr spCard;
00326                   CHECKHRCOM(pPileSrc->GetCard(j, &spCard));
00327                   CHECKHRCOM(pFrag->AddToFragment(spCard));
00328                }
00329                m_spDragSrc.Assign(pPileSrc);
00330             }
00331             return S_OK;
00332          }
00333       }
00334    }
00335    CATCHALL;
00336
00337    return S_OK;
00338 }
00339
00340
00341 //----------------------------------------------------------------------------
00342 //
00343 // ISolpackGame::DropFragment method
00344 //    If possible, drops the cards from the specified fragment onto the
00345 //    specified pile.
00346 //
00347 // Parameters:
00348 //    pFrag:         [in] A pointer to the ISolpackFragment interface of the
00349 //                   fragment containing the card(s) being dragged.
00350 //    pPileDest:     [in] A pointer to the ISolpackPile interface of the pile
00351 //                   onto which the user has dropped the fragment.
00352 //    pbValid:       [in] The address of a VARIANT_BOOL variable that receives
00353 //                   whether the cards were dropped.
00354 //
00355 // Returns:          A standard COM success or error value.
00356 //
00357 //----------------------------------------------------------------------------
00358 STDMETHODIMP CGameSpider::DropFragment(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00359                                        VARIANT_BOOL *pbValid)
00360 {
00361    ENSUREBASE(CGameBase::DropFragment(pFrag, pPileDest, pbValid));
00362    ODS("CGameSpider::DropFragment");
00363
00364    try   // COM-called code
00365    {
00366       // There must be at least one card in the fragment
00367       long lNumCards;
00368       CHECKHRCOM(pFrag->get_NumCards(&lNumCards));
00369       if(lNumCards < 1)
00370          return S_OK;
00371
00372       // Get the bottommost card in the fragment
00373       CSolpackCardPtr spCardFrag;
00374       CHECKHRCOM(pFrag->GetCard(0, &spCardFrag));
00375
00376       // Find out which piles the card(s) came from and are going to
00377       int iSrc = -1;
00378       int iDest = -1;
00379       for(int i = 0; i < 10 && (iSrc == -1 || iDest == -1); i++)
00380       {
00381          if(ObjectsEqual(m_spDragSrc, m_apPiles[i]))
00382             iSrc = i;
00383          if(ObjectsEqual(pPileDest, m_apPiles[i]))
00384             iDest = i;
00385       }
00386
00387       // Note: iSrc should never be -1. But if iDest is -1, they we are trying
00388       // to drop cards on a non-tableau pile, so return.
00389       if(iSrc == -1 || iDest == -1)
00390          return S_OK;
00391
00392       long lIncr = 0;
00393       CSolpackCardPtr spCardTop = GetCardFromData(m_apTopCards[iDest]);
00394       if(spCardTop)
00395       {
00396          // We're trying to drop card(s) on other cards
00397          if(DoesCardFollow(spCardTop, spCardFrag))
00398          {
00399             // The move is valid
00400             *pbValid = VARIANT_TRUE;
00401
00402             // Determine how many points to give
00403             if(DoesCardFollow(spCardTop, spCardFrag, TRUE))
00404             {
00405                // Dest:  [spCardTop-1][spCardTop][spCardFrag][spCardFrag+1]...[NewTopOfPile]
00406                // Determine if the former top of pile will get a point
00407                long lIndexTop = 0;
00408                CHECKHRCOM(spCardTop->get_Index(&lIndexTop));
00409                if(lIndexTop == 0)
00410                   lIncr++;
00411                else
00412                {
00413                   CSolpackCardPtr spCardBeforeTop;
00414                   CHECKHRCOM(m_apPiles[iDest]->GetCard(lIndexTop - 1, &spCardBeforeTop));
00415                   if(!DoesCardFollow(spCardBeforeTop, spCardTop, TRUE))
00416                      lIncr++;
00417                }
00418                if(lNumCards == 1)
00419                   lIncr++;
00420             }
00421          }
00422       } else
00423          // Can always move onto an empty pile
00424          *pbValid = VARIANT_TRUE;
00425
00426       if(*pbValid == VARIANT_TRUE)
00427       {
00428          // Some valid move occurred
00429          CSolpackCardPtr spNewTop;
00430          CHECKHRCOM(pFrag->GetCard(lNumCards-1, &spNewTop));
00431          CHECKHRCOM(pFrag->MoveToPile(pPileDest, -1, VARIANT_TRUE, VARIANT_FALSE));
00432          AdjustAfterSuccess(iSrc);
00433
00434          // Figure out whether we broke up a chunk such that points need to be
00435          // subracted from the score
00436          CSolpackCardPtr spTopSrc = GetCardFromData(m_apTopCards[iSrc]);
00437          if(DoesCardFollow(spTopSrc, spCardFrag, TRUE))  // we broke up a pile
00438          {
00439             long lIndexSrc = 0;
00440             CHECKHRCOM(spTopSrc->get_Index(&lIndexSrc));
00441             if(lIndexSrc > 0)
00442             {
00443                CSolpackCardPtr spBeforeSrc;
00444                CHECKHRCOM(m_apPiles[iSrc]->GetCard(lIndexSrc - 1, &spBeforeSrc));
00445                if(!DoesCardFollow(spBeforeSrc, spTopSrc, TRUE))
00446                   lIncr--;
00447             } else
00448                lIncr--;
00449             if(lNumCards == 1)
00450                lIncr--;
00451          }
00452          AdjustAfterSuccess(iDest);
00453          m_spDragSrc.Release();
00454
00455          // Update the score and check if we've assembled a complete pile
00456          if(lIncr != 0)
00457             IncrScore(lIncr);
00458          CheckPile(iDest);
00459       }
00460    }
00461    CATCHALL;
00462
00463    return S_OK;
00464 }
00465
00466
00467 //----------------------------------------------------------------------------
00468 //
00469 // Create function
00470 //    Creates an instance of the game object.
00471 //
00472 // Parameters:
00473 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00474 //    pInfo:         The information object for this game.
00475 //
00476 // Returns:          A pointer to the newly created game object.
00477 //
00478 //----------------------------------------------------------------------------
00479 CGameBase* CGameSpider::Create(UINT uGameID, CGameInfo *pInfo)
00480 {
00481    return (CGameBase*)(new CGameSpider(uGameID, pInfo));
00482 }
00483
00484
00485 //----------------------------------------------------------------------------
00486 //
00487 // UpdateLayout function
00488 //    Positions pile objects appropriately.
00489 //
00490 // Parameters:
00491 //    uGameID:       The identifier of this game, taken from GameIDs.h.
00492 //    pInfo:         The information object for this game.
00493 //
00494 // Returns:          A pointer to the newly created game object.
00495 //
00496 //----------------------------------------------------------------------------
00497 void CGameSpider::UpdateLayout()
00498 {
00499    // Figure out the dimensions of the full stock
00500    long lHeightStock = 0;
00501    CHECKHRCOM(m_spStock->HeightWith(54, &lHeightStock));
00502    long lStockExtra = lHeightStock - m_lCardHeight;
00503    if(lStockExtra > (m_lSpacingY / 2))
00504       lStockExtra += (m_lSpacingY / 2);
00505    else
00506       lStockExtra = m_lSpacingY;
00507
00508    // Calculate where the "left edge" of the tableau should be so that the
00509    // entire tableau is centered horizontally
00510    long lWidthNeeded = (10 * m_lCardWidth) + (12 * m_lSpacingX);
00511    long lLeft = (m_lWindowWidth < lWidthNeeded ? 0 :
00512       ((m_lWindowWidth / 2) - (lWidthNeeded / 2)));
00513
00514    // Position the stock
00515    CHECKHRCOM(m_spStock->put_X(lLeft + m_lSpacingX));
00516    CHECKHRCOM(m_spStock->put_Y(m_lSpacingY));
00517
00518    // Position the tableau piles
00519    int i;
00520    for(i = 0; i < 10; i++)
00521    {
00522       CHECKHRCOM(m_apPiles[i]->put_X(lLeft + m_lSpacingX + (i * (m_lSpacingX + m_lCardWidth))));
00523       CHECKHRCOM(m_apPiles[i]->put_Y(m_lSpacingY + m_lCardHeight + lStockExtra));
00524    }
00525
00526    // Position the foundation piles
00527    for(i = 0; i < 8; i++)
00528    {
00529       CHECKHRCOM(m_apFoundations[i]->put_X
00530          (lLeft + m_lSpacingX + ((i + 2) * (m_lSpacingX + m_lCardWidth))));
00531       CHECKHRCOM(m_apFoundations[i]->put_Y(m_lSpacingY));
00532    }
00533 }
00534
00535
00536 //----------------------------------------------------------------------------
00537 //
00538 // DealCard function
00539 //    Deals the specified card to the specified tableau pile, updating game
00540 //    data objects, setting CanDrag, and checking for points to score.
00541 //
00542 // Parameters:
00543 //    m:             The index of the tableau pile on which to deal the card.
00544 //    pInfo:         The card to deal.
00545 //
00546 // Returns:          TRUE if some points were scored, else FALSE.
00547 //
00548 //----------------------------------------------------------------------------
00549 BOOL CGameSpider::DealCard(long m, ISolpackCard *pCard)
00550 {
00551    _ASSERT(pCard);
00552
00553    // Determine whether the movement scores points.
00554    // Combining two single cards gives two points. Combining a single card
00555    // with an existing chunk gives one point. Otherwise, zero points.
00556    long lIncr = 0;
00557    CSolpackCardPtr spTop = GetCardFromData(m_apTopCards[m]);
00558    if(spTop)
00559    {
00560       if(DoesCardFollow(spTop, pCard, TRUE))
00561       {
00562          long lIndexTop = 0;
00563          CHECKHRCOM(spTop->get_Index(&lIndexTop));
00564          if(lIndexTop > 0)
00565          {
00566             CSolpackCardPtr spCardBeforeTop;
00567             CHECKHRCOM(m_apPiles[m]->GetCard(lIndexTop - 1, &spCardBeforeTop));
00568             if(DoesCardFollow(spCardBeforeTop, spTop, TRUE))
00569                lIncr--;
00570          }
00571          lIncr += 2;
00572          IncrScore(lIncr);
00573       }
00574    }
00575
00576    // Set the card's dragability and store it as the top card of the pile
00577    pCard->put_CanDrag(VARIANT_TRUE);
00578    PutCardInData(m_apTopCards[m], pCard);
00579
00580    // Return whether or not points were scored
00581    return (lIncr > 0);
00582 }
00583
00584
00585 //----------------------------------------------------------------------------
00586 //
00587 // DoesCardFollow function
00588 //    Tests whether the specified card can follow the existing one.
00589 //
00590 // Parameters:
00591 //    pCardExist:    The card that is already in place.
00592 //    pCardFollower: The card to test for validity after pCardExist.
00593 //    bMatchSuits:   TRUE if the cards must be of the same suit, else FALSE.
00594 //
00595 // Returns:          TRUE if the card can follow, else FALSE.
00596 //
00597 //----------------------------------------------------------------------------
00598 BOOL CGameSpider::DoesCardFollow(ISolpackCard *pCardExist, ISolpackCard *pCardFollower,
00599                                  BOOL bMatchSuits)
00600 {
00601    // Must have two card objects
00602    if(!pCardExist || !pCardFollower)
00603       return FALSE;
00604
00605    // In place card must be face up
00606    VARIANT_BOOL bFaceUp;
00607    CHECKHRCOM(pCardExist->get_FaceUp(&bFaceUp));
00608    if(bFaceUp != VARIANT_TRUE)
00609       return FALSE;
00610
00611    // If we need to check for matching suits, do so
00612    if(bMatchSuits)
00613    {
00614       long lSuitExist = 0;
00615       long lSuitFollower = 0;
00616       CHECKHRCOM(pCardExist->get_Suit(&lSuitExist));
00617       CHECKHRCOM(pCardFollower->get_Suit(&lSuitFollower));
00618       if(lSuitExist != lSuitFollower)
00619          return FALSE;
00620    }
00621
00622    // Rank of existing must be one more than rank of follower
00623    long lRankExist = 0;
00624    long lRankFollower = 0;
00625    CHECKHRCOM(pCardExist->get_Rank(&lRankExist));
00626    CHECKHRCOM(pCardFollower->get_Rank(&lRankFollower));
00627    return(lRankFollower == lRankExist - 1);
00628 }
00629
00630
00631 //----------------------------------------------------------------------------
00632 //
00633 // AdjustAfterSuccess function
00634 //    Reassigns top and bottom cards after cards were removed from a pile and
00635 //    possibly added to another.
00636 //
00637 // Parameters:
00638 //    iSrc:          Index of the pile from which cards were removed.
00639 //
00640 // Returns:          None.
00641 //
00642 //----------------------------------------------------------------------------
00643 void CGameSpider::AdjustAfterSuccess(int iSrc)
00644 {
00645    // Determine how many cards are in the pile
00646    long lNumCards = 0;
00647    CHECKHRCOM(m_apPiles[iSrc]->get_NumCards(&lNumCards));
00648    CSolpackCardPtr spCardTop;
00649    CSolpackCardPtr spCardBottom;
00650    if(lNumCards > 0)
00651    {
00652       // There are still cards in the pile
00653       CHECKHRCOM(m_apPiles[iSrc]->GetCard(lNumCards - 1, &spCardTop));
00654       spCardBottom = spCardTop;
00655
00656       // Figure out what card is the "bottom" of the draggable chunk
00657       for(long l = 2; l <= lNumCards; l++)
00658       {
00659          CSolpackCardPtr spCard;
00660          CHECKHRCOM(m_apPiles[iSrc]->GetCard(lNumCards - l, &spCard));
00661          if(DoesCardFollow(spCard, spCardBottom, TRUE))
00662          {
00663             spCardBottom = spCard;
00664          } else
00665             break;
00666       }
00667    }
00668
00669    // Store the top and bottom card pointers
00670    PutCardInData(m_apTopCards[iSrc], spCardTop);
00671    PutCardInData(m_apBottomCards[iSrc], spCardBottom);
00672 }
00673
00674
00675 //----------------------------------------------------------------------------
00676 //
00677 // CheckPile function
00678 //    Checks to see if the given pile contains a complete sequence of 13
00679 //    cards. If so, they are removed.
00680 //
00681 // Parameters:
00682 //    m:             The index of the tableau pile to check.
00683 //
00684 // Returns:          None.
00685 //
00686 //----------------------------------------------------------------------------
00687 void CGameSpider::CheckPile(long m)
00688 {
00689    // There must be at least 13 cards in the pile
00690    long lNumCards = 0;
00691    CHECKHRCOM(m_apPiles[m]->get_NumCards(&lNumCards));
00692    if(lNumCards < 13)
00693       return;
00694
00695    long cPilesGone = GetLongFromData(m_pNumPilesGone);
00696    long lCount = RANK_ACE;
00697    long lSuit = 0;
00698
00699    // Get the topmost card
00700    CSolpackCardPtr spCard;
00701    CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - lCount, &spCard));
00702    CHECKHRCOM(spCard->get_Suit(&lSuit));
00703
00704    // Go through the next 13 cards, stopping when an incorrect card is found
00705    BOOL bOkSoFar = TRUE;
00706    while(lCount <= 13)
00707    {
00708       spCard.Release();
00709       CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - lCount, &spCard));
00710
00711       // Card must be face up
00712       VARIANT_BOOL bFaceUp = VARIANT_FALSE;
00713       CHECKHRCOM(spCard->get_FaceUp(&bFaceUp));
00714       if(bFaceUp == VARIANT_FALSE)
00715          return;
00716
00717       // Cards must be of same suit
00718       long lSuitNew = 0;
00719       CHECKHRCOM(spCard->get_Suit(&lSuitNew));
00720       if(lSuit != lSuitNew)
00721          return;
00722
00723       // Ranks must be ascending
00724       long lRank = 0;
00725       CHECKHRCOM(spCard->get_Rank(&lRank));
00726       if(lRank != lCount)
00727          return;
00728
00729       lCount++;
00730    }
00731
00732    // We have thirteen cards in order, so put them in the fragment
00733    CSolpackFragmentPtr spFrag;
00734    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00735    for(long l = 13; l > 0; l--)
00736    {
00737       CSolpackCardPtr spCard;
00738       CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - l, &spCard));
00739       CHECKHRCOM(spFrag->AddToFragment(spCard));
00740       spCard->put_CanDrag(VARIANT_FALSE);
00741    }
00742
00743    // Move them to the next available "foundation" above the tableau
00744    CHECKHRCOM(spFrag->MoveToPile(m_apFoundations[cPilesGone], -1, VARIANT_TRUE, VARIANT_FALSE));
00745    cPilesGone++;
00746    PutLongInData(m_pNumPilesGone, cPilesGone);
00747    AdjustAfterSuccess(m);
00748
00749    // Check whether all eight sets are gone
00750    if(cPilesGone == 8)
00751       CHECKHRCOM(m_spApp->GameWon());
00752 }
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


GameSpider.h File Reference

#include "GameBase.h"

Go to the source code of this file.

Compounds

class | CGameSpider

Defines

#define | AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file GameSpider.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


GameSpider.h Source File

GameSpider.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // GameSpider.h
00004 //    Class which implements the game Spider.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "GameBase.h"
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CGameSpider class
00026 //    Implements the game Spider.
00027 //
00028 //----------------------------------------------------------------------------
00029 class CGameSpider : public CGameBase
00030 {
00031 public:
00032    CGameSpider(UINT uGameID, CGameInfo *pInfo);
00033    virtual ~CGameSpider();
00034
00035    // ISolpackGame overrides
00036    STDMETHOD (Initialize)(ISolpackApp *pApp);
00037    STDMETHOD (Uninitialize)();
00038    STDMETHOD (Deal)();
00039    STDMETHOD (PileClicked)(ISolpackPile *pPile, ISolpackCard *pCard);
00040    STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc, ISolpackCard *pCardSrc,
00041       ISolpackFragment *pFrag);
00042    STDMETHOD (DropFragment)(ISolpackFragment *pFrag, ISolpackPile *pPileDest,
00043       VARIANT_BOOL *pbValid);
00044
00045    static CGameBase* Create(UINT uGameID, CGameInfo *pInfo);
00046
00047 protected:
00048    void UpdateLayout();
00049    BOOL DealCard(long m, ISolpackCard *pCard);
00050    BOOL DoesCardFollow(ISolpackCard *pCardExist, ISolpackCard *pCardFollower,
00051       BOOL bMatchSuits = FALSE);
00052    void AdjustAfterSuccess(int iSrc);
00053    void CheckPile(long m);
00054
00055    CSolpackPilePtr m_spDeck2;             // The second deck used in Spider
00056    CSolpackPilePtr m_spStock;             // The stock pile
00057    CSolpackPileArray m_apPiles;           // The tableau piles
00058    CSolpackPileArray m_apFoundations;     // The foundation piles
00059    CSolpackGameDataArray m_apTopCards;    // Holds top cards of each pile
00060    CSolpackGameDataArray m_apBottomCards; // Holds bottom cards of each pile's top draggable unit
00061    CSolpackGameDataPtr m_pNumPilesGone;   // Holds number of piles that have been removed
00062 };
00063
00064
00065 #endif // !defined(AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


Solpack/Helpers.cpp File Reference

Helpers.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SolpckLC\resource.h"
#include <bmws_error.cpp>
#include <bmws_registry.cpp>
#include <bmws_waitcursor.cpp>
#include <bmws_formatdouble.cpp>
#include <bmws_choosecolor.cpp>
#include <bmws_resurl.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 13 of file Solpack/Helpers.cpp.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


Helpers.cpp Source File

Helpers.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Helpers.cpp
00004 //    Includes miscellaneous component source files.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include "resource.h"
00011 #include "..\SolpckLC\resource.h"
00012
00013 extern HINSTANCE g_hInst;
00014
00015 #include <bmws_error.cpp>
00016 #include <bmws_registry.cpp>
00017 #include <bmws_waitcursor.cpp>
00018 #include <bmws_formatdouble.cpp>
00019 #include <bmws_choosecolor.cpp>
00020 #include <bmws_resurl.cpp>
00021 #ifdef BMWS_TRACKMEMALLOC
00022 #include <bmws_trackmemalloc.cpp>
00023 #include <bmws_pointer.cpp>
00024 #endif
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


SPGames/Helpers.cpp File Reference

Helpers.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SPGameLC\resource.h"
#include <bmws_error.cpp>
#include <bmws_registry.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 6 of file SPGames/Helpers.cpp.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


Helpers.cpp Source File

Helpers.cpp

Go to the documentation of this file.
00001
00002 #include "stdafx.h"
00003 #include "resource.h"
00004 #include "..\SPGameLC\resource.h"
00005
00006 extern HINSTANCE g_hInst;
00007
00008 #include <bmws_error.cpp>
00009 #include <bmws_registry.cpp>
00010 #ifdef BMWS_TRACKMEMALLOC
00011 #include <bmws_trackmemalloc.cpp>
00012 #endif
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


HelpPane.cpp File Reference

#include "stdafx.h"
#include "HelpPane.h"
#include <bmws_waitcursor.h>
#include <commctrl.h>
#include <exdispid.h>
#include <bmws_resurl.h>
#include <bmws_window_res_lc.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | CXY_SPLITTER 4
#define | ID_HELPPANEREBAR 6000

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Define Documentation

#define CXY_SPLITTER 4

Definition at line 33 of file HelpPane.cpp.

Referenced by CHelpPane::OnSize().

#define ID_HELPPANEREBAR 6000

Definition at line 39 of file HelpPane.cpp.

Referenced by CHelpPane::OnCreate(), and CHelpPane::OnNotify().

Variable Documentation

HINSTANCE g_hInst

Definition at line 26 of file HelpPane.cpp.

Referenced by CHelpPane::OnCreate(), and CHelpPane::UpdateColors().

HINSTANCE g_hInstLC

Definition at line 27 of file HelpPane.cpp.

Referenced by CHelpPane::OnCreatePane().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


HelpPane.cpp Source File

HelpPane.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // HelpPane.cpp
00004 //    Class to encapsulate the Instructions pane.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "HelpPane.h"
00014 #include <bmws_waitcursor.h>
00015 #include <commctrl.h>
00016 #include <exdispid.h>
00017 #include <bmws_resurl.h>
00018 #include <bmws_window_res_lc.h>
00019 #include "resource.h"
00020 #include "..\SolpckLC\resource.h"
00021
00022
00023 //----------------------------------------------------------------------------
00024 // Global and external variables
00025 //----------------------------------------------------------------------------
00026 extern HINSTANCE g_hInst;        // Application instance handle
00027 extern HINSTANCE g_hInstLC;      // Localized resources module handle
00028
00029
00030 //----------------------------------------------------------------------------
00031 // Height of resize border
00032 //----------------------------------------------------------------------------
00033 #define CXY_SPLITTER    4
00034
00035
00036 //----------------------------------------------------------------------------
00037 // Window ID for the rebar
00038 //----------------------------------------------------------------------------
00039 #define ID_HELPPANEREBAR   6000
00040
00041
00042 BOOL CHelpPane::s_bRegistered = FALSE; // Initially, window class has not been registered
00043
00044
00045 //----------------------------------------------------------------------------
00046 //
00047 // CHelpPane constructor
00048 //
00049 // Parameters:       None.
00050 //
00051 //----------------------------------------------------------------------------
00052 CHelpPane::CHelpPane()
00053 {
00054    // Set initial values for member variables
00055    m_pBrowserContainer = NULL;
00056    m_pHH = NULL;
00057    m_pRebar = NULL;
00058    m_pXTB = NULL;
00059    m_pPane = NULL;
00060    m_hFont = NULL;
00061    m_bResizing = FALSE;
00062 }
00063
00064
00065 //----------------------------------------------------------------------------
00066 //
00067 // CHelpPane destructor
00068 //
00069 //----------------------------------------------------------------------------
00070 CHelpPane::~CHelpPane()
00071 {
00072    // Destroy all window objects
00073    if(m_pXTB)
00074    {
00075       HIMAGELIST himl = (HIMAGELIST)m_pXTB->SendMessage(TB_GETIMAGELIST, 0, 0);
00076       if(himl)
00077          ImageList_Destroy(himl);
00078    }
00079    SAFEDELETE(m_pXTB);
00080    SAFEDELETE(m_pPane);
00081    SAFEDELETE(m_pRebar);
00082 }
00083
00084
00085 //----------------------------------------------------------------------------
00086 //
00087 // Register function
00088 //    Registers the bar and pane classes with Windows.
00089 //
00090 // Parameters:       None.
00091 //
00092 // Returns:          None.
00093 //
00094 // Throws:           Exception if the class could not be registered.
00095 //
00096 //----------------------------------------------------------------------------
00097 void CHelpPane::Register()
00098 {
00099    // Load the class names; register the classes, if not already registered.
00100    m_lpszClassName.Assign(IDS_BARCLASSNAME);
00101    m_lpszPaneClass.Assign(IDS_PANECLASSNAME);
00102
00103    if(s_bRegistered)
00104       return;
00105
00106    RegisterWindowClass(m_lpszClassName, CS_SAVEBITS, (WNDPROC)BarWndProc, NULL,
00107       (HBRUSH)(COLOR_3DFACE+1), NULL, LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS)));
00108    RegisterWindowClass(m_lpszPaneClass, 0, (WNDPROC)PaneWndProc, NULL, (HBRUSH)(COLOR_WINDOW+1),
00109       NULL);
00110
00111    s_bRegistered = TRUE;
00112 }
00113
00114
00115 //----------------------------------------------------------------------------
00116 //
00117 // Create function
00118 //    Creates the help bar window.
00119 //
00120 // Parameters:
00121 //    hwndParent:    Handle to the parent for the bar window.
00122 //
00123 // Returns:          TRUE or FALSE: whether the window was successfully
00124 //                   created or not.
00125 //
00126 //----------------------------------------------------------------------------
00127 BOOL CHelpPane::Create(HWND hwndParent)
00128 {
00129    CreateWindowEx(WS_EX_TOOLWINDOW, m_lpszClassName, NULL, WS_CHILD |
00130       WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 0, 0, hwndParent, NULL,
00131       (LPVOID)this);
00132
00133    return TRUE;
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // BarWndProc function
00140 //    Callback function that handles messages to the help pane.
00141 //
00142 // Parameters:
00143 //    hWnd:          The main window handle.
00144 //    uMsg:          Message identifer.
00145 //    wParam:        Message-specific parameter.
00146 //    lParam:        Message-specific parameter.
00147 //
00148 // Returns:
00149 //    Depends on the message. If the message was not handled, the return value
00150 //    of DefWindowProc will be returned.
00151 //
00152 //----------------------------------------------------------------------------
00153 LRESULT CALLBACK CHelpPane::BarWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00154 {
00155    // Retrieve "this" pointer from window handle
00156    CHelpPane *pThis = (CHelpPane*)GetWindowLong(hWnd, GWL_USERDATA);
00157
00158    try   // Windows-called code
00159    {
00160       switch(uMsg)
00161       {
00162          // Called before the window is created.
00163          case WM_NCCREATE:
00164             // Store the "this" pointer with the window handle
00165             pThis = (CHelpPane*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00166             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00167             pThis->m_hWnd = hWnd;
00168             return TRUE;
00169
00170          // Called when the window is created
00171          case WM_CREATE:
00172             return (pThis->OnCreate() ? 0 : -1);
00173
00174          // Called when the user is sizing the window
00175          case WM_SIZE:
00176             pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00177             return 0;
00178
00179          // Called when system color settings have changed
00180          case WM_SYSCOLORCHANGE:
00181             pThis->UpdateColors(wParam, lParam);
00182             break;
00183
00184          // Called when the Close toolbar button is clicked
00185          case WM_COMMAND:
00186             if(LOWORD(wParam) == IDM_HELP_GAMEINSTRUCTIONS)
00187             {
00188                ::SendMessage(GetParent(pThis->m_hWnd), WM_COMMAND, wParam, lParam);
00189                return 0;
00190             }
00191             break;
00192
00193          // Called when a common control event occurs
00194          case WM_NOTIFY:
00195             return pThis->OnNotify(wParam, lParam);
00196
00197          // Called when the user moves the mouse
00198          case WM_MOUSEMOVE:
00199             if(pThis->m_bResizing)
00200                ::SendMessage(GetParent(hWnd), WM_PANESIZE_MOVE, MAKEPOINTS(lParam).y, 0);
00201             return 0;
00202
00203          // Called when the left mouse button is pushed
00204          case WM_LBUTTONDOWN:
00205             pThis->m_bResizing = TRUE;
00206             SetCapture(hWnd);
00207             ::SendMessage(GetParent(hWnd), WM_PANESIZE_START, 0, 0);
00208             ::SendMessage(hWnd, WM_ENTERSIZEMOVE, 0, 0);
00209             return 0;
00210
00211          // Called when the left mouse button is released
00212          case WM_LBUTTONUP:
00213             pThis->CancelResize();
00214             ::SendMessage(GetParent(hWnd), WM_PANESIZE_END, 0, 0);
00215             return 0;
00216       }
00217    }
00218    catch(CExcep *pE)
00219    {
00220       pE->Report();
00221       pE->Delete();
00222    }
00223
00224    // Let Windows process the message
00225    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00226 }
00227
00228
00229 //----------------------------------------------------------------------------
00230 //
00231 // OnCreate function
00232 //    Called in response to the WM_CREATE messsage. Creates rebar, toolbar,
00233 //    and browser wrapper.
00234 //
00235 // Parameters:       None.
00236 //
00237 // Returns:          TRUE if successful, FALSE if not.
00238 //
00239 //----------------------------------------------------------------------------
00240 BOOL CHelpPane::OnCreate()
00241 {
00242    HIMAGELIST himl = NULL;
00243
00244    try
00245    {
00246       UpdateFont();
00247
00248       // Create and initialize the rebar window
00249       m_pRebar = new CHWND();
00250       ENSUREALLOC(m_pRebar);
00251
00252       m_pRebar->CreateWindowEx(0, REBARCLASSNAME, NULL, RBS_DBLCLKTOGGLE | RBS_VARHEIGHT |
00253          RBS_AUTOSIZE | RBS_VERTICALGRIPPER | CCS_BOTTOM | CCS_NODIVIDER | CCS_NOPARENTALIGN |
00254          CCS_NORESIZE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE |
00255          WS_OVERLAPPED, 0, 0, 0, 0, m_hWnd, NULL, NULL);
00256
00257       REBARINFO rbi;
00258       REBARBANDINFO rbBand;
00259
00260       rbi.cbSize = sizeof(REBARINFO);  // Required when using this struct.
00261       rbi.fMask  = 0;
00262       rbi.himl   = (HIMAGELIST)NULL;
00263       if(!m_pRebar->SendMessage(RB_SETBARINFO, 0, (LPARAM)&rbi))
00264          return FALSE;
00265
00266       m_pRebar->SendMessage(RB_SETBKCOLOR, 0, (LPARAM)GetSysColor(COLOR_3DFACE));
00267
00268       // Create the Close toolbar
00269       m_pXTB = new CHWND();
00270       ENSUREALLOC(m_pXTB);
00271
00272       m_pXTB->CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_FLAT |
00273          TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOMOVEY |
00274          CCS_NOPARENTALIGN | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 20, 18,
00275          *m_pRebar, NULL, NULL);
00276
00277       m_pXTB->SendMessage(TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
00278       m_pXTB->SendMessage(TB_SETMAXTEXTROWS, 0, 0);
00279
00280       // Load the Close toolbar bitmap
00281       HBITMAP hbm;
00282       himl = ImageList_Create(13, 11, ILC_COLORDDB, 0, 1);
00283       if(!himl)
00284          THROW(new CExcepEx(IDS_ERR_IMLCREATE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00285
00286       hbm = CreateMappedBitmap(g_hInst, IDB_BARCLOSE, 0, NULL, 1);
00287       if(!hbm)
00288          THROW(new CExcepEx(IDS_ERR_LOADIMAGE, IDS_BMWS_REMEDY_RESTART, IDB_BARCLOSE, 0,
00289             ERROR_ERRORINS_INT), CExcepEx*);
00290
00291       ImageList_Add(himl, hbm, NULL);
00292       DeleteObject(hbm);
00293       m_pXTB->SendMessage(TB_SETIMAGELIST, 0, (LPARAM)himl);
00294
00295       CTSTR lpszClose(IDS_TB_CLOSE);
00296       TBBUTTON atbButtons[1];
00297       atbButtons[0].iBitmap = 0;
00298       atbButtons[0].idCommand = IDM_HELP_GAMEINSTRUCTIONS;
00299       atbButtons[0].fsState = TBSTATE_ENABLED;
00300       atbButtons[0].fsStyle = BTNS_BUTTON;
00301       atbButtons[0].dwData = 0;
00302       atbButtons[0].iString = (int)(LPTSTR)lpszClose;
00303
00304       m_pXTB->SendMessage(TB_ADDBUTTONS, (UINT)1, (LPARAM)atbButtons);
00305       m_pXTB->SendMessage(TB_AUTOSIZE, 0, 0);
00306
00307       // Create the Pane window
00308       m_pPane = new CHWND();
00309       ENSUREALLOC(m_pPane);
00310       m_pPane->CreateWindowEx(0, m_lpszPaneClass, NULL, WS_CHILD | WS_VISIBLE |
00311          WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 0, 0, *m_pRebar, NULL, (LPVOID)this);
00312
00313       RECT rcRR;
00314       GetWindowRect(*m_pRebar, &rcRR);
00315
00316       // Set up the rebar
00317       ZeroMemory(&rbBand, sizeof(rbBand));
00318       rbBand.cbSize = sizeof(REBARBANDINFO);
00319       rbBand.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_HEADERSIZE;
00320       rbBand.cyMinChild = 16;
00321       rbBand.cxMinChild = 0;
00322       rbBand.cyMaxChild = 32000;
00323       rbBand.cyIntegral = 1;
00324       rbBand.fStyle = RBBS_FIXEDBMP | RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT | RBBS_FIXEDSIZE;
00325       rbBand.wID = ID_HELPPANEREBAR;
00326       rbBand.hwndChild = *m_pPane;
00327
00328       HFONT hfOld;
00329       HDC hdc;
00330       TEXTMETRIC tm;
00331
00332       hdc = GetDC(*m_pRebar);
00333       hfOld = (HFONT)SelectObject(hdc, m_hFont);
00334       GetTextMetrics(hdc, &tm);
00335       SelectObject(hdc, hfOld);
00336       ReleaseDC(*m_pRebar, hdc);
00337       rbBand.cxHeader = tm.tmHeight + 9;
00338       if(rbBand.cxHeader < 21)
00339          rbBand.cxHeader = 21;
00340
00341       m_pRebar->SendMessage(RB_INSERTBAND, -1, (LPARAM)&rbBand);
00342    }
00343    catch(CExcep *pE)
00344    {
00345       if(himl)
00346          ImageList_Destroy(himl);
00347       pE->Report();
00348       pE->Delete();
00349       return FALSE;
00350    }
00351
00352    return TRUE;
00353 }
00354
00355
00356 //----------------------------------------------------------------------------
00357 //
00358 // OnSize function
00359 //    Called in response to the WM_SIZE messsage. Resizes and moves child
00360 //    windows, as necessary.
00361 //
00362 // Parameters:
00363 //    nWidth:        Width of the client area, in pixels.
00364 //    nHeight:       Height of the client area, in pixels.
00365 //
00366 // Returns:          None.
00367 //
00368 //----------------------------------------------------------------------------
00369 void CHelpPane::OnSize(int nWidth, int nHeight)
00370 {
00371    MoveWindow(*m_pRebar, 0, CXY_SPLITTER, nWidth, nHeight - CXY_SPLITTER, TRUE);
00372    RECT rcRR;
00373    GetWindowRect(*m_pRebar, &rcRR);
00374    MoveWindow(*m_pXTB, 0, 1, 20, 18, TRUE);
00375 }
00376
00377
00378 //----------------------------------------------------------------------------
00379 //
00380 // OnNotify function
00381 //    Called in response to a WM_NOTIFY messsage from a common control child.
00382 //
00383 // Parameters:
00384 //    wParam:        Message-specific parameter.
00385 //    lParam:        Message-specific parameter.
00386 //
00387 // Returns:          FALSE if the message was not handled, or a message-
00388 //                   specific value otherwise.
00389 //
00390 //----------------------------------------------------------------------------
00391 LRESULT CHelpPane::OnNotify(WPARAM wParam, LPARAM lParam)
00392 {
00393    // This function draws the rebar's 3D bevel.
00394    if(((LPNMHDR)lParam)->code != NM_CUSTOMDRAW)
00395       return FALSE;
00396
00397    LPNMCUSTOMDRAW lpnmcd = (LPNMCUSTOMDRAW)lParam;
00398    switch(lpnmcd->dwDrawStage)
00399    {
00400       case CDDS_PREPAINT:
00401          return CDRF_NOTIFYITEMDRAW;
00402
00403       case CDDS_ITEMPREPAINT:
00404          return CDRF_NOTIFYPOSTPAINT;
00405
00406       case CDDS_ITEMPOSTPAINT:
00407          if(lpnmcd->dwItemSpec == ID_HELPPANEREBAR)
00408          {
00409             // Custom draw the rebar to look like IE's bars
00410             HFONT hfOld;
00411             HPEN hpenOld;
00412             TEXTMETRIC tm;
00413             LONG lHeight;
00414             RECT rc;
00415
00416             hfOld = (HFONT)SelectObject(lpnmcd->hdc, m_hFont);
00417             GetTextMetrics(lpnmcd->hdc, &tm);
00418             SelectObject(lpnmcd->hdc, hfOld);
00419             CopyRect(&rc, &lpnmcd->rc);
00420             lHeight = tm.tmHeight;
00421             if(lHeight < 12)
00422                lHeight = 12;
00423             rc.left += 3;
00424             rc.right = rc.left + lHeight;
00425             hpenOld = (HPEN)SelectObject(lpnmcd->hdc, CreatePen(PS_SOLID, 1,
00426                GetSysColor(COLOR_3DSHADOW)));
00427             MoveToEx(lpnmcd->hdc, rc.right + 4, rc.bottom, NULL);
00428             LineTo(lpnmcd->hdc, rc.right + 4, rc.top);
00429             DeleteObject(SelectObject(lpnmcd->hdc, CreatePen(PS_SOLID, 1,
00430                GetSysColor(COLOR_3DHILIGHT))));
00431             MoveToEx(lpnmcd->hdc, rc.right + 5, rc.bottom, NULL);
00432             LineTo(lpnmcd->hdc, rc.right + 5, rc.top);
00433             DeleteObject(SelectObject(lpnmcd->hdc, hpenOld));
00434          }
00435          break;
00436    }
00437
00438    return 0;
00439 }
00440
00441
00442 //----------------------------------------------------------------------------
00443 //
00444 // PaneWndProc function
00445 //    Callback function that handles messages to the browser wrapper pane.
00446 //
00447 // Parameters:
00448 //    hWnd:          The main window handle.
00449 //    uMsg:          Message identifer.
00450 //    wParam:        Message-specific parameter.
00451 //    lParam:        Message-specific parameter.
00452 //
00453 // Returns:
00454 //    Depends on the message. If the message was not handled, the return value
00455 //    of DefWindowProc will be returned.
00456 //
00457 //----------------------------------------------------------------------------
00458 LRESULT CALLBACK CHelpPane::PaneWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00459 {
00460    // Retrieve "this" pointer from window handle
00461    CHelpPane *pThis = (CHelpPane*)GetWindowLong(hWnd, GWL_USERDATA);
00462
00463    try   // Windows-called code
00464    {
00465       switch(uMsg)
00466       {
00467          // Called before the window is created.
00468          case WM_NCCREATE:
00469             // Store the "this" pointer with the window handle
00470             pThis = (CHelpPane*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00471             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00472             pThis->m_pPane->m_hWnd = hWnd;
00473             return TRUE;
00474
00475          // Called when the window is created
00476          case WM_CREATE:
00477             return (pThis->OnCreatePane() ? 0 : -1);
00478
00479          // Called when the user is sizing the window
00480          case WM_SIZE:
00481             pThis->OnSizePane(LOWORD(lParam), HIWORD(lParam));
00482             return 0;
00483
00484          // Called before the window is destroyed
00485          case WM_DESTROY:
00486             pThis->OnDestroyPane();
00487             return 0;
00488       }
00489    }
00490    catch(CExcep *pE)
00491    {
00492       pE->Report();
00493       pE->Delete();
00494    }
00495
00496    // Let Windows process the message
00497    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00498 }
00499
00500
00501 //----------------------------------------------------------------------------
00502 //
00503 // OnCreatePane function
00504 //    Called in response to the WM_CREATE messsage. Creates the WebBrowser
00505 //    container.
00506 //
00507 // Parameters:       None.
00508 //
00509 // Returns:          TRUE if successful, FALSE if not.
00510 //
00511 //----------------------------------------------------------------------------
00512 BOOL CHelpPane::OnCreatePane()
00513 {
00514    try
00515    {
00516       // Create and initialize the browser container
00517       m_pBrowserContainer = new CBrowserContainer(TRUE, TRUE);
00518       ENSUREALLOC(m_pBrowserContainer);
00519       m_pBrowserContainer->AddRef();
00520       m_pBrowserContainer->Init(*m_pPane, &m_spBrowser, (IEventSinkSite*)this, 0);
00521       m_spBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
00522
00523       // Prepare to navigate the browser to our instruction-holding HTML file
00524       CTSTR lpszHtml = CreateResURL(g_hInstLC, CTSTR(IDS_HELPHTML));
00525
00526       // Remove below line to use the resource instead of the file
00527       //lpszHtml.Assign(TEXT("C:\\Programming\\Microsoft Visual Studio\\MyProjects\\Solitaire Pack\\SolpckLC\\res\\help.html"));
00528
00529       VARIANT v;
00530       v.vt = VT_I4;
00531       v.lVal = navNoHistory;
00532       CHECKHRCOM(m_spBrowser->Navigate(CBSTR(lpszHtml), &v, NULL, NULL, NULL));
00533    }
00534    catch(CExcep *pE)
00535    {
00536       pE->Report();
00537       pE->Delete();
00538       return FALSE;
00539    }
00540
00541    return TRUE;
00542 }
00543
00544
00545 //----------------------------------------------------------------------------
00546 //
00547 // OnSizePane function
00548 //    Called in response to the WM_SIZE messsage. Resizes the browser
00549 //    container.
00550 //
00551 // Parameters:
00552 //    nWidth:        Width of the client area, in pixels.
00553 //    nHeight:       Height of the client area, in pixels.
00554 //
00555 // Returns:          None.
00556 //
00557 //----------------------------------------------------------------------------
00558 void CHelpPane::OnSizePane(int nWidth, int nHeight)
00559 {
00560    // Position the browser container
00561    if(m_pBrowserContainer)
00562       m_pBrowserContainer->SetLocation(0, 0, nWidth, nHeight);
00563 }
00564
00565
00566 //----------------------------------------------------------------------------
00567 //
00568 // OnDestroy function
00569 //    Called in response to the WM_DESTROY messsage. Delete all created
00570 //    objects.
00571 //
00572 // Parameters:       None.
00573 //
00574 // Returns:          None.
00575 //
00576 //----------------------------------------------------------------------------
00577 void CHelpPane::OnDestroyPane()
00578 {
00579    // Delete the HTML helper object
00580    SAFEDELETE(m_pHH);
00581
00582    // Uninitialize and free the browser container
00583    m_spBrowser.Release();
00584    if(m_pBrowserContainer)
00585    {
00586       m_pBrowserContainer->Uninit();
00587       m_pBrowserContainer->Release();
00588       m_pBrowserContainer = NULL;
00589    }
00590 }
00591
00592
00593 //----------------------------------------------------------------------------
00594 //
00595 // UpdateFont function
00596 //    Called to refresh the pane rebar based on the system's menu font.
00597 //
00598 // Parameters:       None.
00599 //
00600 // Returns:          None.
00601 //
00602 //----------------------------------------------------------------------------
00603 void CHelpPane::UpdateFont()
00604 {
00605    HDC hdc;
00606    TEXTMETRIC tm;
00607    HFONT hfOld;
00608    NONCLIENTMETRICS ninfo;
00609    REBARBANDINFO rbbi;
00610
00611    if(m_hFont)
00612       DeleteObject(m_hFont);
00613
00614    // Get the font that Windows uses for menus
00615    ninfo.cbSize = sizeof(ninfo);
00616    SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ninfo), &ninfo, 0);
00617    m_hFont = CreateFontIndirect(&ninfo.lfMenuFont);
00618
00619    if(m_pRebar)
00620    {
00621       // Set the size of the rebar header based on the font
00622       hdc = GetDC(*m_pRebar);
00623       hfOld = (HFONT)SelectObject(hdc, m_hFont);
00624       GetTextMetrics(hdc, &tm);
00625       SelectObject(hdc, hfOld);
00626       ReleaseDC(*m_pRebar, hdc);
00627       rbbi.cbSize = sizeof(REBARBANDINFO);
00628       rbbi.fMask = RBBIM_HEADERSIZE;
00629       rbbi.cxHeader = tm.tmHeight + 9;
00630       if(rbbi.cxHeader < 21)
00631          rbbi.cxHeader = 21;
00632
00633       m_pRebar->SendMessage(RB_SETBANDINFO, 0, (LPARAM)&rbbi);
00634
00635       MoveWindow(*m_pXTB, 0, 1, 20, 18, TRUE);
00636    }
00637 }
00638
00639
00640 //----------------------------------------------------------------------------
00641 //
00642 // UpdateColors function
00643 //    Called to refresh the pane rebar based on the system's colors.
00644 //
00645 // Parameters:
00646 //    wParam:        Parameter from WM_SYSCOLORCHANGE.
00647 //    lParam:        Parameter from WM_SYSCOLORCHANGE.
00648 //
00649 // Returns:          None.
00650 //
00651 //----------------------------------------------------------------------------
00652 void CHelpPane::UpdateColors(WPARAM wParam, LPARAM lParam)
00653 {
00654    HBITMAP hbm;
00655    HIMAGELIST himl;
00656    REBARBANDINFO rbbi;
00657
00658    // Create a new image list for the toolbar
00659    himl = ImageList_Create(13, 11, ILC_COLORDDB, 0, 1);
00660    if(!himl)
00661       THROW(new CExcepEx(IDS_ERR_IMLCREATE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00662    hbm = CreateMappedBitmap(g_hInst, IDB_BARCLOSE, 0, NULL, 1);
00663    if(!hbm)
00664    {
00665       ImageList_Destroy(himl);
00666       THROW(new CExcepEx(IDS_ERR_LOADIMAGE, IDS_BMWS_REMEDY_RESTART, IDB_BARCLOSE, 0,
00667          ERROR_ERRORINS_INT), CExcepEx*);
00668    }
00669
00670    ImageList_Add(himl, hbm, NULL);
00671    DeleteObject(hbm);
00672    m_pXTB->SendMessage(TB_SETIMAGELIST, 0, (LPARAM)himl);
00673    m_pRebar->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00674    rbbi.cbSize = sizeof(REBARBANDINFO);
00675    rbbi.fMask = RBBIM_COLORS;
00676    m_pRebar->SendMessage(RB_GETBANDINFO, 0, (LPARAM)&rbbi);
00677    rbbi.clrBack = GetSysColor(COLOR_3DFACE);
00678    m_pRebar->SendMessage(RB_SETBANDINFO, 0, (LPARAM)&rbbi);
00679 }
00680
00681
00682 //----------------------------------------------------------------------------
00683 //
00684 // SetGame function
00685 //    Sets the name of the game to display in the pane.
00686 //
00687 // Parameters:
00688 //    bstr:          The name of the game.
00689 //
00690 // Returns:          None.
00691 //
00692 //----------------------------------------------------------------------------
00693 void CHelpPane::SetGame(CBSTR& bstr)
00694 {
00695    m_bstrGame = bstr;
00696    if(m_pHH)
00697       m_pHH->SetElText(IDS_EL_HELPGAME, m_bstrGame);
00698 }
00699
00700
00701 //----------------------------------------------------------------------------
00702 //
00703 // SetInstr function
00704 //    Sets the instructions to display in the pane.
00705 //
00706 // Parameters:
00707 //    bstr:          The instruction string.
00708 //
00709 // Returns:          None.
00710 //
00711 //----------------------------------------------------------------------------
00712 void CHelpPane::SetInstr(CBSTR& bstr)
00713 {
00714    m_bstrInstr = bstr;
00715    if(m_pHH)
00716    {
00717       // Set the text, and scroll the window back to the top
00718       m_pHH->SetElText(IDS_EL_HELPINSTR, m_bstrInstr);
00719       CHECKHRCOM(m_pHH->m_spWindow2->scrollTo(0, 0));
00720    }
00721 }
00722
00723
00724 //----------------------------------------------------------------------------
00725 //
00726 // IEventSinkSite::EventSink method
00727 //    Handles all events from the WebBrowser event sink.
00728 //
00729 // Parameters:
00730 //    lParam:        Optional site-specific parameter. (Not used)
00731 //    dispid:        The identifier of the event.
00732 //    pdispparams:   Pointer to any parameters associated with the event.
00733 //
00734 // Returns:          S_OK in all cases.
00735 //
00736 //----------------------------------------------------------------------------
00737 HRESULT CHelpPane::EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS *pdispparams)
00738 {
00739    try   // Windows-called code
00740    {
00741       switch(dispid)
00742       {
00743          // The HTML document has reached the READYSTATE_COMPLETE state
00744          case DISPID_DOCUMENTCOMPLETE:
00745             HTMLComplete();
00746             break;
00747
00748          // A new window is to be created for displaying a resource
00749          case DISPID_NEWWINDOW2:
00750             // We don't want to pop up new windows; cancel the event.
00751             *(pdispparams->rgvarg[0].pboolVal) = VARIANT_TRUE;
00752             break;
00753       }
00754    }
00755    catch(CExcep *pE)
00756    {
00757       pE->Report();
00758       pE->Delete();
00759    }
00760    return S_OK;
00761 }
00762
00763
00764 //----------------------------------------------------------------------------
00765 //
00766 // HTMLComplete function
00767 //    When the HTML document has been loaded, set up the HTML helper object.
00768 //
00769 // Parameters:       None.
00770 //
00771 // Returns:          None.
00772 //
00773 //----------------------------------------------------------------------------
00774 void CHelpPane::HTMLComplete()
00775 {
00776    if(m_pHH)
00777       return;
00778
00779    CWaitCursor wait;
00780
00781    // Get the HTML document object from the web browser
00782    CPtr<IDispatch, &IID_IDispatch> spDocDisp;
00783    CHECKHRCOM(m_spBrowser->get_Document(&spDocDisp));
00784    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTMLDoc = spDocDisp;
00785    m_pHH = new CHTMLHelper(spHTMLDoc);
00786    ENSUREALLOC(m_pHH);
00787
00788    // Prevent the HTML from being selected or dragged
00789    m_pHH->ProtectUI(IDS_EL_BODY);
00790
00791    // Initialize the HTML helper for adding document styles
00792    m_pHH->InitAddStyle();
00793
00794    // Display the current game title and rules
00795    if(m_bstrGame)
00796       m_pHH->SetElText(IDS_EL_HELPGAME, m_bstrGame);
00797    if(m_bstrInstr)
00798       m_pHH->SetElText(IDS_EL_HELPINSTR, m_bstrInstr);
00799 }
00800
00801
00802 //----------------------------------------------------------------------------
00803 //
00804 // CancelResize function
00805 //    Called when the user pressed Escape; cancels the resize operation.
00806 //
00807 // Parameters:       None.
00808 //
00809 // Returns:          None.
00810 //
00811 //----------------------------------------------------------------------------
00812 void CHelpPane::CancelResize()
00813 {
00814    if(m_bResizing)
00815    {
00816       m_bResizing = FALSE;
00817       ReleaseCapture();
00818       SendMessage(WM_EXITSIZEMOVE, 0, 0);
00819    }
00820 }
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


HelpPane.h File Reference

#include <bmws_window.h>
#include <bmws_browsercontainer.h>
#include <bmws_htmlhelpers.h>
#include <bmws_eventhandler.h>

Go to the source code of this file.

Compounds

class | CHelpPane

Defines

#define | AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_
#define | WM_PANESIZE_START (WM_USER+1)
#define | WM_PANESIZE_MOVE (WM_USER+2)
#define | WM_PANESIZE_END (WM_USER+3)

Define Documentation

#define AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_

Definition at line 10 of file HelpPane.h.

#define WM_PANESIZE_END (WM_USER+3)

Definition at line 31 of file HelpPane.h.

Referenced by CHelpPane::BarWndProc(), and CMainWindow::MainWndProc().

#define WM_PANESIZE_MOVE (WM_USER+2)

Definition at line 30 of file HelpPane.h.

Referenced by CHelpPane::BarWndProc(), and CMainWindow::MainWndProc().

#define WM_PANESIZE_START (WM_USER+1)

Definition at line 29 of file HelpPane.h.

Referenced by CHelpPane::BarWndProc(), and CMainWindow::MainWndProc().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


HelpPane.h Source File

HelpPane.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // HelpPane.h
00004 //    Class to encapsulate the Instructions pane.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_)
00010 #define AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_window.h>
00021 #include <bmws_browsercontainer.h>
00022 #include <bmws_htmlhelpers.h>
00023 #include <bmws_eventhandler.h>
00024
00025
00026 //----------------------------------------------------------------------------
00027 // Pane sizing messages, sent to main window during resizing
00028 //----------------------------------------------------------------------------
00029 #define WM_PANESIZE_START  (WM_USER+1)
00030 #define WM_PANESIZE_MOVE   (WM_USER+2)
00031 #define WM_PANESIZE_END    (WM_USER+3)
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CHelpPane class
00037 //    Encapsulates the Instructions pane. The pane actually contains several
00038 //    windows: the "Bar" window, which contains a rebar, containing a toolbar
00039 //    and the "Pane" window, which hosts the browser container. Bar and Pane
00040 //    functionality is combined into one class.
00041 //
00042 //----------------------------------------------------------------------------
00043 class CHelpPane : public CHWND, public IEventSinkSite
00044 {
00045 public:
00046    CHelpPane();
00047    virtual ~CHelpPane();
00048
00049    void Register();
00050    BOOL Create(HWND hwndParent);
00051    void UpdateFont();
00052    void CancelResize();
00053    void SetGame(CBSTR& bstr);
00054    void SetInstr(CBSTR& bstr);
00055
00056    // Window and dialog box procedures
00057    static LRESULT CALLBACK BarWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00058    static LRESULT CALLBACK PaneWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00059
00060    // IEventSinkSite method
00061    HRESULT EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams);
00062
00063    static BOOL s_bRegistered;    // Have the window classes been registered?
00064
00065 protected:
00066    // Window message handlers
00067    BOOL OnCreate();
00068    void OnSize(int nWidth, int nHeight);
00069    LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
00070    void UpdateColors(WPARAM wParam, LPARAM lParam);
00071    BOOL OnCreatePane();
00072    void OnSizePane(int nWidth, int nHeight);
00073    void OnDestroyPane();
00074    void HTMLComplete();
00075
00076    CBrowserContainer *m_pBrowserContainer;   // Browser container object
00077    CWebBrowser2Ptr m_spBrowser;              // Web browser interface
00078    CHTMLHelper *m_pHH;                       // HTML Helper object
00079
00080    CTSTR m_lpszPaneClass;                    // Window class of pane
00081    CHWND *m_pRebar;                          // Rebar window
00082    CHWND *m_pXTB;                            // "Close" toolbar window
00083    CHWND *m_pPane;                           // Pane window object
00084    HFONT m_hFont;                            // Font used to calculate header size
00085
00086    CBSTR m_bstrGame;                         // Current game title
00087    CBSTR m_bstrInstr;                        // Current instructions
00088
00089    BOOL m_bResizing;                         // Whether bar is currently being resized
00090 };
00091
00092
00093 #endif // !defined(AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


Hlink.cpp File Reference

#include "stdafx.h"
#include <bmws_hlink.cpp>
#include <bmws_hlinkcolor.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


Hlink.cpp Source File

Hlink.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Hlink.cpp
00004 //    Includes component source files related to hyperlink windows.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_hlink.cpp>
00011 #include <bmws_hlinkcolor.cpp>
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


HTMLHelpers.cpp File Reference

#include "stdafx.h"
#include <bmws_htmlhelpers.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


HTMLHelpers.cpp Source File

HTMLHelpers.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // HTMLHelpers.cpp
00004 //    Includes component source files related to HTML documents and elements.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_htmlhelpers.cpp>
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


LibMgr.cpp File Reference

#include "stdafx.h"
#include "LibMgr.h"
#include <bmws_lib.h>
#include <comcat.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


LibMgr.cpp Source File

LibMgr.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // LibMgr.cpp
00004 //    Class to manage game library operations.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "LibMgr.h"
00014 #include <bmws_lib.h>
00015 #include <comcat.h>
00016 #include "resource.h"
00017 #include "..\SolpckLC\resource.h"
00018
00019
00020 //----------------------------------------------------------------------------
00021 //
00022 // CLibMgr constructor
00023 //
00024 // Parameters:       None.
00025 //
00026 //----------------------------------------------------------------------------
00027 CLibMgr::CLibMgr()
00028 {
00029    // Set initial value of member variable
00030    m_cGames = 0;
00031
00032    // Signify that the contained pointers are COM interface pointers that
00033    // should be released, not deleted, when destroyed.
00034    m_apLibs.SetRelease(TRUE);
00035 }
00036
00037
00038 //----------------------------------------------------------------------------
00039 //
00040 // CLibMgr destructor
00041 //
00042 //----------------------------------------------------------------------------
00043 CLibMgr::~CLibMgr()
00044 {
00045 }
00046
00047
00048 //----------------------------------------------------------------------------
00049 //
00050 // Refresh function
00051 //    Enumerates through registered libraries and recreates library objects.
00052 //
00053 // Parameters:       None.
00054 //
00055 // Returns:          None.
00056 //
00057 //----------------------------------------------------------------------------
00058 void CLibMgr::Refresh()
00059 {
00060    m_apLibs.SetSize(0);
00061    m_cGames = 0;
00062
00063    // Use Windows's Component Categories manager object
00064    CPtr<ICatInformation, &IID_ICatInformation> spCatInfo;
00065    CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_ALL,
00066       IID_ICatInformation, (LPVOID*)&spCatInfo));
00067
00068    // Array of Categories
00069    CATID IDs[1];
00070    IDs[0] = CATID_SolpackGameLibs;
00071
00072    // Get the IEnumCLSID interface
00073    IEnumCLSID* pEnum = NULL;
00074    CHECKHRCOM(spCatInfo->EnumClassesOfCategories(1, IDs, 0, NULL, &pEnum));
00075
00076    CLSID clsid;
00077
00078    // Go through each registered game library
00079    HRESULT hr = pEnum->Next(1, &clsid, NULL);
00080    while(hr != S_FALSE)
00081    {
00082       CHECKHRCOM(hr);
00083
00084       // Create an instance of the game library object and store it.
00085       CPtr<ISolpackGameLib, &IID_ISolpackGameLib> spTempLib;
00086       if(SUCCEEDED(CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER |
00087          CLSCTX_LOCAL_SERVER, IID_ISolpackGameLib, (LPVOID*)&spTempLib)))
00088       {
00089          m_apLibs.Add(spTempLib);
00090          spTempLib->AddRef();
00091
00092          long l;
00093          CHECKHRCOM(spTempLib->get_NumGames(&l));
00094          m_cGames += l;
00095       }
00096
00097       hr = pEnum->Next(1, &clsid, NULL);
00098    }
00099 }
00100
00101
00102 //----------------------------------------------------------------------------
00103 //
00104 // GetNumLibs function
00105 //    Retrieves the number of registered libraries.
00106 //
00107 // Parameters:       None.
00108 //
00109 // Returns:          The number of registered libraries.
00110 //
00111 //----------------------------------------------------------------------------
00112 int CLibMgr::GetNumLibs()
00113 {
00114    return m_apLibs.GetSize();
00115 }
00116
00117
00118 //----------------------------------------------------------------------------
00119 //
00120 // GetNumGames function
00121 //    Retrieves the number of games implemented in the specified library.
00122 //
00123 // Parameters:
00124 //    iLibIndex:     Zero-based index of the library. If -1, return the total
00125 //                   number of games.
00126 //
00127 // Returns:          The number of games in the library.
00128 //
00129 //----------------------------------------------------------------------------
00130 int CLibMgr::GetNumGames(int iLibIndex)
00131 {
00132    long l = 0;
00133
00134    if(iLibIndex >= 0)
00135    {
00136       // Just a single library
00137       CHECKHRCOM(m_apLibs[iLibIndex]->get_NumGames(&l));
00138    } else
00139       l = m_cGames;
00140
00141    return l;
00142 }
00143
00144
00145 //----------------------------------------------------------------------------
00146 //
00147 // GetLib function
00148 //    Retrieves the specified library interface pointer.
00149 //
00150 // Parameters:
00151 //    iLibIndex:     Zero-based index of the library.
00152 //
00153 // Returns:          The ISolpackGameLib interface pointer of the library.
00154 //
00155 //----------------------------------------------------------------------------
00156 ISolpackGameLib* CLibMgr::GetLib(int iLibIndex)
00157 {
00158    m_apLibs[iLibIndex]->AddRef();
00159    return m_apLibs[iLibIndex];
00160 }
00161
00162
00163 //----------------------------------------------------------------------------
00164 //
00165 // GetGameInfo function
00166 //    Retrieves the game information object for the specified game in the
00167 //    specified library.
00168 //
00169 // Parameters:
00170 //    iLibIndex:     Zero-based index of the library.
00171 //    iGameIndex:    Zero-based index of the game within the library.
00172 //
00173 // Returns:          The ISolpackGameInfo interface pointer of the object.
00174 //
00175 //----------------------------------------------------------------------------
00176 ISolpackGameInfo* CLibMgr::GetGameInfo(int iLibIndex, int iGameIndex)
00177 {
00178    ISolpackGameInfo *pReturn = NULL;
00179    CHECKHRCOM(m_apLibs[iLibIndex]->GetGameInfo(iGameIndex, &pReturn));
00180    return pReturn;
00181 }
00182
00183
00184 //----------------------------------------------------------------------------
00185 //
00186 // GetGame function
00187 //    Retrieves the specified game object from the specified library.
00188 //
00189 // Parameters:
00190 //    iLibIndex:     Zero-based index of the library.
00191 //    iGameIndex:    Zero-based index of the game within the library.
00192 //
00193 // Returns:          The ISolpackGameInfo interface pointer of the object.
00194 //
00195 //----------------------------------------------------------------------------
00196 ISolpackGame* CLibMgr::GetGame(int iLibIndex, int iGameIndex)
00197 {
00198    ISolpackGame *pReturn = NULL;
00199    CHECKHRCOM(m_apLibs[iLibIndex]->GetGame(iGameIndex, &pReturn));
00200    return pReturn;
00201 }
00202
00203
00204 //----------------------------------------------------------------------------
00205 //
00206 // RegLibrary function
00207 //    Registers the specified game library file.
00208 //
00209 // Parameters:
00210 //    iLibIndex:     Zero-based index of the library.
00211 //
00212 // Returns:          TRUE if the library was registered correctly, else FALSE.
00213 //
00214 //----------------------------------------------------------------------------
00215 BOOL CLibMgr::RegLibrary(CTSTR& lpszFile)
00216 {
00217    // Try to load the library DLL file
00218    CLib hDLL(lpszFile);
00219    if(hDLL == NULL)
00220    {
00221       ODS("RegLibrary: LoadLibrary() failed");
00222       return FALSE;
00223    }
00224
00225    // Retrieve the DllRegisterServer entry point function
00226    typedef HRESULT (CALLBACK *HCRET)(void);
00227    HCRET lpfnDllRegisterServer;
00228    lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, TEXT("DllRegisterServer"));
00229    if(NULL == lpfnDllRegisterServer)
00230    {
00231       ODS("RegLibrary: DllRegisterServer() does not exist");
00232       return FALSE;
00233    }
00234
00235    // Register the DLL
00236    if(FAILED((*lpfnDllRegisterServer)()))
00237    {
00238       ODS("RegLibrary: DllRegisterServer() failed");
00239       return FALSE;
00240    }
00241
00242    return TRUE;
00243 }
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


LibMgr.h File Reference

#include "..\SolpackTLB\Solpack.h"
#include <bmws_array.h>
#include <bmws_ptr.h>
#include <bmws_string.h>

Go to the source code of this file.

Compounds

class | CLibMgr

Defines

#define | AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file LibMgr.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


LibMgr.h Source File

LibMgr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // LibMgr.h
00004 //    Class to manage game library operations.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\Solpack.h"
00021 #include <bmws_array.h>
00022 #include <bmws_ptr.h>
00023 #include <bmws_string.h>
00024
00025
00026 //----------------------------------------------------------------------------
00027 //
00028 // CLibMgr class
00029 //    Manages game library operations. This class registers  game libraries
00030 //    and is used to wrap common ISolpackGameLib uses.
00031 //
00032 //----------------------------------------------------------------------------
00033 class CLibMgr
00034 {
00035 public:
00036    CLibMgr();
00037    virtual ~CLibMgr();
00038
00039    void Refresh();
00040    int GetNumLibs();
00041    int GetNumGames(int iLibIndex);
00042    ISolpackGameLib* GetLib(int iLibIndex);
00043    ISolpackGameInfo* GetGameInfo(int iLibIndex, int iGameIndex);
00044    ISolpackGame* GetGame(int iLibIndex, int iGameIndex);
00045
00046    BOOL RegLibrary(CTSTR& lpszFile);
00047
00048 protected:
00049    CPtrArray<ISolpackGameLib*, ISolpackGameLib*> m_apLibs;  // Registered library objects
00050    int m_cGames;  // The total number of games
00051 };
00052
00053
00054 #endif // !defined(AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:07 2002 for Solitaire Pack by doxygen 1.2.15


MainWindow.cpp File Reference

#include "stdafx.h"
#include "MainWindow.h"
#include "AboutDlg.h"
#include <bmws_hlinkcolor.h>
#include <bmws_registry.h>
#include <bmws_regservices.h>
#include <bmws_formatdouble.h>
#include <bmws_variant.h>
#include <bmws_resurl.h>
#include <bmws_singleofn.h>
#include <bmws_waitcursor.h>
#include <commctrl.h>
#include <exdispid.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | MW_UNINIT 0
#define | MW_CREATING 1
#define | MW_WAITFORHTML 2
#define | MW_INITHTML 3
#define | MW_GAMEMENU 4
#define | MW_ENGINE 5
#define | CY_HELPPANE_MIN 24
#define | CY_BROWSER_MIN 24

Variables

TCHAR | g_szAppTitle [64]
HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
HWND | g_hWnd
COOMExcep * g_pOOMExcep
BOOL | g_bExited
CTSTR g_lpszUserName
COLORREF | g_colorHlink = RGB(0,0,255)

Define Documentation

#define CY_BROWSER_MIN 24

Definition at line 57 of file MainWindow.cpp.

Referenced by CMainWindow::MainWndProc().

#define CY_HELPPANE_MIN 24

Definition at line 56 of file MainWindow.cpp.

Referenced by CMainWindow::MainWndProc().

#define MW_CREATING 1

Definition at line 46 of file MainWindow.cpp.

Referenced by CMainWindow::Create().

#define MW_ENGINE 5

Definition at line 50 of file MainWindow.cpp.

Referenced by CMainWindow::OnCommand(), and CMainWindow::ShowHideEngine().

#define MW_GAMEMENU 4

Definition at line 49 of file MainWindow.cpp.

Referenced by CMainWindow::GameSelected(), and CMainWindow::ShowHideGameMenu().

#define MW_INITHTML 3

Definition at line 48 of file MainWindow.cpp.

Referenced by CMainWindow::HTMLComplete(), and CMainWindow::OnDestroy().

#define MW_UNINIT 0

Definition at line 45 of file MainWindow.cpp.

Referenced by CMainWindow::CMainWindow(), and CMainWindow::Create().

#define MW_WAITFORHTML 2

Definition at line 47 of file MainWindow.cpp.

Referenced by CMainWindow::Create(), and CMainWindow::HTMLComplete().

Variable Documentation

BOOL g_bExited

Definition at line 37 of file MainWindow.cpp.

Referenced by CSolpackApp::CSolpackApp(), CSolpackApp::EmptyMessageQueue(), CMainWindow::MainWndProc(), CMainWindow::OnCommand(), and CSolpackApp::Run().

COLORREF g_colorHlink = RGB(0,0,255)

Definition at line 39 of file MainWindow.cpp.

Referenced by CMainWindow::Create(), CAboutDlg::DlgProc(), CMainWindow::OnCommand(), and CMainWindow::PresentUpdate().

HINSTANCE g_hInst

Definition at line 33 of file MainWindow.cpp.

HINSTANCE g_hInstLC

Definition at line 34 of file MainWindow.cpp.

Referenced by CMainWindow::Create(), and CMainWindow::OnCreate().

HWND g_hWnd

Definition at line 35 of file MainWindow.cpp.

Referenced by CMainWindow::OnCreate().

CTSTR g_lpszUserName

Definition at line 38 of file MainWindow.cpp.

COOMExcep* g_pOOMExcep

Definition at line 36 of file MainWindow.cpp.

TCHAR g_szAppTitle[64]

Definition at line 32 of file MainWindow.cpp.

Referenced by CMainWindow::Create(), CMainWindow::GameSelected(), CMainWindow::OnCommand(), and CMainWindow::OnCreate().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


MainWindow.cpp Source File

MainWindow.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // MainWindow.cpp
00004 //    Class to encapsulate the main window and main program logic.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "MainWindow.h"
00014 #include "AboutDlg.h"
00015 #include <bmws_hlinkcolor.h>
00016 #include <bmws_registry.h>
00017 #include <bmws_regservices.h>
00018 #include <bmws_formatdouble.h>
00019 #include <bmws_variant.h>
00020 #include <bmws_resurl.h>
00021 #include <bmws_singleofn.h>
00022 #include <bmws_waitcursor.h>
00023 #include <commctrl.h>
00024 #include <exdispid.h>
00025 #include "resource.h"
00026 #include "..\SolpckLC\resource.h"
00027
00028
00029 //----------------------------------------------------------------------------
00030 // Global and external variables
00031 //----------------------------------------------------------------------------
00032 extern TCHAR g_szAppTitle[64];         // The title bar text
00033 extern HINSTANCE g_hInst;              // Application instance handle
00034 extern HINSTANCE g_hInstLC;            // Localized resources module handle
00035 extern HWND g_hWnd;                    // Main window handle
00036 extern COOMExcep *g_pOOMExcep;         // Out of memory exception object
00037 extern BOOL g_bExited;                 // Whether the app has just quit
00038 extern CTSTR g_lpszUserName;           // Registered user name
00039 COLORREF g_colorHlink = RGB(0,0,255);  // Color of hyperlinks
00040
00041
00042 //----------------------------------------------------------------------------
00043 // Main window states (m_dwState)
00044 //----------------------------------------------------------------------------
00045 #define MW_UNINIT       0  // Window has not been created
00046 #define MW_CREATING     1  // Window is being created
00047 #define MW_WAITFORHTML  2  // Waiting for HTML document to load completely
00048 #define MW_INITHTML     3  // Initializing the loaded HTML document
00049 #define MW_GAMEMENU     4  // Displaying the game menu
00050 #define MW_ENGINE       5  // Playing a game
00051
00052
00053 //----------------------------------------------------------------------------
00054 // Minimum size constants for the help pane and browser container
00055 //----------------------------------------------------------------------------
00056 #define CY_HELPPANE_MIN       24
00057 #define CY_BROWSER_MIN        24
00058
00059
00060 BOOL CMainWindow::s_bRegistered = FALSE;  // Initially, window class has not been registered
00061
00062
00063 //----------------------------------------------------------------------------
00064 //
00065 // CMainWindow constructor
00066 //
00067 // Parameters:
00068 //    pMsgProcessor: Interface that enables message processing.
00069 //
00070 //----------------------------------------------------------------------------
00071 CMainWindow::CMainWindow(IMsgProcessor *pMsgProcessor)
00072 {
00073    // Set initial values for member variables
00074    _ASSERT(pMsgProcessor);
00075    m_pMsgProcessor = pMsgProcessor;
00076    m_bPresentUpdate = FALSE;
00077    m_dAvailVersion = 0.0;
00078    m_cyHelpPaneSize = 0;
00079    m_bPaneSizing = FALSE;
00080    m_bSizing = FALSE;
00081    m_pBrowserContainer = NULL;
00082    m_pHH = NULL;
00083    m_bNavigated = FALSE;
00084    m_pEngine = NULL;
00085    m_userPrefs.SetSite((IUserPrefsSite*)this);
00086    m_cTasks = 0;
00087    m_cTasksDone = 0;
00088    m_dwState = MW_UNINIT;
00089 }
00090
00091
00092 //----------------------------------------------------------------------------
00093 //
00094 // CMainWindow destructor
00095 //
00096 //----------------------------------------------------------------------------
00097 CMainWindow::~CMainWindow()
00098 {
00099 }
00100
00101
00102 //----------------------------------------------------------------------------
00103 //
00104 // Register function
00105 //    Registers the main window class with Windows.
00106 //
00107 // Parameters:       None.
00108 //
00109 // Returns:          None.
00110 //
00111 // Throws:           Exception if the class could not be registered.
00112 //
00113 //----------------------------------------------------------------------------
00114 void CMainWindow::Register()
00115 {
00116    // Load the class name; register the class, if not already registered.
00117    m_lpszClassName.Assign(IDS_CLASSNAME);
00118
00119    if(s_bRegistered)
00120       return;
00121
00122    RegisterWindowClass(m_lpszClassName, 0, (WNDPROC)MainWndProc, MAKEINTRESOURCE(IDI_SOLPACK),
00123       (HBRUSH)(COLOR_3DFACE+1), NULL);
00124    s_bRegistered = TRUE;
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // Create function
00131 //    Creates the main window and performs other startup tasks.
00132 //
00133 // Parameters:
00134 //    pSplash:       Pointer to the splash window.
00135 //    nCmdShow:      Specifies how the window should be showed.
00136 //
00137 // Returns:          TRUE or FALSE: whether the window was successfully
00138 //                   created or not.
00139 //
00140 //----------------------------------------------------------------------------
00141 BOOL CMainWindow::Create(CSplashWindow *pSplash, int nCmdShow)
00142 {
00143    m_dwState = MW_CREATING;
00144    try
00145    {
00146       m_pSplash = pSplash;
00147       m_nCmdShow = nCmdShow;
00148
00149       // Load the main window's accelerators
00150       m_hAccelTable = LoadAccelerators(g_hInstLC, MAKEINTRESOURCE(IDR_SOLPACKACCEL));
00151       if(!m_hAccelTable)
00152          THROW(new CExcepEx(IDS_BMWS_ERROR_ACCEL, IDS_BMWS_REMEDY_RESTART, IDR_SOLPACKACCEL, 0,
00153             ERROR_ERRORINS_INT), CExcepEx*);
00154
00155       // Read in user preferences
00156       m_userPrefs.ReadRegistry();
00157
00158       // Randomize
00159       FILETIME ft;
00160       GetSystemTimeAsFileTime(&ft);
00161       srand((unsigned int)ft.dwLowDateTime);
00162
00163       // Get the user's IE hyperlink color (for use in hyperlink controls in dialogs)
00164       g_colorHlink = GetHlinkColor();
00165
00166       // Create the main window.
00167       // Note: OnCreate() will be called before this function returns
00168       CreateWindowEx(0, m_lpszClassName, g_szAppTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN |
00169          WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, (LPVOID)this);
00170
00171       // If Solpack has been registered, remove the Register menu item
00172       if(g_lpszUserName)
00173          RemoveRegMenuItem();
00174
00175       // Restore the main window position from the registry setting
00176       CKey hKeyProduct;
00177       if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00178          if(RestoreWindowPlacement(hKeyProduct, IDS_REG_MAINWNDPLACEMENT, m_nCmdShow))
00179             m_nCmdShow = -1;  // -1 means we don't need to call ShowWindow later
00180
00181       // Prepare to navigate the browser to our UI's HTML file
00182       CTSTR lpszHtml = CreateResURL(g_hInstLC, CTSTR(IDS_MAINHTML));
00183
00184       // Remove below line to use the resource instead of the file
00185       //lpszHtml.Assign(TEXT("C:\\Programming\\Microsoft Visual Studio\\MyProjects\\Solitaire Pack\\SolpckLC\\res\\index.html"));
00186
00187       m_dwState = MW_WAITFORHTML;
00188       VARIANT v;
00189       v.vt = VT_I4;
00190       v.lVal = navNoHistory | navNoReadFromCache | navNoWriteToCache;
00191       CHECKHRCOM(m_spBrowser->Navigate(CBSTR(lpszHtml), &v, NULL, NULL, NULL));
00192    }
00193    catch(CExcep *pE)
00194    {
00195       m_dwState = MW_UNINIT;
00196       throw pE;
00197    }
00198
00199    return TRUE;
00200 }
00201
00202
00203 //----------------------------------------------------------------------------
00204 //
00205 // PreprocessMessage function.
00206 //    Gives the main window a chance to handle a message before Windows
00207 //    processes it.
00208 //
00209 // Parameters:
00210 //    lpMsg:         Pointer to the message to translate.
00211 //
00212 // Returns:          TRUE if the accelerator was handled, else FALSE.
00213 //
00214 //----------------------------------------------------------------------------
00215 BOOL CMainWindow::PreprocessMessage(LPMSG lpMsg)
00216 {
00217    // Handle keyboard accelerators
00218    if(TranslateAccelerator(m_hWnd, m_hAccelTable, lpMsg))
00219       return TRUE;
00220
00221    // Only interested in keyboard messages
00222    if((lpMsg->message >= WM_KEYFIRST) && (lpMsg->message <= WM_KEYLAST))
00223    {
00224       // If the help pane is being resized and user presses Escape, then cancel the size.
00225       if((lpMsg->wParam == VK_ESCAPE) && m_bPaneSizing)
00226       {
00227          RECT rc;
00228          GetClientRect(m_hWnd, &rc);
00229          OnSize(rc.right - rc.left, rc.bottom - rc.top);
00230          m_bPaneSizing = FALSE;
00231          m_pHelpPane->CancelResize();
00232          return TRUE;
00233       }
00234
00235       // Let the browser container handle the keyboard message.
00236       if(m_pBrowserContainer)
00237       {
00238          if(lpMsg->wParam == VK_TAB)
00239             m_pBrowserContainer->SetFocus();
00240          return (m_pBrowserContainer->TranslateKey(lpMsg) == S_OK);
00241       }
00242    }
00243
00244    // We didn't handle the message
00245    return FALSE;
00246 }
00247
00248
00249 //----------------------------------------------------------------------------
00250 //
00251 // MainWndProc function
00252 //    Callback function that handles messages to the main window.
00253 //
00254 // Parameters:
00255 //    hWnd:          The main window handle.
00256 //    uMsg:          Message identifer.
00257 //    wParam:        Message-specific parameter.
00258 //    lParam:        Message-specific parameter.
00259 //
00260 // Returns:
00261 //    Depends on the message. If the message was not handled, the return value
00262 //    of DefWindowProc will be returned.
00263 //
00264 //----------------------------------------------------------------------------
00265 LRESULT CALLBACK CMainWindow::MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
00266 {
00267    // Retrieve "this" pointer from window handle
00268    CMainWindow *pThis = (CMainWindow*)GetWindowLong(hWnd, GWL_USERDATA);
00269
00270    try   // Windows-called code
00271    {
00272       switch(uMsg)
00273       {
00274          // Called before the window is created.
00275          case WM_NCCREATE:
00276             // Store the "this" pointer with the window handle
00277             pThis = (CMainWindow*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00278             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00279             pThis->m_hWnd = hWnd;
00280             return TRUE;
00281
00282          // Called when the window is created
00283          case WM_CREATE:
00284             return (pThis->OnCreate() ? 0 : -1);
00285
00286          // Called when the user is sizing the window
00287          case WM_SIZE:
00288             if(wParam != SIZE_MINIMIZED)
00289                pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00290             return 0;
00291
00292          // Called before the window is destroyed
00293          case WM_DESTROY:
00294             pThis->OnDestroy();
00295             return 0;
00296
00297          // Called when system color settings have changed
00298          case WM_SYSCOLORCHANGE:
00299             if(pThis->m_pHelpPane)
00300                pThis->m_pHelpPane->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00301             if(pThis->m_pSB)
00302                pThis->m_pSB->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00303             break;
00304
00305          // Called when some system metric changed
00306          case WM_SETTINGCHANGE:
00307             if(pThis->m_pHelpPane)
00308                pThis->m_pHelpPane->UpdateFont();
00309             break;
00310
00311          // Called when the Close box is clicked
00312          case WM_CLOSE:
00313             g_bExited = TRUE;
00314             if(pThis->m_pEngine)
00315                pThis->m_pEngine->TryCommand((UINT)-1, 0, 0);
00316             PostMessage(hWnd, WM_USER, 0, 0);
00317             return 0;
00318
00319          // Called when a menu item is clicked
00320          case WM_COMMAND:
00321             if(pThis->OnCommand(LOWORD(wParam), lParam) == 0)
00322                return 0;
00323             break;
00324
00325          // Called before displaying popup menus
00326          case WM_INITMENU:
00327             if(pThis->m_pEngine)
00328             {
00329                HMENU hMenuGame = GetSubMenu((HMENU)wParam, 0);
00330                CUndoMgr *pUndoMgr = pThis->m_pEngine->GetUndoMgr();
00331                EnableMenuItem(hMenuGame, IDM_GAME_UNDO, MF_BYCOMMAND | (pUndoMgr->CanUndo() ?
00332                   MF_ENABLED : MF_GRAYED));
00333                EnableMenuItem(hMenuGame, IDM_GAME_REDO, MF_BYCOMMAND | (pUndoMgr->CanRedo() ?
00334                   MF_ENABLED : MF_GRAYED));
00335             }
00336             return 0;
00337
00338          // Called when the mouse moves over a menu item
00339          case WM_MENUSELECT:
00340             pThis->OnMenuSelect((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam);
00341             return 0;
00342
00343          // Called when the user begins sizing or moving the window
00344          case WM_ENTERSIZEMOVE:
00345             if(pThis->m_pBrowserContainer)
00346                pThis->m_pBrowserContainer->GetLocation(&pThis->m_rcSizeBefore);
00347             pThis->m_bSizing = TRUE;
00348             return 0;
00349
00350          // Called when the user finishes sizing or moving the window
00351          case WM_EXITSIZEMOVE:
00352             pThis->m_bSizing = FALSE;
00353             pThis->CheckRecalcNeeded();
00354             return 0;
00355
00356          // Called when the application loses focus
00357          case WM_ACTIVATE:
00358             if((LOWORD(wParam) == WA_INACTIVE) && (pThis->m_pEngine != NULL))
00359                pThis->m_pEngine->CancelMouseEvent();
00360             return 0;
00361
00362          // Custom message; called when the user starts resizing the help pane
00363          case WM_PANESIZE_START:
00364             pThis->m_cyHelpPaneSize = pThis->m_userPrefs.m_cyHelpPane;
00365             pThis->m_bPaneSizing = TRUE;
00366             break;
00367
00368          // Custom message; called while the user resizes the help pane
00369          case WM_PANESIZE_MOVE:
00370          {
00371             RECT rc;
00372             GetClientRect(hWnd, &rc);
00373             pThis->m_cyHelpPaneSize -= (int)wParam;
00374             if(pThis->m_cyHelpPaneSize < CY_HELPPANE_MIN)   // Don't size too small
00375                pThis->m_cyHelpPaneSize = CY_HELPPANE_MIN;   // or too large
00376             else if(rc.bottom - rc.top - pThis->m_cyHelpPaneSize < CY_BROWSER_MIN)
00377                pThis->m_cyHelpPaneSize = rc.bottom - rc.top - CY_BROWSER_MIN;
00378             pThis->OnSize(rc.right - rc.left, rc.bottom - rc.top, pThis->m_cyHelpPaneSize);
00379          } break;
00380
00381          // Custom message; called when the user finishes resizing the help pane
00382          case WM_PANESIZE_END:
00383             pThis->m_userPrefs.m_cyHelpPane = pThis->m_cyHelpPaneSize;
00384             pThis->m_bPaneSizing = FALSE;
00385             pThis->CheckRecalcNeeded();
00386             break;
00387       }
00388    }
00389    catch(CExcep *pE)
00390    {
00391       pE->Report();
00392       pE->Delete();
00393    }
00394
00395    // Let Windows process the message
00396    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00397 }
00398
00399
00400 //----------------------------------------------------------------------------
00401 //
00402 // OnCreate function
00403 //    Called in response to the WM_CREATE messsage. Sets up child windows and
00404 //    window-dependent objects.
00405 //
00406 // Parameters:       None.
00407 //
00408 // Returns:          TRUE if successful, FALSE if not.
00409 //
00410 //----------------------------------------------------------------------------
00411 BOOL CMainWindow::OnCreate()
00412 {
00413    g_hWnd = m_hWnd;  // Set the global main window handle
00414
00415    // Load the menu for this window
00416    SetMenu(m_hWnd, LoadMenu(g_hInstLC, MAKEINTRESOURCE(IDR_MAINMENU)));
00417
00418    try
00419    {
00420       // Initialize the common controls
00421       INITCOMMONCONTROLSEX icex;
00422       icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00423       icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_PROGRESS_CLASS;
00424       if(!InitCommonControlsEx(&icex))
00425          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMCTRL, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00426
00427       // Create and show help pane, if supposed to
00428       if(m_userPrefs.m_bHelpPane)
00429          DoHelpPane(TRUE);
00430
00431       // Create and show status bar, if supposed to
00432       if(m_userPrefs.m_bStatusBar)
00433          OptionStatusBar(TRUE);
00434
00435       // Create and initialize the web browser container
00436       m_pBrowserContainer = new CBrowserContainer(FALSE);
00437       ENSUREALLOC(m_pBrowserContainer);
00438       m_pBrowserContainer->AddRef();
00439       m_pBrowserContainer->Init(m_hWnd, &m_spBrowser, (IEventSinkSite*)this, 0);
00440       m_spBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
00441    }
00442    catch(CExcep *pE)
00443    {
00444       pE->Report();
00445       pE->Delete();
00446       return FALSE;
00447    }
00448
00449    // Set title of window
00450    SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)g_szAppTitle);
00451
00452    // If the user's online, check for updated versions of Solpack
00453    CheckForUpdate(IDS_UPDATEXML, (IUpdateSite*)this, m_userPrefs.m_bCheckVer,
00454       m_userPrefs.m_bCheckExtras);
00455
00456    return TRUE;
00457 }
00458
00459
00460 //----------------------------------------------------------------------------
00461 //
00462 // OnSize function
00463 //    Called in response to the WM_SIZE messsage. Resizes and moves child
00464 //    windows, as necessary.
00465 //
00466 // Parameters:
00467 //    nWidth:        Width of the client area, in pixels.
00468 //    nHeight:       Height of the client area, in pixels.
00469 //    cyHelpPane:    The height of the help pane (if called during sizing).
00470 //                   Defaults to -1, in which case the stored help pane height
00471 //                   is used.
00472 //
00473 // Returns:          None.
00474 //
00475 //----------------------------------------------------------------------------
00476 void CMainWindow::OnSize(int nWidth, int nHeight, int cyHelpPane)
00477 {
00478    // Calculate height that status bar occupies (zero if its not showing); position status bar
00479    int cyStatusBar = 0;
00480    if(m_pSB)
00481    {
00482       RECT rc;
00483       GetClientRect(*m_pSB, &rc);
00484       cyStatusBar = rc.bottom - rc.top;
00485       MoveWindow(*m_pSB, 0, nHeight - cyStatusBar, nWidth, cyStatusBar, TRUE);
00486    }
00487
00488    // Position help pane
00489    if(m_pHelpPane)
00490    {
00491       if(cyHelpPane == -1)
00492          cyHelpPane = m_userPrefs.m_cyHelpPane;
00493       MoveWindow(*m_pHelpPane, 0, nHeight - cyHelpPane - cyStatusBar, nWidth, cyHelpPane, TRUE);
00494    } else
00495       cyHelpPane = 0;
00496
00497    // Position the browser container
00498    if(m_pBrowserContainer)
00499       m_pBrowserContainer->SetLocation(0, 0, nWidth, nHeight - cyHelpPane - cyStatusBar);
00500
00501    // See if we need to call the current game's RecalcLayout
00502    if(!m_bSizing && !m_bPaneSizing)
00503       CheckRecalcNeeded();
00504 }
00505
00506
00507 //----------------------------------------------------------------------------
00508 //
00509 // OnDestroy function
00510 //    Called in response to the WM_DESTROY messsage. Delete all created
00511 //    objects, free all memory, and post quit message.
00512 //
00513 // Parameters:       None.
00514 //
00515 // Returns:          None.
00516 //
00517 //----------------------------------------------------------------------------
00518 void CMainWindow::OnDestroy()
00519 {
00520    // Release the engine object
00521    if(m_pEngine)
00522       m_pEngine->Uninit();
00523    SAFERELEASE(m_pEngine);
00524
00525    // Release the game menu
00526    if(m_dwState >= MW_INITHTML)
00527       m_gameMenu.Uninit();
00528
00529    CleanupCheckForUpdate();
00530
00531    // Store settings
00532    m_userPrefs.WriteRegistry(SETTING_ALL);
00533
00534    m_pHelpPane = NULL;
00535
00536    // Delete the HTML helper object
00537    SAFEDELETE(m_pHH);
00538
00539    // Uninitialize and free the browser container
00540    m_spBrowser.Release();
00541    if(m_pBrowserContainer)
00542    {
00543       m_pBrowserContainer->Uninit();
00544       m_pBrowserContainer->Release();
00545       m_pBrowserContainer = NULL;
00546    }
00547
00548    // Save window placement in registry
00549    CKey hKeyProduct;
00550    if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00551       SaveWindowPlacement(hKeyProduct, IDS_REG_MAINWNDPLACEMENT);
00552
00553    // Tell Windows we're ready to quit
00554    PostQuitMessage(0);
00555 }
00556
00557
00558 //----------------------------------------------------------------------------
00559 //
00560 // OnCommand function
00561 //    Called in response to the WM_COMMAND messsage. Handles the command as
00562 //    appropriate.
00563 //
00564 // Parameters:
00565 //    wCmd:          Identifier of the command to process.
00566 //    lParam:        (HWND) Handle to the control sending the message if the
00567 //                   message is from a control. Otherwise, this parameter is
00568 //                   NULL.
00569 //
00570 // Returns:          0 if the message was handled, else 1.
00571 //
00572 //----------------------------------------------------------------------------
00573 LRESULT CMainWindow::OnCommand(WORD wCmd, LPARAM lParam)
00574 {
00575    switch(wCmd)
00576    {
00577       //----------------------------------------------------------------------
00578       //
00579       // IDM_GAME_DEAL command
00580       //    Deals a new game.
00581       //
00582       // IDM_GAME_AUTOPLAY command
00583       //    Plays all possible cards to the foundation(s).
00584       //
00585       // IDM_GAME_UNDO command
00586       //    Undoes the previous move.
00587       //
00588       // IDM_GAME_REDO command
00589       //    Redoes the previously undone move.
00590       //
00591       //----------------------------------------------------------------------
00592       case IDM_GAME_DEAL:
00593       case IDM_GAME_AUTOPLAY:
00594       case IDM_GAME_UNDO:
00595       case IDM_GAME_REDO:
00596          if(m_dwState == MW_ENGINE)
00597             m_pEngine->TryCommand(WM_COMMAND, MAKELONG(wCmd, 0), lParam);
00598          break;
00599
00600       //----------------------------------------------------------------------
00601       //
00602       // IDM_GAME_GAMESMENU command
00603       //    Ends the current game and displays the games menu.
00604       //
00605       //----------------------------------------------------------------------
00606       case IDM_GAME_GAMESMENU:
00607          if(m_dwState == MW_ENGINE)
00608          {
00609             // Engine must be idle before we can continue
00610             if(m_pEngine->TryCommand(WM_COMMAND, MAKELONG(wCmd, 0), lParam))
00611             {
00612                m_pEngine->StopPlayGame();
00613                ShowHideEngine(FALSE);
00614                ShowHideGameMenu(TRUE);
00615                SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)g_szAppTitle);
00616             }
00617          }
00618          break;
00619
00620       //----------------------------------------------------------------------
00621       //
00622       // IDM_GAME_EXIT command
00623       //    Quits Solitaire Pack.
00624       //
00625       //----------------------------------------------------------------------
00626       case IDM_GAME_EXIT:
00627          if(m_pEngine)
00628             m_pEngine->TryCommand((UINT)-1, 0, 0);
00629          g_bExited = TRUE;
00630          break;
00631
00632       //----------------------------------------------------------------------
00633       //
00634       // IDM_OPTIONS_PROGRAMOPTIONS command
00635       //    Changes options.
00636       //
00637       //----------------------------------------------------------------------
00638       case IDM_OPTIONS_PROGRAMOPTIONS:
00639          m_userPrefs.DoOptions(m_hWnd);
00640          break;
00641
00642       //----------------------------------------------------------------------
00643       //
00644       // IDM_OPTIONS_ADDGAMELIBRARY command
00645       //    Registers a game library and adds its games to the menu.
00646       //
00647       //----------------------------------------------------------------------
00648       case IDM_OPTIONS_ADDGAMELIBRARY:
00649       {
00650          // Present the File Open dialog box
00651          CTSTR lpszTheFile;
00652          if(SingleOFN(lpszTheFile, IDS_FILTER, NULL, m_hWnd, OFN_FILEMUSTEXIST |
00653             OFN_HIDEREADONLY, CTSTR(IDS_ADDGAMELIBTITLE), CTSTR(), IDS_DEFEXT) == 1)
00654          {
00655             // We have a file, so try to register it
00656             CWaitCursor wait;
00657             if(m_libMgr.RegLibrary(lpszTheFile))
00658             {
00659                m_libMgr.Refresh();
00660                m_gameMenu.Refresh(m_pMsgProcessor);
00661             }
00662          }
00663       } break;
00664
00665       //----------------------------------------------------------------------
00666       //
00667       // IDM_HELP_CONTENTSANDINDEX command
00668       //    Opens Help.
00669       //
00670       //----------------------------------------------------------------------
00671       case IDM_HELP_CONTENTSANDINDEX:
00672 //       g_pHelp->ShowHelp(m_hWnd);
00673          break;
00674
00675       //----------------------------------------------------------------------
00676       //
00677       // IDM_HELP_GAMEINSTRUCTIONS command
00678       //    Displays instructions on how to play the current game.
00679       //
00680       //----------------------------------------------------------------------
00681       case IDM_HELP_GAMEINSTRUCTIONS:
00682          DoHelpPane(!m_userPrefs.m_bHelpPane);
00683          break;
00684
00685       //----------------------------------------------------------------------
00686       //
00687       // IDM_HELP_ABOUT command
00688       //    Displays the About box.
00689       //
00690       //----------------------------------------------------------------------
00691       case IDM_HELP_ABOUT:
00692       {
00693          CAboutDlg a;
00694          if(a.Run(m_hWnd) != IDC_ABOUT_REGISTER)
00695             break;   // Break if OK button was clicked
00696       } // continue on if Register button was clicked
00697
00698       //----------------------------------------------------------------------
00699       //
00700       // IDM_HELP_REGISTER command
00701       //    Displays the Registration dialog box.
00702       //
00703       //----------------------------------------------------------------------
00704       case IDM_HELP_REGISTER:
00705       {
00706          // Display the Registration dialog box
00707          CKey hKeyProduct;
00708          GetProductKey(hKeyProduct, FALSE);
00709          CTSTR lpszApp(IDS_APP_TITLE);
00710          if(ShowRegistrationDialog(m_hWnd, hKeyProduct, lpszApp, CTSTR(IDS_REGISTERURL),
00711             g_colorHlink, SOLPACK_HASHVALUE))
00712          {
00713             // The user registered successfully
00714             g_lpszUserName = GetRegisteredName(hKeyProduct, lpszApp, SOLPACK_HASHVALUE);
00715             CTSTR lpszGreetingHolder(IDS_REGISTEREDGREETING);
00716             CTSTR lpszGreeting(TRUE, g_lpszUserName.Len() + lpszGreetingHolder.Len() + 1);
00717             wsprintf(lpszGreeting, lpszGreetingHolder, g_lpszUserName);
00718             MessageBox(m_hWnd, lpszGreeting, g_szAppTitle, MB_OK);
00719             RemoveRegMenuItem();
00720          }
00721          break;
00722       }
00723
00724       default:
00725          return 1;   // Unhandled command
00726    }
00727    return 0;
00728 }
00729
00730
00731 //----------------------------------------------------------------------------
00732 //
00733 // OnMenuSelect function
00734 //    Called in response to the WM_MENUSELECT messsage. If the status bar is
00735 //    being displayed, the menu help string is shown.
00736 //
00737 // Parameters:
00738 //    idCmd:         The command identifier of the menu item, or, if the item
00739 //                   is a popup menu, its zero-based index.
00740 //    uFlags:        Flags specifiying attributes of the item.
00741 //    hMenu:         Handle to the menu that was clicked.
00742 //
00743 // Returns:          None.
00744 //
00745 //----------------------------------------------------------------------------
00746 void CMainWindow::OnMenuSelect(UINT idCmd, UINT uFlags, HMENU hMenu)
00747 {
00748    if(!m_pSB)
00749       return;
00750
00751    if(!hMenu && (LOWORD(uFlags) == 0xffff))
00752    {
00753       // Menu is being closed;
00754       m_pSB->CancelHelpText();
00755       return;
00756    }
00757
00758    // Set uHelp to be the string resource identifier of the help string for the
00759    // given menu item or popup
00760    UINT uHelp;
00761
00762    if(uFlags & MF_SEPARATOR)
00763    {
00764       // Over a separator; use blank text
00765       uHelp = (UINT)-1;
00766    } else if(uFlags & (MF_SYSMENU))
00767    {
00768       // Somewhere in the system menu
00769       if(uFlags & MF_POPUP)
00770       {
00771          // The system menu itself
00772          uHelp = IDS_SYSMENU;
00773       } else
00774       {
00775          // Find out which system menu item is being used
00776          switch(idCmd)
00777          {
00778             case SC_SIZE:
00779                uHelp = IDS_SC_SIZE;
00780                break;
00781             case SC_MOVE:
00782                uHelp = IDS_SC_MOVE;
00783                break;
00784             case SC_MINIMIZE:
00785                uHelp = IDS_SC_MINIMIZE;
00786                break;
00787             case SC_MAXIMIZE:
00788                uHelp = IDS_SC_MAXIMIZE;
00789                break;
00790             case SC_CLOSE:
00791                uHelp = 10000 + IDM_GAME_EXIT;
00792                break;
00793             case SC_RESTORE:
00794                uHelp = IDS_SC_RESTORE;
00795                break;
00796             case SC_TASKLIST:
00797                uHelp = IDS_SC_TASKLIST;
00798                break;
00799          }
00800       }
00801    } else if(uFlags & MF_POPUP)
00802    {
00803       // Some popup menu
00804       uHelp = 12000 - idCmd;
00805    } else
00806       // A menu item
00807       uHelp = 10000 + idCmd;
00808
00809    m_pSB->SetHelpText(uHelp);
00810 }
00811
00812
00813 //----------------------------------------------------------------------------
00814 //
00815 // RemoveRegMenuItem function
00816 //    Removes the Register menu item and separator from the menu.
00817 //
00818 // Parameters:       None.
00819 //
00820 // Returns:          None.
00821 //
00822 //----------------------------------------------------------------------------
00823 void CMainWindow::RemoveRegMenuItem()
00824 {
00825    HMENU hMenu = GetSubMenu(GetMenu(m_hWnd), 2);
00826    RemoveMenu(hMenu, 2, MF_BYPOSITION);
00827    RemoveMenu(hMenu, IDM_HELP_REGISTER, MF_BYCOMMAND);
00828    DrawMenuBar(m_hWnd);
00829 }
00830
00831
00832 //----------------------------------------------------------------------------
00833 //
00834 // IUpdateSite::UpdateDone method
00835 //    Called when it has been determined what version of Solpack is now
00836 //    available. If it is a newer version than this, informs the user.
00837 //
00838 // Parameters:
00839 //    dAvailVersion: The version number of Solpack that is now available,
00840 //                   according to the update code.
00841 //    bstrExtra:     The extra information available, such as new game modules
00842 //                   available for download.
00843 //
00844 // Returns:          None.
00845 //
00846 //----------------------------------------------------------------------------
00847 void CMainWindow::UpdateDone(double dAvailVersion, CBSTR& bstrExtra)
00848 {
00849    // Did we actually find something?
00850    if(dAvailVersion > BMWS_APP_VER || bstrExtra)
00851    {
00852       m_dAvailVersion = dAvailVersion;
00853       m_bstrExtras = bstrExtra;
00854       if(m_pHH)
00855       {
00856          PresentUpdate();         // Present update now
00857       } else
00858          m_bPresentUpdate = TRUE; // Wait for main window to be ready before presenting update
00859    }
00860 }
00861
00862
00863 //----------------------------------------------------------------------------
00864 //
00865 // IUpdateDlgSite::GetCheckUpdate method
00866 //    Called by the update dialog box to retrieve current notification
00867 //    settings.
00868 //
00869 // Parameters:
00870 //    pbNewVer:         Receives whether to check for new versions.
00871 //    pbExtras:         Receives whether to check for extra features.
00872 //    lpszNewVerText:   Text to associate with the new version check box.
00873 //    lpszExtrasText:   Text to associate with the extras check box.
00874 //
00875 // Returns:             None.
00876 //
00877 //----------------------------------------------------------------------------
00878 void CMainWindow::GetCheckUpdate(BOOL *pbNewVer, BOOL *pbExtras, CTSTR& lpszNewText,
00879                                  CTSTR& lpszExtrasText)
00880 {
00881    *pbNewVer = m_userPrefs.m_bCheckVer;
00882    *pbExtras = m_userPrefs.m_bCheckExtras;
00883
00884    // Text parameters are not modified, so default text is displayed
00885 }
00886
00887
00888 //----------------------------------------------------------------------------
00889 //
00890 // IUpdateDlgSite::SetCheckUpdate method
00891 //    Called when the user changes the update checking settings via the
00892 //    update available dialog box.
00893 //
00894 // Parameters:
00895 //    bNewVer:       Whether to check for new versions.
00896 //    bExtras:       Whether to check for extra features.
00897 //
00898 // Returns:          None.
00899 //
00900 //----------------------------------------------------------------------------
00901 void CMainWindow::SetCheckUpdate(BOOL bNewVer, BOOL bExtras)
00902 {
00903    // Store new settings
00904    m_userPrefs.m_bCheckVer = bNewVer;
00905    m_userPrefs.m_bCheckExtras = bExtras;
00906    m_userPrefs.WriteRegistry(SETTING_NOTIFY);
00907 }
00908
00909
00910 //----------------------------------------------------------------------------
00911 //
00912 // IEventSinkSite::EventSink method
00913 //    Handles all events from the WebBrowser event sink.
00914 //
00915 // Parameters:
00916 //    lParam:        Optional site-specific parameter. (Not used)
00917 //    dispid:        The identifier of the event.
00918 //    pdispparams:   Pointer to any parameters associated with the event.
00919 //
00920 // Returns:          S_OK in all cases.
00921 //
00922 //----------------------------------------------------------------------------
00923 HRESULT CMainWindow::EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS *pdispparams)
00924 {
00925    try   // Windows-called code
00926    {
00927       switch(dispid)
00928       {
00929          // The HTML document has reached the READYSTATE_COMPLETE state
00930          case DISPID_DOCUMENTCOMPLETE:
00931             HTMLComplete();
00932             break;
00933
00934          // Before navigation occurs in the browser
00935          case DISPID_BEFORENAVIGATE2:
00936             if(m_bNavigated)
00937             {
00938                // We've already shown our UI HTML document, so this must be a link,
00939                // which should be displayed in a new window
00940                *(pdispparams->rgvarg[0].pboolVal) = VARIANT_TRUE;
00941                if(pdispparams->rgvarg[5].vt == (VT_VARIANT | VT_BYREF))
00942                {
00943                   VARIANT *pvar = pdispparams->rgvarg[5].pvarVal;
00944                   if(pvar->vt == VT_BSTR)
00945                   {
00946                      CHECKHRCOM(m_spBrowser->Navigate(pvar->bstrVal,
00947                         &(CVariant(navOpenInNewWindow)), NULL, NULL, NULL));
00948                   }
00949                }
00950             } else   // This is the first navigation (to our UI HTML document)
00951                m_bNavigated = TRUE;
00952             break;
00953       }
00954    }
00955    catch(CExcep *pE)
00956    {
00957       pE->Report();
00958       pE->Delete();
00959    }
00960    return S_OK;
00961 }
00962
00963
00964 //----------------------------------------------------------------------------
00965 //
00966 // IEngineSite::SetScore method
00967 //    Called by the engine when the displayed score should be updated.
00968 //
00969 // Parameters:
00970 //    lScore:        The new score to display.
00971 //
00972 // Returns:          S_OK in all cases.
00973 //
00974 //----------------------------------------------------------------------------
00975 void CMainWindow::SetScore(long lScore)
00976 {
00977    m_pSB->SetScore(lScore);
00978 }
00979
00980
00981 //----------------------------------------------------------------------------
00982 //
00983 // IEngineSite::GetShowTooltips method
00984 //    Retrieves whether to show pile tooltips.
00985 //
00986 // Parameters:       None.
00987 //
00988 // Returns:          TRUE if tooltips are to be displayed, else FALSE.
00989 //
00990 //----------------------------------------------------------------------------
00991 BOOL CMainWindow::GetShowTooltips()
00992 {
00993    return m_userPrefs.m_bTooltips;
00994 }
00995
00996
00997 //----------------------------------------------------------------------------
00998 //
00999 // IEngineSite::GetAnim method
01000 //    Retrieves whether to animate cards.
01001 //
01002 // Parameters:       None.
01003 //
01004 // Returns:          TRUE if cards are to be animated, else FALSE.
01005 //
01006 //----------------------------------------------------------------------------
01007 BOOL CMainWindow::GetAnim()
01008 {
01009    return m_userPrefs.m_bAnimCards;
01010 }
01011
01012
01013 //----------------------------------------------------------------------------
01014 //
01015 // IEngineSite::PlayCPSound method
01016 //    Plays the specified Control Panel sound.
01017 //
01018 // Parameters:
01019 //    uIndex:        Zero-based index of the sound to play.
01020 //
01021 // Returns:          None.
01022 //
01023 //----------------------------------------------------------------------------
01024 void CMainWindow::PlayCPSound(UINT uIndex)
01025 {
01026    m_userPrefs.m_pCPSounds->Play(uIndex);
01027 }
01028
01029
01030 //----------------------------------------------------------------------------
01031 //
01032 // IEngineSite::PostMsg method
01033 //    Posts the specified message to the window's message queue.
01034 //
01035 // Parameters:
01036 //    uMsg:          Message identifer.
01037 //    wParam:        Message-specific parameter.
01038 //    lParam:        Message-specific parameter.
01039 //
01040 // Returns:          None.
01041 //
01042 //----------------------------------------------------------------------------
01043 void CMainWindow::PostMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
01044 {
01045    PostMessage(m_hWnd, uMsg, wParam, lParam);
01046 }
01047
01048
01049 //----------------------------------------------------------------------------
01050 //
01051 // IGameMenuSite::GameSelected method
01052 //    Called when a game was chosen from the menu. Hide the menu, activate the
01053 //    engine, and start up the game.
01054 //
01055 // Parameters:
01056 //    iLibIndex:     Zero-based index of the library containing the game.
01057 //    iGameIndex:    Zero-based index of the game within its library.
01058 //
01059 // Returns:          None.
01060 //
01061 //----------------------------------------------------------------------------
01062 void CMainWindow::GameSelected(int iLibIndex, int iGameIndex)
01063 {
01064    if(m_dwState == MW_GAMEMENU)
01065    {
01066       // Switch to the engine
01067       ShowHideGameMenu(FALSE);
01068       ShowHideEngine(TRUE);
01069
01070       // Retrieve the title
01071       CBSTR bstr;
01072       CSolpackGameInfoPtr spInfo(TRUE, m_libMgr.GetGameInfo(iLibIndex, iGameIndex));
01073       CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
01074
01075       // Modify the window's title bar
01076       CTSTR lpszHolder(IDS_TITLEBARHOLDER);
01077       CTSTR lpszTotal(TRUE, lpszHolder.Len() + lstrlen(g_szAppTitle) + bstr.Len());
01078       wsprintf(lpszTotal, lpszHolder, g_szAppTitle, CTSTR(bstr));
01079       SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)lpszTotal);
01080
01081       // Start the game
01082       m_pEngine->PlayGame(iLibIndex, iGameIndex);
01083    }
01084 }
01085
01086
01087 //----------------------------------------------------------------------------
01088 //
01089 // IGameMenuSite::ToggleShowRules method
01090 //    Switches whether the instruction pane is showing.
01091 //
01092 // Parameters:       None.
01093 //
01094 // Returns:          None.
01095 //
01096 //----------------------------------------------------------------------------
01097 void CMainWindow::ToggleShowRules()
01098 {
01099    DoHelpPane(m_pHelpPane == NULL);
01100 }
01101
01102
01103 //----------------------------------------------------------------------------
01104 //
01105 // IGameMenuSite::ActiveGameChanged method
01106 //    Called when the menu's active game has changed.
01107 //
01108 // Parameters:       None.
01109 //
01110 // Returns:          None.
01111 //
01112 //----------------------------------------------------------------------------
01113 void CMainWindow::ActiveGameChanged()
01114 {
01115    if(m_pHelpPane)
01116       UpdateInstr();
01117 }
01118
01119
01120 //----------------------------------------------------------------------------
01121 //
01122 // IStatusBarMgr::SBSetText method
01123 //    Updates the text displayed in the status bar, if the status bar is
01124 //    visible.
01125 //
01126 // Parameters:
01127 //    lpszStatus:    The status text to display; pass CTSTR() to clear the
01128 //                   text.
01129 //
01130 // Returns:          S_OK in all cases.
01131 //
01132 //----------------------------------------------------------------------------
01133 void CMainWindow::SBSetText(CTSTR& lpszStatus)
01134 {
01135    if(m_pSB)
01136       m_pSB->SetStatusText(lpszStatus);
01137 }
01138
01139
01140 //----------------------------------------------------------------------------
01141 //
01142 // IStatusBarMgr::SBUpdateTasks method
01143 //    Updates the status bar's progress bar based upon task completion, if the
01144 //    status bar is visible.
01145 //
01146 // Parameters:
01147 //    cAdd:          The number of tasks to add to the total count.
01148 //    cCompleted:    The number of tasks which have just been completed.
01149 //
01150 // Returns:          S_OK in all cases.
01151 //
01152 //----------------------------------------------------------------------------
01153 void CMainWindow::SBUpdateTasks(int cAdd, int cCompleted)
01154 {
01155    // Update internal counter
01156    m_cTasks += cAdd;
01157    m_cTasksDone += cCompleted;
01158
01159    if(m_cTasks == m_cTasksDone)
01160    {
01161       // We've completed all pending tasks, so reset progress bar
01162       m_cTasks = 0;
01163       m_cTasksDone = 0;
01164       if(m_pSB)
01165          m_pSB->SetProgress(0);
01166    } else
01167    {
01168       // Update progress bar with progress so far
01169       _ASSERT(m_cTasks != 0);
01170       if(m_pSB)
01171          m_pSB->SetProgress((32768 / m_cTasks) * (m_cTasksDone + 1));
01172    }
01173 }
01174
01175
01176 //----------------------------------------------------------------------------
01177 //
01178 // PresentUpdate function
01179 //    Informs the user that a new version or extra features are available.
01180 //
01181 // Parameters:       None.
01182 //
01183 // Returns:          None.
01184 //
01185 //----------------------------------------------------------------------------
01186 void CMainWindow::PresentUpdate()
01187 {
01188    // Determine what is available and make the text to display it.
01189    m_bPresentUpdate = FALSE;
01190    CTSTR lpszVer;
01191    CTSTR lpszExtra;
01192    CTSTR lpszTotal;
01193    if(m_dAvailVersion > BMWS_APP_VER)
01194    {
01195       lpszVer.Alloc(128);
01196       wsprintf(lpszVer, CTSTR(IDS_NEWVERHOLDER), FormatDouble(m_dAvailVersion));
01197    }
01198    if(m_bstrExtras)
01199       lpszExtra = (BSTR)m_bstrExtras;
01200    if((m_dAvailVersion > BMWS_APP_VER) && m_bstrExtras)
01201    {
01202       lpszTotal.Alloc(lstrlen(lpszVer) + lstrlen(lpszExtra) + 8);
01203       wsprintf(lpszTotal, TEXT("%s\r\n\r\n%s"), lpszVer, lpszExtra);
01204    } else
01205       lpszTotal.Assign((m_dAvailVersion > BMWS_APP_VER) ? lpszVer : lpszExtra);
01206
01207    // Create the standard update dialog box
01208    CUpdateDlg dlg((IUpdateDlgSite*)this, IDS_SITEURL, lpszTotal, g_colorHlink);
01209    dlg.Run(m_hWnd);
01210 }
01211
01212
01213 //----------------------------------------------------------------------------
01214 //
01215 // DoHelpPane function
01216 //    Shows or hides the help pane.
01217 //
01218 // Parameters:
01219 //    bShow:         TRUE to show the help pane, or FALSE to hide it.
01220 //
01221 // Returns:          None.
01222 //
01223 //----------------------------------------------------------------------------
01224 void CMainWindow::DoHelpPane(BOOL bShow)
01225 {
01226    m_userPrefs.m_bHelpPane = bShow;
01227
01228    // Adjust menu item check mark
01229    CheckMenuItem(GetSubMenu(GetMenu(m_hWnd), 2), IDM_HELP_GAMEINSTRUCTIONS, MF_BYCOMMAND |
01230       (bShow ? MF_CHECKED : MF_UNCHECKED));
01231
01232    m_pHelpPane = NULL;
01233    if(m_userPrefs.m_bHelpPane)
01234    {
01235       // Create new help pane object
01236       m_pHelpPane = new CHelpPane();
01237       ENSUREALLOC(m_pHelpPane);
01238       m_pHelpPane->Register();
01239       m_pHelpPane->Create(m_hWnd);
01240
01241       UpdateInstr();
01242    }
01243
01244    if(m_pHH)
01245       m_pHH->SetElText(IDS_EL_MENUINSTR,
01246          CBSTR(m_pHelpPane == NULL ? IDS_SHOWRULES : IDS_HIDERULES));
01247
01248    // Re-layout the main window
01249    RECT rc;
01250    GetClientRect(m_hWnd, &rc);
01251    OnSize(rc.right - rc.left, rc.bottom - rc.top);
01252
01253    m_userPrefs.WriteRegistry(SETTING_GENERAL);
01254 }
01255
01256
01257 //----------------------------------------------------------------------------
01258 //
01259 // IUserPrefsSite::OptionStatusBar method
01260 //    Shows or hides the status bar.
01261 //
01262 // Parameters:
01263 //    bShow:         Whether the status bar should be shown.
01264 //
01265 // Returns:          None.
01266 //
01267 //----------------------------------------------------------------------------
01268 void CMainWindow::OptionStatusBar(BOOL bShow)
01269 {
01270    m_userPrefs.m_bStatusBar = bShow;
01271
01272    m_pSB = NULL;
01273    if(bShow)
01274    {
01275       // Create the status bar object
01276       m_pSB = new CStatusBar();
01277       ENSUREALLOC(m_pSB);
01278       m_pSB->Create(m_hWnd);
01279    }
01280
01281    // Re-layout the main window
01282    RECT rc;
01283    GetClientRect(m_hWnd, &rc);
01284    OnSize(rc.right - rc.left, rc.bottom - rc.top);
01285 }
01286
01287
01288 //----------------------------------------------------------------------------
01289 //
01290 // IUserPrefsSite::OptionTooltips method
01291 //    Shows or hides pile tooltips.
01292 //
01293 // Parameters:
01294 //    bShow:         Whether tooltips should be displayed.
01295 //
01296 // Returns:          None.
01297 //
01298 //----------------------------------------------------------------------------
01299 void CMainWindow::OptionTooltips(BOOL bShow)
01300 {
01301    m_userPrefs.m_bTooltips = bShow;
01302
01303    // Toggle tooltips
01304    m_pEngine->UpdateTooltips();
01305 }
01306
01307
01308 //----------------------------------------------------------------------------
01309 //
01310 // IUserPrefsSite::GetHH method
01311 //    Retrieves the HTML helper object, so that the display can be updated.
01312 //
01313 // Parameters:
01314 //
01315 // Returns:          The current HTML helper object.
01316 //
01317 //----------------------------------------------------------------------------
01318 CHTMLHelper* CMainWindow::GetHH()
01319 {
01320    return m_pHH;
01321 }
01322
01323
01324 //----------------------------------------------------------------------------
01325 //
01326 // HTMLComplete function
01327 //    When the HTML document has been loaded, set up the HTML helper object.
01328 //
01329 // Parameters:       None.
01330 //
01331 // Returns:          None.
01332 //
01333 //----------------------------------------------------------------------------
01334 void CMainWindow::HTMLComplete()
01335 {
01336    if(m_dwState != MW_WAITFORHTML)  // Have we already handled this event?
01337       return;
01338
01339    m_dwState = MW_INITHTML;
01340
01341    // Get the HTML document object from the web browser
01342    CDispatchPtr spDocDisp;
01343    CHECKHRCOM(m_spBrowser->get_Document(&spDocDisp));
01344    if(!spDocDisp)
01345       THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
01346    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTMLDoc = spDocDisp;
01347    m_pHH = new CHTMLHelper(spHTMLDoc);
01348    ENSUREALLOC(m_pHH);
01349
01350    // Prevent the HTML from being selected or dragged
01351    m_pHH->ProtectUI(IDS_EL_BODY);
01352
01353    // Initialize the HTML helper for adding document styles
01354    m_pHH->InitAddStyle();
01355
01356    // Apply all appearance settings to the HTML
01357    m_userPrefs.UpdateAppearance(UA_ALL);
01358
01359    // We're all set up now, so destroy the splash screen
01360    if(m_pSplash)
01361    {
01362       DestroyWindow(*m_pSplash);
01363       m_pSplash = NULL;
01364    }
01365
01366    // Show the main window
01367    if(m_nCmdShow >= 0)
01368    {
01369       ShowWindow(m_nCmdShow);
01370       UpdateWindow(m_hWnd);
01371    }
01372
01373    // If we already know there's new stuff available, present it to the user
01374    if(m_bPresentUpdate)
01375       PresentUpdate();
01376
01377    // Enumerate the registered game libraries
01378    m_libMgr.Refresh();
01379
01380    // Create and initialize the engine
01381    m_pEngine = new CEngine();
01382    ENSUREALLOC(m_pEngine);
01383    m_pEngine->AddRef();
01384    m_pEngine->InitEngine(m_pMsgProcessor, (IEngineSite*)this, (IStatusBarMgr*)this, &m_libMgr,
01385       m_pHH);
01386
01387    m_pHH->SetElText(IDS_EL_MENUINSTR,
01388       CBSTR(m_pHelpPane == NULL ? IDS_SHOWRULES : IDS_HIDERULES));
01389
01390    // Initialize the game menu and then show it
01391    m_gameMenu.Init(m_pMsgProcessor, (IGameMenuSite*)this, (IStatusBarMgr*)this, &m_libMgr,
01392       m_pHH);
01393    ShowHideGameMenu(TRUE);
01394 }
01395
01396
01397 //----------------------------------------------------------------------------
01398 //
01399 // ShowHideGameMenu function
01400 //    Shows or hides the game menu UI, changing corresponding main window UI
01401 //    as needed.
01402 //
01403 // Parameters:
01404 //    bShow:         TRUE to show the game menu, FALSE to hide it.
01405 //
01406 // Returns:          None.
01407 //
01408 //----------------------------------------------------------------------------
01409 void CMainWindow::ShowHideGameMenu(BOOL bShow)
01410 {
01411    m_gameMenu.Show(bShow);
01412    if(bShow)
01413       m_dwState = MW_GAMEMENU;
01414 }
01415
01416
01417 //----------------------------------------------------------------------------
01418 //
01419 // ShowHideEngine function
01420 //    Changes main window UI as related to the engine.
01421 //
01422 // Parameters:
01423 //    bShow:         TRUE to show the engine UI, FALSE to hide it.
01424 //
01425 // Returns:          None.
01426 //
01427 //----------------------------------------------------------------------------
01428 void CMainWindow::ShowHideEngine(BOOL bShow)
01429 {
01430    // Get the Game submenu (of the main window menu)
01431    HMENU hGameMenu = GetSubMenu(GetMenu(m_hWnd), 0);
01432
01433    // Enable or disable flags
01434    UINT uEnable = MF_BYCOMMAND | (bShow ? MF_ENABLED : MF_GRAYED);
01435
01436    // Enable or disable menu items
01437    EnableMenuItem(hGameMenu, IDM_GAME_DEAL, uEnable);
01438    EnableMenuItem(hGameMenu, IDM_GAME_AUTOPLAY, uEnable);
01439    EnableMenuItem(hGameMenu, IDM_GAME_GAMESMENU, uEnable);
01440
01441    if(bShow)
01442       m_dwState = MW_ENGINE;
01443    else
01444       m_pSB->SetStatusText(CTSTR());
01445 }
01446
01447
01448 //----------------------------------------------------------------------------
01449 //
01450 // CheckRecalcLayout function
01451 //    Determines whether the WebBrowser dimensions have changed; if so,
01452 //    informs the engine to tell the current game to recalculate its layout.
01453 //
01454 // Parameters:       None.
01455 //
01456 // Returns:          None.
01457 //
01458 //----------------------------------------------------------------------------
01459 void CMainWindow::CheckRecalcNeeded()
01460 {
01461    if(m_pBrowserContainer)
01462    {
01463       // Figure out if the size of the browser container actually changed
01464       RECT rc;
01465       m_pBrowserContainer->GetLocation(&rc);
01466       if(((m_rcSizeBefore.right - m_rcSizeBefore.left) != (rc.right - rc.left)) ||
01467          ((m_rcSizeBefore.bottom - m_rcSizeBefore.top) != (rc.bottom - rc.top)))
01468       {
01469          m_pBrowserContainer->GetLocation(&m_rcSizeBefore);
01470          if(m_pEngine)
01471             m_pEngine->RecalcLayout();
01472       }
01473    }
01474 }
01475
01476
01477 //----------------------------------------------------------------------------
01478 //
01479 // UpdateInstr function
01480 //    Sets the text of the instruction pane to that of the rules of the menu's
01481 //    currently selected game.
01482 //
01483 // Parameters:       None.
01484 //
01485 // Returns:          None.
01486 //
01487 //----------------------------------------------------------------------------
01488 void CMainWindow::UpdateInstr()
01489 {
01490    // If we have no games, there are no instructions to show
01491    if(m_libMgr.GetNumGames(-1) < 1)
01492       return;
01493
01494    // Retrieve the game information object
01495    CBSTR bstr;
01496    CSolpackGameInfoPtr spInfo(TRUE, m_libMgr.GetGameInfo(m_gameMenu.GetActiveLib(),
01497       m_gameMenu.GetActiveGame()));
01498
01499    // Store the title and rules strings
01500    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
01501    m_pHelpPane->SetGame(bstr);
01502    bstr = NULL;
01503    CHECKHRCOM(spInfo->get_Rules(bstr.Addr()));
01504    m_pHelpPane->SetInstr(bstr);
01505 }
Generated on Wed May 8 12:39:08 2002 for Solitaire Pack by doxygen 1.2.15


MainWindow.h File Reference

#include "ProcessMsg.h"
#include "UserPrefs.h"
#include "HelpPane.h"
#include "StatusBar.h"
#include "StatusBarMgr.h"
#include "Engine.h"
#include "GameMenu.h"
#include <bmws_window.h>
#include <bmws_splashscreen.h>
#include <bmws_update.h>
#include <bmws_updatedlg.h>
#include <bmws_browsercontainer.h>

Go to the source code of this file.

Compounds

class | CMainWindow

Defines

#define | AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Definition at line 10 of file MainWindow.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


MainWindow.h Source File

MainWindow.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // MainWindow.h
00004 //    Class to encapsulate the main window and main program logic.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
00010 #define AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "ProcessMsg.h"
00021 #include "UserPrefs.h"
00022 #include "HelpPane.h"
00023 #include "StatusBar.h"
00024 #include "StatusBarMgr.h"
00025 #include "Engine.h"
00026 #include "GameMenu.h"
00027 #include <bmws_window.h>
00028 #include <bmws_splashscreen.h>
00029 #include <bmws_update.h>
00030 #include <bmws_updatedlg.h>
00031 #include <bmws_browsercontainer.h>
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CMainWindow class
00037 //    Encapsulates the main window and main program logic.
00038 //
00039 //----------------------------------------------------------------------------
00040 class CMainWindow : public CHWND, public IStatusBarMgr, public IUserPrefsSite,
00041                     public IEngineSite, public IGameMenuSite, public IUpdateSite,
00042                     public IUpdateDlgSite, public IEventSinkSite
00043 {
00044 public:
00045    CMainWindow(IMsgProcessor *pMsgProcessor);
00046    virtual ~CMainWindow();
00047
00048    void Register();
00049    BOOL Create(CSplashWindow* pSplash, int nCmdShow);
00050    BOOL PreprocessMessage(LPMSG lpMsg);
00051
00052    // Window procedure
00053    static LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00054
00055    static BOOL s_bRegistered;    // Has the window class been registered?
00056
00057    // IUpdateSite method
00058    virtual void UpdateDone(double dAvailVersion, CBSTR& bstrExtra);
00059
00060    // IUpdateDlgSite methods
00061    virtual void GetCheckUpdate(BOOL *pbNewVer, BOOL *pbExtras, CTSTR& lpszNewVerText,
00062       CTSTR& lpszExtrasText);
00063    virtual void SetCheckUpdate(BOOL bNewVer, BOOL bExtras);
00064
00065    // IEventSinkSite method
00066    HRESULT EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams);
00067
00068    // IEngineSite methods
00069    void SetScore(long lScore);
00070    BOOL GetShowTooltips();
00071    BOOL GetAnim();
00072    void PlayCPSound(UINT uIndex);
00073    void PostMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
00074
00075    // IGameMenuSite method
00076    void GameSelected(int iLibIndex, int iGameIndex);
00077    void ToggleShowRules();
00078    void ActiveGameChanged();
00079
00080    // IUserPrefsSite method
00081    void OptionStatusBar(BOOL bShow);
00082    void OptionTooltips(BOOL bShow);
00083    CHTMLHelper* GetHH();
00084
00085    // IStatusBarMgr method
00086    void SBSetText(CTSTR& lpszStatus);
00087    void SBUpdateTasks(int cAdd, int cCompleted);
00088
00089 protected:
00090    // Window message handlers
00091    BOOL OnCreate();
00092    void OnSize(int nWidth, int nHeight, int cyHelpPane = -1);
00093    void OnDestroy();
00094    LRESULT OnCommand(WORD wCmd, LPARAM lParam);
00095    void OnMenuSelect(UINT idCmd, UINT uFlags, HMENU hMenu);
00096
00097    void RemoveRegMenuItem();
00098    void PresentUpdate();
00099    void DoHelpPane(BOOL bShow);
00100    void HTMLComplete();
00101    void ShowHideGameMenu(BOOL bShow);
00102    void ShowHideEngine(BOOL bShow);
00103    void CheckRecalcNeeded();
00104    void UpdateInstr();
00105
00106    IMsgProcessor *m_pMsgProcessor;           // Message processor interface
00107    int m_nCmdShow;                           // Way in which window should be displayed
00108
00109    CPointer<CSplashWindow> m_pSplash;        // Splash window object
00110    CPointer<CHelpPane> m_pHelpPane;          // Help pane, if displayed
00111    CUserPrefs m_userPrefs;                   // User preferences object
00112    CLibMgr m_libMgr;                         // Game library manager object
00113
00114    // A "task" is something that needs to be done, such as creating a game menu item or
00115    // creating a card object
00116    CPointer<CStatusBar> m_pSB;               // Status bar window
00117    int m_cTasks;                             // Number of tasks that need to be completed
00118    int m_cTasksDone;                         // Number of tasks that have been completed
00119
00120    CBrowserContainer *m_pBrowserContainer;   // Browser container object
00121    CWebBrowser2Ptr m_spBrowser;              // Web browser interface
00122    CHTMLHelper *m_pHH;                       // HTML Helper object
00123    BOOL m_bNavigated;                        // Whether the page has been navigated to
00124
00125    CEngine* m_pEngine;                       // Engine object
00126    CGameMenu m_gameMenu;                     // Game menu object
00127
00128    BOOL m_bPresentUpdate;                    // Does an update need to be presented
00129    double m_dAvailVersion;                   // Version available online
00130    CBSTR m_bstrExtras;                       // Extra features available
00131
00132    int m_cyHelpPaneSize;                     // Temporary height of help pane, during sizing
00133    BOOL m_bPaneSizing;                       // Whether the pane is being sized
00134    BOOL m_bSizing;                           // Whether the window is being sized
00135    RECT m_rcSizeBefore;                      // Size of client before sizing began
00136
00137    HACCEL m_hAccelTable;                     // Keyboard accelerator table
00138
00139    DWORD m_dwState;                          // The state of the main window object
00140 };
00141
00142
00143 #endif // !defined(AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:08 2002 for Solitaire Pack by doxygen 1.2.15


OFN.cpp File Reference

#include "stdafx.h"
#include <bmws_ofn.cpp>
#include <bmws_singleofn.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


OFN.cpp Source File

OFN.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // OFN.cpp
00004 //    Includes component source files related to the Open common dialog box.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_ofn.cpp>
00011 #include <bmws_singleofn.cpp>
Generated on Wed May 8 12:39:08 2002 for Solitaire Pack by doxygen 1.2.15


Pile.cpp File Reference

#include "stdafx.h"
#include "Pile.h"
#include "SolpackInternal.h"
#include "CPSoundsIDs.h"
#include <bmws_variant.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Compounds

class | CPileCommentAction
class | CPileShuffleAction

Defines

#define | ACTION_COMMENT 1
#define | ACTION_SHOWNUMCARDS 2
#define | ACTION_PILEX 3
#define | ACTION_PILEY 4
#define | ACTION_BASETYPE 5
#define | ACTION_SHUFFLE 6
#define | CX_TABLEAURIGHTSPC 14
#define | CY_TABLEAUDOWNSPC 25
#define | CX_STACKSPC 2
#define | CY_STACKSPC 1
#define | NUMCARDSINSTACKGROUP 8
#define | CX_TALON3SPC CX_TABLEAURIGHTSPC
#define | CY_TALON3SPC 1
#define | RANDOMNUM(maxval) (((2 * rand() * (maxval) + RAND_MAX) / RAND_MAX - 1) / 2)

Variables

ITypeLib * | g_pTypeLib

Define Documentation

#define ACTION_BASETYPE 5

Definition at line 34 of file Pile.cpp.

Referenced by CPile::DoAction(), and CPile::UndoAction().

#define ACTION_COMMENT 1

Definition at line 30 of file Pile.cpp.

Referenced by CPileCommentAction::CPileCommentAction(), CPile::DoAction(), and CPile::UndoAction().

#define ACTION_PILEX 3

Definition at line 32 of file Pile.cpp.

Referenced by CPile::DoAction(), and CPile::UndoAction().

#define ACTION_PILEY 4

Definition at line 33 of file Pile.cpp.

Referenced by CPile::DoAction(), and CPile::UndoAction().

#define ACTION_SHOWNUMCARDS 2

Definition at line 31 of file Pile.cpp.

Referenced by CPile::DoAction(), and CPile::UndoAction().

#define ACTION_SHUFFLE 6

Definition at line 35 of file Pile.cpp.

Referenced by CPileShuffleAction::CPileShuffleAction(), CPile::DoAction(), and CPile::UndoAction().

#define CX_STACKSPC 2

Definition at line 43 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define CX_TABLEAURIGHTSPC 14

Definition at line 41 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define CX_TALON3SPC CX_TABLEAURIGHTSPC

Definition at line 46 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define CY_STACKSPC 1

Definition at line 44 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define CY_TABLEAUDOWNSPC 25

Definition at line 42 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define CY_TALON3SPC 1

Definition at line 47 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define NUMCARDSINSTACKGROUP 8

Definition at line 45 of file Pile.cpp.

Referenced by CPile::GetCardSpot(), and CPile::GetSizeWith().

#define RANDOMNUM ( maxval ) (((2 * rand() * (maxval) + RAND_MAX) / RAND_MAX - 1) / 2)

Definition at line 53 of file Pile.cpp.

Variable Documentation

ITypeLib* g_pTypeLib

Definition at line 24 of file Pile.cpp.

Referenced by CPile::InitPile().

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


Pile.cpp Source File

Pile.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Pile.cpp
00004 //    Class to encapsulate a pile of cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Pile.h"
00014 #include "SolpackInternal.h"
00015 #include "CPSoundsIDs.h"
00016 #include <bmws_variant.h>
00017 #include "resource.h"
00018 #include "..\SolpckLC\resource.h"
00019
00020
00021 //----------------------------------------------------------------------------
00022 // Global and external variables
00023 //----------------------------------------------------------------------------
00024 extern ITypeLib *g_pTypeLib;     // The Solpack type library
00025
00026
00027 //----------------------------------------------------------------------------
00028 // Action Types
00029 //----------------------------------------------------------------------------
00030 #define ACTION_COMMENT        1  // CUndoComment
00031 #define ACTION_SHOWNUMCARDS   2  // data = shownumcards
00032 #define ACTION_PILEX          3  // data = x offset
00033 #define ACTION_PILEY          4  // data = y offset
00034 #define ACTION_BASETYPE       5  // data = offset
00035 #define ACTION_SHUFFLE        6  // CPileShuffleAction
00036
00037
00038 //----------------------------------------------------------------------------
00039 // Pile spacing constants
00040 //----------------------------------------------------------------------------
00041 #define CX_TABLEAURIGHTSPC    14
00042 #define CY_TABLEAUDOWNSPC     25
00043 #define CX_STACKSPC           2
00044 #define CY_STACKSPC           1
00045 #define NUMCARDSINSTACKGROUP  8
00046 #define CX_TALON3SPC          CX_TABLEAURIGHTSPC
00047 #define CY_TALON3SPC          1
00048
00049
00050 //----------------------------------------------------------------------------
00051 // Helper macro
00052 //----------------------------------------------------------------------------
00053 #define RANDOMNUM(maxval) (((2 * rand() * (maxval) + RAND_MAX) / RAND_MAX - 1) / 2)
00054
00055
00056 //----------------------------------------------------------------------------
00057 //
00058 // CPileShuffleAction class
00059 //    Stores information about the shuffling of a pile.
00060 //
00061 //----------------------------------------------------------------------------
00062 class CPileShuffleAction : public CAction
00063 {
00064 public:
00065    CPileShuffleAction(IActionSite *pSite);
00066    virtual ~CPileShuffleAction() {}
00067
00068    friend class CPile;
00069
00070 protected:
00071    CPtrArray<CCard*, CCard*> m_apCardsOld;   // Cards in previous order
00072    CPtrArray<CCard*, CCard*> m_apCardsNew;   // Cards in shuffled order
00073 };
00074
00075
00076 //----------------------------------------------------------------------------
00077 //
00078 // CPileShuffleAction constructor
00079 //
00080 // Parameters:
00081 //    pSite:         Interface of the fragment that handles the action.
00082 //
00083 //----------------------------------------------------------------------------
00084 CPileShuffleAction::CPileShuffleAction(IActionSite *pSite) : CAction(pSite, ACTION_SHUFFLE, 0)
00085 {
00086    // Signify that the contained pointers are COM interface pointers that
00087    // should be released, not deleted, when destroyed.
00088    m_apCardsOld.SetRelease(TRUE);
00089    m_apCardsNew.SetRelease(TRUE);
00090 }
00091
00092
00093 //----------------------------------------------------------------------------
00094 //
00095 // CPileCommentAction class
00096 //    Stores information about the changing of a pile's comment.
00097 //
00098 //----------------------------------------------------------------------------
00099 class CPileCommentAction : public CAction
00100 {
00101 public:
00102    CPileCommentAction(IActionSite *pSite);
00103    virtual ~CPileCommentAction() {}
00104
00105    friend class CPile;
00106
00107 protected:
00108    CTSTR m_lpszOld;  // Previous comment
00109    CTSTR m_lpszNew;  // New comment
00110 };
00111
00112
00113 //----------------------------------------------------------------------------
00114 //
00115 // CPileCommentAction constructor
00116 //
00117 // Parameters:
00118 //    pSite:         Interface of the fragment that handles the action.
00119 //
00120 //----------------------------------------------------------------------------
00121 CPileCommentAction::CPileCommentAction(IActionSite *pSite) : CAction(pSite, ACTION_COMMENT, 0)
00122 {
00123 }
00124
00125
00126 //----------------------------------------------------------------------------
00127 //
00128 // CPile constructor
00129 //
00130 // Parameters:
00131 //    lType:         The type of pile to create, from SOLPACKPILETYPE.
00132 //
00133 //----------------------------------------------------------------------------
00134 CPile::CPile(long lType)
00135 {
00136    // Set initial values for member variables
00137    m_dwEngObjType = ENGOBJ_PILE;
00138    m_pSite = NULL;
00139    m_bShowNumCards = FALSE;
00140    m_lType = lType;
00141    m_lBaseType = (m_lType == PILE_DECK ? BASE_NONE : BASE_FRAME);
00142    m_lX = 0;
00143    m_lY = 0;
00144    m_lWidth = 0;
00145    m_lHeight = 0;
00146    m_hRgn = NULL;
00147    m_apCards.SetSize(0, 8);
00148
00149    // Signify that the contained pointers are COM interface pointers that
00150    // should be released, not deleted, when destroyed.
00151    m_apCards.SetRelease(TRUE);
00152    ODS("CPile constructor");
00153 }
00154
00155
00156 //----------------------------------------------------------------------------
00157 //
00158 // CPile destructor
00159 //
00160 //----------------------------------------------------------------------------
00161 CPile::~CPile()
00162 {
00163    if(m_hRgn)
00164       DeleteObject(m_hRgn);
00165    if(m_spEl)
00166    {
00167       // Remove the pile element from the HTML document
00168       IHTMLDOMNode *pNode = NULL;
00169       if(SUCCEEDED(m_spEl->QueryInterface(IID_IHTMLDOMNode, (LPVOID*)&pNode)))
00170       {
00171          IHTMLDOMNode *pRemoved = NULL;
00172          pNode->removeNode(VARIANT_TRUE, &pRemoved);
00173          SAFERELEASE(pRemoved);
00174          SAFERELEASE(pNode);
00175       }
00176    }
00177    ODS("CPile destructor");
00178 }
00179
00180
00181 //----------------------------------------------------------------------------
00182 //
00183 // ISolpackPile::get_Type method
00184 //    Retrieves the type of the pile, defined when it is created.
00185 //
00186 // Parameters:
00187 //    p:             [out] Address of a long integer variable that receives
00188 //                   the pile type, from the SOLPACKPILETYPE enumeration.
00189 //
00190 // Returns:          A standard COM success or error value.
00191 //
00192 //----------------------------------------------------------------------------
00193 STDMETHODIMP CPile::get_Type(long *p)
00194 {
00195    CHECKPTR(p);
00196    *p = m_lType;
00197    return S_OK;
00198 }
00199
00200
00201 //----------------------------------------------------------------------------
00202 //
00203 // ISolpackPile::get_X method
00204 //    Retrieves the x-coordinate of the pile.
00205 //
00206 // Parameters:
00207 //    p:             [out] Address of a long integer variable that receives
00208 //                   the pile's x-coordinate, in pixels.
00209 //
00210 // Returns:          A standard COM success or error value.
00211 //
00212 //----------------------------------------------------------------------------
00213 STDMETHODIMP CPile::get_X(long *p)
00214 {
00215    CHECKPTR(p);
00216    *p = m_lX;
00217    return S_OK;
00218 }
00219
00220
00221 //----------------------------------------------------------------------------
00222 //
00223 // ISolpackPile::put_X method
00224 //    Sets the x-coordinate of the pile.
00225 //
00226 // Parameters:
00227 //    v:             [in] A long integer value that specifies the pile's new
00228 //                   x-coordinate, in pixels.
00229 //
00230 // Returns:          A standard COM success or error value.
00231 //
00232 //----------------------------------------------------------------------------
00233 STDMETHODIMP CPile::put_X(long v)
00234 {
00235    if(v != m_lX)
00236    {
00237       try   // COM-called code
00238       {
00239          // Record the action, during which it will be performed
00240          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00241             ACTION_PILEX, (DWORD)(v - m_lX));
00242       }
00243       CATCHALL;
00244    }
00245    return S_OK;
00246 }
00247
00248
00249 //----------------------------------------------------------------------------
00250 //
00251 // ISolpackPile::get_Y method
00252 //    Retrieves the y-coordinate of the pile.
00253 //
00254 // Parameters:
00255 //    p:             [out] Address of a long integer variable that receives
00256 //                   the pile's y-coordinate, in pixels.
00257 //
00258 // Returns:          A standard COM success or error value.
00259 //
00260 //----------------------------------------------------------------------------
00261 STDMETHODIMP CPile::get_Y(long *p)
00262 {
00263    CHECKPTR(p);
00264    *p = m_lY;
00265    return S_OK;
00266 }
00267
00268
00269 //----------------------------------------------------------------------------
00270 //
00271 // ISolpackPile::put_Y method
00272 //    Sets the y-coordinate of the pile.
00273 //
00274 // Parameters:
00275 //    v:             [in] A long integer value that specifies the pile's new
00276 //                   y-coordinate, in pixels.
00277 //
00278 // Returns:          A standard COM success or error value.
00279 //
00280 //----------------------------------------------------------------------------
00281 STDMETHODIMP CPile::put_Y(long v)
00282 {
00283    if(v != m_lY)
00284    {
00285       try   // COM-called code
00286       {
00287          // Record the action, during which it will be performed
00288          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00289             ACTION_PILEY, (DWORD)(v - m_lY));
00290       }
00291       CATCHALL;
00292    }
00293    return S_OK;
00294 }
00295
00296
00297 //----------------------------------------------------------------------------
00298 //
00299 // ISolpackPile::get_Width method
00300 //    Retrieves the current width of the pile, in pixels.
00301 //
00302 // Parameters:
00303 //    p:             [out] Address of a long integer variable that receives
00304 //                   the width, in pixels.
00305 //
00306 // Returns:          A standard COM success or error value.
00307 //
00308 //----------------------------------------------------------------------------
00309 STDMETHODIMP CPile::get_Width(long *p)
00310 {
00311    CHECKPTR(p);
00312    *p = m_lWidth;
00313    return S_OK;
00314 }
00315
00316
00317 //----------------------------------------------------------------------------
00318 //
00319 // ISolpackPile::get_Height method
00320 //    Retrieves the current height of the pile, in pixels.
00321 //
00322 // Parameters:
00323 //    p:             [out] Address of a long integer variable that receives
00324 //                   the height, in pixels.
00325 //
00326 // Returns:          A standard COM success or error value.
00327 //
00328 //----------------------------------------------------------------------------
00329 STDMETHODIMP CPile::get_Height(long *p)
00330 {
00331    CHECKPTR(p);
00332    *p = m_lHeight;
00333    return S_OK;
00334 }
00335
00336
00337 //----------------------------------------------------------------------------
00338 //
00339 // ISolpackPile::get_NumCards method
00340 //    Retrieves the number of cards in the pile.
00341 //
00342 // Parameters:
00343 //    p:             [out] Address of a long integer variable that receives
00344 //                   the count of cards.
00345 //
00346 // Returns:          A standard COM success or error value.
00347 //
00348 //----------------------------------------------------------------------------
00349 STDMETHODIMP CPile::get_NumCards(long *p)
00350 {
00351    CHECKPTR(p);
00352    *p = m_apCards.GetSize();
00353    return S_OK;
00354 }
00355
00356
00357 //----------------------------------------------------------------------------
00358 //
00359 // ISolpackPile::get_CommentTooltip method
00360 //    Retrieves text to display as the pile's tooltip.
00361 //
00362 // Parameters:
00363 //    pbstrText:     [out] Address of a string variable to receive the pile's
00364 //                   current tooltip text.
00365 //
00366 // Returns:          A standard COM success or error value.
00367 //
00368 //----------------------------------------------------------------------------
00369 STDMETHODIMP CPile::get_CommentTooltip(BSTR *pbstrText)
00370 {
00371    CHECKPTR(pbstrText);
00372    try   // COM-called code
00373    {
00374       *pbstrText = CBSTR(m_lpszTooltip).Detach();
00375    }
00376    CATCHALL;
00377    return S_OK;
00378 }
00379
00380
00381 //----------------------------------------------------------------------------
00382 //
00383 // ISolpackPile::put_CommentTooltip method
00384 //    Sets text to display as the pile's tooltip.
00385 //
00386 // Parameters:
00387 //    bstrText:      [in] A string specifying the new tooltip text. If NULL,
00388 //                   there will be no comment tooltip.
00389 //
00390 // Returns:          A standard COM success or error value.
00391 //
00392 //----------------------------------------------------------------------------
00393 STDMETHODIMP CPile::put_CommentTooltip(BSTR bstrText)
00394 {
00395    try   // COM-called code
00396    {
00397       // Create and initialize the action
00398       CPileCommentAction *pPCAction = new CPileCommentAction((IActionSite*)this);
00399       ENSUREALLOC(pPCAction);
00400       pPCAction->m_lpszOld.Assign(m_lpszTooltip);
00401       pPCAction->m_lpszNew.Assign(bstrText);
00402
00403       // Record the action, during which it will be performed
00404       m_pEngObjSite->EngGetUndoMgr()->RecordAction(pPCAction);
00405    }
00406    CATCHALL;
00407    return S_OK;
00408 }
00409
00410
00411 //----------------------------------------------------------------------------
00412 //
00413 // ISolpackPile::get_ShowNumCardsTooltip method
00414 //    Retrieves whether to display the count of cards in the pile's tooltip.
00415 //
00416 // Parameters:
00417 //    pbShow:        [out] Address of a VARIANT_BOOL variable to receive
00418 //                   whether the count of cards is displayed.
00419 //
00420 // Returns:          A standard COM success or error value.
00421 //
00422 //----------------------------------------------------------------------------
00423 STDMETHODIMP CPile::get_ShowNumCardsTooltip(VARIANT_BOOL *pbShow)
00424 {
00425    CHECKPTR(pbShow);
00426    *pbShow = (m_bShowNumCards ? VARIANT_TRUE : VARIANT_FALSE);
00427    return S_OK;
00428 }
00429
00430
00431 //----------------------------------------------------------------------------
00432 //
00433 // ISolpackPile::put_ShowNumCardsTooltip method
00434 //    Sets whether to display the count of cards in the pile's tooltip.
00435 //
00436 // Parameters:
00437 //    bShow:         [in] A VARIANT_BOOL variable specifying whether to show
00438 //                   the count of cards (VARIANT_TRUE) or not (VARIANT_FALSE).
00439 //
00440 // Returns:          A standard COM success or error value.
00441 //
00442 //----------------------------------------------------------------------------
00443 STDMETHODIMP CPile::put_ShowNumCardsTooltip(VARIANT_BOOL bShow)
00444 {
00445    BOOL bShowNumCards = (bShow == VARIANT_TRUE);
00446    if(bShowNumCards != m_bShowNumCards)
00447    {
00448       try   // COM-called code
00449       {
00450          // Record the action, during which it will be performed
00451          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00452             ACTION_SHOWNUMCARDS, bShowNumCards);
00453       }
00454       CATCHALL;
00455    }
00456    return S_OK;
00457 }
00458
00459
00460 //----------------------------------------------------------------------------
00461 //
00462 // ISolpackPile::get_BaseType method
00463 //    Retrieves which base image the pile displays.
00464 //
00465 // Parameters:
00466 //    p:             [out] Address of a long integer variable that receives
00467 //                   the base image type, from the SOLPACKBASETYPE
00468 //                   enumeration.
00469 //
00470 // Returns:          A standard COM success or error value.
00471 //
00472 //----------------------------------------------------------------------------
00473 STDMETHODIMP CPile::get_BaseType(long *p)
00474 {
00475    CHECKPTR(p);
00476    *p = m_lBaseType;
00477    return S_OK;
00478 }
00479
00480
00481 //----------------------------------------------------------------------------
00482 //
00483 // ISolpackPile::put_BaseType method
00484 //    Sets whether to display the count of cards in the pile's tooltip.
00485 //
00486 // Parameters:
00487 //    bShow:         [in] A long integer value that specifies the new base
00488 //                   image type, from the SOLPACKBASETYPE enumeration.
00489 //
00490 // Returns:          A standard COM success or error value.
00491 //
00492 //----------------------------------------------------------------------------
00493 STDMETHODIMP CPile::put_BaseType(long v)
00494 {
00495    // Check for a valid base image type
00496    if((v < BASE_NONE) || (v > BASE_NOREDEAL))
00497       return E_INVALIDARG;
00498
00499    if(v != m_lBaseType)
00500    {
00501       try   // COM-called code
00502       {
00503          // Record the action, during which it will be performed
00504          m_pEngObjSite->EngGetUndoMgr()->RecordAction((IActionSite*)this,
00505             ACTION_BASETYPE, (DWORD)(v - m_lBaseType));
00506       }
00507       CATCHALL;
00508    }
00509    return S_OK;
00510 }
00511
00512
00513 //----------------------------------------------------------------------------
00514 //
00515 // ISolpackPile::Shuffle method
00516 //    Randomizes the positions of the cards in the pile.
00517 //
00518 // Parameters:       None.
00519 //
00520 // Returns:          A standard COM success or error value.
00521 //
00522 //----------------------------------------------------------------------------
00523 STDMETHODIMP CPile::Shuffle()
00524 {
00525    int cCards = m_apCards.GetSize();
00526    if(cCards < 2)
00527       return S_OK;
00528
00529    try   // COM-called code
00530    {
00531       // Create the action object
00532       CPileShuffleAction *pPSAction = new CPileShuffleAction((IActionSite*)this);
00533       ENSUREALLOC(pPSAction);
00534
00535       m_pSite->PlayCPSound(CPSOUNDS_SHUFFLE);
00536
00537       // Randomly arrange cards in new order
00538       pPSAction->m_apCardsOld.SetSize(cCards);
00539       pPSAction->m_apCardsNew.SetSize(cCards);
00540       int i, j;
00541       for(i = 0; i < cCards; i++)
00542       {
00543          // Store old order
00544          pPSAction->m_apCardsOld.SetAt(i, m_apCards[i]);
00545          m_apCards[i]->AddRef();
00546          do
00547          {
00548             do
00549             {
00550                j = RANDOMNUM(cCards);
00551             } while(j < 0 || j >= cCards);
00552          } while(pPSAction->m_apCardsNew[j]);
00553
00554          // Store new order
00555          pPSAction->m_apCardsNew.SetAt(j, m_apCards[i]);
00556          pPSAction->m_apCardsNew[j]->AddRef();
00557       }
00558
00559       // Record the action, during which it will be performed
00560       m_pEngObjSite->EngGetUndoMgr()->RecordAction(pPSAction);
00561    }
00562    CATCHALL;
00563
00564    return S_OK;
00565 }
00566
00567
00568 //----------------------------------------------------------------------------
00569 //
00570 // ISolpackPile::GetCard method
00571 //    Retrieves the card at the specified index.
00572 //
00573 // Parameters:
00574 //    lIndex:        [in] Long integer value specifying the zero-based index
00575 //                   of the card to retrieve.
00576 //    ppCard:        [out] Address of a pointer to the ISolpackCard interface
00577 //                   of the specified card.
00578 //
00579 // Returns:          A standard COM success or error value.
00580 //
00581 //----------------------------------------------------------------------------
00582 STDMETHODIMP CPile::GetCard(long lIndex, ISolpackCard **ppCard)
00583 {
00584    // Check for valid card index
00585    if(lIndex < 0 || lIndex >= m_apCards.GetSize())
00586       return E_INVALIDARG;
00587    return m_apCards[lIndex]->QueryInterface(IID_ISolpackCard, (LPVOID*)ppCard);
00588 }
00589
00590
00591 //----------------------------------------------------------------------------
00592 //
00593 // ISolpackPile::WidthWith method
00594 //    Retrieves the width the pile would have with a given number of cards.
00595 //
00596 // Parameters:
00597 //    lNumCards:     [in] The number of cards to test with.
00598 //    plWidth:       [out] Address of a long integer variable that receives
00599 //                   the width, in pixels.
00600 //
00601 // Returns:          A standard COM success or error value.
00602 //
00603 //----------------------------------------------------------------------------
00604 STDMETHODIMP CPile::WidthWith(long lNumCards, long *plWidth)
00605 {
00606    CHECKPTR(plWidth);
00607    if(lNumCards < 0)
00608       return E_INVALIDARG;
00609
00610    *plWidth = GetSizeWith(lNumCards).cx;
00611    return S_OK;
00612 }
00613
00614
00615 //----------------------------------------------------------------------------
00616 //
00617 // ISolpackPile::HeightWith method
00618 //    Retrieves the height the pile would have with a given number of cards.
00619 //
00620 // Parameters:
00621 //    lNumCards:     [in] The number of cards to test with.
00622 //    plHeight:      [out] Address of a long integer variable that receives
00623 //                   the height, in pixels.
00624 //
00625 // Returns:          A standard COM success or error value.
00626 //
00627 //----------------------------------------------------------------------------
00628 STDMETHODIMP CPile::HeightWith(long lNumCards, long *plHeight)
00629 {
00630    CHECKPTR(plHeight);
00631    if(lNumCards < 0)
00632       return E_INVALIDARG;
00633
00634    *plHeight = GetSizeWith(lNumCards).cy;
00635    return S_OK;
00636 }
00637
00638
00639 //----------------------------------------------------------------------------
00640 //
00641 // INDUnknownAndDispatch::NDQueryInterface method
00642 //    Returns pointers to supported interfaces.
00643 //
00644 // Parameters:
00645 //    riid:          [in] Identifier of the interface being requested.
00646 //    ppvObject:     [out] Address of pointer variable that receives the
00647 //                   interface pointer requested in riid.
00648 //
00649 // Returns:          A standard COM success or error value.
00650 //
00651 //----------------------------------------------------------------------------
00652 STDMETHODIMP CPile::NDQueryInterface(REFIID riid, LPVOID *ppvObject)
00653 {
00654    if(IsEqualIID(riid, IID_ISolpackPile))
00655    {
00656       *ppvObject = (ISolpackPile*)this;
00657       (*(LPUNKNOWN*)ppvObject)->AddRef();
00658       return S_OK;
00659    } else if(IsEqualIID(riid, IID_IInternalPile))
00660    {
00661       *ppvObject = (CPile*)this;
00662       return S_OK;
00663    } else
00664       return CDispBase::NDQueryInterface(riid, ppvObject);
00665 }
00666
00667
00668 //----------------------------------------------------------------------------
00669 //
00670 // IActionSite::DoAction method
00671 //    Executes the specified action.
00672 //
00673 // Parameters:
00674 //    pAction:       Object containing information on an action.
00675 //
00676 // Returns:          None.
00677 //
00678 //----------------------------------------------------------------------------
00679 void CPile::DoAction(CAction *pAction)
00680 {
00681    switch(pAction->m_dwType)
00682    {
00683       case ACTION_COMMENT:
00684       {
00685          // Set the tooltip to the new string
00686          CPileCommentAction *pPCAction = (CPileCommentAction*)pAction;
00687          m_lpszTooltip.Assign(pPCAction->m_lpszNew);
00688          UpdateTooltip();
00689       } break;
00690
00691       case ACTION_SHOWNUMCARDS:
00692          // Set the new setting
00693          m_bShowNumCards = (BOOL)pAction->m_dwData;
00694          UpdateTooltip();
00695          break;
00696
00697       case ACTION_PILEX:
00698       {
00699          // Position pile
00700          long lOffsetX = (long)pAction->m_dwData;
00701          OffsetRgn(m_hRgn, lOffsetX, 0);
00702          m_lX += lOffsetX;
00703          CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00704       } break;
00705
00706       case ACTION_PILEY:
00707       {
00708          // Position pile
00709          long lOffsetY = (long)pAction->m_dwData;
00710          OffsetRgn(m_hRgn, 0, lOffsetY);
00711          m_lY += lOffsetY;
00712          CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00713       } break;
00714
00715       case ACTION_BASETYPE:
00716       {
00717          // Update the base image
00718          m_lBaseType += (long)pAction->m_dwData;
00719          UpdateBaseImg();
00720       } break;
00721
00722       case ACTION_SHUFFLE:
00723       {
00724          // Store the shuffled order as the current order
00725          CPileShuffleAction *pPSAction = (CPileShuffleAction*)pAction;
00726          m_apCards.SetSize(0);
00727          m_apCards.Append(pPSAction->m_apCardsNew);
00728          int cCards = pPSAction->m_apCardsNew.GetSize();
00729          int i;
00730          for(i = 0; i < cCards; i++)
00731             m_apCards[i]->AddRef();
00732          CHTMLElement2Ptr spEl2(m_spEl);
00733
00734          // Set each card in its new position
00735          for(i = 0; i < cCards; i++)
00736          {
00737             m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00738             m_apCards[i]->SetIndex(i);
00739          }
00740          UpdateLayout();
00741       } break;
00742    }
00743 }
00744
00745
00746 //----------------------------------------------------------------------------
00747 //
00748 // IActionSite::UndoAction method
00749 //    Undoes the specified action.
00750 //
00751 // Parameters:
00752 //    pAction:       Object containing information on an action.
00753 //
00754 // Returns:          None.
00755 //
00756 //----------------------------------------------------------------------------
00757 void CPile::UndoAction(CAction *pAction)
00758 {
00759    switch(pAction->m_dwType)
00760    {
00761       case ACTION_COMMENT:
00762       {
00763          // Set the tooltip to the previous string
00764          CPileCommentAction *pPCAction = (CPileCommentAction*)pAction;
00765          m_lpszTooltip.Assign(pPCAction->m_lpszOld);
00766          UpdateTooltip();
00767       } break;
00768
00769       case ACTION_SHOWNUMCARDS:
00770          // Set the previous setting
00771          m_bShowNumCards = !(BOOL)pAction->m_dwData;
00772          UpdateTooltip();
00773          break;
00774
00775       case ACTION_PILEX:
00776       {
00777          // Position pile in old position
00778          long lOffsetX = (long)pAction->m_dwData;
00779          OffsetRgn(m_hRgn, -lOffsetX, 0);
00780          m_lX -= lOffsetX;
00781          CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00782       } break;
00783
00784       case ACTION_PILEY:
00785       {
00786          // Position pile in old position
00787          long lOffsetY = (long)pAction->m_dwData;
00788          OffsetRgn(m_hRgn, 0, -lOffsetY);
00789          m_lY -= lOffsetY;
00790          CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00791       } break;
00792
00793       case ACTION_BASETYPE:
00794       {
00795          // Set the previous pile type
00796          m_lBaseType -= (long)pAction->m_dwData;
00797          UpdateBaseImg();
00798       } break;
00799
00800       case ACTION_SHUFFLE:
00801       {
00802          // Store the previous order as the current order
00803          CPileShuffleAction *pPSAction = (CPileShuffleAction*)pAction;
00804          m_apCards.SetSize(0);
00805          m_apCards.Append(pPSAction->m_apCardsOld);
00806          int cCards = pPSAction->m_apCardsNew.GetSize();
00807          int i;
00808          for(i = 0; i < cCards; i++)
00809             m_apCards[i]->AddRef();
00810          CHTMLElement2Ptr spEl2(m_spEl);
00811
00812          // Set each card in its new position
00813          for(i = 0; i < cCards; i++)
00814          {
00815             m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00816             m_apCards[i]->SetIndex(i);
00817          }
00818          UpdateLayout();
00819       } break;
00820    }
00821 }
00822
00823
00824 //----------------------------------------------------------------------------
00825 //
00826 // InitPile function
00827 //    Creates the pile HTML elements and event handlers.
00828 //
00829 // Parameters:
00830 //    pSite:         Interface of the engine to receive pile notifications.
00831 //    pEngObjSite:   Interface of the engine to receive engine object
00832 //                   notifications.
00833 //    pHH:           The HTML helper object to use.
00834 //
00835 // Returns:          None.
00836 //
00837 //----------------------------------------------------------------------------
00838 void CPile::InitPile(IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
00839 {
00840    ODS("CPile::InitPile starting");
00841    InitEngineObj(pEngObjSite, pHH);
00842
00843    // Set member variables' values
00844    _ASSERT(pSite);
00845    m_pSite = pSite;
00846
00847    if(m_lType != PILE_FRAGMENT)
00848    {
00849       Init(g_pTypeLib, IID_ISolpackPile, (LPDISPATCH)((ISolpackPile*)this));
00850
00851       // Create the Span element
00852       m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_SPAN, IID_IHTMLElement));
00853
00854       // Set the pile's position style to absolute
00855       CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00856       CPtr<IHTMLStyle2, &IID_IHTMLStyle2> spStyle2(m_spStyle);
00857       CHECKHRCOM(spStyle2->put_position(CBSTR(TEXT("absolute"))));
00858
00859       // Create and the pile base image element to the pile span
00860       m_spImgElBase.Assign(TRUE, pHH->CreateElement(IDS_TAG_IMG, IID_IHTMLImgElement));
00861       CHTMLElementPtr spElTemp(m_spImgElBase);
00862       spElTemp->put_className(CBSTR(IDS_CLASS_PILEBASE));
00863       CHTMLElement2Ptr spEl2(m_spEl);
00864       CHECKHRCOM(spEl2->insertAdjacentElement(pHH->m_bstrBeforeEnd, spElTemp, NULL));
00865       UpdateBaseImg();
00866
00867       // Add the pile span element to the tableau element
00868       CHTMLElement2Ptr spTableau2(TRUE, m_pHH->GetNamedEl(IDS_EL_TABLEAU, IID_IHTMLElement2));
00869       CHECKHRCOM(spTableau2->insertAdjacentElement(pHH->m_bstrBeforeEnd, m_spEl, NULL));
00870
00871       UpdateDims();
00872
00873       // Create and attach handlers for mouse events
00874       SetEventHandlers();
00875    }
00876
00877    UpdateLayout();
00878
00879    ODS("CPile::InitPile finished");
00880 }
00881
00882
00883 //----------------------------------------------------------------------------
00884 //
00885 // TooltipPrefChanged function
00886 //    Called by the engine when the user's display tooltip preference has
00887 //    changed.
00888 //
00889 // Parameters:       None.
00890 //
00891 // Returns:          None.
00892 //
00893 //----------------------------------------------------------------------------
00894 void CPile::TooltipPrefChanged()
00895 {
00896    UpdateTooltip();
00897 }
00898
00899
00900 //----------------------------------------------------------------------------
00901 //
00902 // GetNumCards function
00903 //    Retrieves the number of cards in the pile.
00904 //
00905 // Parameters:       None.
00906 //
00907 // Returns:          The number of cards in the pile.
00908 //
00909 //----------------------------------------------------------------------------
00910 int CPile::GetNumCards()
00911 {
00912    return m_apCards.GetSize();
00913 }
00914
00915
00916 //----------------------------------------------------------------------------
00917 //
00918 // TransferCards function
00919 //    Moves all the cards in this pile's card array into the specified array.
00920 //
00921 // Parameters:
00922 //    apDest:        Array into which the cards should be added.
00923 //
00924 // Returns:          None.
00925 //
00926 //----------------------------------------------------------------------------
00927 void CPile::TransferCards(CPtrArray<CCard*, CCard*>& apDest)
00928 {
00929    // Copy card pointers from our array to the specified array. Note that our
00930    // array still also has pointers to the cards at this point.
00931    int cCards = m_apCards.GetSize();
00932    for(int i = 0; i < cCards; i++)
00933    {
00934       apDest.Add(m_apCards[i]);
00935       m_apCards[i]->AddRef();
00936    }
00937 }
00938
00939
00940 //----------------------------------------------------------------------------
00941 //
00942 // TransferCards function
00943 //    Moves a specified number of cards from this pile into the specified
00944 //    array.
00945 //
00946 // Parameters:
00947 //    lIndex:        Zero-based index of the first card to transfer.
00948 //    cCards:        Number of cards to transfer.
00949 //    apDest:        Array into which the cards should be added.
00950 //
00951 // Returns:          None.
00952 //
00953 //----------------------------------------------------------------------------
00954 void CPile::TransferCards(long lIndex, long cCards, CPtrArray<CCard*, CCard*>& apDest)
00955 {
00956    _ASSERT(lIndex >= 0);
00957    _ASSERT(lIndex < m_apCards.GetSize());
00958    _ASSERT(lIndex + cCards <= m_apCards.GetSize());
00959
00960    // Copy the desired card pointers from our array to the specified array.
00961    // Note that our array still also has pointers to the cards at this point.
00962    int i;
00963    for(i = 0; i < cCards; i++)
00964    {
00965       CCard *pCard = m_apCards[lIndex+i];
00966       pCard->AddRef();
00967       apDest.Add(pCard);
00968
00969       // Mark that the card was transferred out
00970       m_abTransferred.SetAt(lIndex+i, TRUE);
00971    }
00972 }
00973
00974
00975 //----------------------------------------------------------------------------
00976 //
00977 // ClearTransferred function
00978 //    Removes cards that have been transferred to another pile from this pile.
00979 //
00980 // Parameters:       None.
00981 //
00982 // Returns:          None.
00983 //
00984 //----------------------------------------------------------------------------
00985 void CPile::ClearTransferred()
00986 {
00987    int cCurCards = m_apCards.GetSize();
00988    for(int i = 0; i < cCurCards; )
00989    {
00990       if(m_abTransferred[i])
00991       {
00992          // Removed transferred cards from our array
00993          m_apCards.RemoveAt(i);
00994          m_abTransferred.RemoveAt(i);
00995          cCurCards--;
00996       } else
00997       {
00998          // Update the index of the cards that weren't transferred
00999          m_apCards[i]->SetIndex(i);
01000          i++;
01001       }
01002    }
01003 }
01004
01005
01006 //----------------------------------------------------------------------------
01007 //
01008 // PreReceiveCards function
01009 //    Moves cards from the specified array into this pile's array.
01010 //
01011 // Parameters:
01012 //    lIndex:        The zero-based index at which to put the first card.
01013 //    apSrc:         Array from which the cards should be removed.
01014 //    lIndexStart:   The zero-based index from which to retrieve the first
01015 //                   card. Defaults to 0.
01016 //    cCards:        The number of cards to transfer. Defaults to -1,
01017 //                   indicating all cards.
01018 //
01019 // Returns:          The zero-based index that the first card actually
01020 //                   received.
01021 //
01022 //----------------------------------------------------------------------------
01023 long CPile::PreReceiveCards(long lIndex, CPtrArray<CCard*, CCard*>& apSrc, long lIndexStart,
01024                             long cCards)
01025 {
01026    // This function lets us store pointers to the card objects. However, the
01027    // cards' HTML elements are still part of the previous pile/fragment.
01028
01029    // Figure out how many cards we are dealing with and where the cards go
01030    if(cCards == -1)
01031       cCards = apSrc.GetSize();
01032    int iCardsOld = m_apCards.GetSize();
01033    if(lIndex < 0)
01034       lIndex = iCardsOld;
01035
01036    // See if we have to add "empty" slots in order to position card correctly
01037    int i;
01038    int iDiff = (lIndex - iCardsOld);
01039    if(iDiff < 0)
01040       iDiff = 0;
01041    int cCardsTotal = iCardsOld + cCards + iDiff;
01042    if(iDiff > 0)
01043    {
01044       // Add empty slots
01045       for(int j = 0; j < iDiff; j++)
01046       {
01047          m_apCards.Add(NULL);
01048          m_abTransferred.Add(TRUE);
01049       }
01050    }
01051
01052    // Add cards to our array in the specified point
01053    for(i = 0; i < cCards; i++)
01054    {
01055       if(lIndex+i >= m_apCards.GetSize())
01056       {
01057          m_apCards.SetAtGrow(lIndex+i, apSrc[lIndexStart+i]);
01058          m_abTransferred.SetAtGrow(lIndex+i, FALSE);
01059       } else if(m_abTransferred[lIndex+i])
01060       {
01061          m_apCards.SetAt(lIndex+i, apSrc[lIndexStart+i]);
01062          m_abTransferred.SetAt(lIndex+i, FALSE);
01063       } else
01064       {
01065          m_apCards.InsertAt(lIndex+i, apSrc[lIndexStart+i]);
01066          m_abTransferred.InsertAt(lIndex+i, FALSE);
01067       }
01068       m_apCards[lIndex+i]->AddRef();
01069       m_apCards[lIndex+i]->SetPile((ICardPileSite*)this, CHTMLElement2Ptr());
01070    }
01071
01072    // Set cards' indices
01073    int cNewCards = m_apCards.GetSize();
01074    for(i = lIndex; i < cNewCards; i++)
01075    {
01076       if(m_apCards[i])
01077          m_apCards[i]->SetIndex(i);
01078    }
01079    UpdateLayout(lIndex + cCards);
01080    return lIndex;
01081 }
01082
01083
01084 //----------------------------------------------------------------------------
01085 //
01086 // ReceiveCards function
01087 //    Moves cards' HTML elements to belong to this pile.
01088 //
01089 // Parameters:
01090 //    lIndex:        The zero-based index at which to put the first card.
01091 //    apSrc:         Array from which the cards should be removed.
01092 //    lIndexStart:   The zero-based index from which to retrieve the first
01093 //                   card. Defaults to 0.
01094 //    cCards:        The number of cards to transfer. Defaults to -1,
01095 //                   indicating all cards.
01096 //
01097 // Returns:          None.
01098 //
01099 //----------------------------------------------------------------------------
01100 void CPile::ReceiveCards(long lIndex, CPtrArray<CCard*, CCard*>& apSrc, long lIndexStart,
01101                          long cCards)
01102 {
01103    // Figure out indices
01104    if(cCards == -1)
01105       cCards = apSrc.GetSize();
01106    long lIndexBefore = lIndex + cCards;
01107    int iCardsOld = m_apCards.GetSize() - cCards;
01108
01109    // Figure out what card HTML element to insert the cards before
01110    CHTMLElementPtr spElBefore;
01111    if(lIndexBefore >= iCardsOld + cCards)
01112       lIndexBefore = iCardsOld + cCards;
01113    else
01114       spElBefore.Assign(m_apCards[lIndexBefore]->GetElement());
01115    CHTMLElement2Ptr spEl2(m_spEl);
01116
01117    // Transfer cards' elements into their proper spot
01118    for(int i = 0; i < cCards; i++)
01119    {
01120       m_abTransferred.SetAt(lIndex+i, FALSE);
01121       CHTMLElementPtr spElCur = m_apCards[lIndex+i]->GetElement();
01122       if(spElBefore)
01123       {
01124          // Insert card element before another element
01125          CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNode(spElCur);
01126          CVariant v;
01127          v.vt = VT_DISPATCH;
01128          CHECKHRCOM(spElBefore->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
01129
01130          CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNodeThis(m_spEl);
01131          CHECKHRCOM(spNodeThis->insertBefore(spNode, v, NULL));
01132       } else
01133       {
01134          // Insert card element at the end of our element
01135          CHTMLElement2Ptr spEl2(m_spEl);
01136          CHECKHRCOM(spEl2->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, spElCur, NULL));
01137       }
01138    }
01139    UpdateLayout(lIndex, lIndex + cCards);
01140 }
01141
01142
01143 //----------------------------------------------------------------------------
01144 //
01145 // GetCardSpot function
01146 //    Retrieves the position that the card with the specified index should
01147 //    occupy.
01148 //
01149 // Parameters:
01150 //    lIndex:        The zero-based index at which to put the first card.
01151 //
01152 // Returns:          None.
01153 //
01154 //----------------------------------------------------------------------------
01155 POINT CPile::GetCardSpot(long lIndex)
01156 {
01157    POINT pt;
01158    pt.x = 0;
01159    pt.y = 0;
01160
01161    // Calculate card spot based on index and pile type
01162    switch(m_lType)
01163    {
01164       case PILE_STACK:
01165       case PILE_TALON:
01166          pt.x += (lIndex / NUMCARDSINSTACKGROUP) * CX_STACKSPC;
01167          pt.y += (lIndex / NUMCARDSINSTACKGROUP) * CY_STACKSPC;
01168          break;
01169       case PILE_TABLEAURIGHT:
01170          pt.x = lIndex * CX_TABLEAURIGHTSPC;
01171          break;
01172       case PILE_TABLEAUDOWN:
01173          pt.y = lIndex * CY_TABLEAUDOWNSPC;
01174          break;
01175       case PILE_TALON3:
01176          pt.x = (lIndex % 3) * CX_TALON3SPC;
01177          pt.y = (lIndex % 3) * CY_TALON3SPC;
01178          break;
01179    }
01180
01181    return pt;
01182 }
01183
01184
01185 //----------------------------------------------------------------------------
01186 //
01187 // ClearCards function
01188 //    Removes all cards from this pile.
01189 //
01190 // Parameters:       None.
01191 //
01192 // Returns:          None.
01193 //
01194 //----------------------------------------------------------------------------
01195 void CPile::ClearCards()
01196 {
01197    m_apCards.SetSize(0);
01198    m_abTransferred.SetSize(0);
01199 }
01200
01201
01202 //----------------------------------------------------------------------------
01203 //
01204 // PtInPile function
01205 //    Determines whether the specified point is within this pile's region.
01206 //
01207 // Parameters:
01208 //    pt:            The point to test.
01209 //
01210 // Returns:          TRUE if the point is within this pile, else FALSE.
01211 //
01212 //----------------------------------------------------------------------------
01213 BOOL CPile::PtInPile(POINT pt)
01214 {
01215    return PtInRegion(m_hRgn, pt.x, pt.y);
01216 }
01217
01218
01219 //----------------------------------------------------------------------------
01220 //
01221 // RgnInPile function
01222 //    Determines whether the specified region intersects with this pile's
01223 //    region.
01224 //
01225 // Parameters:
01226 //    hRgn:          Handle to the region to test.
01227 //
01228 // Returns:          TRUE if the regions intersect, else FALSE.
01229 //
01230 //----------------------------------------------------------------------------
01231 BOOL CPile::RgnInPile(HRGN hRgn)
01232 {
01233    // Test for a non-null intersection of our pile's region and the specified
01234    // region
01235    HRGN hRgnTemp = CreateRectRgn(0, 0, 0, 0);
01236    int i = CombineRgn(hRgnTemp, m_hRgn, hRgn, RGN_AND);
01237    DeleteObject(hRgnTemp);
01238    return (i != NULLREGION);
01239 }
01240
01241
01242 //----------------------------------------------------------------------------
01243 //
01244 // ICardPileSite::GetPileInterface method
01245 //    Called by contained cards to get their containing pile's ISolpackPile
01246 //    interface.
01247 //
01248 // Parameters:
01249 //    pp:            [out] Address of a pointer to the ISolpackPile interface
01250 //                   of the pile.
01251 //
01252 // Returns:          A standard COM success or error value.
01253 //
01254 //----------------------------------------------------------------------------
01255 HRESULT CPile::GetPileInterface(ISolpackPile **pp)
01256 {
01257    return QueryInterface(IID_ISolpackPile, (LPVOID*)pp);
01258 }
01259
01260
01261 //----------------------------------------------------------------------------
01262 //
01263 // ICardPileSite::SetCardIndex method
01264 //    Called by contained cards change their index.
01265 //
01266 // Parameters:
01267 //    pCard:         The card whose index is changing.
01268 //    lOldIndex:     The previous index of the card.
01269 //    plNewIndex:    Pointer containing the desired index of the card. If -1
01270 //                   or greater than the number of cards, specifies to move
01271 //                   the card to the end. On return, specifies the index that
01272 //                   the card was actually put at.
01273 //
01274 // Returns:          A standard COM success or error value.
01275 //
01276 //----------------------------------------------------------------------------
01277 void CPile::SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex)
01278 {
01279    pCard->AddRef();
01280
01281    // Figure out what index to put the card at
01282    int cCards = m_apCards.GetSize()-1;
01283    CHTMLElementPtr spElBefore;
01284    if(*plNewIndex < 0 || *plNewIndex >= cCards)
01285       *plNewIndex = cCards;
01286    else
01287       spElBefore.Assign(m_apCards[(*plNewIndex)+(lOldIndex < *plNewIndex ? 1 : 0)]->
01288          GetElement());
01289
01290    // Remove the card from the old index and put it at the new index
01291    m_apCards.RemoveAt(lOldIndex);
01292    m_abTransferred.RemoveAt(lOldIndex);
01293    m_apCards.InsertAt(*plNewIndex, pCard);
01294    m_abTransferred.InsertAt(*plNewIndex, FALSE);
01295
01296    // Transfer card element into its proper spot
01297    CHTMLElementPtr spElCur = pCard->GetElement();
01298    if(spElBefore)
01299    {
01300       // Insert card element before another element
01301       CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNode(spElCur);
01302       CVariant v;
01303       v.vt = VT_DISPATCH;
01304       CHECKHRCOM(spElBefore->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
01305
01306       CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNodeThis(m_spEl);
01307       CHECKHRCOM(spNodeThis->insertBefore(spNode, v, NULL));
01308    } else
01309    {
01310       // Insert card element at the end of our element
01311       CHTMLElement2Ptr spEl2(m_spEl);
01312       CHECKHRCOM(spEl2->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, spElCur, NULL));
01313    }
01314
01315    long lNew = (*plNewIndex);
01316
01317    long lMin = min(lOldIndex, lNew);
01318    long lMax = max(lOldIndex, lNew);
01319
01320    // Update the indices of other cards that changed
01321    CHTMLElement2Ptr spEl2(m_spEl);
01322    for(int i = lMin; i <= lMax; i++)
01323       m_apCards[i]->SetIndex(i);
01324    UpdateLayout(lMin, lMax);
01325 }
01326
01327
01328 //----------------------------------------------------------------------------
01329 //
01330 // UpdateTooltip function
01331 //    Changes the pile's HTML element's TITLE attribute to display the new
01332 //    comment or correct number of cards.
01333 //
01334 // Parameters:       None.
01335 //
01336 // Returns:          None.
01337 //
01338 //----------------------------------------------------------------------------
01339 void CPile::UpdateTooltip()
01340 {
01341    // Decks and fragments can't have tooltips
01342    if((m_lType == PILE_DECK) || (m_lType == PILE_FRAGMENT))
01343       return;
01344
01345    if(m_pSite->GetShowTooltips() && (m_lpszTooltip || m_bShowNumCards))
01346    {
01347       // Build up the string, consisting of either a tooltip, a "__ cards"
01348       // string, or both
01349
01350       CTSTR lpszNumCards;
01351       if(m_bShowNumCards)
01352          lpszNumCards.Format(CTSTR(IDS_NUMCARDSTOOLTIP), m_apCards.GetSize());
01353
01354       CTSTR lpszFinal(TRUE, m_lpszTooltip.Len() + lpszNumCards.Len() + 8);
01355       LPTSTR lpsz = lpszFinal.m_lpsz;
01356       if(m_lpszTooltip)
01357       {
01358          lstrcpy(lpsz, m_lpszTooltip);
01359          lpsz += (m_lpszTooltip.Len() * sizeof(TCHAR));
01360          if(m_bShowNumCards)
01361          {
01362             lstrcpy(lpsz, TEXT("\n"));
01363             lpsz += (sizeof(TCHAR));
01364          }
01365       }
01366
01367       if(m_bShowNumCards)
01368          lstrcpy(lpsz, lpszNumCards);
01369
01370       // Set the tooltip
01371       CHECKHRCOM(m_spEl->put_title(CBSTR(lpszFinal)));
01372    } else
01373       CHECKHRCOM(m_spEl->put_title(NULL));   // No tooltip
01374 }
01375
01376
01377 //----------------------------------------------------------------------------
01378 //
01379 // UpdateBaseImg function
01380 //    Sets the base image element to display the image file corresponding to
01381 //    the base type.
01382 //
01383 // Parameters:       None.
01384 //
01385 // Returns:          None.
01386 //
01387 //----------------------------------------------------------------------------
01388 void CPile::UpdateBaseImg()
01389 {
01390    CHECKHRCOM(m_spImgElBase->put_src(CBSTR(m_lBaseType + IDS_IMG_BASE_NONE)));
01391 }
01392
01393
01394 //----------------------------------------------------------------------------
01395 //
01396 // UpdateDims function
01397 //    Updates the pile element's width and height CSS properties.
01398 //
01399 // Parameters:       None.
01400 //
01401 // Returns:          None.
01402 //
01403 //----------------------------------------------------------------------------
01404 void CPile::UpdateDims()
01405 {
01406    CHECKHRCOM(m_spStyle->put_pixelWidth(m_lWidth));
01407    CHECKHRCOM(m_spStyle->put_pixelHeight(m_lHeight));
01408 }
01409
01410
01411 //----------------------------------------------------------------------------
01412 //
01413 // UpdateLayout function
01414 //    Updates the offset coordinates of the cards in the pile, based on the
01415 //    type of pile.
01416 //
01417 // Parameters:
01418 //    iBegin:        Index of the first card to update. Defaults to 0.
01419 //    iEnd:          Index of the last card to update. Defaults to -1, in
01420 //                   which case the last card will be the pile's last card.
01421 //
01422 // Returns:          None.
01423 //
01424 //----------------------------------------------------------------------------
01425 void CPile::UpdateLayout(int iBegin, int iEnd)
01426 {
01427    int i;
01428    int cCards = m_apCards.GetSize();
01429
01430    if(m_lType != PILE_FRAGMENT)
01431    {
01432       SIZE s = GetSizeWith(cCards);
01433
01434       if(cCards > 0)
01435       {
01436          if((iEnd < 0) || (iEnd >= cCards))
01437             iEnd = cCards-1;
01438
01439          // Within the desired range, update the position of each card
01440          // of the pile
01441          for(i = iBegin; i <= iEnd; i++)
01442          {
01443             if(!m_abTransferred[i])
01444             {
01445                POINT pt = GetCardSpot(i);
01446                m_apCards[i]->SetPosition(pt.x, pt.y);
01447             }
01448          }
01449       }
01450
01451       // Update the pile dimensions and tooltip
01452       m_lWidth = s.cx;
01453       m_lHeight = s.cy;
01454
01455       UpdateDims();
01456       UpdateTooltip();
01457    }
01458
01459    // Create the pile region
01460    if(m_hRgn)
01461       DeleteObject(m_hRgn);
01462    if(m_lType == PILE_FRAGMENT || m_lType == PILE_DECK)
01463       m_hRgn = CreateRectRgn(0, 0, 0, 0);
01464    else
01465       m_hRgn = CreateRectRgn(m_lX, m_lY, m_lX + CARDWIDTH, m_lY + CARDHEIGHT);
01466
01467    if(m_lType != PILE_DECK)
01468    {
01469       // Build up the pile's region
01470       for(i = 0; i < cCards; i++)
01471       {
01472          if(m_apCards[i])
01473          {
01474             // Or the card's region with this pile's region so far
01475             POINT pt = m_apCards[i]->GetPosition();
01476             HRGN h = CreateRectRgn(m_lX + pt.x, m_lY + pt.y, m_lX + pt.x + CARDWIDTH,
01477                m_lY + pt.y + CARDHEIGHT);
01478             CombineRgn(m_hRgn, m_hRgn, h, RGN_OR);
01479             DeleteObject(h);
01480          }
01481       }
01482    }
01483 }
01484
01485
01486 //----------------------------------------------------------------------------
01487 //
01488 // GetSizeWith function
01489 //    Calculates the width and height of the pile, given a number of cards.
01490 //
01491 // Parameters:
01492 //    cCards:        The number of cards for which to retrieve the dimensions.
01493 //
01494 // Returns:          None.
01495 //
01496 //----------------------------------------------------------------------------
01497 SIZE CPile::GetSizeWith(int cCards)
01498 {
01499    SIZE s;
01500    s.cx = CARDWIDTH;
01501    s.cy = CARDHEIGHT;
01502
01503    // Based on the number of dimensions and pile type, retrieve the dimensions
01504    if(cCards > 0)
01505    {
01506       switch(m_lType)
01507       {
01508          case PILE_STACK:
01509          case PILE_TALON:
01510             s.cx += (((cCards - 1) / NUMCARDSINSTACKGROUP) * CX_STACKSPC);
01511             s.cy += (((cCards - 1) / NUMCARDSINSTACKGROUP) * CY_STACKSPC);
01512             break;
01513          case PILE_TABLEAUDOWN:
01514             s.cy += ((cCards - 1) * CY_TABLEAUDOWNSPC);
01515             break;
01516          case PILE_TABLEAURIGHT:
01517             s.cx += ((cCards - 1) * CX_TABLEAURIGHTSPC);
01518             break;
01519          case PILE_TALON3:
01520             s.cx += (((cCards >= 3) ? 2 : (cCards-1)) * CX_TALON3SPC);
01521             s.cy += (((cCards >= 3) ? 2 : (cCards-1)) * CY_TALON3SPC);
01522             break;
01523          case PILE_FRAGMENT:
01524             s.cx = 0;
01525             s.cy = 0;
01526             break;
01527       }
01528    }
01529    return s;
01530 }
01531
01532
01533 //----------------------------------------------------------------------------
01534 //
01535 // SetElCapture function
01536 //    Sets mouse capture on the pile HTML element.
01537 //
01538 // Parameters:       None.
01539 //
01540 // Returns:          None.
01541 //
01542 //----------------------------------------------------------------------------
01543 void CPile::SetElCapture()
01544 {
01545    CHTMLElement2Ptr spEl2(m_spEl);
01546    spEl2->setCapture();
01547 }
01548
01549
01550 //----------------------------------------------------------------------------
01551 //
01552 // ReleaseElCapture function
01553 //    Releases mouse capture on the pile HTML element.
01554 //
01555 // Parameters:       None.
01556 //
01557 // Returns:          None.
01558 //
01559 //----------------------------------------------------------------------------
01560 void CPile::ReleaseElCapture()
01561 {
01562    CHTMLElement2Ptr spEl2(m_spEl);
01563    spEl2->releaseCapture();
01564 }
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


Pile.h File Reference

#include "..\SolpackTLB\SolpackIncl.h"
#include "EngineObj.h"
#include "Action.h"
#include "Card.h"
#include <bmws_array.h>
#include <bmws_dispbase.h>

Go to the source code of this file.

Compounds

class | CPile
class | IPileSite

Defines

#define | AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Pile.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


Pile.h Source File

Pile.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Pile.h
00004 //    Class to encapsulate a pile of cards.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "..\SolpackTLB\SolpackIncl.h"
00021 #include "EngineObj.h"
00022 #include "Action.h"
00023 #include "Card.h"
00024 #include <bmws_array.h>
00025 #include <bmws_dispbase.h>
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // IPileSite abstract class
00031 //    Enables the pile to get settings from the engine.
00032 //
00033 //----------------------------------------------------------------------------
00034 class IPileSite
00035 {
00036 public:
00037    virtual BOOL GetShowTooltips() = 0;
00038    virtual BOOL GetAnim() = 0;
00039    virtual void PlayCPSound(UINT uIndex) = 0;
00040 };
00041
00042
00043 //----------------------------------------------------------------------------
00044 //
00045 // CPile class
00046 //    Encapsulates a pile of cards. Implements the ISolpackPile interface.
00047 //    These objects are managed by the engine object.
00048 //
00049 //----------------------------------------------------------------------------
00050 class CPile : public CDispBase, public CEngineObj, public ISolpackPile, public ICardPileSite,
00051               public IActionSite
00052 {
00053 public:
00054    CPile(long lType);
00055    virtual ~CPile();
00056
00057    DECLARE_IUNKNOWN_AND_IDISPATCH;
00058
00059    // ISolpackPile methods
00060    STDMETHOD (get_Type)(long *p);
00061    STDMETHOD (get_X)(long *p);
00062    STDMETHOD (put_X)(long v);
00063    STDMETHOD (get_Y)(long *p);
00064    STDMETHOD (put_Y)(long v);
00065    STDMETHOD (get_Width)(long *p);
00066    STDMETHOD (get_Height)(long *p);
00067    STDMETHOD (get_NumCards)(long *p);
00068    STDMETHOD (get_CommentTooltip)(BSTR *pbstrText);
00069    STDMETHOD (put_CommentTooltip)(BSTR bstrText);
00070    STDMETHOD (get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow);
00071    STDMETHOD (put_ShowNumCardsTooltip)(VARIANT_BOOL bShow);
00072    STDMETHOD (get_BaseType)(long *p);
00073    STDMETHOD (put_BaseType)(long v);
00074    STDMETHOD (Shuffle)();
00075    STDMETHOD (GetCard)(long lIndex, ISolpackCard **ppCard);
00076    STDMETHOD (WidthWith)(long lNumCards, long *plWidth);
00077    STDMETHOD (HeightWith)(long lNumCards, long *plHeight);
00078
00079    // INDUnknownAndDispatch override
00080    STDMETHOD (NDQueryInterface)(REFIID riid, LPVOID *ppvObject);
00081
00082    // IActionSite methods
00083    void DoAction(CAction *pAction);
00084    void UndoAction(CAction *pAction);
00085
00086    void InitPile(IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH);
00087    void TooltipPrefChanged();
00088    int GetNumCards();
00089    void TransferCards(CPtrArray<CCard*, CCard*>& apDest);
00090    void TransferCards(long lIndex, long cCards, CPtrArray<CCard*, CCard*>& apDest);
00091    void ClearTransferred();
00092    long PreReceiveCards(long lIndex, CPtrArray<CCard*, CCard*>& apSrc, long lIndexStart = 0,
00093       long cCards = -1);
00094    void ReceiveCards(long lIndex, CPtrArray<CCard*, CCard*>& apSrc, long lIndexStart = 0,
00095       long cCards = -1);
00096    POINT GetCardSpot(long lIndex);
00097    void UpdateLayout(int iBegin = 0, int iEnd = -1);
00098    void ClearCards();
00099    BOOL PtInPile(POINT pt);
00100    BOOL RgnInPile(HRGN hRgn);
00101
00102    // ICardPileSite methods
00103    HRESULT GetPileInterface(ISolpackPile **pp);
00104    void SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex);
00105    void PileSetElCapture() { SetElCapture(); }
00106    void PileReleaseElCapture() { ReleaseElCapture(); }
00107
00108    long m_lType;              // The type of pile (SOLPACKPILETYPE)
00109    long m_lX;                 // X-coordinate of the pile
00110    long m_lY;                 // Y-coordinate of the pile
00111
00112 protected:
00113    void UpdateTooltip();
00114    void UpdateBaseImg();
00115    void UpdateDims();
00116    SIZE GetSizeWith(int cCards);
00117    void SetElCapture();
00118    void ReleaseElCapture();
00119
00120    IPileSite *m_pSite;                    // Engine interface
00121
00122    CHTMLImgElementPtr m_spImgElBase;      // IMG element that displays the base image
00123
00124    long m_lBaseType;                      // The base image (SOLPACKBASETYPE)
00125    CTSTR m_lpszTooltip;                   // Tooltip comment for the pile
00126    BOOL m_bShowNumCards;                  // Whether to show number of cards in tooltip
00127
00128    long m_lWidth;                         // Current width of the pile
00129    long m_lHeight;                        // Current height of the pile
00130    HRGN m_hRgn;                           // Region representing pile shape
00131
00132    CPtrArray<CCard*, CCard*> m_apCards;   // Cards in the pile
00133    CArray<BOOL, BOOL> m_abTransferred;    // Which cards have been transferred
00134 };
00135
00136
00137 #endif // !defined(AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


ProcessMsg.h File Reference

#include <bmws_error.h>

Go to the source code of this file.

Compounds

class | CQuitExcep
class | IMsgProcessor

Defines

#define | AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file ProcessMsg.h.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


ProcessMsg.h Source File

ProcessMsg.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // ProcessMsg.h
00004 //    Abstract class to enable processing of Windows messages.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_error.h>
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CQuitExcep class
00026 //    Used to safely jump out of a lengthy process. For instance, when the
00027 //    message processor discovers the user wants to quit, this exception will
00028 //    be thrown.
00029 //
00030 //----------------------------------------------------------------------------
00031 class CQuitExcep : public CExcep
00032 {
00033 public:
00034    CQuitExcep() : CExcep(0)
00035    {
00036    }
00037
00038    virtual void Report()
00039    {
00040    }
00041 };
00042
00043
00044 //----------------------------------------------------------------------------
00045 //
00046 // IMsgProcessor abstract class
00047 //    Enables processing of Windows messages. Implemented by the application
00048 //    class. Used within lengthy processes to keep the app responsive and to
00049 //    allow IE to actually show card movements, etc., properly.
00050 //
00051 //----------------------------------------------------------------------------
00052 class IMsgProcessor
00053 {
00054 public:
00055    virtual void ProcessMessage(LPMSG lpMsg) = 0;
00056    virtual void EmptyMessageQueue(BOOL bCheckQuit) = 0;
00057 };
00058
00059
00060 #endif // !defined(AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


RegServices.cpp File Reference

#include "stdafx.h"
#include <bmws_window.h>
#include <bmws_regservices.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:21 2002 for Solitaire Pack by doxygen 1.2.15


RegServices.cpp Source File

RegServices.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // RegServices.cpp
00004 //    Includes component source files related to product registration.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_window.h>
00011 #include <bmws_regservices.cpp>
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


Solpack/resource.h File Reference

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDS_COMPANY 2
#define | IDS_CLASSNAME 3
#define | IDS_SPLASHCLASSNAME 4
#define | IDS_BARCLASSNAME 5
#define | IDS_PANECLASSNAME 6
#define | IDS_ANIMGIF 7
#define | IDS_MAINHTML 8
#define | IDS_HELPHTML 9
#define | IDS_MENUCELL 10
#define | IDS_HEXCOLORHOLDER 11
#define | IDS_IMGHOLDER 12
#define | IDS_SHATTERCOLOR 13
#define | IDS_DEFEXT 14
#define | IDS_MAILTOPROTOCOL 15
#define | IDI_SOLPACK 101
#define | IDB_BARCLOSE 101
#define | IDS_REG_SOFTWARE 401
#define | IDS_REG_HELPPANE 402
#define | IDS_REG_HELPPANEHEIGHT 403
#define | IDS_REG_NOTIFYUPDATE 404
#define | IDS_REG_NOTIFYEXTRAS 405
#define | IDS_REG_STATUSBAR 406
#define | IDS_REG_MAINWNDPLACEMENT 407
#define | IDS_REG_BGIMG 408
#define | IDS_REG_BGCOLOR 409
#define | IDS_REG_TEXTCOLOR 410
#define | IDS_REG_CUSTCOLORS 411
#define | IDS_REG_EVENTSTITLE 412
#define | IDS_REG_SOUND_SHUFFLE 413
#define | IDS_REG_SOUND_WON 414
#define | IDS_REG_SOUND_DROP 415
#define | IDS_REG_SOUND_FLIP 416
#define | IDS_REG_ANIMWON 417
#define | IDS_REG_ANIMCARDS 418
#define | IDS_IMG_SPADE 801
#define | IDS_IMG_HEART 802
#define | IDS_IMG_CLUB 803
#define | IDS_IMG_DIAMOND 804
#define | IDS_IMG_BASE_NONE 901
#define | IDS_IMG_BASE_FRAME 902
#define | IDS_IMG_BASE_FOUNDATION 903
#define | IDS_IMG_BASE_REDEAL 904
#define | IDS_IMG_BASE_NOREDEAL 905
#define | IDS_EL_BODY 3001
#define | IDS_EL_GAMEMENU 3002
#define | IDS_EL_DAVC 3003
#define | IDS_EL_MENUHOLDER 3004
#define | IDS_EL_MENULIB 3005
#define | IDS_EL_MENUGAME 3006
#define | IDS_EL_MENUDIFFICULTY 3007
#define | IDS_EL_MENULIBAUTHOR 3008
#define | IDS_EL_MENUINSTR 3009
#define | IDS_EL_MENUPLAY 3010
#define | IDS_EL_MENUPANE 3011
#define | IDS_EL_ENGINE 3012
#define | IDS_EL_COMMANDROW 3013
#define | IDS_EL_COMMANDBARHOLDER 3014
#define | IDS_EL_TABLEAU 3015
#define | IDS_EL_FRAGMENT 3016
#define | IDS_EL_HELPINSTR 3017
#define | IDS_EL_MENULIBEMAIL 3018
#define | IDS_EL_MENULIBWEBSITE 3019
#define | IDS_EL_HELPGAME 3020
#define | IDS_TAG_A 3401
#define | IDS_TAG_IMG 3402
#define | IDS_TAG_SPAN 3403
#define | IDS_CLASS_PILEBASE 3801
#define | IDS_CLASS_CARD 3802
#define | IDS_SEL_PILEBASECLASS 4001
#define | IDS_STYLE_COLOR 4501
#define | IDS_STYLE_PILEBASEFILTER 4502
#define | IDS_ERR_LCNOTFOUND 7001

Define Documentation

#define IDB_BARCLOSE 101

Definition at line 20 of file Solpack/resource.h.

Referenced by CHelpPane::OnCreate(), and CHelpPane::UpdateColors().

#define IDI_SOLPACK 101

Definition at line 19 of file Solpack/resource.h.

Referenced by CAboutDlg::CAboutDlg(), and CMainWindow::Register().

#define IDS_ANIMGIF 7

Definition at line 10 of file Solpack/resource.h.

#define IDS_BARCLASSNAME 5

Definition at line 8 of file Solpack/resource.h.

Referenced by CHelpPane::Register().

#define IDS_CLASS_CARD 3802

Definition at line 72 of file Solpack/resource.h.

Referenced by CCard::InitCard().

#define IDS_CLASS_PILEBASE 3801

Definition at line 71 of file Solpack/resource.h.

Referenced by CPile::InitPile().

#define IDS_CLASSNAME 3

Definition at line 6 of file Solpack/resource.h.

Referenced by CMainWindow::Register().

#define IDS_COMPANY 2

Definition at line 5 of file Solpack/resource.h.

#define IDS_DEFEXT 14

Definition at line 17 of file Solpack/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDS_EL_BODY 3001

Definition at line 48 of file Solpack/resource.h.

Referenced by CMainWindow::HTMLComplete(), CHelpPane::HTMLComplete(), CEngine::PlayGame(), CEngine::StopPlayGame(), and CUserPrefs::UpdateAppearance().

#define IDS_EL_COMMANDBARHOLDER 3014

Definition at line 61 of file Solpack/resource.h.

Referenced by CGameCommandMgr::AddGameCommand(), and CGameCommandMgr::Clear().

#define IDS_EL_COMMANDROW 3013

Definition at line 60 of file Solpack/resource.h.

Referenced by CGameCommandMgr::Clear(), and CGameCommand::Init().

#define IDS_EL_DAVC 3003

Definition at line 50 of file Solpack/resource.h.

Referenced by CEngine::InitEngine().

#define IDS_EL_ENGINE 3012

Definition at line 59 of file Solpack/resource.h.

Referenced by CEngine::PlayGame(), and CEngine::StopPlayGame().

#define IDS_EL_FRAGMENT 3016

Definition at line 63 of file Solpack/resource.h.

Referenced by CFragment::InitFragment().

#define IDS_EL_GAMEMENU 3002

Definition at line 49 of file Solpack/resource.h.

Referenced by CGameMenu::Show().

#define IDS_EL_HELPGAME 3020

Definition at line 67 of file Solpack/resource.h.

Referenced by CHelpPane::HTMLComplete(), and CHelpPane::SetGame().

#define IDS_EL_HELPINSTR 3017

Definition at line 64 of file Solpack/resource.h.

Referenced by CHelpPane::HTMLComplete(), and CHelpPane::SetInstr().

#define IDS_EL_MENUDIFFICULTY 3007

Definition at line 54 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_EL_MENUGAME 3006

Definition at line 53 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_EL_MENUHOLDER 3004

Definition at line 51 of file Solpack/resource.h.

Referenced by CGameMenu::Refresh().

#define IDS_EL_MENUINSTR 3009

Definition at line 56 of file Solpack/resource.h.

Referenced by CMainWindow::DoHelpPane(), CMainWindow::HTMLComplete(), CGameMenu::Init(), and CGameMenu::Uninit().

#define IDS_EL_MENULIB 3005

Definition at line 52 of file Solpack/resource.h.

#define IDS_EL_MENULIBAUTHOR 3008

Definition at line 55 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_EL_MENULIBEMAIL 3018

Definition at line 65 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_EL_MENULIBWEBSITE 3019

Definition at line 66 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_EL_MENUPANE 3011

Definition at line 58 of file Solpack/resource.h.

Referenced by CGameMenu::Init(), and CGameMenu::Refresh().

#define IDS_EL_MENUPLAY 3010

Definition at line 57 of file Solpack/resource.h.

Referenced by CGameMenu::Init(), and CGameMenu::Uninit().

#define IDS_EL_TABLEAU 3015

Definition at line 62 of file Solpack/resource.h.

Referenced by CPile::InitPile().

#define IDS_ERR_LCNOTFOUND 7001

Definition at line 76 of file Solpack/resource.h.

Referenced by CSolpackApp::Run().

#define IDS_HELPHTML 9

Definition at line 12 of file Solpack/resource.h.

Referenced by CHelpPane::OnCreatePane().

#define IDS_HEXCOLORHOLDER 11

Definition at line 14 of file Solpack/resource.h.

Referenced by CUserPrefs::UpdateAppearance().

#define IDS_IMG_BASE_FOUNDATION 903

Definition at line 45 of file Solpack/resource.h.

#define IDS_IMG_BASE_FRAME 902

Definition at line 44 of file Solpack/resource.h.

#define IDS_IMG_BASE_NONE 901

Definition at line 43 of file Solpack/resource.h.

Referenced by CPile::UpdateBaseImg().

#define IDS_IMG_BASE_NOREDEAL 905

Definition at line 47 of file Solpack/resource.h.

#define IDS_IMG_BASE_REDEAL 904

Definition at line 46 of file Solpack/resource.h.

#define IDS_IMG_CLUB 803

Definition at line 41 of file Solpack/resource.h.

#define IDS_IMG_DIAMOND 804

Definition at line 42 of file Solpack/resource.h.

#define IDS_IMG_HEART 802

Definition at line 40 of file Solpack/resource.h.

#define IDS_IMG_SPADE 801

Definition at line 39 of file Solpack/resource.h.

Referenced by CGameMenu::Init().

#define IDS_IMGHOLDER 12

Definition at line 15 of file Solpack/resource.h.

Referenced by CUserPrefs::UpdateAppearance(), and CCard::UpdateImg().

#define IDS_MAILTOPROTOCOL 15

Definition at line 18 of file Solpack/resource.h.

Referenced by CGameMenu::FillGameInfo().

#define IDS_MAINHTML 8

Definition at line 11 of file Solpack/resource.h.

Referenced by CMainWindow::Create().

#define IDS_MENUCELL 10

Definition at line 13 of file Solpack/resource.h.

Referenced by CGameMenuItem::Init().

#define IDS_PANECLASSNAME 6

Definition at line 9 of file Solpack/resource.h.

Referenced by CHelpPane::Register().

#define IDS_REG_ANIMCARDS 418

Definition at line 38 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_ANIMWON 417

Definition at line 37 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_BGCOLOR 409

Definition at line 29 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_BGIMG 408

Definition at line 28 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_CUSTCOLORS 411

Definition at line 31 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_EVENTSTITLE 412

Definition at line 32 of file Solpack/resource.h.

Referenced by CSolpackApp::Register(), CUserPrefs::SetSite(), and CSolpackApp::Unregister().

#define IDS_REG_HELPPANE 402

Definition at line 22 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_HELPPANEHEIGHT 403

Definition at line 23 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_MAINWNDPLACEMENT 407

Definition at line 27 of file Solpack/resource.h.

Referenced by CMainWindow::Create(), and CMainWindow::OnDestroy().

#define IDS_REG_NOTIFYEXTRAS 405

Definition at line 25 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), CSolpackApp::Register(), and CUserPrefs::WriteRegistry().

#define IDS_REG_NOTIFYUPDATE 404

Definition at line 24 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), CSolpackApp::Register(), and CUserPrefs::WriteRegistry().

#define IDS_REG_SOFTWARE 401

Definition at line 21 of file Solpack/resource.h.

#define IDS_REG_SOUND_DROP 415

Definition at line 35 of file Solpack/resource.h.

#define IDS_REG_SOUND_FLIP 416

Definition at line 36 of file Solpack/resource.h.

#define IDS_REG_SOUND_SHUFFLE 413

Definition at line 33 of file Solpack/resource.h.

#define IDS_REG_SOUND_WON 414

Definition at line 34 of file Solpack/resource.h.

#define IDS_REG_STATUSBAR 406

Definition at line 26 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_REG_TEXTCOLOR 410

Definition at line 30 of file Solpack/resource.h.

Referenced by CUserPrefs::ReadRegistry(), and CUserPrefs::WriteRegistry().

#define IDS_SEL_PILEBASECLASS 4001

Definition at line 73 of file Solpack/resource.h.

Referenced by CUserPrefs::UpdateAppearance().

#define IDS_SHATTERCOLOR 13

Definition at line 16 of file Solpack/resource.h.

#define IDS_SPLASHCLASSNAME 4

Definition at line 7 of file Solpack/resource.h.

Referenced by CSplashWindow::Create(), and CSplashWindow::Register().

#define IDS_STYLE_COLOR 4501

Definition at line 74 of file Solpack/resource.h.

Referenced by CUserPrefs::UpdateAppearance().

#define IDS_STYLE_PILEBASEFILTER 4502

Definition at line 75 of file Solpack/resource.h.

Referenced by CUserPrefs::UpdateAppearance().

#define IDS_TAG_A 3401

Definition at line 68 of file Solpack/resource.h.

Referenced by CGameCommand::Enable(), and CGameMenuItem::Init().

#define IDS_TAG_IMG 3402

Definition at line 69 of file Solpack/resource.h.

Referenced by CPile::InitPile().

#define IDS_TAG_SPAN 3403

Definition at line 70 of file Solpack/resource.h.

Referenced by CCard::InitCard(), and CPile::InitPile().

Generated on Wed May 8 12:39:22 2002 for Solitaire Pack by doxygen 1.2.15


resource.h Source File

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by Solpack.rc
00004 //
00005 #define IDS_COMPANY                     2
00006 #define IDS_CLASSNAME                   3
00007 #define IDS_SPLASHCLASSNAME             4
00008 #define IDS_BARCLASSNAME                5
00009 #define IDS_PANECLASSNAME               6
00010 #define IDS_ANIMGIF                     7
00011 #define IDS_MAINHTML                    8
00012 #define IDS_HELPHTML                    9
00013 #define IDS_MENUCELL                    10
00014 #define IDS_HEXCOLORHOLDER              11
00015 #define IDS_IMGHOLDER                   12
00016 #define IDS_SHATTERCOLOR                13
00017 #define IDS_DEFEXT                      14
00018 #define IDS_MAILTOPROTOCOL              15
00019 #define IDI_SOLPACK                     101
00020 #define IDB_BARCLOSE                    101
00021 #define IDS_REG_SOFTWARE                401
00022 #define IDS_REG_HELPPANE                402
00023 #define IDS_REG_HELPPANEHEIGHT          403
00024 #define IDS_REG_NOTIFYUPDATE            404
00025 #define IDS_REG_NOTIFYEXTRAS            405
00026 #define IDS_REG_STATUSBAR               406
00027 #define IDS_REG_MAINWNDPLACEMENT        407
00028 #define IDS_REG_BGIMG                   408
00029 #define IDS_REG_BGCOLOR                 409
00030 #define IDS_REG_TEXTCOLOR               410
00031 #define IDS_REG_CUSTCOLORS              411
00032 #define IDS_REG_EVENTSTITLE             412
00033 #define IDS_REG_SOUND_SHUFFLE           413
00034 #define IDS_REG_SOUND_WON               414
00035 #define IDS_REG_SOUND_DROP              415
00036 #define IDS_REG_SOUND_FLIP              416
00037 #define IDS_REG_ANIMWON                 417
00038 #define IDS_REG_ANIMCARDS               418
00039 #define IDS_IMG_SPADE                   801
00040 #define IDS_IMG_HEART                   802
00041 #define IDS_IMG_CLUB                    803
00042 #define IDS_IMG_DIAMOND                 804
00043 #define IDS_IMG_BASE_NONE               901
00044 #define IDS_IMG_BASE_FRAME              902
00045 #define IDS_IMG_BASE_FOUNDATION         903
00046 #define IDS_IMG_BASE_REDEAL             904
00047 #define IDS_IMG_BASE_NOREDEAL           905
00048 #define IDS_EL_BODY                     3001
00049 #define IDS_EL_GAMEMENU                 3002
00050 #define IDS_EL_DAVC                     3003
00051 #define IDS_EL_MENUHOLDER               3004
00052 #define IDS_EL_MENULIB                  3005
00053 #define IDS_EL_MENUGAME                 3006
00054 #define IDS_EL_MENUDIFFICULTY           3007
00055 #define IDS_EL_MENULIBAUTHOR            3008
00056 #define IDS_EL_MENUINSTR                3009
00057 #define IDS_EL_MENUPLAY                 3010
00058 #define IDS_EL_MENUPANE                 3011
00059 #define IDS_EL_ENGINE                   3012
00060 #define IDS_EL_COMMANDROW               3013
00061 #define IDS_EL_COMMANDBARHOLDER         3014
00062 #define IDS_EL_TABLEAU                  3015
00063 #define IDS_EL_FRAGMENT                 3016
00064 #define IDS_EL_HELPINSTR                3017
00065 #define IDS_EL_MENULIBEMAIL             3018
00066 #define IDS_EL_MENULIBWEBSITE           3019
00067 #define IDS_EL_HELPGAME                 3020
00068 #define IDS_TAG_A                       3401
00069 #define IDS_TAG_IMG                     3402
00070 #define IDS_TAG_SPAN                    3403
00071 #define IDS_CLASS_PILEBASE              3801
00072 #define IDS_CLASS_CARD                  3802
00073 #define IDS_SEL_PILEBASECLASS           4001
00074 #define IDS_STYLE_COLOR                 4501
00075 #define IDS_STYLE_PILEBASEFILTER        4502
00076 #define IDS_ERR_LCNOTFOUND              7001
00077
00078 // Next default values for new objects
00079 //
00080 #ifdef APSTUDIO_INVOKED
00081 #ifndef APSTUDIO_READONLY_SYMBOLS
00082 #define _APS_NEXT_RESOURCE_VALUE        105
00083 #define _APS_NEXT_COMMAND_VALUE         40001
00084 #define _APS_NEXT_CONTROL_VALUE         1000
00085 #define _APS_NEXT_SYMED_VALUE           101
00086 #endif
00087 #endif
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


SolpckLC/resource.h File Reference

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDM_GAME_DEAL 1001
#define | IDM_GAME_AUTOPLAY 1002
#define | IDM_GAME_UNDO 1003
#define | IDM_GAME_REDO 1004
#define | IDM_GAME_GAMESMENU 1005
#define | IDM_GAME_EXIT 1006
#define | IDM_OPTIONS_PROGRAMOPTIONS 1021
#define | IDM_OPTIONS_ADDGAMELIBRARY 1022
#define | IDM_HELP_CONTENTSANDINDEX 1041
#define | IDM_HELP_GAMEINSTRUCTIONS 1042
#define | IDM_HELP_REGISTER 1043
#define | IDM_HELP_ABOUT 1044
#define | IDR_SOLPACKACCEL 10001
#define | IDR_MAINMENU 10001
#define | IDS_APP_TITLE 10001
#define | IDD_ABOUTBOX 10001
#define | IDS_CATDESC 10002
#define | IDD_OPTIONS_GENERAL 10002
#define | IDD_OPTIONS_APPEARANCE 10003
#define | IDS_REGISTEREDGREETING 10005
#define | IDS_UNREGISTERED 10006
#define | IDS_TITLEBARHOLDER 10007
#define | IDS_TB_CLOSE 10008
#define | IDS_OPTIONSDLGTITLE 10009
#define | IDS_FILTER 10010
#define | IDS_IMGFILTER 10011
#define | IDS_ADDGAMELIBTITLE 10012
#define | IDS_SITEURL 10016
#define | IDS_REGISTERURL 10017
#define | IDS_UPDATEXML 10018
#define | IDS_SPLASHVERSION 10019
#define | IDS_SPLASHCOPYRIGHT 10020
#define | IDS_NEWVERHOLDER 10021
#define | IDS_FILENOTFOUND 10022
#define | IDS_BROWSEBKIMG 10023
#define | IDS_CHOOSECOLOR_TITLE 10024
#define | IDS_COLOR_BKG 10025
#define | IDS_COLOR_TEXT 10026
#define | IDS_SHOWRULES 10027
#define | IDS_HIDERULES 10028
#define | IDS_NUMCARDSTOOLTIP 10029
#define | IDC_ABOUT_SOLPACKICON 10100
#define | IDC_ABOUT_BMWSURL 10101
#define | IDS_SOUND_SHUFFLE 10101
#define | IDC_ABOUT_REG 10102
#define | IDS_SOUND_FLIP 10102
#define | IDC_ABOUT_REGISTER 10103
#define | IDS_SOUND_DROP 10103
#define | IDS_SOUND_WON 10104
#define | IDC_OPTGENERAL_STATUSBAR 10200
#define | IDS_STATUS_INITDECK 10201
#define | IDC_OPTGENERAL_ANIMCARDS 10201
#define | IDS_STATUS_INITGAME 10202
#define | IDC_OPTGENERAL_CHECKNEWVER 10202
#define | IDS_STATUS_INITMENU 10203
#define | IDC_OPTGENERAL_CHECKEXTRAS 10203
#define | IDS_STATUS_SCORE 10204
#define | IDC_OPTGENERAL_TOOLTIPS 10204
#define | IDC_OPTGENERAL_ANIMATEWON 10205
#define | IDC_OPTAPP_TEXTCOLOR 10300
#define | IDC_OPTAPP_BKCOLOR 10301
#define | IDS_DIFFICULTY_EASY 10301
#define | IDC_OPTAPP_BKIMGCHK 10302
#define | IDS_DIFFICULTY_MEDIUM 10302
#define | IDC_OPTAPP_BKIMGEDIT 10303
#define | IDS_DIFFICULTY_HARD 10303
#define | IDC_OPTAPP_BROWSEBKIMG 10304
#define | IDC_OPTAPP_RESTORE 10305
#define | IDS_SOUNDFILE_SHUFFLE 10501
#define | IDS_SOUNDFILE_FLIP 10502
#define | IDS_SOUNDFILE_DROP 10503
#define | IDS_SOUNDFILE_WON 10504
#define | IDB_SPLASH 11001
#define | IDS_SYSMENU 12001
#define | IDS_SC_SIZE 12002
#define | IDS_SC_MOVE 12003
#define | IDS_SC_MINIMIZE 12004
#define | IDS_SC_MAXIMIZE 12005
#define | IDS_SC_RESTORE 12006
#define | IDS_SC_TASKLIST 12007
#define | IDS_ERR_LOADIMAGE 17001
#define | IDS_ERR_IMLCREATE 17002
#define | IDC_STATIC -1

Define Documentation

#define IDB_SPLASH 11001

Definition at line 77 of file SolpckLC/resource.h.

Referenced by CSplashWindow::Create().

#define IDC_ABOUT_BMWSURL 10101

Definition at line 47 of file SolpckLC/resource.h.

Referenced by CAboutDlg::DlgProc().

#define IDC_ABOUT_REG 10102

Definition at line 49 of file SolpckLC/resource.h.

Referenced by CAboutDlg::DlgProc().

#define IDC_ABOUT_REGISTER 10103

Definition at line 51 of file SolpckLC/resource.h.

Referenced by CAboutDlg::DlgProc(), and CMainWindow::OnCommand().

#define IDC_ABOUT_SOLPACKICON 10100

Definition at line 46 of file SolpckLC/resource.h.

Referenced by CAboutDlg::DlgProc().

#define IDC_OPTAPP_BKCOLOR 10301

Definition at line 65 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTAPP_BKIMGCHK 10302

Definition at line 67 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoBkImgChk(), and CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTAPP_BKIMGEDIT 10303

Definition at line 69 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoBkImgChk(), and CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTAPP_BROWSEBKIMG 10304

Definition at line 71 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoBkImgChk(), and CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTAPP_RESTORE 10305

Definition at line 72 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTAPP_TEXTCOLOR 10300

Definition at line 64 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoChooseColor(), and CAppearanceDlg::OptionsAppearanceProc().

#define IDC_OPTGENERAL_ANIMATEWON 10205

Definition at line 63 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_OPTGENERAL_ANIMCARDS 10201

Definition at line 56 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_OPTGENERAL_CHECKEXTRAS 10203

Definition at line 60 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_OPTGENERAL_CHECKNEWVER 10202

Definition at line 58 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_OPTGENERAL_STATUSBAR 10200

Definition at line 54 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_OPTGENERAL_TOOLTIPS 10204

Definition at line 62 of file SolpckLC/resource.h.

Referenced by CUserPrefs::OptionsGeneralProc().

#define IDC_STATIC -1

Definition at line 87 of file SolpckLC/resource.h.

#define IDD_ABOUTBOX 10001

Definition at line 20 of file SolpckLC/resource.h.

Referenced by CAboutDlg::CAboutDlg().

#define IDD_OPTIONS_APPEARANCE 10003

Definition at line 23 of file SolpckLC/resource.h.

Referenced by CUserPrefs::DoOptions().

#define IDD_OPTIONS_GENERAL 10002

Definition at line 22 of file SolpckLC/resource.h.

Referenced by CUserPrefs::DoOptions().

#define IDM_GAME_AUTOPLAY 1002

Definition at line 6 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand(), CMainWindow::ShowHideEngine(), and CEngine::TryCommand().

#define IDM_GAME_DEAL 1001

Definition at line 5 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand(), CMainWindow::ShowHideEngine(), and CEngine::TryCommand().

#define IDM_GAME_EXIT 1006

Definition at line 10 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand(), and CMainWindow::OnMenuSelect().

#define IDM_GAME_GAMESMENU 1005

Definition at line 9 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand(), and CMainWindow::ShowHideEngine().

#define IDM_GAME_REDO 1004

Definition at line 8 of file SolpckLC/resource.h.

Referenced by CMainWindow::MainWndProc(), CMainWindow::OnCommand(), and CEngine::TryCommand().

#define IDM_GAME_UNDO 1003

Definition at line 7 of file SolpckLC/resource.h.

Referenced by CMainWindow::MainWndProc(), CMainWindow::OnCommand(), and CEngine::TryCommand().

#define IDM_HELP_ABOUT 1044

Definition at line 16 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDM_HELP_CONTENTSANDINDEX 1041

Definition at line 13 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDM_HELP_GAMEINSTRUCTIONS 1042

Definition at line 14 of file SolpckLC/resource.h.

Referenced by CHelpPane::BarWndProc(), CMainWindow::DoHelpPane(), CMainWindow::OnCommand(), and CHelpPane::OnCreate().

#define IDM_HELP_REGISTER 1043

Definition at line 15 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand(), and CMainWindow::RemoveRegMenuItem().

#define IDM_OPTIONS_ADDGAMELIBRARY 1022

Definition at line 12 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDM_OPTIONS_PROGRAMOPTIONS 1021

Definition at line 11 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDR_MAINMENU 10001

Definition at line 18 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCreate().

#define IDR_SOLPACKACCEL 10001

Definition at line 17 of file SolpckLC/resource.h.

Referenced by CMainWindow::Create().

#define IDS_ADDGAMELIBTITLE 10012

Definition at line 31 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDS_APP_TITLE 10001

Definition at line 19 of file SolpckLC/resource.h.

#define IDS_BROWSEBKIMG 10023

Definition at line 39 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc().

#define IDS_CATDESC 10002

Definition at line 21 of file SolpckLC/resource.h.

Referenced by CSolpackApp::Register().

#define IDS_CHOOSECOLOR_TITLE 10024

Definition at line 40 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoChooseColor().

#define IDS_COLOR_BKG 10025

Definition at line 41 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoChooseColor().

#define IDS_COLOR_TEXT 10026

Definition at line 42 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::DoChooseColor().

#define IDS_DIFFICULTY_EASY 10301

Definition at line 66 of file SolpckLC/resource.h.

Referenced by CGameMenu::Init().

#define IDS_DIFFICULTY_HARD 10303

Definition at line 70 of file SolpckLC/resource.h.

#define IDS_DIFFICULTY_MEDIUM 10302

Definition at line 68 of file SolpckLC/resource.h.

#define IDS_ERR_IMLCREATE 17002

Definition at line 86 of file SolpckLC/resource.h.

Referenced by CHelpPane::OnCreate(), and CHelpPane::UpdateColors().

#define IDS_ERR_LOADIMAGE 17001

Definition at line 85 of file SolpckLC/resource.h.

Referenced by CHelpPane::OnCreate(), and CHelpPane::UpdateColors().

#define IDS_FILENOTFOUND 10022

Definition at line 38 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc().

#define IDS_FILTER 10010

Definition at line 29 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDS_HIDERULES 10028

Definition at line 44 of file SolpckLC/resource.h.

Referenced by CMainWindow::DoHelpPane(), and CMainWindow::HTMLComplete().

#define IDS_IMGFILTER 10011

Definition at line 30 of file SolpckLC/resource.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc().

#define IDS_NEWVERHOLDER 10021

Definition at line 37 of file SolpckLC/resource.h.

Referenced by CMainWindow::PresentUpdate().

#define IDS_NUMCARDSTOOLTIP 10029

Definition at line 45 of file SolpckLC/resource.h.

Referenced by CPile::UpdateTooltip().

#define IDS_OPTIONSDLGTITLE 10009

Definition at line 28 of file SolpckLC/resource.h.

Referenced by CUserPrefs::DoOptions().

#define IDS_REGISTEREDGREETING 10005

Definition at line 24 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDS_REGISTERURL 10017

Definition at line 33 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCommand().

#define IDS_SC_MAXIMIZE 12005

Definition at line 82 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SC_MINIMIZE 12004

Definition at line 81 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SC_MOVE 12003

Definition at line 80 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SC_RESTORE 12006

Definition at line 83 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SC_SIZE 12002

Definition at line 79 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SC_TASKLIST 12007

Definition at line 84 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_SHOWRULES 10027

Definition at line 43 of file SolpckLC/resource.h.

Referenced by CMainWindow::DoHelpPane(), and CMainWindow::HTMLComplete().

#define IDS_SITEURL 10016

Definition at line 32 of file SolpckLC/resource.h.

Referenced by CMainWindow::PresentUpdate().

#define IDS_SOUND_DROP 10103

Definition at line 52 of file SolpckLC/resource.h.

#define IDS_SOUND_FLIP 10102

Definition at line 50 of file SolpckLC/resource.h.

#define IDS_SOUND_SHUFFLE 10101

Definition at line 48 of file SolpckLC/resource.h.

#define IDS_SOUND_WON 10104

Definition at line 53 of file SolpckLC/resource.h.

#define IDS_SOUNDFILE_DROP 10503

Definition at line 75 of file SolpckLC/resource.h.

#define IDS_SOUNDFILE_FLIP 10502

Definition at line 74 of file SolpckLC/resource.h.

#define IDS_SOUNDFILE_SHUFFLE 10501

Definition at line 73 of file SolpckLC/resource.h.

Referenced by CSolpackApp::Register().

#define IDS_SOUNDFILE_WON 10504

Definition at line 76 of file SolpckLC/resource.h.

#define IDS_SPLASHCOPYRIGHT 10020

Definition at line 36 of file SolpckLC/resource.h.

Referenced by CSolpackApp::Run().

#define IDS_SPLASHVERSION 10019

Definition at line 35 of file SolpckLC/resource.h.

Referenced by CSolpackApp::Run().

#define IDS_STATUS_INITDECK 10201

Definition at line 55 of file SolpckLC/resource.h.

Referenced by CEngine::InitEngine().

#define IDS_STATUS_INITGAME 10202

Definition at line 57 of file SolpckLC/resource.h.

Referenced by CEngine::PlayGame().

#define IDS_STATUS_INITMENU 10203

Definition at line 59 of file SolpckLC/resource.h.

Referenced by CGameMenu::Refresh().

#define IDS_STATUS_SCORE 10204

Definition at line 61 of file SolpckLC/resource.h.

Referenced by CStatusBar::Create().

#define IDS_SYSMENU 12001

Definition at line 78 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnMenuSelect().

#define IDS_TB_CLOSE 10008

Definition at line 27 of file SolpckLC/resource.h.

Referenced by CHelpPane::OnCreate().

#define IDS_TITLEBARHOLDER 10007

Definition at line 26 of file SolpckLC/resource.h.

Referenced by CMainWindow::GameSelected().

#define IDS_UNREGISTERED 10006

Definition at line 25 of file SolpckLC/resource.h.

Referenced by CAboutDlg::DlgProc().

#define IDS_UPDATEXML 10018

Definition at line 34 of file SolpckLC/resource.h.

Referenced by CMainWindow::OnCreate().

Generated on Wed May 8 12:39:23 2002 for Solitaire Pack by doxygen 1.2.15


resource.h Source File

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SolpckLC.rc
00004 //
00005 #define IDM_GAME_DEAL                   1001
00006 #define IDM_GAME_AUTOPLAY               1002
00007 #define IDM_GAME_UNDO                   1003
00008 #define IDM_GAME_REDO                   1004
00009 #define IDM_GAME_GAMESMENU              1005
00010 #define IDM_GAME_EXIT                   1006
00011 #define IDM_OPTIONS_PROGRAMOPTIONS      1021
00012 #define IDM_OPTIONS_ADDGAMELIBRARY      1022
00013 #define IDM_HELP_CONTENTSANDINDEX       1041
00014 #define IDM_HELP_GAMEINSTRUCTIONS       1042
00015 #define IDM_HELP_REGISTER               1043
00016 #define IDM_HELP_ABOUT                  1044
00017 #define IDR_SOLPACKACCEL                10001
00018 #define IDR_MAINMENU                    10001
00019 #define IDS_APP_TITLE                   10001
00020 #define IDD_ABOUTBOX                    10001
00021 #define IDS_CATDESC                     10002
00022 #define IDD_OPTIONS_GENERAL             10002
00023 #define IDD_OPTIONS_APPEARANCE          10003
00024 #define IDS_REGISTEREDGREETING          10005
00025 #define IDS_UNREGISTERED                10006
00026 #define IDS_TITLEBARHOLDER              10007
00027 #define IDS_TB_CLOSE                    10008
00028 #define IDS_OPTIONSDLGTITLE             10009
00029 #define IDS_FILTER                      10010
00030 #define IDS_IMGFILTER                   10011
00031 #define IDS_ADDGAMELIBTITLE             10012
00032 #define IDS_SITEURL                     10016
00033 #define IDS_REGISTERURL                 10017
00034 #define IDS_UPDATEXML                   10018
00035 #define IDS_SPLASHVERSION               10019
00036 #define IDS_SPLASHCOPYRIGHT             10020
00037 #define IDS_NEWVERHOLDER                10021
00038 #define IDS_FILENOTFOUND                10022
00039 #define IDS_BROWSEBKIMG                 10023
00040 #define IDS_CHOOSECOLOR_TITLE           10024
00041 #define IDS_COLOR_BKG                   10025
00042 #define IDS_COLOR_TEXT                  10026
00043 #define IDS_SHOWRULES                   10027
00044 #define IDS_HIDERULES                   10028
00045 #define IDS_NUMCARDSTOOLTIP             10029
00046 #define IDC_ABOUT_SOLPACKICON           10100
00047 #define IDC_ABOUT_BMWSURL               10101
00048 #define IDS_SOUND_SHUFFLE               10101
00049 #define IDC_ABOUT_REG                   10102
00050 #define IDS_SOUND_FLIP                  10102
00051 #define IDC_ABOUT_REGISTER              10103
00052 #define IDS_SOUND_DROP                  10103
00053 #define IDS_SOUND_WON                   10104
00054 #define IDC_OPTGENERAL_STATUSBAR        10200
00055 #define IDS_STATUS_INITDECK             10201
00056 #define IDC_OPTGENERAL_ANIMCARDS        10201
00057 #define IDS_STATUS_INITGAME             10202
00058 #define IDC_OPTGENERAL_CHECKNEWVER      10202
00059 #define IDS_STATUS_INITMENU             10203
00060 #define IDC_OPTGENERAL_CHECKEXTRAS      10203
00061 #define IDS_STATUS_SCORE                10204
00062 #define IDC_OPTGENERAL_TOOLTIPS         10204
00063 #define IDC_OPTGENERAL_ANIMATEWON       10205
00064 #define IDC_OPTAPP_TEXTCOLOR            10300
00065 #define IDC_OPTAPP_BKCOLOR              10301
00066 #define IDS_DIFFICULTY_EASY             10301
00067 #define IDC_OPTAPP_BKIMGCHK             10302
00068 #define IDS_DIFFICULTY_MEDIUM           10302
00069 #define IDC_OPTAPP_BKIMGEDIT            10303
00070 #define IDS_DIFFICULTY_HARD             10303
00071 #define IDC_OPTAPP_BROWSEBKIMG          10304
00072 #define IDC_OPTAPP_RESTORE              10305
00073 #define IDS_SOUNDFILE_SHUFFLE           10501
00074 #define IDS_SOUNDFILE_FLIP              10502
00075 #define IDS_SOUNDFILE_DROP              10503
00076 #define IDS_SOUNDFILE_WON               10504
00077 #define IDB_SPLASH                      11001
00078 #define IDS_SYSMENU                     12001
00079 #define IDS_SC_SIZE                     12002
00080 #define IDS_SC_MOVE                     12003
00081 #define IDS_SC_MINIMIZE                 12004
00082 #define IDS_SC_MAXIMIZE                 12005
00083 #define IDS_SC_RESTORE                  12006
00084 #define IDS_SC_TASKLIST                 12007
00085 #define IDS_ERR_LOADIMAGE               17001
00086 #define IDS_ERR_IMLCREATE               17002
00087 #define IDC_STATIC                      -1
00088
00089 // Next default values for new objects
00090 //
00091 #ifdef APSTUDIO_INVOKED
00092 #ifndef APSTUDIO_READONLY_SYMBOLS
00093 #define _APS_NEXT_RESOURCE_VALUE        110
00094 #define _APS_NEXT_COMMAND_VALUE         40003
00095 #define _APS_NEXT_CONTROL_VALUE         1026
00096 #define _APS_NEXT_SYMED_VALUE           117
00097 #endif
00098 #endif
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


SPGameLC/resource.h File Reference

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDS_APP_TITLE 10001
#define | IDS_REG_LIBDESC 10002
#define | IDS_COMMENT_SPIDERSTOCK 10003
#define | IDS_COMMENT_ACEKINGFOUNDATION 10004
#define | IDS_CMD_LABELLELUCIE_REDEAL 10005
#define | IDS_CMDHELP_LABELLELUCIE_REDEAL 10006
#define | IDS_TITLEBASE 15000

Define Documentation

#define IDS_APP_TITLE 10001

Definition at line 5 of file SPGameLC/resource.h.

#define IDS_CMD_LABELLELUCIE_REDEAL 10005

Definition at line 9 of file SPGameLC/resource.h.

#define IDS_CMDHELP_LABELLELUCIE_REDEAL 10006

Definition at line 10 of file SPGameLC/resource.h.

#define IDS_COMMENT_ACEKINGFOUNDATION 10004

Definition at line 8 of file SPGameLC/resource.h.

#define IDS_COMMENT_SPIDERSTOCK 10003

Definition at line 7 of file SPGameLC/resource.h.

#define IDS_REG_LIBDESC 10002

Definition at line 6 of file SPGameLC/resource.h.

#define IDS_TITLEBASE 15000

Definition at line 11 of file SPGameLC/resource.h.

Referenced by CGameInfo::InitGameInfo().

Generated on Wed May 8 12:39:23 2002 for Solitaire Pack by doxygen 1.2.15


resource.h Source File

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SPGameLC.rc
00004 //
00005 #define IDS_APP_TITLE                   10001
00006 #define IDS_REG_LIBDESC                 10002
00007 #define IDS_COMMENT_SPIDERSTOCK         10003
00008 #define IDS_COMMENT_ACEKINGFOUNDATION   10004
00009 #define IDS_CMD_LABELLELUCIE_REDEAL     10005
00010 #define IDS_CMDHELP_LABELLELUCIE_REDEAL 10006
00011 #define IDS_TITLEBASE                   15000
00012
00013 // Next default values for new objects
00014 //
00015 #ifdef APSTUDIO_INVOKED
00016 #ifndef APSTUDIO_READONLY_SYMBOLS
00017 #define _APS_NEXT_RESOURCE_VALUE        110
00018 #define _APS_NEXT_COMMAND_VALUE         40002
00019 #define _APS_NEXT_CONTROL_VALUE         1024
00020 #define _APS_NEXT_SYMED_VALUE           118
00021 #endif
00022 #endif
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


SPGames/resource.h File Reference

resource.h File Reference

Go to the source code of this file.

Defines

#define | IDS_COMPANY 2
#define | IDS_PERCENTS 3
#define | IDS_EMAIL 4
#define | IDS_WEBSITE 5
#define | IDS_REG_SOFTWARE 401
#define | IDS_REG_PROGIDHOLDER 402
#define | IDS_REG_PROGIDVIHOLDER 403
#define | IDS_REG_SPGAMESPROGID 404

Define Documentation

#define IDS_COMPANY 2

Definition at line 5 of file SPGames/resource.h.

#define IDS_EMAIL 4

Definition at line 7 of file SPGames/resource.h.

#define IDS_PERCENTS 3

Definition at line 6 of file SPGames/resource.h.

#define IDS_REG_PROGIDHOLDER 402

Definition at line 10 of file SPGames/resource.h.

#define IDS_REG_PROGIDVIHOLDER 403

Definition at line 11 of file SPGames/resource.h.

#define IDS_REG_SOFTWARE 401

Definition at line 9 of file SPGames/resource.h.

#define IDS_REG_SPGAMESPROGID 404

Definition at line 12 of file SPGames/resource.h.

#define IDS_WEBSITE 5

Definition at line 8 of file SPGames/resource.h.

Generated on Wed May 8 12:39:23 2002 for Solitaire Pack by doxygen 1.2.15


resource.h Source File

resource.h

Go to the documentation of this file.
00001 //{{NO_DEPENDENCIES}}
00002 // Microsoft Developer Studio generated include file.
00003 // Used by SPGames.rc
00004 //
00005 #define IDS_COMPANY                     2
00006 #define IDS_PERCENTS                    3
00007 #define IDS_EMAIL                       4
00008 #define IDS_WEBSITE                     5
00009 #define IDS_REG_SOFTWARE                401
00010 #define IDS_REG_PROGIDHOLDER            402
00011 #define IDS_REG_PROGIDVIHOLDER          403
00012 #define IDS_REG_SPGAMESPROGID           404
00013
00014 // Next default values for new objects
00015 //
00016 #ifdef APSTUDIO_INVOKED
00017 #ifndef APSTUDIO_READONLY_SYMBOLS
00018 #define _APS_NEXT_RESOURCE_VALUE        105
00019 #define _APS_NEXT_COMMAND_VALUE         40001
00020 #define _APS_NEXT_CONTROL_VALUE         1000
00021 #define _APS_NEXT_SYMED_VALUE           101
00022 #endif
00023 #endif
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.cpp File Reference

#include "stdafx.h"
#include "SolpackApp.h"
#include "..\SolpackTLB\Solpack.h"
#include "..\SolpackTLB\Solpack_i.c"
#include "..\SolpackTLB\Solpack_catid.c"
#include "SolpackInternal.h"
#include "SolpackInternal_i.c"

Go to the source code of this file.

Functions

int APIENTRY | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)

Variables

TCHAR | g_szAppTitle [64]
long | g_cActiveComponents = 0

Function Documentation

int APIENTRY WinMain | ( | HINSTANCE | hInstance,
 |  | HINSTANCE | hPrevInstance,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |

Definition at line 49 of file Solpack.cpp.

References CSolpackApp::Run().

00050 {
00051    // Create and run the application object
00052    CSolpackApp theApp;
00053    return theApp.Run(hInstance, lpCmdLine, nCmdShow);
00054 }

Variable Documentation

long g_cActiveComponents = 0

Definition at line 26 of file Solpack.cpp.

TCHAR g_szAppTitle[64]

Definition at line 25 of file Solpack.cpp.

Generated on Wed May 8 12:39:23 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.cpp Source File

Solpack.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Solpack.cpp
00004 //    Defines the entry point for the application.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "SolpackApp.h"
00014
00015 #include "..\SolpackTLB\Solpack.h"
00016 #include "..\SolpackTLB\Solpack_i.c"
00017 #include "..\SolpackTLB\Solpack_catid.c"
00018 #include "SolpackInternal.h"
00019 #include "SolpackInternal_i.c"
00020
00021
00022 //----------------------------------------------------------------------------
00023 // Global variables
00024 //----------------------------------------------------------------------------
00025 TCHAR g_szAppTitle[64];             // The title bar text
00026 long g_cActiveComponents = 0;       // Number of active COM objects
00027 #ifdef BMWS_TRACKMEMALLOC
00028 TCHAR g_szModule[10] = "Solpack ";  // Name for debugging purposes
00029 #endif
00030
00031
00032 //----------------------------------------------------------------------------
00033 //
00034 // WinMain function
00035 //    Defines the entry point for the application. Creates and executes the
00036 //    application object.
00037 //
00038 // Parameters:
00039 //    hInstance:     [in] Handle to the current instance of the application.
00040 //    hPrevInstance: [in] NULL in all cases; unused.
00041 //    lpCmdLine:     [in] Pointer to a null-terminated string specifying the
00042 //                   command line for the application, excluding the program
00043 //                   name.
00044 //    nCmdShow:      [in] Specifies how the window is to be shown.
00045 //
00046 // Returns:          The value returned by the application's Run function
00047 //
00048 //----------------------------------------------------------------------------
00049 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
00050 {
00051    // Create and run the application object
00052    CSolpackApp theApp;
00053    return theApp.Run(hInstance, lpCmdLine, nCmdShow);
00054 }
Generated on Wed May 8 12:39:09 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.h File Reference

#include "rpc.h"
#include "rpcndr.h"
#include "oaidl.h"

Go to the source code of this file.

Compounds

interface | ISolpackApp
struct | ISolpackAppVtbl
interface | ISolpackCard
struct | ISolpackCardVtbl
interface | ISolpackFragment
struct | ISolpackFragmentVtbl
interface | ISolpackGame
interface | ISolpackGameData
struct | ISolpackGameDataVtbl
interface | ISolpackGameInfo
struct | ISolpackGameInfoVtbl
interface | ISolpackGameLib
struct | ISolpackGameLibVtbl
struct | ISolpackGameVtbl
interface | ISolpackPile
struct | ISolpackPileVtbl

Defines

#define | __REQUIRED_RPCNDR_H_VERSION__ 440

Typedefs

typedef interface ISolpackPile | ISolpackPile
typedef interface ISolpackFragment | ISolpackFragment
typedef interface ISolpackCard | ISolpackCard
typedef interface ISolpackGameInfo | ISolpackGameInfo
typedef interface ISolpackGameData | ISolpackGameData
typedef interface ISolpackApp | ISolpackApp
typedef interface ISolpackGame | ISolpackGame
typedef interface ISolpackGameLib | ISolpackGameLib
typedef enum tagSOLPACKRANK | SOLPACKRANK
typedef enum tagSOLPACKSUIT | SOLPACKSUIT
typedef enum tagSOLPACKDIFFICULTY | SOLPACKDIFFICULTY
typedef enum tagSOLPACKPILETYPE | SOLPACKPILETYPE
typedef enum tagSOLPACKBASETYPE | SOLPACKBASETYPE
typedef ISolpackPileVtbl | ISolpackPileVtbl
typedef ISolpackFragmentVtbl | ISolpackFragmentVtbl
typedef ISolpackCardVtbl | ISolpackCardVtbl
typedef ISolpackGameInfoVtbl | ISolpackGameInfoVtbl
typedef ISolpackGameDataVtbl | ISolpackGameDataVtbl
typedef ISolpackAppVtbl | ISolpackAppVtbl
typedef ISolpackGameVtbl | ISolpackGameVtbl
typedef ISolpackGameLibVtbl | ISolpackGameLibVtbl

Enumerations

enum tagSOLPACKRANK {
RANK_ACE = 1, RANK_2 = 2, RANK_3 = 3, RANK_4 = 4,
RANK_5 = 5, RANK_6 = 6, RANK_7 = 7, RANK_8 = 8,
RANK_9 = 9, RANK_10 = 10, RANK_JACK = 11, RANK_QUEEN = 12,
RANK_KING = 13
}
enum | tagSOLPACKSUIT { SUIT_CLUB = 1, SUIT_DIAMOND = 2, SUIT_HEART = 3, SUIT_SPADE = 4 }
enum | tagSOLPACKDIFFICULTY { DIFFICULTY_EASY = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_HARD = 3 }
enum tagSOLPACKPILETYPE {
PILE_DECK = 1, PILE_STACK = 2, PILE_TABLEAURIGHT = 3, PILE_TABLEAUDOWN = 4,
PILE_TALON = 5, PILE_TALON3 = 6, PILE_FRAGMENT = 7
}
enum tagSOLPACKBASETYPE {
BASE_NONE = 0, BASE_FRAME = 1, BASE_FOUNDATION = 2, BASE_REDEAL = 3,
BASE_NOREDEAL = 4
}

Functions

void __RPC_FAR *__RPC_USER | MIDL_user_allocate (size_t)
void __RPC_USER | MIDL_user_free (void __RPC_FAR *)
DEFINE_GUID (CATID_SolpackGameLibs, 0x0cbc4040, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_Type_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_Type_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_X_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_X_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_put_X_Proxy (ISolpackPile __RPC_FAR *This, long v)
void __RPC_STUB | ISolpackPile_put_X_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_Y_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_Y_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_put_Y_Proxy (ISolpackPile __RPC_FAR *This, long v)
void __RPC_STUB | ISolpackPile_put_Y_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_Width_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_Width_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_Height_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_Height_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_NumCards_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_NumCards_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_CommentTooltip_Proxy (ISolpackPile __RPC_FAR *This, BSTR __RPC_FAR *pbstrText)
void __RPC_STUB | ISolpackPile_get_CommentTooltip_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_put_CommentTooltip_Proxy (ISolpackPile __RPC_FAR *This, BSTR bstrText)
void __RPC_STUB | ISolpackPile_put_CommentTooltip_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_ShowNumCardsTooltip_Proxy (ISolpackPile __RPC_FAR *This, VARIANT_BOOL __RPC_FAR *pbShow)
void __RPC_STUB | ISolpackPile_get_ShowNumCardsTooltip_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_put_ShowNumCardsTooltip_Proxy (ISolpackPile __RPC_FAR *This, VARIANT_BOOL bShowNum)
void __RPC_STUB | ISolpackPile_put_ShowNumCardsTooltip_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_get_BaseType_Proxy (ISolpackPile __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackPile_get_BaseType_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_put_BaseType_Proxy (ISolpackPile __RPC_FAR *This, long v)
void __RPC_STUB | ISolpackPile_put_BaseType_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_Shuffle_Proxy (ISolpackPile __RPC_FAR *This)
void __RPC_STUB | ISolpackPile_Shuffle_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_GetCard_Proxy (ISolpackPile __RPC_FAR *This, long lIndex, ISolpackCard __RPC_FAR *__RPC_FAR *ppCard)
void __RPC_STUB | ISolpackPile_GetCard_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_WidthWith_Proxy (ISolpackPile __RPC_FAR *This, long lNumCards, long __RPC_FAR *plWidth)
void __RPC_STUB | ISolpackPile_WidthWith_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackPile_HeightWith_Proxy (ISolpackPile __RPC_FAR *This, long lNumCards, long __RPC_FAR *plHeight)
void __RPC_STUB | ISolpackPile_HeightWith_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackFragment_AddToFragment_Proxy (ISolpackFragment __RPC_FAR *This, IDispatch __RPC_FAR *pObj)
void __RPC_STUB | ISolpackFragment_AddToFragment_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackFragment_MoveToPile_Proxy (ISolpackFragment __RPC_FAR *This, ISolpackPile __RPC_FAR *pDest, long lIndex, VARIANT_BOOL bAnimate, VARIANT_BOOL bToggleFace)
void __RPC_STUB | ISolpackFragment_MoveToPile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_ID_Proxy (ISolpackCard __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackCard_get_ID_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_Rank_Proxy (ISolpackCard __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackCard_get_Rank_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_Suit_Proxy (ISolpackCard __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackCard_get_Suit_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_CanDrag_Proxy (ISolpackCard __RPC_FAR *This, VARIANT_BOOL __RPC_FAR *pbCanDrag)
void __RPC_STUB | ISolpackCard_get_CanDrag_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_put_CanDrag_Proxy (ISolpackCard __RPC_FAR *This, VARIANT_BOOL bCanDrag)
void __RPC_STUB | ISolpackCard_put_CanDrag_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_FaceUp_Proxy (ISolpackCard __RPC_FAR *This, VARIANT_BOOL __RPC_FAR *pbFaceUp)
void __RPC_STUB | ISolpackCard_get_FaceUp_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_put_FaceUp_Proxy (ISolpackCard __RPC_FAR *This, VARIANT_BOOL bFaceUp)
void __RPC_STUB | ISolpackCard_put_FaceUp_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_Pile_Proxy (ISolpackCard __RPC_FAR *This, ISolpackPile __RPC_FAR *__RPC_FAR *pp)
void __RPC_STUB | ISolpackCard_get_Pile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_get_Index_Proxy (ISolpackCard __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackCard_get_Index_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackCard_put_Index_Proxy (ISolpackCard __RPC_FAR *This, long v)
void __RPC_STUB | ISolpackCard_put_Index_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameInfo_get_Title_Proxy (ISolpackGameInfo __RPC_FAR *This, BSTR __RPC_FAR *p)
void __RPC_STUB | ISolpackGameInfo_get_Title_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameInfo_get_Rules_Proxy (ISolpackGameInfo __RPC_FAR *This, BSTR __RPC_FAR *p)
void __RPC_STUB | ISolpackGameInfo_get_Rules_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameInfo_get_Difficulty_Proxy (ISolpackGameInfo __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackGameInfo_get_Difficulty_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameData_get_Data_Proxy (ISolpackGameData __RPC_FAR *This, VARIANT __RPC_FAR *p)
void __RPC_STUB | ISolpackGameData_get_Data_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameData_put_Data_Proxy (ISolpackGameData __RPC_FAR *This, VARIANT v)
void __RPC_STUB | ISolpackGameData_put_Data_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_CardWidth_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_CardWidth_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_CardHeight_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_CardHeight_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_Score_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_Score_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_put_Score_Proxy (ISolpackApp __RPC_FAR *This, long v)
void __RPC_STUB | ISolpackApp_put_Score_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_WindowWidth_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_WindowWidth_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_WindowHeight_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_WindowHeight_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_SpacingX_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_SpacingX_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_SpacingY_Proxy (ISolpackApp __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackApp_get_SpacingY_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_get_Fragment_Proxy (ISolpackApp __RPC_FAR *This, ISolpackFragment __RPC_FAR *__RPC_FAR *pp)
void __RPC_STUB | ISolpackApp_get_Fragment_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_CreatePile_Proxy (ISolpackApp __RPC_FAR *This, long lType, ISolpackPile __RPC_FAR *__RPC_FAR *ppPile)
void __RPC_STUB | ISolpackApp_CreatePile_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_CreateGameData_Proxy (ISolpackApp __RPC_FAR *This, ISolpackGameData __RPC_FAR *__RPC_FAR *ppGameData)
void __RPC_STUB | ISolpackApp_CreateGameData_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_AddGameCommand_Proxy (ISolpackApp __RPC_FAR *This, long lID, BSTR bstrText, BSTR bstrHelpText)
void __RPC_STUB | ISolpackApp_AddGameCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_EnableGameCommand_Proxy (ISolpackApp __RPC_FAR *This, long lID, VARIANT_BOOL bEnable)
void __RPC_STUB | ISolpackApp_EnableGameCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackApp_GameWon_Proxy (ISolpackApp __RPC_FAR *This)
void __RPC_STUB | ISolpackApp_GameWon_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_get_Info_Proxy (ISolpackGame __RPC_FAR *This, ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppInfo)
void __RPC_STUB | ISolpackGame_get_Info_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_Initialize_Proxy (ISolpackGame __RPC_FAR *This, ISolpackApp __RPC_FAR *pApp)
void __RPC_STUB | ISolpackGame_Initialize_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_Uninitialize_Proxy (ISolpackGame __RPC_FAR *This)
void __RPC_STUB | ISolpackGame_Uninitialize_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_Deal_Proxy (ISolpackGame __RPC_FAR *This)
void __RPC_STUB | ISolpackGame_Deal_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_AutoPlay_Proxy (ISolpackGame __RPC_FAR *This)
void __RPC_STUB | ISolpackGame_AutoPlay_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_AutoPlayCard_Proxy (ISolpackGame __RPC_FAR *This, ISolpackCard __RPC_FAR *pCard)
void __RPC_STUB | ISolpackGame_AutoPlayCard_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_HandleCommand_Proxy (ISolpackGame __RPC_FAR *This, long lID)
void __RPC_STUB | ISolpackGame_HandleCommand_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_PileClicked_Proxy (ISolpackGame __RPC_FAR *This, ISolpackPile __RPC_FAR *pPile, ISolpackCard __RPC_FAR *pCard)
void __RPC_STUB | ISolpackGame_PileClicked_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_SetupFragment_Proxy (ISolpackGame __RPC_FAR *This, ISolpackPile __RPC_FAR *pPileSrc, ISolpackCard __RPC_FAR *pCardSrc, ISolpackFragment __RPC_FAR *pFrag)
void __RPC_STUB | ISolpackGame_SetupFragment_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_DropFragment_Proxy (ISolpackGame __RPC_FAR *This, ISolpackFragment __RPC_FAR *pFrag, ISolpackPile __RPC_FAR *pDest, VARIANT_BOOL __RPC_FAR *pbValid)
void __RPC_STUB | ISolpackGame_DropFragment_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_CancelMove_Proxy (ISolpackGame __RPC_FAR *This)
void __RPC_STUB | ISolpackGame_CancelMove_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGame_RecalcLayout_Proxy (ISolpackGame __RPC_FAR *This)
void __RPC_STUB | ISolpackGame_RecalcLayout_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_get_Author_Proxy (ISolpackGameLib __RPC_FAR *This, BSTR __RPC_FAR *p)
void __RPC_STUB | ISolpackGameLib_get_Author_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_get_Email_Proxy (ISolpackGameLib __RPC_FAR *This, BSTR __RPC_FAR *p)
void __RPC_STUB | ISolpackGameLib_get_Email_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_get_WebSite_Proxy (ISolpackGameLib __RPC_FAR *This, BSTR __RPC_FAR *p)
void __RPC_STUB | ISolpackGameLib_get_WebSite_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_get_NumGames_Proxy (ISolpackGameLib __RPC_FAR *This, long __RPC_FAR *p)
void __RPC_STUB | ISolpackGameLib_get_NumGames_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_GetGame_Proxy (ISolpackGameLib __RPC_FAR *This, long lIndex, ISolpackGame __RPC_FAR *__RPC_FAR *ppGame)
void __RPC_STUB | ISolpackGameLib_GetGame_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
HRESULT STDMETHODCALLTYPE | ISolpackGameLib_GetGameInfo_Proxy (ISolpackGameLib __RPC_FAR *This, long lIndex, ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppGameInfo)
void __RPC_STUB | ISolpackGameLib_GetGameInfo_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)

Variables

RPC_IF_HANDLE | __MIDL_itf_Solpack_0000_v0_0_c_ifspec
RPC_IF_HANDLE | __MIDL_itf_Solpack_0000_v0_0_s_ifspec
EXTERN_C const IID | LIBID_SolpackLib
EXTERN_C const IID | IID_ISolpackPile
EXTERN_C const IID | IID_ISolpackFragment
EXTERN_C const IID | IID_ISolpackCard
EXTERN_C const IID | IID_ISolpackGameInfo
EXTERN_C const IID | IID_ISolpackGameData
EXTERN_C const IID | IID_ISolpackApp
EXTERN_C const IID | IID_ISolpackGame
EXTERN_C const IID | IID_ISolpackGameLib

Define Documentation

#define __REQUIRED_RPCNDR_H_VERSION__ 440

Definition at line 22 of file Solpack.h.

Typedef Documentation

typedef interface ISolpackApp ISolpackApp

Definition at line 65 of file Solpack.h.

Referenced by CEngine::InitEngine(), and CEngine::PlayGame().

typedef struct ISolpackAppVtbl ISolpackAppVtbl

typedef interface ISolpackCard ISolpackCard

Definition at line 47 of file Solpack.h.

Referenced by CGameSpider::DealCard(), CGameSpider::DoesCardFollow(), CCard::InitCard(), CGameLaBelleLucie::InternalAutoPlayCard(), CEngine::MouseUp(), CGameBase::PutCardInData(), and CGameLaBelleLucie::ScoreCard().

typedef struct ISolpackCardVtbl ISolpackCardVtbl

typedef interface ISolpackFragment ISolpackFragment

Definition at line 41 of file Solpack.h.

Referenced by CEngine::HandleTryDrop(), CFragment::InitFragment(), CEngine::MouseMove(), and CGameLaBelleLucie::ScoreCard().

typedef struct ISolpackFragmentVtbl ISolpackFragmentVtbl

typedef interface ISolpackGame ISolpackGame

Definition at line 71 of file Solpack.h.

Referenced by CLibMgr::GetGame(), and CGameBase::InitGame().

typedef interface ISolpackGameData ISolpackGameData

Definition at line 59 of file Solpack.h.

Referenced by CGameBase::GetCardFromData(), CGameBase::GetLongFromData(), CGameData::InitGameData(), CGameBase::PutCardInData(), and CGameBase::PutLongInData().

typedef struct ISolpackGameDataVtbl ISolpackGameDataVtbl

typedef interface ISolpackGameInfo ISolpackGameInfo

Definition at line 53 of file Solpack.h.

Referenced by CLibMgr::GetGameInfo(), and CGameInfo::InitGameInfo().

typedef struct ISolpackGameInfoVtbl ISolpackGameInfoVtbl

typedef interface ISolpackGameLib ISolpackGameLib

Definition at line 77 of file Solpack.h.

Referenced by CLibMgr::GetLib(), and CGameLib::InitGameLib().

typedef struct ISolpackGameLibVtbl ISolpackGameLibVtbl

typedef struct ISolpackGameVtbl ISolpackGameVtbl

typedef interface ISolpackPile ISolpackPile

Definition at line 35 of file Solpack.h.

Referenced by CGameBase::CreateDeck(), CPile::GetPileInterface(), CEngine::HandleTryDrop(), and CPile::InitPile().

typedef struct ISolpackPileVtbl ISolpackPileVtbl

typedef enum tagSOLPACKBASETYPE SOLPACKBASETYPE

typedef enum tagSOLPACKDIFFICULTY SOLPACKDIFFICULTY

typedef enum tagSOLPACKPILETYPE SOLPACKPILETYPE

typedef enum tagSOLPACKRANK SOLPACKRANK

typedef enum tagSOLPACKSUIT SOLPACKSUIT

Enumeration Type Documentation

enum tagSOLPACKBASETYPE

Enumeration values:
BASE_NONE
BASE_FRAME
BASE_FOUNDATION
BASE_REDEAL
BASE_NOREDEAL

Definition at line 161 of file Solpack.h.

00162     { BASE_NONE   = 0,
00163    BASE_FRAME  = 1,
00164    BASE_FOUNDATION   = 2,
00165    BASE_REDEAL = 3,
00166    BASE_NOREDEAL  = 4
00167     } SOLPACKBASETYPE;

enum tagSOLPACKDIFFICULTY

Enumeration values:
DIFFICULTY_EASY
DIFFICULTY_MEDIUM
DIFFICULTY_HARD

Definition at line 143 of file Solpack.h.

00144     { DIFFICULTY_EASY   = 1,
00145    DIFFICULTY_MEDIUM = 2,
00146    DIFFICULTY_HARD   = 3
00147     } SOLPACKDIFFICULTY;

enum tagSOLPACKPILETYPE

Enumeration values:
PILE_DECK
PILE_STACK
PILE_TABLEAURIGHT
PILE_TABLEAUDOWN
PILE_TALON
PILE_TALON3
PILE_FRAGMENT

Definition at line 150 of file Solpack.h.

00151     { PILE_DECK   = 1,
00152    PILE_STACK  = 2,
00153    PILE_TABLEAURIGHT = 3,
00154    PILE_TABLEAUDOWN  = 4,
00155    PILE_TALON  = 5,
00156    PILE_TALON3 = 6,
00157    PILE_FRAGMENT  = 7
00158     } SOLPACKPILETYPE;

enum tagSOLPACKRANK

Enumeration values:
RANK_ACE
RANK_2
RANK_3
RANK_4
RANK_5
RANK_6
RANK_7
RANK_8
RANK_9
RANK_10
RANK_JACK
RANK_QUEEN
RANK_KING

Definition at line 118 of file Solpack.h.

00119     { RANK_ACE = 1,
00120    RANK_2   = 2,
00121    RANK_3   = 3,
00122    RANK_4   = 4,
00123    RANK_5   = 5,
00124    RANK_6   = 6,
00125    RANK_7   = 7,
00126    RANK_8   = 8,
00127    RANK_9   = 9,
00128    RANK_10  = 10,
00129    RANK_JACK   = 11,
00130    RANK_QUEEN  = 12,
00131    RANK_KING   = 13
00132     } SOLPACKRANK;

enum tagSOLPACKSUIT

Enumeration values:
SUIT_CLUB
SUIT_DIAMOND
SUIT_HEART
SUIT_SPADE

Definition at line 135 of file Solpack.h.

00136     { SUIT_CLUB   = 1,
00137    SUIT_DIAMOND   = 2,
00138    SUIT_HEART  = 3,
00139    SUIT_SPADE  = 4
00140     } SOLPACKSUIT;

Function Documentation

DEFINE_GUID | ( | CATID_SolpackGameLibs | ,
 |  | 0x0cbc4040 | ,
 |  | 0x2ca8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x0 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0xd | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_AddGameCommand_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long | lID,
 |  | BSTR | bstrText,
 |  | BSTR | bstrHelpText
 | ) |

void __RPC_STUB ISolpackApp_AddGameCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_CreateGameData_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | ISolpackGameData __RPC_FAR *__RPC_FAR * | ppGameData
 | ) |

void __RPC_STUB ISolpackApp_CreateGameData_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_CreatePile_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long | lType,
 |  | ISolpackPile __RPC_FAR *__RPC_FAR * | ppPile
 | ) |

void __RPC_STUB ISolpackApp_CreatePile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_EnableGameCommand_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long | lID,
 |  | VARIANT_BOOL | bEnable
 | ) |

void __RPC_STUB ISolpackApp_EnableGameCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_GameWon_Proxy ( ISolpackApp __RPC_FAR * This )

void __RPC_STUB ISolpackApp_GameWon_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_CardHeight_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_CardHeight_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_CardWidth_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_CardWidth_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_Fragment_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | ISolpackFragment __RPC_FAR *__RPC_FAR * | pp
 | ) |

void __RPC_STUB ISolpackApp_get_Fragment_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_Score_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_Score_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_SpacingX_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_SpacingX_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_SpacingY_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_SpacingY_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_WindowHeight_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_WindowHeight_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_get_WindowWidth_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackApp_get_WindowWidth_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackApp_put_Score_Proxy | ( | ISolpackApp __RPC_FAR * | This,
 |  | long | v
 | ) |

void __RPC_STUB ISolpackApp_put_Score_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_CanDrag_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | VARIANT_BOOL __RPC_FAR * | pbCanDrag
 | ) |

void __RPC_STUB ISolpackCard_get_CanDrag_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_FaceUp_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | VARIANT_BOOL __RPC_FAR * | pbFaceUp
 | ) |

void __RPC_STUB ISolpackCard_get_FaceUp_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_ID_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackCard_get_ID_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_Index_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackCard_get_Index_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_Pile_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | ISolpackPile __RPC_FAR *__RPC_FAR * | pp
 | ) |

void __RPC_STUB ISolpackCard_get_Pile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_Rank_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackCard_get_Rank_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_get_Suit_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackCard_get_Suit_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_put_CanDrag_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | VARIANT_BOOL | bCanDrag
 | ) |

void __RPC_STUB ISolpackCard_put_CanDrag_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_put_FaceUp_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | VARIANT_BOOL | bFaceUp
 | ) |

void __RPC_STUB ISolpackCard_put_FaceUp_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackCard_put_Index_Proxy | ( | ISolpackCard __RPC_FAR * | This,
 |  | long | v
 | ) |

void __RPC_STUB ISolpackCard_put_Index_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackFragment_AddToFragment_Proxy | ( | ISolpackFragment __RPC_FAR * | This,
 |  | IDispatch __RPC_FAR * | pObj
 | ) |

void __RPC_STUB ISolpackFragment_AddToFragment_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackFragment_MoveToPile_Proxy | ( | ISolpackFragment __RPC_FAR * | This,
 |  | ISolpackPile __RPC_FAR * | pDest,
 |  | long | lIndex,
 |  | VARIANT_BOOL | bAnimate,
 |  | VARIANT_BOOL | bToggleFace
 | ) |

void __RPC_STUB ISolpackFragment_MoveToPile_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_AutoPlay_Proxy ( ISolpackGame __RPC_FAR * This )

void __RPC_STUB ISolpackGame_AutoPlay_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_AutoPlayCard_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackCard __RPC_FAR * | pCard
 | ) |

void __RPC_STUB ISolpackGame_AutoPlayCard_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_CancelMove_Proxy ( ISolpackGame __RPC_FAR * This )

void __RPC_STUB ISolpackGame_CancelMove_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_Deal_Proxy ( ISolpackGame __RPC_FAR * This )

void __RPC_STUB ISolpackGame_Deal_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_DropFragment_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackFragment __RPC_FAR * | pFrag,
 |  | ISolpackPile __RPC_FAR * | pDest,
 |  | VARIANT_BOOL __RPC_FAR * | pbValid
 | ) |

void __RPC_STUB ISolpackGame_DropFragment_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_get_Info_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackGameInfo __RPC_FAR *__RPC_FAR * | ppInfo
 | ) |

void __RPC_STUB ISolpackGame_get_Info_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_HandleCommand_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | long | lID
 | ) |

void __RPC_STUB ISolpackGame_HandleCommand_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_Initialize_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackApp __RPC_FAR * | pApp
 | ) |

void __RPC_STUB ISolpackGame_Initialize_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_PileClicked_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackPile __RPC_FAR * | pPile,
 |  | ISolpackCard __RPC_FAR * | pCard
 | ) |

void __RPC_STUB ISolpackGame_PileClicked_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_RecalcLayout_Proxy ( ISolpackGame __RPC_FAR * This )

void __RPC_STUB ISolpackGame_RecalcLayout_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_SetupFragment_Proxy | ( | ISolpackGame __RPC_FAR * | This,
 |  | ISolpackPile __RPC_FAR * | pPileSrc,
 |  | ISolpackCard __RPC_FAR * | pCardSrc,
 |  | ISolpackFragment __RPC_FAR * | pFrag
 | ) |

void __RPC_STUB ISolpackGame_SetupFragment_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGame_Uninitialize_Proxy ( ISolpackGame __RPC_FAR * This )

void __RPC_STUB ISolpackGame_Uninitialize_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameData_get_Data_Proxy | ( | ISolpackGameData __RPC_FAR * | This,
 |  | VARIANT __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameData_get_Data_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameData_put_Data_Proxy | ( | ISolpackGameData __RPC_FAR * | This,
 |  | VARIANT | v
 | ) |

void __RPC_STUB ISolpackGameData_put_Data_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Difficulty_Proxy | ( | ISolpackGameInfo __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameInfo_get_Difficulty_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Rules_Proxy | ( | ISolpackGameInfo __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameInfo_get_Rules_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Title_Proxy | ( | ISolpackGameInfo __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameInfo_get_Title_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_Author_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameLib_get_Author_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_Email_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameLib_get_Email_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_NumGames_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameLib_get_NumGames_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_WebSite_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackGameLib_get_WebSite_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_GetGame_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | long | lIndex,
 |  | ISolpackGame __RPC_FAR *__RPC_FAR * | ppGame
 | ) |

void __RPC_STUB ISolpackGameLib_GetGame_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackGameLib_GetGameInfo_Proxy | ( | ISolpackGameLib __RPC_FAR * | This,
 |  | long | lIndex,
 |  | ISolpackGameInfo __RPC_FAR *__RPC_FAR * | ppGameInfo
 | ) |

void __RPC_STUB ISolpackGameLib_GetGameInfo_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_BaseType_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_BaseType_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_CommentTooltip_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | BSTR __RPC_FAR * | pbstrText
 | ) |

void __RPC_STUB ISolpackPile_get_CommentTooltip_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_Height_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_Height_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_NumCards_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_NumCards_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_ShowNumCardsTooltip_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | VARIANT_BOOL __RPC_FAR * | pbShow
 | ) |

void __RPC_STUB ISolpackPile_get_ShowNumCardsTooltip_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_Type_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_Type_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_Width_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_Width_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_X_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_X_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_get_Y_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long __RPC_FAR * | p
 | ) |

void __RPC_STUB ISolpackPile_get_Y_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_GetCard_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | lIndex,
 |  | ISolpackCard __RPC_FAR *__RPC_FAR * | ppCard
 | ) |

void __RPC_STUB ISolpackPile_GetCard_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_HeightWith_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | lNumCards,
 |  | long __RPC_FAR * | plHeight
 | ) |

void __RPC_STUB ISolpackPile_HeightWith_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_put_BaseType_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | v
 | ) |

void __RPC_STUB ISolpackPile_put_BaseType_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_put_CommentTooltip_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | BSTR | bstrText
 | ) |

void __RPC_STUB ISolpackPile_put_CommentTooltip_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_put_ShowNumCardsTooltip_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | VARIANT_BOOL | bShowNum
 | ) |

void __RPC_STUB ISolpackPile_put_ShowNumCardsTooltip_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_put_X_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | v
 | ) |

void __RPC_STUB ISolpackPile_put_X_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_put_Y_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | v
 | ) |

void __RPC_STUB ISolpackPile_put_Y_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_Shuffle_Proxy ( ISolpackPile __RPC_FAR * This )

void __RPC_STUB ISolpackPile_Shuffle_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

HRESULT STDMETHODCALLTYPE ISolpackPile_WidthWith_Proxy | ( | ISolpackPile __RPC_FAR * | This,
 |  | long | lNumCards,
 |  | long __RPC_FAR * | plWidth
 | ) |

void __RPC_STUB ISolpackPile_WidthWith_Stub | ( | IRpcStubBuffer * | This,
 |  | IRpcChannelBuffer * | _pRpcChannelBuffer,
 |  | PRPC_MESSAGE | _pRpcMessage,
 |  | DWORD * | _pdwStubPhase
 | ) |

void __RPC_FAR* __RPC_USER MIDL_user_allocate ( size_t )

void __RPC_USER MIDL_user_free ( void __RPC_FAR * )

Variable Documentation

RPC_IF_HANDLE __MIDL_itf_Solpack_0000_v0_0_c_ifspec

Definition at line 107 of file Solpack.h.

RPC_IF_HANDLE __MIDL_itf_Solpack_0000_v0_0_s_ifspec

Definition at line 108 of file Solpack.h.

EXTERN_C const IID IID_ISolpackApp

Definition at line 1648 of file Solpack.h.

Referenced by CEngine::InitEngine().

EXTERN_C const IID IID_ISolpackCard

Definition at line 988 of file Solpack.h.

Referenced by CGameBase::GetCardFromData(), and CCard::InitCard().

EXTERN_C const IID IID_ISolpackFragment

Definition at line 696 of file Solpack.h.

Referenced by CFragment::InitFragment().

EXTERN_C const IID IID_ISolpackGame

Definition at line 2075 of file Solpack.h.

Referenced by CGameBase::InitGame().

EXTERN_C const IID IID_ISolpackGameData

Definition at line 1494 of file Solpack.h.

Referenced by CGameData::InitGameData().

EXTERN_C const IID IID_ISolpackGameInfo

Definition at line 1318 of file Solpack.h.

Referenced by CGameInfo::InitGameInfo().

EXTERN_C const IID IID_ISolpackGameLib

Definition at line 2449 of file Solpack.h.

Referenced by CGameLib::InitGameLib(), and CLibMgr::Refresh().

EXTERN_C const IID IID_ISolpackPile

Definition at line 184 of file Solpack.h.

Referenced by CPile::GetPileInterface(), and CPile::InitPile().

EXTERN_C const IID LIBID_SolpackLib

Definition at line 175 of file Solpack.h.

Referenced by CSolpackApp::Register(), CSolpackApp::Run(), and CSolpackApp::Unregister().

Generated on Wed May 8 12:39:25 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.h Source File

Solpack.h

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00005
00006
00007  /* File created by MIDL compiler version 5.03.0280 */
00008 /* at Tue May 07 23:01:26 2002
00009  */
00010 /* Compiler settings for C:\Programming\Microsoft Visual Studio\MyProjects\Solitaire Pack\SolpackTLB\Solpack.idl:
00011     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013     VC __declspec() decoration level:
00014          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00015          DECLSPEC_UUID(), MIDL_INTERFACE()
00016 */
00017 //@@MIDL_FILE_HEADING(  )
00018
00019
00020 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00021 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00022 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00023 #endif
00024
00025 #include "rpc.h"
00026 #include "rpcndr.h"
00027
00028 #ifndef __Solpack_h__
00029 #define __Solpack_h__
00030
00031 /* Forward Declarations */
00032
00033 #ifndef __ISolpackPile_FWD_DEFINED__
00034 #define __ISolpackPile_FWD_DEFINED__
00035 typedef interface ISolpackPile ISolpackPile;
00036 #endif   /* __ISolpackPile_FWD_DEFINED__ */
00037
00038
00039 #ifndef __ISolpackFragment_FWD_DEFINED__
00040 #define __ISolpackFragment_FWD_DEFINED__
00041 typedef interface ISolpackFragment ISolpackFragment;
00042 #endif   /* __ISolpackFragment_FWD_DEFINED__ */
00043
00044
00045 #ifndef __ISolpackCard_FWD_DEFINED__
00046 #define __ISolpackCard_FWD_DEFINED__
00047 typedef interface ISolpackCard ISolpackCard;
00048 #endif   /* __ISolpackCard_FWD_DEFINED__ */
00049
00050
00051 #ifndef __ISolpackGameInfo_FWD_DEFINED__
00052 #define __ISolpackGameInfo_FWD_DEFINED__
00053 typedef interface ISolpackGameInfo ISolpackGameInfo;
00054 #endif   /* __ISolpackGameInfo_FWD_DEFINED__ */
00055
00056
00057 #ifndef __ISolpackGameData_FWD_DEFINED__
00058 #define __ISolpackGameData_FWD_DEFINED__
00059 typedef interface ISolpackGameData ISolpackGameData;
00060 #endif   /* __ISolpackGameData_FWD_DEFINED__ */
00061
00062
00063 #ifndef __ISolpackApp_FWD_DEFINED__
00064 #define __ISolpackApp_FWD_DEFINED__
00065 typedef interface ISolpackApp ISolpackApp;
00066 #endif   /* __ISolpackApp_FWD_DEFINED__ */
00067
00068
00069 #ifndef __ISolpackGame_FWD_DEFINED__
00070 #define __ISolpackGame_FWD_DEFINED__
00071 typedef interface ISolpackGame ISolpackGame;
00072 #endif   /* __ISolpackGame_FWD_DEFINED__ */
00073
00074
00075 #ifndef __ISolpackGameLib_FWD_DEFINED__
00076 #define __ISolpackGameLib_FWD_DEFINED__
00077 typedef interface ISolpackGameLib ISolpackGameLib;
00078 #endif   /* __ISolpackGameLib_FWD_DEFINED__ */
00079
00080
00081 /* header files for imported files */
00082 #include "oaidl.h"
00083
00084 #ifdef __cplusplus
00085 extern "C"{
00086 #endif
00087
00088 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00089 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00090
00091 /* interface __MIDL_itf_Solpack_0000 */
00092 /* [local] */
00093
00094 //--------------------------------------------------------------------------
00095 //
00096 //  Solitaire Pack
00097 //  Copyright (C) 2002 Bot Productions
00098 //
00099 //--------------------------------------------------------------------------
00100
00101
00102 // {0CBC4042-2CA8-11d6-8301-0020780D1875}
00103 DEFINE_GUID(CATID_SolpackGameLibs, 0x0cbc4040, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75);
00104
00105
00106
00107 extern RPC_IF_HANDLE __MIDL_itf_Solpack_0000_v0_0_c_ifspec;
00108 extern RPC_IF_HANDLE __MIDL_itf_Solpack_0000_v0_0_s_ifspec;
00109
00110
00111 #ifndef __SolpackLib_LIBRARY_DEFINED__
00112 #define __SolpackLib_LIBRARY_DEFINED__
00113
00114 /* library SolpackLib */
00115 /* [helpstring][version][uuid] */
00116
00117 typedef /* [public][helpstring] */
00118 enum tagSOLPACKRANK
00119     { RANK_ACE = 1,
00120    RANK_2   = 2,
00121    RANK_3   = 3,
00122    RANK_4   = 4,
00123    RANK_5   = 5,
00124    RANK_6   = 6,
00125    RANK_7   = 7,
00126    RANK_8   = 8,
00127    RANK_9   = 9,
00128    RANK_10  = 10,
00129    RANK_JACK   = 11,
00130    RANK_QUEEN  = 12,
00131    RANK_KING   = 13
00132     } SOLPACKRANK;
00133
00134 typedef /* [public][helpstring] */
00135 enum tagSOLPACKSUIT
00136     { SUIT_CLUB   = 1,
00137    SUIT_DIAMOND   = 2,
00138    SUIT_HEART  = 3,
00139    SUIT_SPADE  = 4
00140     } SOLPACKSUIT;
00141
00142 typedef /* [public][helpstring] */
00143 enum tagSOLPACKDIFFICULTY
00144     { DIFFICULTY_EASY   = 1,
00145    DIFFICULTY_MEDIUM = 2,
00146    DIFFICULTY_HARD   = 3
00147     } SOLPACKDIFFICULTY;
00148
00149 typedef /* [public][helpstring] */
00150 enum tagSOLPACKPILETYPE
00151     { PILE_DECK   = 1,
00152    PILE_STACK  = 2,
00153    PILE_TABLEAURIGHT = 3,
00154    PILE_TABLEAUDOWN  = 4,
00155    PILE_TALON  = 5,
00156    PILE_TALON3 = 6,
00157    PILE_FRAGMENT  = 7
00158     } SOLPACKPILETYPE;
00159
00160 typedef /* [public][helpstring] */
00161 enum tagSOLPACKBASETYPE
00162     { BASE_NONE   = 0,
00163    BASE_FRAME  = 1,
00164    BASE_FOUNDATION   = 2,
00165    BASE_REDEAL = 3,
00166    BASE_NOREDEAL  = 4
00167     } SOLPACKBASETYPE;
00168
00169
00170
00171
00172
00173
00174
00175 EXTERN_C const IID LIBID_SolpackLib;
00176
00177 #ifndef __ISolpackPile_INTERFACE_DEFINED__
00178 #define __ISolpackPile_INTERFACE_DEFINED__
00179
00180 /* interface ISolpackPile */
00181 /* [unique][helpstring][dual][uuid][object] */
00182
00183
00184 EXTERN_C const IID IID_ISolpackPile;
00185
00186 #if defined(__cplusplus) && !defined(CINTERFACE)
00187
00188     MIDL_INTERFACE("0CBC4046-2CA8-11d6-8301-0020780D1875")
00189     ISolpackPile : public IDispatch
00190     {
00191     public:
00192         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Type(
00193             /* [retval][out] */ long __RPC_FAR *p) = 0;
00194
00195         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_X(
00196             /* [retval][out] */ long __RPC_FAR *p) = 0;
00197
00198         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_X(
00199             /* [in] */ long v) = 0;
00200
00201         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Y(
00202             /* [retval][out] */ long __RPC_FAR *p) = 0;
00203
00204         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Y(
00205             /* [in] */ long v) = 0;
00206
00207         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Width(
00208             /* [retval][out] */ long __RPC_FAR *p) = 0;
00209
00210         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Height(
00211             /* [retval][out] */ long __RPC_FAR *p) = 0;
00212
00213         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NumCards(
00214             /* [retval][out] */ long __RPC_FAR *p) = 0;
00215
00216         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CommentTooltip(
00217             /* [retval][out] */ BSTR __RPC_FAR *pbstrText) = 0;
00218
00219         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CommentTooltip(
00220             /* [in] */ BSTR bstrText) = 0;
00221
00222         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ShowNumCardsTooltip(
00223             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbShow) = 0;
00224
00225         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ShowNumCardsTooltip(
00226             /* [in] */ VARIANT_BOOL bShowNum) = 0;
00227
00228         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BaseType(
00229             /* [retval][out] */ long __RPC_FAR *p) = 0;
00230
00231         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BaseType(
00232             /* [in] */ long v) = 0;
00233
00234         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Shuffle( void) = 0;
00235
00236         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCard(
00237             /* [in] */ long lIndex,
00238             /* [retval][out] */ ISolpackCard __RPC_FAR *__RPC_FAR *ppCard) = 0;
00239
00240         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WidthWith(
00241             /* [in] */ long lNumCards,
00242             /* [retval][out] */ long __RPC_FAR *plWidth) = 0;
00243
00244         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE HeightWith(
00245             /* [in] */ long lNumCards,
00246             /* [retval][out] */ long __RPC_FAR *plHeight) = 0;
00247
00248     };
00249
00250 #else    /* C style interface */
00251
00252     typedef struct ISolpackPileVtbl
00253     {
00254         BEGIN_INTERFACE
00255
00256         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00257             ISolpackPile __RPC_FAR * This,
00258             /* [in] */ REFIID riid,
00259             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00260
00261         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00262             ISolpackPile __RPC_FAR * This);
00263
00264         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00265             ISolpackPile __RPC_FAR * This);
00266
00267         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
00268             ISolpackPile __RPC_FAR * This,
00269             /* [out] */ UINT __RPC_FAR *pctinfo);
00270
00271         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
00272             ISolpackPile __RPC_FAR * This,
00273             /* [in] */ UINT iTInfo,
00274             /* [in] */ LCID lcid,
00275             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
00276
00277         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
00278             ISolpackPile __RPC_FAR * This,
00279             /* [in] */ REFIID riid,
00280             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
00281             /* [in] */ UINT cNames,
00282             /* [in] */ LCID lcid,
00283             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
00284
00285         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
00286             ISolpackPile __RPC_FAR * This,
00287             /* [in] */ DISPID dispIdMember,
00288             /* [in] */ REFIID riid,
00289             /* [in] */ LCID lcid,
00290             /* [in] */ WORD wFlags,
00291             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
00292             /* [out] */ VARIANT __RPC_FAR *pVarResult,
00293             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
00294             /* [out] */ UINT __RPC_FAR *puArgErr);
00295
00296         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Type )(
00297             ISolpackPile __RPC_FAR * This,
00298             /* [retval][out] */ long __RPC_FAR *p);
00299
00300         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_X )(
00301             ISolpackPile __RPC_FAR * This,
00302             /* [retval][out] */ long __RPC_FAR *p);
00303
00304         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_X )(
00305             ISolpackPile __RPC_FAR * This,
00306             /* [in] */ long v);
00307
00308         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Y )(
00309             ISolpackPile __RPC_FAR * This,
00310             /* [retval][out] */ long __RPC_FAR *p);
00311
00312         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Y )(
00313             ISolpackPile __RPC_FAR * This,
00314             /* [in] */ long v);
00315
00316         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Width )(
00317             ISolpackPile __RPC_FAR * This,
00318             /* [retval][out] */ long __RPC_FAR *p);
00319
00320         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Height )(
00321             ISolpackPile __RPC_FAR * This,
00322             /* [retval][out] */ long __RPC_FAR *p);
00323
00324         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_NumCards )(
00325             ISolpackPile __RPC_FAR * This,
00326             /* [retval][out] */ long __RPC_FAR *p);
00327
00328         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip )(
00329             ISolpackPile __RPC_FAR * This,
00330             /* [retval][out] */ BSTR __RPC_FAR *pbstrText);
00331
00332         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip )(
00333             ISolpackPile __RPC_FAR * This,
00334             /* [in] */ BSTR bstrText);
00335
00336         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip )(
00337             ISolpackPile __RPC_FAR * This,
00338             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbShow);
00339
00340         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip )(
00341             ISolpackPile __RPC_FAR * This,
00342             /* [in] */ VARIANT_BOOL bShowNum);
00343
00344         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_BaseType )(
00345             ISolpackPile __RPC_FAR * This,
00346             /* [retval][out] */ long __RPC_FAR *p);
00347
00348         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_BaseType )(
00349             ISolpackPile __RPC_FAR * This,
00350             /* [in] */ long v);
00351
00352         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Shuffle )(
00353             ISolpackPile __RPC_FAR * This);
00354
00355         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetCard )(
00356             ISolpackPile __RPC_FAR * This,
00357             /* [in] */ long lIndex,
00358             /* [retval][out] */ ISolpackCard __RPC_FAR *__RPC_FAR *ppCard);
00359
00360         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *WidthWith )(
00361             ISolpackPile __RPC_FAR * This,
00362             /* [in] */ long lNumCards,
00363             /* [retval][out] */ long __RPC_FAR *plWidth);
00364
00365         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HeightWith )(
00366             ISolpackPile __RPC_FAR * This,
00367             /* [in] */ long lNumCards,
00368             /* [retval][out] */ long __RPC_FAR *plHeight);
00369
00370         END_INTERFACE
00371     } ISolpackPileVtbl;
00372
00373     interface ISolpackPile
00374     {
00375         CONST_VTBL struct ISolpackPileVtbl __RPC_FAR *lpVtbl;
00376     };
00377
00378
00379
00380 #ifdef COBJMACROS
00381
00382
00383 #define ISolpackPile_QueryInterface(This,riid,ppvObject) \
00384     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00385
00386 #define ISolpackPile_AddRef(This)   \
00387     (This)->lpVtbl -> AddRef(This)
00388
00389 #define ISolpackPile_Release(This)  \
00390     (This)->lpVtbl -> Release(This)
00391
00392
00393 #define ISolpackPile_GetTypeInfoCount(This,pctinfo)   \
00394     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
00395
00396 #define ISolpackPile_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
00397     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
00398
00399 #define ISolpackPile_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
00400     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
00401
00402 #define ISolpackPile_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
00403     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
00404
00405
00406 #define ISolpackPile_get_Type(This,p)  \
00407     (This)->lpVtbl -> get_Type(This,p)
00408
00409 #define ISolpackPile_get_X(This,p)  \
00410     (This)->lpVtbl -> get_X(This,p)
00411
00412 #define ISolpackPile_put_X(This,v)  \
00413     (This)->lpVtbl -> put_X(This,v)
00414
00415 #define ISolpackPile_get_Y(This,p)  \
00416     (This)->lpVtbl -> get_Y(This,p)
00417
00418 #define ISolpackPile_put_Y(This,v)  \
00419     (This)->lpVtbl -> put_Y(This,v)
00420
00421 #define ISolpackPile_get_Width(This,p) \
00422     (This)->lpVtbl -> get_Width(This,p)
00423
00424 #define ISolpackPile_get_Height(This,p)   \
00425     (This)->lpVtbl -> get_Height(This,p)
00426
00427 #define ISolpackPile_get_NumCards(This,p) \
00428     (This)->lpVtbl -> get_NumCards(This,p)
00429
00430 #define ISolpackPile_get_CommentTooltip(This,pbstrText)  \
00431     (This)->lpVtbl -> get_CommentTooltip(This,pbstrText)
00432
00433 #define ISolpackPile_put_CommentTooltip(This,bstrText)   \
00434     (This)->lpVtbl -> put_CommentTooltip(This,bstrText)
00435
00436 #define ISolpackPile_get_ShowNumCardsTooltip(This,pbShow)   \
00437     (This)->lpVtbl -> get_ShowNumCardsTooltip(This,pbShow)
00438
00439 #define ISolpackPile_put_ShowNumCardsTooltip(This,bShowNum) \
00440     (This)->lpVtbl -> put_ShowNumCardsTooltip(This,bShowNum)
00441
00442 #define ISolpackPile_get_BaseType(This,p) \
00443     (This)->lpVtbl -> get_BaseType(This,p)
00444
00445 #define ISolpackPile_put_BaseType(This,v) \
00446     (This)->lpVtbl -> put_BaseType(This,v)
00447
00448 #define ISolpackPile_Shuffle(This)  \
00449     (This)->lpVtbl -> Shuffle(This)
00450
00451 #define ISolpackPile_GetCard(This,lIndex,ppCard)   \
00452     (This)->lpVtbl -> GetCard(This,lIndex,ppCard)
00453
00454 #define ISolpackPile_WidthWith(This,lNumCards,plWidth)   \
00455     (This)->lpVtbl -> WidthWith(This,lNumCards,plWidth)
00456
00457 #define ISolpackPile_HeightWith(This,lNumCards,plHeight) \
00458     (This)->lpVtbl -> HeightWith(This,lNumCards,plHeight)
00459
00460 #endif /* COBJMACROS */
00461
00462
00463 #endif   /* C style interface */
00464
00465
00466
00467 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_Type_Proxy(
00468     ISolpackPile __RPC_FAR * This,
00469     /* [retval][out] */ long __RPC_FAR *p);
00470
00471
00472 void __RPC_STUB ISolpackPile_get_Type_Stub(
00473     IRpcStubBuffer *This,
00474     IRpcChannelBuffer *_pRpcChannelBuffer,
00475     PRPC_MESSAGE _pRpcMessage,
00476     DWORD *_pdwStubPhase);
00477
00478
00479 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_X_Proxy(
00480     ISolpackPile __RPC_FAR * This,
00481     /* [retval][out] */ long __RPC_FAR *p);
00482
00483
00484 void __RPC_STUB ISolpackPile_get_X_Stub(
00485     IRpcStubBuffer *This,
00486     IRpcChannelBuffer *_pRpcChannelBuffer,
00487     PRPC_MESSAGE _pRpcMessage,
00488     DWORD *_pdwStubPhase);
00489
00490
00491 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackPile_put_X_Proxy(
00492     ISolpackPile __RPC_FAR * This,
00493     /* [in] */ long v);
00494
00495
00496 void __RPC_STUB ISolpackPile_put_X_Stub(
00497     IRpcStubBuffer *This,
00498     IRpcChannelBuffer *_pRpcChannelBuffer,
00499     PRPC_MESSAGE _pRpcMessage,
00500     DWORD *_pdwStubPhase);
00501
00502
00503 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_Y_Proxy(
00504     ISolpackPile __RPC_FAR * This,
00505     /* [retval][out] */ long __RPC_FAR *p);
00506
00507
00508 void __RPC_STUB ISolpackPile_get_Y_Stub(
00509     IRpcStubBuffer *This,
00510     IRpcChannelBuffer *_pRpcChannelBuffer,
00511     PRPC_MESSAGE _pRpcMessage,
00512     DWORD *_pdwStubPhase);
00513
00514
00515 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackPile_put_Y_Proxy(
00516     ISolpackPile __RPC_FAR * This,
00517     /* [in] */ long v);
00518
00519
00520 void __RPC_STUB ISolpackPile_put_Y_Stub(
00521     IRpcStubBuffer *This,
00522     IRpcChannelBuffer *_pRpcChannelBuffer,
00523     PRPC_MESSAGE _pRpcMessage,
00524     DWORD *_pdwStubPhase);
00525
00526
00527 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_Width_Proxy(
00528     ISolpackPile __RPC_FAR * This,
00529     /* [retval][out] */ long __RPC_FAR *p);
00530
00531
00532 void __RPC_STUB ISolpackPile_get_Width_Stub(
00533     IRpcStubBuffer *This,
00534     IRpcChannelBuffer *_pRpcChannelBuffer,
00535     PRPC_MESSAGE _pRpcMessage,
00536     DWORD *_pdwStubPhase);
00537
00538
00539 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_Height_Proxy(
00540     ISolpackPile __RPC_FAR * This,
00541     /* [retval][out] */ long __RPC_FAR *p);
00542
00543
00544 void __RPC_STUB ISolpackPile_get_Height_Stub(
00545     IRpcStubBuffer *This,
00546     IRpcChannelBuffer *_pRpcChannelBuffer,
00547     PRPC_MESSAGE _pRpcMessage,
00548     DWORD *_pdwStubPhase);
00549
00550
00551 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_NumCards_Proxy(
00552     ISolpackPile __RPC_FAR * This,
00553     /* [retval][out] */ long __RPC_FAR *p);
00554
00555
00556 void __RPC_STUB ISolpackPile_get_NumCards_Stub(
00557     IRpcStubBuffer *This,
00558     IRpcChannelBuffer *_pRpcChannelBuffer,
00559     PRPC_MESSAGE _pRpcMessage,
00560     DWORD *_pdwStubPhase);
00561
00562
00563 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_CommentTooltip_Proxy(
00564     ISolpackPile __RPC_FAR * This,
00565     /* [retval][out] */ BSTR __RPC_FAR *pbstrText);
00566
00567
00568 void __RPC_STUB ISolpackPile_get_CommentTooltip_Stub(
00569     IRpcStubBuffer *This,
00570     IRpcChannelBuffer *_pRpcChannelBuffer,
00571     PRPC_MESSAGE _pRpcMessage,
00572     DWORD *_pdwStubPhase);
00573
00574
00575 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackPile_put_CommentTooltip_Proxy(
00576     ISolpackPile __RPC_FAR * This,
00577     /* [in] */ BSTR bstrText);
00578
00579
00580 void __RPC_STUB ISolpackPile_put_CommentTooltip_Stub(
00581     IRpcStubBuffer *This,
00582     IRpcChannelBuffer *_pRpcChannelBuffer,
00583     PRPC_MESSAGE _pRpcMessage,
00584     DWORD *_pdwStubPhase);
00585
00586
00587 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_ShowNumCardsTooltip_Proxy(
00588     ISolpackPile __RPC_FAR * This,
00589     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbShow);
00590
00591
00592 void __RPC_STUB ISolpackPile_get_ShowNumCardsTooltip_Stub(
00593     IRpcStubBuffer *This,
00594     IRpcChannelBuffer *_pRpcChannelBuffer,
00595     PRPC_MESSAGE _pRpcMessage,
00596     DWORD *_pdwStubPhase);
00597
00598
00599 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackPile_put_ShowNumCardsTooltip_Proxy(
00600     ISolpackPile __RPC_FAR * This,
00601     /* [in] */ VARIANT_BOOL bShowNum);
00602
00603
00604 void __RPC_STUB ISolpackPile_put_ShowNumCardsTooltip_Stub(
00605     IRpcStubBuffer *This,
00606     IRpcChannelBuffer *_pRpcChannelBuffer,
00607     PRPC_MESSAGE _pRpcMessage,
00608     DWORD *_pdwStubPhase);
00609
00610
00611 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackPile_get_BaseType_Proxy(
00612     ISolpackPile __RPC_FAR * This,
00613     /* [retval][out] */ long __RPC_FAR *p);
00614
00615
00616 void __RPC_STUB ISolpackPile_get_BaseType_Stub(
00617     IRpcStubBuffer *This,
00618     IRpcChannelBuffer *_pRpcChannelBuffer,
00619     PRPC_MESSAGE _pRpcMessage,
00620     DWORD *_pdwStubPhase);
00621
00622
00623 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackPile_put_BaseType_Proxy(
00624     ISolpackPile __RPC_FAR * This,
00625     /* [in] */ long v);
00626
00627
00628 void __RPC_STUB ISolpackPile_put_BaseType_Stub(
00629     IRpcStubBuffer *This,
00630     IRpcChannelBuffer *_pRpcChannelBuffer,
00631     PRPC_MESSAGE _pRpcMessage,
00632     DWORD *_pdwStubPhase);
00633
00634
00635 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackPile_Shuffle_Proxy(
00636     ISolpackPile __RPC_FAR * This);
00637
00638
00639 void __RPC_STUB ISolpackPile_Shuffle_Stub(
00640     IRpcStubBuffer *This,
00641     IRpcChannelBuffer *_pRpcChannelBuffer,
00642     PRPC_MESSAGE _pRpcMessage,
00643     DWORD *_pdwStubPhase);
00644
00645
00646 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackPile_GetCard_Proxy(
00647     ISolpackPile __RPC_FAR * This,
00648     /* [in] */ long lIndex,
00649     /* [retval][out] */ ISolpackCard __RPC_FAR *__RPC_FAR *ppCard);
00650
00651
00652 void __RPC_STUB ISolpackPile_GetCard_Stub(
00653     IRpcStubBuffer *This,
00654     IRpcChannelBuffer *_pRpcChannelBuffer,
00655     PRPC_MESSAGE _pRpcMessage,
00656     DWORD *_pdwStubPhase);
00657
00658
00659 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackPile_WidthWith_Proxy(
00660     ISolpackPile __RPC_FAR * This,
00661     /* [in] */ long lNumCards,
00662     /* [retval][out] */ long __RPC_FAR *plWidth);
00663
00664
00665 void __RPC_STUB ISolpackPile_WidthWith_Stub(
00666     IRpcStubBuffer *This,
00667     IRpcChannelBuffer *_pRpcChannelBuffer,
00668     PRPC_MESSAGE _pRpcMessage,
00669     DWORD *_pdwStubPhase);
00670
00671
00672 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackPile_HeightWith_Proxy(
00673     ISolpackPile __RPC_FAR * This,
00674     /* [in] */ long lNumCards,
00675     /* [retval][out] */ long __RPC_FAR *plHeight);
00676
00677
00678 void __RPC_STUB ISolpackPile_HeightWith_Stub(
00679     IRpcStubBuffer *This,
00680     IRpcChannelBuffer *_pRpcChannelBuffer,
00681     PRPC_MESSAGE _pRpcMessage,
00682     DWORD *_pdwStubPhase);
00683
00684
00685
00686 #endif   /* __ISolpackPile_INTERFACE_DEFINED__ */
00687
00688
00689 #ifndef __ISolpackFragment_INTERFACE_DEFINED__
00690 #define __ISolpackFragment_INTERFACE_DEFINED__
00691
00692 /* interface ISolpackFragment */
00693 /* [unique][helpstring][dual][uuid][object] */
00694
00695
00696 EXTERN_C const IID IID_ISolpackFragment;
00697
00698 #if defined(__cplusplus) && !defined(CINTERFACE)
00699
00700     MIDL_INTERFACE("0CBC4048-2CA8-11d6-8301-0020780D1875")
00701     ISolpackFragment : public ISolpackPile
00702     {
00703     public:
00704         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddToFragment(
00705             /* [in] */ IDispatch __RPC_FAR *pObj) = 0;
00706
00707         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MoveToPile(
00708             /* [in] */ ISolpackPile __RPC_FAR *pDest,
00709             /* [in] */ long lIndex,
00710             /* [in] */ VARIANT_BOOL bAnimate,
00711             /* [in] */ VARIANT_BOOL bToggleFace) = 0;
00712
00713     };
00714
00715 #else    /* C style interface */
00716
00717     typedef struct ISolpackFragmentVtbl
00718     {
00719         BEGIN_INTERFACE
00720
00721         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
00722             ISolpackFragment __RPC_FAR * This,
00723             /* [in] */ REFIID riid,
00724             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
00725
00726         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
00727             ISolpackFragment __RPC_FAR * This);
00728
00729         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
00730             ISolpackFragment __RPC_FAR * This);
00731
00732         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
00733             ISolpackFragment __RPC_FAR * This,
00734             /* [out] */ UINT __RPC_FAR *pctinfo);
00735
00736         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
00737             ISolpackFragment __RPC_FAR * This,
00738             /* [in] */ UINT iTInfo,
00739             /* [in] */ LCID lcid,
00740             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
00741
00742         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
00743             ISolpackFragment __RPC_FAR * This,
00744             /* [in] */ REFIID riid,
00745             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
00746             /* [in] */ UINT cNames,
00747             /* [in] */ LCID lcid,
00748             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
00749
00750         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
00751             ISolpackFragment __RPC_FAR * This,
00752             /* [in] */ DISPID dispIdMember,
00753             /* [in] */ REFIID riid,
00754             /* [in] */ LCID lcid,
00755             /* [in] */ WORD wFlags,
00756             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
00757             /* [out] */ VARIANT __RPC_FAR *pVarResult,
00758             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
00759             /* [out] */ UINT __RPC_FAR *puArgErr);
00760
00761         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Type )(
00762             ISolpackFragment __RPC_FAR * This,
00763             /* [retval][out] */ long __RPC_FAR *p);
00764
00765         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_X )(
00766             ISolpackFragment __RPC_FAR * This,
00767             /* [retval][out] */ long __RPC_FAR *p);
00768
00769         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_X )(
00770             ISolpackFragment __RPC_FAR * This,
00771             /* [in] */ long v);
00772
00773         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Y )(
00774             ISolpackFragment __RPC_FAR * This,
00775             /* [retval][out] */ long __RPC_FAR *p);
00776
00777         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Y )(
00778             ISolpackFragment __RPC_FAR * This,
00779             /* [in] */ long v);
00780
00781         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Width )(
00782             ISolpackFragment __RPC_FAR * This,
00783             /* [retval][out] */ long __RPC_FAR *p);
00784
00785         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Height )(
00786             ISolpackFragment __RPC_FAR * This,
00787             /* [retval][out] */ long __RPC_FAR *p);
00788
00789         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_NumCards )(
00790             ISolpackFragment __RPC_FAR * This,
00791             /* [retval][out] */ long __RPC_FAR *p);
00792
00793         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip )(
00794             ISolpackFragment __RPC_FAR * This,
00795             /* [retval][out] */ BSTR __RPC_FAR *pbstrText);
00796
00797         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip )(
00798             ISolpackFragment __RPC_FAR * This,
00799             /* [in] */ BSTR bstrText);
00800
00801         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip )(
00802             ISolpackFragment __RPC_FAR * This,
00803             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbShow);
00804
00805         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip )(
00806             ISolpackFragment __RPC_FAR * This,
00807             /* [in] */ VARIANT_BOOL bShowNum);
00808
00809         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_BaseType )(
00810             ISolpackFragment __RPC_FAR * This,
00811             /* [retval][out] */ long __RPC_FAR *p);
00812
00813         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_BaseType )(
00814             ISolpackFragment __RPC_FAR * This,
00815             /* [in] */ long v);
00816
00817         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Shuffle )(
00818             ISolpackFragment __RPC_FAR * This);
00819
00820         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetCard )(
00821             ISolpackFragment __RPC_FAR * This,
00822             /* [in] */ long lIndex,
00823             /* [retval][out] */ ISolpackCard __RPC_FAR *__RPC_FAR *ppCard);
00824
00825         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *WidthWith )(
00826             ISolpackFragment __RPC_FAR * This,
00827             /* [in] */ long lNumCards,
00828             /* [retval][out] */ long __RPC_FAR *plWidth);
00829
00830         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HeightWith )(
00831             ISolpackFragment __RPC_FAR * This,
00832             /* [in] */ long lNumCards,
00833             /* [retval][out] */ long __RPC_FAR *plHeight);
00834
00835         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AddToFragment )(
00836             ISolpackFragment __RPC_FAR * This,
00837             /* [in] */ IDispatch __RPC_FAR *pObj);
00838
00839         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *MoveToPile )(
00840             ISolpackFragment __RPC_FAR * This,
00841             /* [in] */ ISolpackPile __RPC_FAR *pDest,
00842             /* [in] */ long lIndex,
00843             /* [in] */ VARIANT_BOOL bAnimate,
00844             /* [in] */ VARIANT_BOOL bToggleFace);
00845
00846         END_INTERFACE
00847     } ISolpackFragmentVtbl;
00848
00849     interface ISolpackFragment
00850     {
00851         CONST_VTBL struct ISolpackFragmentVtbl __RPC_FAR *lpVtbl;
00852     };
00853
00854
00855
00856 #ifdef COBJMACROS
00857
00858
00859 #define ISolpackFragment_QueryInterface(This,riid,ppvObject)   \
00860     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
00861
00862 #define ISolpackFragment_AddRef(This)  \
00863     (This)->lpVtbl -> AddRef(This)
00864
00865 #define ISolpackFragment_Release(This) \
00866     (This)->lpVtbl -> Release(This)
00867
00868
00869 #define ISolpackFragment_GetTypeInfoCount(This,pctinfo)  \
00870     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
00871
00872 #define ISolpackFragment_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
00873     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
00874
00875 #define ISolpackFragment_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
00876     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
00877
00878 #define ISolpackFragment_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
00879     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
00880
00881
00882 #define ISolpackFragment_get_Type(This,p) \
00883     (This)->lpVtbl -> get_Type(This,p)
00884
00885 #define ISolpackFragment_get_X(This,p) \
00886     (This)->lpVtbl -> get_X(This,p)
00887
00888 #define ISolpackFragment_put_X(This,v) \
00889     (This)->lpVtbl -> put_X(This,v)
00890
00891 #define ISolpackFragment_get_Y(This,p) \
00892     (This)->lpVtbl -> get_Y(This,p)
00893
00894 #define ISolpackFragment_put_Y(This,v) \
00895     (This)->lpVtbl -> put_Y(This,v)
00896
00897 #define ISolpackFragment_get_Width(This,p)   \
00898     (This)->lpVtbl -> get_Width(This,p)
00899
00900 #define ISolpackFragment_get_Height(This,p)  \
00901     (This)->lpVtbl -> get_Height(This,p)
00902
00903 #define ISolpackFragment_get_NumCards(This,p)   \
00904     (This)->lpVtbl -> get_NumCards(This,p)
00905
00906 #define ISolpackFragment_get_CommentTooltip(This,pbstrText) \
00907     (This)->lpVtbl -> get_CommentTooltip(This,pbstrText)
00908
00909 #define ISolpackFragment_put_CommentTooltip(This,bstrText)  \
00910     (This)->lpVtbl -> put_CommentTooltip(This,bstrText)
00911
00912 #define ISolpackFragment_get_ShowNumCardsTooltip(This,pbShow)  \
00913     (This)->lpVtbl -> get_ShowNumCardsTooltip(This,pbShow)
00914
00915 #define ISolpackFragment_put_ShowNumCardsTooltip(This,bShowNum)   \
00916     (This)->lpVtbl -> put_ShowNumCardsTooltip(This,bShowNum)
00917
00918 #define ISolpackFragment_get_BaseType(This,p)   \
00919     (This)->lpVtbl -> get_BaseType(This,p)
00920
00921 #define ISolpackFragment_put_BaseType(This,v)   \
00922     (This)->lpVtbl -> put_BaseType(This,v)
00923
00924 #define ISolpackFragment_Shuffle(This) \
00925     (This)->lpVtbl -> Shuffle(This)
00926
00927 #define ISolpackFragment_GetCard(This,lIndex,ppCard)  \
00928     (This)->lpVtbl -> GetCard(This,lIndex,ppCard)
00929
00930 #define ISolpackFragment_WidthWith(This,lNumCards,plWidth)  \
00931     (This)->lpVtbl -> WidthWith(This,lNumCards,plWidth)
00932
00933 #define ISolpackFragment_HeightWith(This,lNumCards,plHeight)   \
00934     (This)->lpVtbl -> HeightWith(This,lNumCards,plHeight)
00935
00936
00937 #define ISolpackFragment_AddToFragment(This,pObj)  \
00938     (This)->lpVtbl -> AddToFragment(This,pObj)
00939
00940 #define ISolpackFragment_MoveToPile(This,pDest,lIndex,bAnimate,bToggleFace)   \
00941     (This)->lpVtbl -> MoveToPile(This,pDest,lIndex,bAnimate,bToggleFace)
00942
00943 #endif /* COBJMACROS */
00944
00945
00946 #endif   /* C style interface */
00947
00948
00949
00950 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackFragment_AddToFragment_Proxy(
00951     ISolpackFragment __RPC_FAR * This,
00952     /* [in] */ IDispatch __RPC_FAR *pObj);
00953
00954
00955 void __RPC_STUB ISolpackFragment_AddToFragment_Stub(
00956     IRpcStubBuffer *This,
00957     IRpcChannelBuffer *_pRpcChannelBuffer,
00958     PRPC_MESSAGE _pRpcMessage,
00959     DWORD *_pdwStubPhase);
00960
00961
00962 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackFragment_MoveToPile_Proxy(
00963     ISolpackFragment __RPC_FAR * This,
00964     /* [in] */ ISolpackPile __RPC_FAR *pDest,
00965     /* [in] */ long lIndex,
00966     /* [in] */ VARIANT_BOOL bAnimate,
00967     /* [in] */ VARIANT_BOOL bToggleFace);
00968
00969
00970 void __RPC_STUB ISolpackFragment_MoveToPile_Stub(
00971     IRpcStubBuffer *This,
00972     IRpcChannelBuffer *_pRpcChannelBuffer,
00973     PRPC_MESSAGE _pRpcMessage,
00974     DWORD *_pdwStubPhase);
00975
00976
00977
00978 #endif   /* __ISolpackFragment_INTERFACE_DEFINED__ */
00979
00980
00981 #ifndef __ISolpackCard_INTERFACE_DEFINED__
00982 #define __ISolpackCard_INTERFACE_DEFINED__
00983
00984 /* interface ISolpackCard */
00985 /* [unique][helpstring][dual][uuid][object] */
00986
00987
00988 EXTERN_C const IID IID_ISolpackCard;
00989
00990 #if defined(__cplusplus) && !defined(CINTERFACE)
00991
00992     MIDL_INTERFACE("0CBC4047-2CA8-11d6-8301-0020780D1875")
00993     ISolpackCard : public IDispatch
00994     {
00995     public:
00996         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_ID(
00997             /* [retval][out] */ long __RPC_FAR *p) = 0;
00998
00999         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Rank(
01000             /* [retval][out] */ long __RPC_FAR *p) = 0;
01001
01002         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Suit(
01003             /* [retval][out] */ long __RPC_FAR *p) = 0;
01004
01005         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CanDrag(
01006             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbCanDrag) = 0;
01007
01008         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CanDrag(
01009             /* [in] */ VARIANT_BOOL bCanDrag) = 0;
01010
01011         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FaceUp(
01012             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbFaceUp) = 0;
01013
01014         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FaceUp(
01015             /* [in] */ VARIANT_BOOL bFaceUp) = 0;
01016
01017         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Pile(
01018             /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *pp) = 0;
01019
01020         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Index(
01021             /* [retval][out] */ long __RPC_FAR *p) = 0;
01022
01023         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Index(
01024             /* [in] */ long v) = 0;
01025
01026     };
01027
01028 #else    /* C style interface */
01029
01030     typedef struct ISolpackCardVtbl
01031     {
01032         BEGIN_INTERFACE
01033
01034         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01035             ISolpackCard __RPC_FAR * This,
01036             /* [in] */ REFIID riid,
01037             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01038
01039         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01040             ISolpackCard __RPC_FAR * This);
01041
01042         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01043             ISolpackCard __RPC_FAR * This);
01044
01045         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
01046             ISolpackCard __RPC_FAR * This,
01047             /* [out] */ UINT __RPC_FAR *pctinfo);
01048
01049         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
01050             ISolpackCard __RPC_FAR * This,
01051             /* [in] */ UINT iTInfo,
01052             /* [in] */ LCID lcid,
01053             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
01054
01055         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
01056             ISolpackCard __RPC_FAR * This,
01057             /* [in] */ REFIID riid,
01058             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
01059             /* [in] */ UINT cNames,
01060             /* [in] */ LCID lcid,
01061             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
01062
01063         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
01064             ISolpackCard __RPC_FAR * This,
01065             /* [in] */ DISPID dispIdMember,
01066             /* [in] */ REFIID riid,
01067             /* [in] */ LCID lcid,
01068             /* [in] */ WORD wFlags,
01069             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
01070             /* [out] */ VARIANT __RPC_FAR *pVarResult,
01071             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
01072             /* [out] */ UINT __RPC_FAR *puArgErr);
01073
01074         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_ID )(
01075             ISolpackCard __RPC_FAR * This,
01076             /* [retval][out] */ long __RPC_FAR *p);
01077
01078         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Rank )(
01079             ISolpackCard __RPC_FAR * This,
01080             /* [retval][out] */ long __RPC_FAR *p);
01081
01082         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Suit )(
01083             ISolpackCard __RPC_FAR * This,
01084             /* [retval][out] */ long __RPC_FAR *p);
01085
01086         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_CanDrag )(
01087             ISolpackCard __RPC_FAR * This,
01088             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbCanDrag);
01089
01090         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_CanDrag )(
01091             ISolpackCard __RPC_FAR * This,
01092             /* [in] */ VARIANT_BOOL bCanDrag);
01093
01094         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_FaceUp )(
01095             ISolpackCard __RPC_FAR * This,
01096             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbFaceUp);
01097
01098         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_FaceUp )(
01099             ISolpackCard __RPC_FAR * This,
01100             /* [in] */ VARIANT_BOOL bFaceUp);
01101
01102         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Pile )(
01103             ISolpackCard __RPC_FAR * This,
01104             /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *pp);
01105
01106         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Index )(
01107             ISolpackCard __RPC_FAR * This,
01108             /* [retval][out] */ long __RPC_FAR *p);
01109
01110         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Index )(
01111             ISolpackCard __RPC_FAR * This,
01112             /* [in] */ long v);
01113
01114         END_INTERFACE
01115     } ISolpackCardVtbl;
01116
01117     interface ISolpackCard
01118     {
01119         CONST_VTBL struct ISolpackCardVtbl __RPC_FAR *lpVtbl;
01120     };
01121
01122
01123
01124 #ifdef COBJMACROS
01125
01126
01127 #define ISolpackCard_QueryInterface(This,riid,ppvObject) \
01128     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01129
01130 #define ISolpackCard_AddRef(This)   \
01131     (This)->lpVtbl -> AddRef(This)
01132
01133 #define ISolpackCard_Release(This)  \
01134     (This)->lpVtbl -> Release(This)
01135
01136
01137 #define ISolpackCard_GetTypeInfoCount(This,pctinfo)   \
01138     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
01139
01140 #define ISolpackCard_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
01141     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
01142
01143 #define ISolpackCard_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
01144     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
01145
01146 #define ISolpackCard_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
01147     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
01148
01149
01150 #define ISolpackCard_get_ID(This,p) \
01151     (This)->lpVtbl -> get_ID(This,p)
01152
01153 #define ISolpackCard_get_Rank(This,p)  \
01154     (This)->lpVtbl -> get_Rank(This,p)
01155
01156 #define ISolpackCard_get_Suit(This,p)  \
01157     (This)->lpVtbl -> get_Suit(This,p)
01158
01159 #define ISolpackCard_get_CanDrag(This,pbCanDrag)   \
01160     (This)->lpVtbl -> get_CanDrag(This,pbCanDrag)
01161
01162 #define ISolpackCard_put_CanDrag(This,bCanDrag) \
01163     (This)->lpVtbl -> put_CanDrag(This,bCanDrag)
01164
01165 #define ISolpackCard_get_FaceUp(This,pbFaceUp)  \
01166     (This)->lpVtbl -> get_FaceUp(This,pbFaceUp)
01167
01168 #define ISolpackCard_put_FaceUp(This,bFaceUp)   \
01169     (This)->lpVtbl -> put_FaceUp(This,bFaceUp)
01170
01171 #define ISolpackCard_get_Pile(This,pp) \
01172     (This)->lpVtbl -> get_Pile(This,pp)
01173
01174 #define ISolpackCard_get_Index(This,p) \
01175     (This)->lpVtbl -> get_Index(This,p)
01176
01177 #define ISolpackCard_put_Index(This,v) \
01178     (This)->lpVtbl -> put_Index(This,v)
01179
01180 #endif /* COBJMACROS */
01181
01182
01183 #endif   /* C style interface */
01184
01185
01186
01187 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_ID_Proxy(
01188     ISolpackCard __RPC_FAR * This,
01189     /* [retval][out] */ long __RPC_FAR *p);
01190
01191
01192 void __RPC_STUB ISolpackCard_get_ID_Stub(
01193     IRpcStubBuffer *This,
01194     IRpcChannelBuffer *_pRpcChannelBuffer,
01195     PRPC_MESSAGE _pRpcMessage,
01196     DWORD *_pdwStubPhase);
01197
01198
01199 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_Rank_Proxy(
01200     ISolpackCard __RPC_FAR * This,
01201     /* [retval][out] */ long __RPC_FAR *p);
01202
01203
01204 void __RPC_STUB ISolpackCard_get_Rank_Stub(
01205     IRpcStubBuffer *This,
01206     IRpcChannelBuffer *_pRpcChannelBuffer,
01207     PRPC_MESSAGE _pRpcMessage,
01208     DWORD *_pdwStubPhase);
01209
01210
01211 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_Suit_Proxy(
01212     ISolpackCard __RPC_FAR * This,
01213     /* [retval][out] */ long __RPC_FAR *p);
01214
01215
01216 void __RPC_STUB ISolpackCard_get_Suit_Stub(
01217     IRpcStubBuffer *This,
01218     IRpcChannelBuffer *_pRpcChannelBuffer,
01219     PRPC_MESSAGE _pRpcMessage,
01220     DWORD *_pdwStubPhase);
01221
01222
01223 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_CanDrag_Proxy(
01224     ISolpackCard __RPC_FAR * This,
01225     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbCanDrag);
01226
01227
01228 void __RPC_STUB ISolpackCard_get_CanDrag_Stub(
01229     IRpcStubBuffer *This,
01230     IRpcChannelBuffer *_pRpcChannelBuffer,
01231     PRPC_MESSAGE _pRpcMessage,
01232     DWORD *_pdwStubPhase);
01233
01234
01235 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackCard_put_CanDrag_Proxy(
01236     ISolpackCard __RPC_FAR * This,
01237     /* [in] */ VARIANT_BOOL bCanDrag);
01238
01239
01240 void __RPC_STUB ISolpackCard_put_CanDrag_Stub(
01241     IRpcStubBuffer *This,
01242     IRpcChannelBuffer *_pRpcChannelBuffer,
01243     PRPC_MESSAGE _pRpcMessage,
01244     DWORD *_pdwStubPhase);
01245
01246
01247 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_FaceUp_Proxy(
01248     ISolpackCard __RPC_FAR * This,
01249     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbFaceUp);
01250
01251
01252 void __RPC_STUB ISolpackCard_get_FaceUp_Stub(
01253     IRpcStubBuffer *This,
01254     IRpcChannelBuffer *_pRpcChannelBuffer,
01255     PRPC_MESSAGE _pRpcMessage,
01256     DWORD *_pdwStubPhase);
01257
01258
01259 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackCard_put_FaceUp_Proxy(
01260     ISolpackCard __RPC_FAR * This,
01261     /* [in] */ VARIANT_BOOL bFaceUp);
01262
01263
01264 void __RPC_STUB ISolpackCard_put_FaceUp_Stub(
01265     IRpcStubBuffer *This,
01266     IRpcChannelBuffer *_pRpcChannelBuffer,
01267     PRPC_MESSAGE _pRpcMessage,
01268     DWORD *_pdwStubPhase);
01269
01270
01271 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_Pile_Proxy(
01272     ISolpackCard __RPC_FAR * This,
01273     /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *pp);
01274
01275
01276 void __RPC_STUB ISolpackCard_get_Pile_Stub(
01277     IRpcStubBuffer *This,
01278     IRpcChannelBuffer *_pRpcChannelBuffer,
01279     PRPC_MESSAGE _pRpcMessage,
01280     DWORD *_pdwStubPhase);
01281
01282
01283 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackCard_get_Index_Proxy(
01284     ISolpackCard __RPC_FAR * This,
01285     /* [retval][out] */ long __RPC_FAR *p);
01286
01287
01288 void __RPC_STUB ISolpackCard_get_Index_Stub(
01289     IRpcStubBuffer *This,
01290     IRpcChannelBuffer *_pRpcChannelBuffer,
01291     PRPC_MESSAGE _pRpcMessage,
01292     DWORD *_pdwStubPhase);
01293
01294
01295 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackCard_put_Index_Proxy(
01296     ISolpackCard __RPC_FAR * This,
01297     /* [in] */ long v);
01298
01299
01300 void __RPC_STUB ISolpackCard_put_Index_Stub(
01301     IRpcStubBuffer *This,
01302     IRpcChannelBuffer *_pRpcChannelBuffer,
01303     PRPC_MESSAGE _pRpcMessage,
01304     DWORD *_pdwStubPhase);
01305
01306
01307
01308 #endif   /* __ISolpackCard_INTERFACE_DEFINED__ */
01309
01310
01311 #ifndef __ISolpackGameInfo_INTERFACE_DEFINED__
01312 #define __ISolpackGameInfo_INTERFACE_DEFINED__
01313
01314 /* interface ISolpackGameInfo */
01315 /* [unique][helpstring][dual][uuid][object] */
01316
01317
01318 EXTERN_C const IID IID_ISolpackGameInfo;
01319
01320 #if defined(__cplusplus) && !defined(CINTERFACE)
01321
01322     MIDL_INTERFACE("0CBC404A-2CA8-11d6-8301-0020780D1875")
01323     ISolpackGameInfo : public IDispatch
01324     {
01325     public:
01326         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Title(
01327             /* [retval][out] */ BSTR __RPC_FAR *p) = 0;
01328
01329         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Rules(
01330             /* [retval][out] */ BSTR __RPC_FAR *p) = 0;
01331
01332         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Difficulty(
01333             /* [retval][out] */ long __RPC_FAR *p) = 0;
01334
01335     };
01336
01337 #else    /* C style interface */
01338
01339     typedef struct ISolpackGameInfoVtbl
01340     {
01341         BEGIN_INTERFACE
01342
01343         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01344             ISolpackGameInfo __RPC_FAR * This,
01345             /* [in] */ REFIID riid,
01346             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01347
01348         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01349             ISolpackGameInfo __RPC_FAR * This);
01350
01351         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01352             ISolpackGameInfo __RPC_FAR * This);
01353
01354         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
01355             ISolpackGameInfo __RPC_FAR * This,
01356             /* [out] */ UINT __RPC_FAR *pctinfo);
01357
01358         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
01359             ISolpackGameInfo __RPC_FAR * This,
01360             /* [in] */ UINT iTInfo,
01361             /* [in] */ LCID lcid,
01362             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
01363
01364         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
01365             ISolpackGameInfo __RPC_FAR * This,
01366             /* [in] */ REFIID riid,
01367             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
01368             /* [in] */ UINT cNames,
01369             /* [in] */ LCID lcid,
01370             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
01371
01372         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
01373             ISolpackGameInfo __RPC_FAR * This,
01374             /* [in] */ DISPID dispIdMember,
01375             /* [in] */ REFIID riid,
01376             /* [in] */ LCID lcid,
01377             /* [in] */ WORD wFlags,
01378             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
01379             /* [out] */ VARIANT __RPC_FAR *pVarResult,
01380             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
01381             /* [out] */ UINT __RPC_FAR *puArgErr);
01382
01383         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Title )(
01384             ISolpackGameInfo __RPC_FAR * This,
01385             /* [retval][out] */ BSTR __RPC_FAR *p);
01386
01387         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Rules )(
01388             ISolpackGameInfo __RPC_FAR * This,
01389             /* [retval][out] */ BSTR __RPC_FAR *p);
01390
01391         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Difficulty )(
01392             ISolpackGameInfo __RPC_FAR * This,
01393             /* [retval][out] */ long __RPC_FAR *p);
01394
01395         END_INTERFACE
01396     } ISolpackGameInfoVtbl;
01397
01398     interface ISolpackGameInfo
01399     {
01400         CONST_VTBL struct ISolpackGameInfoVtbl __RPC_FAR *lpVtbl;
01401     };
01402
01403
01404
01405 #ifdef COBJMACROS
01406
01407
01408 #define ISolpackGameInfo_QueryInterface(This,riid,ppvObject)   \
01409     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01410
01411 #define ISolpackGameInfo_AddRef(This)  \
01412     (This)->lpVtbl -> AddRef(This)
01413
01414 #define ISolpackGameInfo_Release(This) \
01415     (This)->lpVtbl -> Release(This)
01416
01417
01418 #define ISolpackGameInfo_GetTypeInfoCount(This,pctinfo)  \
01419     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
01420
01421 #define ISolpackGameInfo_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
01422     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
01423
01424 #define ISolpackGameInfo_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
01425     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
01426
01427 #define ISolpackGameInfo_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
01428     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
01429
01430
01431 #define ISolpackGameInfo_get_Title(This,p)   \
01432     (This)->lpVtbl -> get_Title(This,p)
01433
01434 #define ISolpackGameInfo_get_Rules(This,p)   \
01435     (This)->lpVtbl -> get_Rules(This,p)
01436
01437 #define ISolpackGameInfo_get_Difficulty(This,p) \
01438     (This)->lpVtbl -> get_Difficulty(This,p)
01439
01440 #endif /* COBJMACROS */
01441
01442
01443 #endif   /* C style interface */
01444
01445
01446
01447 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Title_Proxy(
01448     ISolpackGameInfo __RPC_FAR * This,
01449     /* [retval][out] */ BSTR __RPC_FAR *p);
01450
01451
01452 void __RPC_STUB ISolpackGameInfo_get_Title_Stub(
01453     IRpcStubBuffer *This,
01454     IRpcChannelBuffer *_pRpcChannelBuffer,
01455     PRPC_MESSAGE _pRpcMessage,
01456     DWORD *_pdwStubPhase);
01457
01458
01459 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Rules_Proxy(
01460     ISolpackGameInfo __RPC_FAR * This,
01461     /* [retval][out] */ BSTR __RPC_FAR *p);
01462
01463
01464 void __RPC_STUB ISolpackGameInfo_get_Rules_Stub(
01465     IRpcStubBuffer *This,
01466     IRpcChannelBuffer *_pRpcChannelBuffer,
01467     PRPC_MESSAGE _pRpcMessage,
01468     DWORD *_pdwStubPhase);
01469
01470
01471 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameInfo_get_Difficulty_Proxy(
01472     ISolpackGameInfo __RPC_FAR * This,
01473     /* [retval][out] */ long __RPC_FAR *p);
01474
01475
01476 void __RPC_STUB ISolpackGameInfo_get_Difficulty_Stub(
01477     IRpcStubBuffer *This,
01478     IRpcChannelBuffer *_pRpcChannelBuffer,
01479     PRPC_MESSAGE _pRpcMessage,
01480     DWORD *_pdwStubPhase);
01481
01482
01483
01484 #endif   /* __ISolpackGameInfo_INTERFACE_DEFINED__ */
01485
01486
01487 #ifndef __ISolpackGameData_INTERFACE_DEFINED__
01488 #define __ISolpackGameData_INTERFACE_DEFINED__
01489
01490 /* interface ISolpackGameData */
01491 /* [unique][helpstring][dual][uuid][object] */
01492
01493
01494 EXTERN_C const IID IID_ISolpackGameData;
01495
01496 #if defined(__cplusplus) && !defined(CINTERFACE)
01497
01498     MIDL_INTERFACE("0CBC404B-2CA8-11d6-8301-0020780D1875")
01499     ISolpackGameData : public IDispatch
01500     {
01501     public:
01502         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Data(
01503             /* [retval][out] */ VARIANT __RPC_FAR *p) = 0;
01504
01505         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Data(
01506             /* [in] */ VARIANT v) = 0;
01507
01508     };
01509
01510 #else    /* C style interface */
01511
01512     typedef struct ISolpackGameDataVtbl
01513     {
01514         BEGIN_INTERFACE
01515
01516         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01517             ISolpackGameData __RPC_FAR * This,
01518             /* [in] */ REFIID riid,
01519             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01520
01521         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01522             ISolpackGameData __RPC_FAR * This);
01523
01524         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01525             ISolpackGameData __RPC_FAR * This);
01526
01527         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
01528             ISolpackGameData __RPC_FAR * This,
01529             /* [out] */ UINT __RPC_FAR *pctinfo);
01530
01531         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
01532             ISolpackGameData __RPC_FAR * This,
01533             /* [in] */ UINT iTInfo,
01534             /* [in] */ LCID lcid,
01535             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
01536
01537         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
01538             ISolpackGameData __RPC_FAR * This,
01539             /* [in] */ REFIID riid,
01540             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
01541             /* [in] */ UINT cNames,
01542             /* [in] */ LCID lcid,
01543             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
01544
01545         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
01546             ISolpackGameData __RPC_FAR * This,
01547             /* [in] */ DISPID dispIdMember,
01548             /* [in] */ REFIID riid,
01549             /* [in] */ LCID lcid,
01550             /* [in] */ WORD wFlags,
01551             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
01552             /* [out] */ VARIANT __RPC_FAR *pVarResult,
01553             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
01554             /* [out] */ UINT __RPC_FAR *puArgErr);
01555
01556         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Data )(
01557             ISolpackGameData __RPC_FAR * This,
01558             /* [retval][out] */ VARIANT __RPC_FAR *p);
01559
01560         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Data )(
01561             ISolpackGameData __RPC_FAR * This,
01562             /* [in] */ VARIANT v);
01563
01564         END_INTERFACE
01565     } ISolpackGameDataVtbl;
01566
01567     interface ISolpackGameData
01568     {
01569         CONST_VTBL struct ISolpackGameDataVtbl __RPC_FAR *lpVtbl;
01570     };
01571
01572
01573
01574 #ifdef COBJMACROS
01575
01576
01577 #define ISolpackGameData_QueryInterface(This,riid,ppvObject)   \
01578     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01579
01580 #define ISolpackGameData_AddRef(This)  \
01581     (This)->lpVtbl -> AddRef(This)
01582
01583 #define ISolpackGameData_Release(This) \
01584     (This)->lpVtbl -> Release(This)
01585
01586
01587 #define ISolpackGameData_GetTypeInfoCount(This,pctinfo)  \
01588     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
01589
01590 #define ISolpackGameData_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
01591     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
01592
01593 #define ISolpackGameData_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
01594     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
01595
01596 #define ISolpackGameData_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
01597     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
01598
01599
01600 #define ISolpackGameData_get_Data(This,p) \
01601     (This)->lpVtbl -> get_Data(This,p)
01602
01603 #define ISolpackGameData_put_Data(This,v) \
01604     (This)->lpVtbl -> put_Data(This,v)
01605
01606 #endif /* COBJMACROS */
01607
01608
01609 #endif   /* C style interface */
01610
01611
01612
01613 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameData_get_Data_Proxy(
01614     ISolpackGameData __RPC_FAR * This,
01615     /* [retval][out] */ VARIANT __RPC_FAR *p);
01616
01617
01618 void __RPC_STUB ISolpackGameData_get_Data_Stub(
01619     IRpcStubBuffer *This,
01620     IRpcChannelBuffer *_pRpcChannelBuffer,
01621     PRPC_MESSAGE _pRpcMessage,
01622     DWORD *_pdwStubPhase);
01623
01624
01625 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackGameData_put_Data_Proxy(
01626     ISolpackGameData __RPC_FAR * This,
01627     /* [in] */ VARIANT v);
01628
01629
01630 void __RPC_STUB ISolpackGameData_put_Data_Stub(
01631     IRpcStubBuffer *This,
01632     IRpcChannelBuffer *_pRpcChannelBuffer,
01633     PRPC_MESSAGE _pRpcMessage,
01634     DWORD *_pdwStubPhase);
01635
01636
01637
01638 #endif   /* __ISolpackGameData_INTERFACE_DEFINED__ */
01639
01640
01641 #ifndef __ISolpackApp_INTERFACE_DEFINED__
01642 #define __ISolpackApp_INTERFACE_DEFINED__
01643
01644 /* interface ISolpackApp */
01645 /* [unique][helpstring][dual][uuid][object] */
01646
01647
01648 EXTERN_C const IID IID_ISolpackApp;
01649
01650 #if defined(__cplusplus) && !defined(CINTERFACE)
01651
01652     MIDL_INTERFACE("0CBC4044-2CA8-11d6-8301-0020780D1875")
01653     ISolpackApp : public IDispatch
01654     {
01655     public:
01656         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CardWidth(
01657             /* [retval][out] */ long __RPC_FAR *p) = 0;
01658
01659         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CardHeight(
01660             /* [retval][out] */ long __RPC_FAR *p) = 0;
01661
01662         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Score(
01663             /* [retval][out] */ long __RPC_FAR *p) = 0;
01664
01665         virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Score(
01666             /* [in] */ long v) = 0;
01667
01668         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_WindowWidth(
01669             /* [retval][out] */ long __RPC_FAR *p) = 0;
01670
01671         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_WindowHeight(
01672             /* [retval][out] */ long __RPC_FAR *p) = 0;
01673
01674         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SpacingX(
01675             /* [retval][out] */ long __RPC_FAR *p) = 0;
01676
01677         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SpacingY(
01678             /* [retval][out] */ long __RPC_FAR *p) = 0;
01679
01680         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Fragment(
01681             /* [retval][out] */ ISolpackFragment __RPC_FAR *__RPC_FAR *pp) = 0;
01682
01683         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreatePile(
01684             /* [in] */ long lType,
01685             /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *ppPile) = 0;
01686
01687         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateGameData(
01688             /* [retval][out] */ ISolpackGameData __RPC_FAR *__RPC_FAR *ppGameData) = 0;
01689
01690         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddGameCommand(
01691             /* [in] */ long lID,
01692             /* [in] */ BSTR bstrText,
01693             /* [in] */ BSTR bstrHelpText) = 0;
01694
01695         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnableGameCommand(
01696             /* [in] */ long lID,
01697             /* [in] */ VARIANT_BOOL bEnable) = 0;
01698
01699         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GameWon( void) = 0;
01700
01701     };
01702
01703 #else    /* C style interface */
01704
01705     typedef struct ISolpackAppVtbl
01706     {
01707         BEGIN_INTERFACE
01708
01709         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
01710             ISolpackApp __RPC_FAR * This,
01711             /* [in] */ REFIID riid,
01712             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
01713
01714         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
01715             ISolpackApp __RPC_FAR * This);
01716
01717         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
01718             ISolpackApp __RPC_FAR * This);
01719
01720         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
01721             ISolpackApp __RPC_FAR * This,
01722             /* [out] */ UINT __RPC_FAR *pctinfo);
01723
01724         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
01725             ISolpackApp __RPC_FAR * This,
01726             /* [in] */ UINT iTInfo,
01727             /* [in] */ LCID lcid,
01728             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
01729
01730         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
01731             ISolpackApp __RPC_FAR * This,
01732             /* [in] */ REFIID riid,
01733             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
01734             /* [in] */ UINT cNames,
01735             /* [in] */ LCID lcid,
01736             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
01737
01738         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
01739             ISolpackApp __RPC_FAR * This,
01740             /* [in] */ DISPID dispIdMember,
01741             /* [in] */ REFIID riid,
01742             /* [in] */ LCID lcid,
01743             /* [in] */ WORD wFlags,
01744             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
01745             /* [out] */ VARIANT __RPC_FAR *pVarResult,
01746             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
01747             /* [out] */ UINT __RPC_FAR *puArgErr);
01748
01749         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_CardWidth )(
01750             ISolpackApp __RPC_FAR * This,
01751             /* [retval][out] */ long __RPC_FAR *p);
01752
01753         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_CardHeight )(
01754             ISolpackApp __RPC_FAR * This,
01755             /* [retval][out] */ long __RPC_FAR *p);
01756
01757         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Score )(
01758             ISolpackApp __RPC_FAR * This,
01759             /* [retval][out] */ long __RPC_FAR *p);
01760
01761         /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Score )(
01762             ISolpackApp __RPC_FAR * This,
01763             /* [in] */ long v);
01764
01765         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_WindowWidth )(
01766             ISolpackApp __RPC_FAR * This,
01767             /* [retval][out] */ long __RPC_FAR *p);
01768
01769         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_WindowHeight )(
01770             ISolpackApp __RPC_FAR * This,
01771             /* [retval][out] */ long __RPC_FAR *p);
01772
01773         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_SpacingX )(
01774             ISolpackApp __RPC_FAR * This,
01775             /* [retval][out] */ long __RPC_FAR *p);
01776
01777         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_SpacingY )(
01778             ISolpackApp __RPC_FAR * This,
01779             /* [retval][out] */ long __RPC_FAR *p);
01780
01781         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Fragment )(
01782             ISolpackApp __RPC_FAR * This,
01783             /* [retval][out] */ ISolpackFragment __RPC_FAR *__RPC_FAR *pp);
01784
01785         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreatePile )(
01786             ISolpackApp __RPC_FAR * This,
01787             /* [in] */ long lType,
01788             /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *ppPile);
01789
01790         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateGameData )(
01791             ISolpackApp __RPC_FAR * This,
01792             /* [retval][out] */ ISolpackGameData __RPC_FAR *__RPC_FAR *ppGameData);
01793
01794         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AddGameCommand )(
01795             ISolpackApp __RPC_FAR * This,
01796             /* [in] */ long lID,
01797             /* [in] */ BSTR bstrText,
01798             /* [in] */ BSTR bstrHelpText);
01799
01800         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *EnableGameCommand )(
01801             ISolpackApp __RPC_FAR * This,
01802             /* [in] */ long lID,
01803             /* [in] */ VARIANT_BOOL bEnable);
01804
01805         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GameWon )(
01806             ISolpackApp __RPC_FAR * This);
01807
01808         END_INTERFACE
01809     } ISolpackAppVtbl;
01810
01811     interface ISolpackApp
01812     {
01813         CONST_VTBL struct ISolpackAppVtbl __RPC_FAR *lpVtbl;
01814     };
01815
01816
01817
01818 #ifdef COBJMACROS
01819
01820
01821 #define ISolpackApp_QueryInterface(This,riid,ppvObject)  \
01822     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
01823
01824 #define ISolpackApp_AddRef(This) \
01825     (This)->lpVtbl -> AddRef(This)
01826
01827 #define ISolpackApp_Release(This)   \
01828     (This)->lpVtbl -> Release(This)
01829
01830
01831 #define ISolpackApp_GetTypeInfoCount(This,pctinfo) \
01832     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
01833
01834 #define ISolpackApp_GetTypeInfo(This,iTInfo,lcid,ppTInfo)   \
01835     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
01836
01837 #define ISolpackApp_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)   \
01838     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
01839
01840 #define ISolpackApp_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)   \
01841     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
01842
01843
01844 #define ISolpackApp_get_CardWidth(This,p) \
01845     (This)->lpVtbl -> get_CardWidth(This,p)
01846
01847 #define ISolpackApp_get_CardHeight(This,p)   \
01848     (This)->lpVtbl -> get_CardHeight(This,p)
01849
01850 #define ISolpackApp_get_Score(This,p)  \
01851     (This)->lpVtbl -> get_Score(This,p)
01852
01853 #define ISolpackApp_put_Score(This,v)  \
01854     (This)->lpVtbl -> put_Score(This,v)
01855
01856 #define ISolpackApp_get_WindowWidth(This,p)  \
01857     (This)->lpVtbl -> get_WindowWidth(This,p)
01858
01859 #define ISolpackApp_get_WindowHeight(This,p) \
01860     (This)->lpVtbl -> get_WindowHeight(This,p)
01861
01862 #define ISolpackApp_get_SpacingX(This,p)  \
01863     (This)->lpVtbl -> get_SpacingX(This,p)
01864
01865 #define ISolpackApp_get_SpacingY(This,p)  \
01866     (This)->lpVtbl -> get_SpacingY(This,p)
01867
01868 #define ISolpackApp_get_Fragment(This,pp) \
01869     (This)->lpVtbl -> get_Fragment(This,pp)
01870
01871 #define ISolpackApp_CreatePile(This,lType,ppPile)  \
01872     (This)->lpVtbl -> CreatePile(This,lType,ppPile)
01873
01874 #define ISolpackApp_CreateGameData(This,ppGameData)   \
01875     (This)->lpVtbl -> CreateGameData(This,ppGameData)
01876
01877 #define ISolpackApp_AddGameCommand(This,lID,bstrText,bstrHelpText)   \
01878     (This)->lpVtbl -> AddGameCommand(This,lID,bstrText,bstrHelpText)
01879
01880 #define ISolpackApp_EnableGameCommand(This,lID,bEnable)  \
01881     (This)->lpVtbl -> EnableGameCommand(This,lID,bEnable)
01882
01883 #define ISolpackApp_GameWon(This)   \
01884     (This)->lpVtbl -> GameWon(This)
01885
01886 #endif /* COBJMACROS */
01887
01888
01889 #endif   /* C style interface */
01890
01891
01892
01893 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_CardWidth_Proxy(
01894     ISolpackApp __RPC_FAR * This,
01895     /* [retval][out] */ long __RPC_FAR *p);
01896
01897
01898 void __RPC_STUB ISolpackApp_get_CardWidth_Stub(
01899     IRpcStubBuffer *This,
01900     IRpcChannelBuffer *_pRpcChannelBuffer,
01901     PRPC_MESSAGE _pRpcMessage,
01902     DWORD *_pdwStubPhase);
01903
01904
01905 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_CardHeight_Proxy(
01906     ISolpackApp __RPC_FAR * This,
01907     /* [retval][out] */ long __RPC_FAR *p);
01908
01909
01910 void __RPC_STUB ISolpackApp_get_CardHeight_Stub(
01911     IRpcStubBuffer *This,
01912     IRpcChannelBuffer *_pRpcChannelBuffer,
01913     PRPC_MESSAGE _pRpcMessage,
01914     DWORD *_pdwStubPhase);
01915
01916
01917 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_Score_Proxy(
01918     ISolpackApp __RPC_FAR * This,
01919     /* [retval][out] */ long __RPC_FAR *p);
01920
01921
01922 void __RPC_STUB ISolpackApp_get_Score_Stub(
01923     IRpcStubBuffer *This,
01924     IRpcChannelBuffer *_pRpcChannelBuffer,
01925     PRPC_MESSAGE _pRpcMessage,
01926     DWORD *_pdwStubPhase);
01927
01928
01929 /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISolpackApp_put_Score_Proxy(
01930     ISolpackApp __RPC_FAR * This,
01931     /* [in] */ long v);
01932
01933
01934 void __RPC_STUB ISolpackApp_put_Score_Stub(
01935     IRpcStubBuffer *This,
01936     IRpcChannelBuffer *_pRpcChannelBuffer,
01937     PRPC_MESSAGE _pRpcMessage,
01938     DWORD *_pdwStubPhase);
01939
01940
01941 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_WindowWidth_Proxy(
01942     ISolpackApp __RPC_FAR * This,
01943     /* [retval][out] */ long __RPC_FAR *p);
01944
01945
01946 void __RPC_STUB ISolpackApp_get_WindowWidth_Stub(
01947     IRpcStubBuffer *This,
01948     IRpcChannelBuffer *_pRpcChannelBuffer,
01949     PRPC_MESSAGE _pRpcMessage,
01950     DWORD *_pdwStubPhase);
01951
01952
01953 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_WindowHeight_Proxy(
01954     ISolpackApp __RPC_FAR * This,
01955     /* [retval][out] */ long __RPC_FAR *p);
01956
01957
01958 void __RPC_STUB ISolpackApp_get_WindowHeight_Stub(
01959     IRpcStubBuffer *This,
01960     IRpcChannelBuffer *_pRpcChannelBuffer,
01961     PRPC_MESSAGE _pRpcMessage,
01962     DWORD *_pdwStubPhase);
01963
01964
01965 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_SpacingX_Proxy(
01966     ISolpackApp __RPC_FAR * This,
01967     /* [retval][out] */ long __RPC_FAR *p);
01968
01969
01970 void __RPC_STUB ISolpackApp_get_SpacingX_Stub(
01971     IRpcStubBuffer *This,
01972     IRpcChannelBuffer *_pRpcChannelBuffer,
01973     PRPC_MESSAGE _pRpcMessage,
01974     DWORD *_pdwStubPhase);
01975
01976
01977 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_SpacingY_Proxy(
01978     ISolpackApp __RPC_FAR * This,
01979     /* [retval][out] */ long __RPC_FAR *p);
01980
01981
01982 void __RPC_STUB ISolpackApp_get_SpacingY_Stub(
01983     IRpcStubBuffer *This,
01984     IRpcChannelBuffer *_pRpcChannelBuffer,
01985     PRPC_MESSAGE _pRpcMessage,
01986     DWORD *_pdwStubPhase);
01987
01988
01989 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackApp_get_Fragment_Proxy(
01990     ISolpackApp __RPC_FAR * This,
01991     /* [retval][out] */ ISolpackFragment __RPC_FAR *__RPC_FAR *pp);
01992
01993
01994 void __RPC_STUB ISolpackApp_get_Fragment_Stub(
01995     IRpcStubBuffer *This,
01996     IRpcChannelBuffer *_pRpcChannelBuffer,
01997     PRPC_MESSAGE _pRpcMessage,
01998     DWORD *_pdwStubPhase);
01999
02000
02001 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackApp_CreatePile_Proxy(
02002     ISolpackApp __RPC_FAR * This,
02003     /* [in] */ long lType,
02004     /* [retval][out] */ ISolpackPile __RPC_FAR *__RPC_FAR *ppPile);
02005
02006
02007 void __RPC_STUB ISolpackApp_CreatePile_Stub(
02008     IRpcStubBuffer *This,
02009     IRpcChannelBuffer *_pRpcChannelBuffer,
02010     PRPC_MESSAGE _pRpcMessage,
02011     DWORD *_pdwStubPhase);
02012
02013
02014 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackApp_CreateGameData_Proxy(
02015     ISolpackApp __RPC_FAR * This,
02016     /* [retval][out] */ ISolpackGameData __RPC_FAR *__RPC_FAR *ppGameData);
02017
02018
02019 void __RPC_STUB ISolpackApp_CreateGameData_Stub(
02020     IRpcStubBuffer *This,
02021     IRpcChannelBuffer *_pRpcChannelBuffer,
02022     PRPC_MESSAGE _pRpcMessage,
02023     DWORD *_pdwStubPhase);
02024
02025
02026 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackApp_AddGameCommand_Proxy(
02027     ISolpackApp __RPC_FAR * This,
02028     /* [in] */ long lID,
02029     /* [in] */ BSTR bstrText,
02030     /* [in] */ BSTR bstrHelpText);
02031
02032
02033 void __RPC_STUB ISolpackApp_AddGameCommand_Stub(
02034     IRpcStubBuffer *This,
02035     IRpcChannelBuffer *_pRpcChannelBuffer,
02036     PRPC_MESSAGE _pRpcMessage,
02037     DWORD *_pdwStubPhase);
02038
02039
02040 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackApp_EnableGameCommand_Proxy(
02041     ISolpackApp __RPC_FAR * This,
02042     /* [in] */ long lID,
02043     /* [in] */ VARIANT_BOOL bEnable);
02044
02045
02046 void __RPC_STUB ISolpackApp_EnableGameCommand_Stub(
02047     IRpcStubBuffer *This,
02048     IRpcChannelBuffer *_pRpcChannelBuffer,
02049     PRPC_MESSAGE _pRpcMessage,
02050     DWORD *_pdwStubPhase);
02051
02052
02053 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackApp_GameWon_Proxy(
02054     ISolpackApp __RPC_FAR * This);
02055
02056
02057 void __RPC_STUB ISolpackApp_GameWon_Stub(
02058     IRpcStubBuffer *This,
02059     IRpcChannelBuffer *_pRpcChannelBuffer,
02060     PRPC_MESSAGE _pRpcMessage,
02061     DWORD *_pdwStubPhase);
02062
02063
02064
02065 #endif   /* __ISolpackApp_INTERFACE_DEFINED__ */
02066
02067
02068 #ifndef __ISolpackGame_INTERFACE_DEFINED__
02069 #define __ISolpackGame_INTERFACE_DEFINED__
02070
02071 /* interface ISolpackGame */
02072 /* [unique][helpstring][dual][uuid][object] */
02073
02074
02075 EXTERN_C const IID IID_ISolpackGame;
02076
02077 #if defined(__cplusplus) && !defined(CINTERFACE)
02078
02079     MIDL_INTERFACE("0CBC4045-2CA8-11d6-8301-0020780D1875")
02080     ISolpackGame : public IDispatch
02081     {
02082     public:
02083         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Info(
02084             /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppInfo) = 0;
02085
02086         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Initialize(
02087             /* [in] */ ISolpackApp __RPC_FAR *pApp) = 0;
02088
02089         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0;
02090
02091         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Deal( void) = 0;
02092
02093         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AutoPlay( void) = 0;
02094
02095         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AutoPlayCard(
02096             /* [in] */ ISolpackCard __RPC_FAR *pCard) = 0;
02097
02098         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE HandleCommand(
02099             /* [in] */ long lID) = 0;
02100
02101         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PileClicked(
02102             /* [in] */ ISolpackPile __RPC_FAR *pPile,
02103             /* [in] */ ISolpackCard __RPC_FAR *pCard) = 0;
02104
02105         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetupFragment(
02106             /* [in] */ ISolpackPile __RPC_FAR *pPileSrc,
02107             /* [in] */ ISolpackCard __RPC_FAR *pCardSrc,
02108             /* [in] */ ISolpackFragment __RPC_FAR *pFrag) = 0;
02109
02110         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DropFragment(
02111             /* [in] */ ISolpackFragment __RPC_FAR *pFrag,
02112             /* [in] */ ISolpackPile __RPC_FAR *pDest,
02113             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbValid) = 0;
02114
02115         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CancelMove( void) = 0;
02116
02117         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE RecalcLayout( void) = 0;
02118
02119     };
02120
02121 #else    /* C style interface */
02122
02123     typedef struct ISolpackGameVtbl
02124     {
02125         BEGIN_INTERFACE
02126
02127         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
02128             ISolpackGame __RPC_FAR * This,
02129             /* [in] */ REFIID riid,
02130             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
02131
02132         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
02133             ISolpackGame __RPC_FAR * This);
02134
02135         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
02136             ISolpackGame __RPC_FAR * This);
02137
02138         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
02139             ISolpackGame __RPC_FAR * This,
02140             /* [out] */ UINT __RPC_FAR *pctinfo);
02141
02142         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
02143             ISolpackGame __RPC_FAR * This,
02144             /* [in] */ UINT iTInfo,
02145             /* [in] */ LCID lcid,
02146             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
02147
02148         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
02149             ISolpackGame __RPC_FAR * This,
02150             /* [in] */ REFIID riid,
02151             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
02152             /* [in] */ UINT cNames,
02153             /* [in] */ LCID lcid,
02154             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
02155
02156         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
02157             ISolpackGame __RPC_FAR * This,
02158             /* [in] */ DISPID dispIdMember,
02159             /* [in] */ REFIID riid,
02160             /* [in] */ LCID lcid,
02161             /* [in] */ WORD wFlags,
02162             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
02163             /* [out] */ VARIANT __RPC_FAR *pVarResult,
02164             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
02165             /* [out] */ UINT __RPC_FAR *puArgErr);
02166
02167         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Info )(
02168             ISolpackGame __RPC_FAR * This,
02169             /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppInfo);
02170
02171         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Initialize )(
02172             ISolpackGame __RPC_FAR * This,
02173             /* [in] */ ISolpackApp __RPC_FAR *pApp);
02174
02175         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Uninitialize )(
02176             ISolpackGame __RPC_FAR * This);
02177
02178         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Deal )(
02179             ISolpackGame __RPC_FAR * This);
02180
02181         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AutoPlay )(
02182             ISolpackGame __RPC_FAR * This);
02183
02184         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *AutoPlayCard )(
02185             ISolpackGame __RPC_FAR * This,
02186             /* [in] */ ISolpackCard __RPC_FAR *pCard);
02187
02188         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HandleCommand )(
02189             ISolpackGame __RPC_FAR * This,
02190             /* [in] */ long lID);
02191
02192         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PileClicked )(
02193             ISolpackGame __RPC_FAR * This,
02194             /* [in] */ ISolpackPile __RPC_FAR *pPile,
02195             /* [in] */ ISolpackCard __RPC_FAR *pCard);
02196
02197         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetupFragment )(
02198             ISolpackGame __RPC_FAR * This,
02199             /* [in] */ ISolpackPile __RPC_FAR *pPileSrc,
02200             /* [in] */ ISolpackCard __RPC_FAR *pCardSrc,
02201             /* [in] */ ISolpackFragment __RPC_FAR *pFrag);
02202
02203         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DropFragment )(
02204             ISolpackGame __RPC_FAR * This,
02205             /* [in] */ ISolpackFragment __RPC_FAR *pFrag,
02206             /* [in] */ ISolpackPile __RPC_FAR *pDest,
02207             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbValid);
02208
02209         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CancelMove )(
02210             ISolpackGame __RPC_FAR * This);
02211
02212         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RecalcLayout )(
02213             ISolpackGame __RPC_FAR * This);
02214
02215         END_INTERFACE
02216     } ISolpackGameVtbl;
02217
02218     interface ISolpackGame
02219     {
02220         CONST_VTBL struct ISolpackGameVtbl __RPC_FAR *lpVtbl;
02221     };
02222
02223
02224
02225 #ifdef COBJMACROS
02226
02227
02228 #define ISolpackGame_QueryInterface(This,riid,ppvObject) \
02229     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
02230
02231 #define ISolpackGame_AddRef(This)   \
02232     (This)->lpVtbl -> AddRef(This)
02233
02234 #define ISolpackGame_Release(This)  \
02235     (This)->lpVtbl -> Release(This)
02236
02237
02238 #define ISolpackGame_GetTypeInfoCount(This,pctinfo)   \
02239     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
02240
02241 #define ISolpackGame_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
02242     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
02243
02244 #define ISolpackGame_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
02245     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
02246
02247 #define ISolpackGame_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
02248     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
02249
02250
02251 #define ISolpackGame_get_Info(This,ppInfo)   \
02252     (This)->lpVtbl -> get_Info(This,ppInfo)
02253
02254 #define ISolpackGame_Initialize(This,pApp)   \
02255     (This)->lpVtbl -> Initialize(This,pApp)
02256
02257 #define ISolpackGame_Uninitialize(This)   \
02258     (This)->lpVtbl -> Uninitialize(This)
02259
02260 #define ISolpackGame_Deal(This)  \
02261     (This)->lpVtbl -> Deal(This)
02262
02263 #define ISolpackGame_AutoPlay(This) \
02264     (This)->lpVtbl -> AutoPlay(This)
02265
02266 #define ISolpackGame_AutoPlayCard(This,pCard)   \
02267     (This)->lpVtbl -> AutoPlayCard(This,pCard)
02268
02269 #define ISolpackGame_HandleCommand(This,lID) \
02270     (This)->lpVtbl -> HandleCommand(This,lID)
02271
02272 #define ISolpackGame_PileClicked(This,pPile,pCard) \
02273     (This)->lpVtbl -> PileClicked(This,pPile,pCard)
02274
02275 #define ISolpackGame_SetupFragment(This,pPileSrc,pCardSrc,pFrag)  \
02276     (This)->lpVtbl -> SetupFragment(This,pPileSrc,pCardSrc,pFrag)
02277
02278 #define ISolpackGame_DropFragment(This,pFrag,pDest,pbValid) \
02279     (This)->lpVtbl -> DropFragment(This,pFrag,pDest,pbValid)
02280
02281 #define ISolpackGame_CancelMove(This)  \
02282     (This)->lpVtbl -> CancelMove(This)
02283
02284 #define ISolpackGame_RecalcLayout(This)   \
02285     (This)->lpVtbl -> RecalcLayout(This)
02286
02287 #endif /* COBJMACROS */
02288
02289
02290 #endif   /* C style interface */
02291
02292
02293
02294 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGame_get_Info_Proxy(
02295     ISolpackGame __RPC_FAR * This,
02296     /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppInfo);
02297
02298
02299 void __RPC_STUB ISolpackGame_get_Info_Stub(
02300     IRpcStubBuffer *This,
02301     IRpcChannelBuffer *_pRpcChannelBuffer,
02302     PRPC_MESSAGE _pRpcMessage,
02303     DWORD *_pdwStubPhase);
02304
02305
02306 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_Initialize_Proxy(
02307     ISolpackGame __RPC_FAR * This,
02308     /* [in] */ ISolpackApp __RPC_FAR *pApp);
02309
02310
02311 void __RPC_STUB ISolpackGame_Initialize_Stub(
02312     IRpcStubBuffer *This,
02313     IRpcChannelBuffer *_pRpcChannelBuffer,
02314     PRPC_MESSAGE _pRpcMessage,
02315     DWORD *_pdwStubPhase);
02316
02317
02318 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_Uninitialize_Proxy(
02319     ISolpackGame __RPC_FAR * This);
02320
02321
02322 void __RPC_STUB ISolpackGame_Uninitialize_Stub(
02323     IRpcStubBuffer *This,
02324     IRpcChannelBuffer *_pRpcChannelBuffer,
02325     PRPC_MESSAGE _pRpcMessage,
02326     DWORD *_pdwStubPhase);
02327
02328
02329 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_Deal_Proxy(
02330     ISolpackGame __RPC_FAR * This);
02331
02332
02333 void __RPC_STUB ISolpackGame_Deal_Stub(
02334     IRpcStubBuffer *This,
02335     IRpcChannelBuffer *_pRpcChannelBuffer,
02336     PRPC_MESSAGE _pRpcMessage,
02337     DWORD *_pdwStubPhase);
02338
02339
02340 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_AutoPlay_Proxy(
02341     ISolpackGame __RPC_FAR * This);
02342
02343
02344 void __RPC_STUB ISolpackGame_AutoPlay_Stub(
02345     IRpcStubBuffer *This,
02346     IRpcChannelBuffer *_pRpcChannelBuffer,
02347     PRPC_MESSAGE _pRpcMessage,
02348     DWORD *_pdwStubPhase);
02349
02350
02351 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_AutoPlayCard_Proxy(
02352     ISolpackGame __RPC_FAR * This,
02353     /* [in] */ ISolpackCard __RPC_FAR *pCard);
02354
02355
02356 void __RPC_STUB ISolpackGame_AutoPlayCard_Stub(
02357     IRpcStubBuffer *This,
02358     IRpcChannelBuffer *_pRpcChannelBuffer,
02359     PRPC_MESSAGE _pRpcMessage,
02360     DWORD *_pdwStubPhase);
02361
02362
02363 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_HandleCommand_Proxy(
02364     ISolpackGame __RPC_FAR * This,
02365     /* [in] */ long lID);
02366
02367
02368 void __RPC_STUB ISolpackGame_HandleCommand_Stub(
02369     IRpcStubBuffer *This,
02370     IRpcChannelBuffer *_pRpcChannelBuffer,
02371     PRPC_MESSAGE _pRpcMessage,
02372     DWORD *_pdwStubPhase);
02373
02374
02375 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_PileClicked_Proxy(
02376     ISolpackGame __RPC_FAR * This,
02377     /* [in] */ ISolpackPile __RPC_FAR *pPile,
02378     /* [in] */ ISolpackCard __RPC_FAR *pCard);
02379
02380
02381 void __RPC_STUB ISolpackGame_PileClicked_Stub(
02382     IRpcStubBuffer *This,
02383     IRpcChannelBuffer *_pRpcChannelBuffer,
02384     PRPC_MESSAGE _pRpcMessage,
02385     DWORD *_pdwStubPhase);
02386
02387
02388 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_SetupFragment_Proxy(
02389     ISolpackGame __RPC_FAR * This,
02390     /* [in] */ ISolpackPile __RPC_FAR *pPileSrc,
02391     /* [in] */ ISolpackCard __RPC_FAR *pCardSrc,
02392     /* [in] */ ISolpackFragment __RPC_FAR *pFrag);
02393
02394
02395 void __RPC_STUB ISolpackGame_SetupFragment_Stub(
02396     IRpcStubBuffer *This,
02397     IRpcChannelBuffer *_pRpcChannelBuffer,
02398     PRPC_MESSAGE _pRpcMessage,
02399     DWORD *_pdwStubPhase);
02400
02401
02402 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_DropFragment_Proxy(
02403     ISolpackGame __RPC_FAR * This,
02404     /* [in] */ ISolpackFragment __RPC_FAR *pFrag,
02405     /* [in] */ ISolpackPile __RPC_FAR *pDest,
02406     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *pbValid);
02407
02408
02409 void __RPC_STUB ISolpackGame_DropFragment_Stub(
02410     IRpcStubBuffer *This,
02411     IRpcChannelBuffer *_pRpcChannelBuffer,
02412     PRPC_MESSAGE _pRpcMessage,
02413     DWORD *_pdwStubPhase);
02414
02415
02416 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_CancelMove_Proxy(
02417     ISolpackGame __RPC_FAR * This);
02418
02419
02420 void __RPC_STUB ISolpackGame_CancelMove_Stub(
02421     IRpcStubBuffer *This,
02422     IRpcChannelBuffer *_pRpcChannelBuffer,
02423     PRPC_MESSAGE _pRpcMessage,
02424     DWORD *_pdwStubPhase);
02425
02426
02427 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGame_RecalcLayout_Proxy(
02428     ISolpackGame __RPC_FAR * This);
02429
02430
02431 void __RPC_STUB ISolpackGame_RecalcLayout_Stub(
02432     IRpcStubBuffer *This,
02433     IRpcChannelBuffer *_pRpcChannelBuffer,
02434     PRPC_MESSAGE _pRpcMessage,
02435     DWORD *_pdwStubPhase);
02436
02437
02438
02439 #endif   /* __ISolpackGame_INTERFACE_DEFINED__ */
02440
02441
02442 #ifndef __ISolpackGameLib_INTERFACE_DEFINED__
02443 #define __ISolpackGameLib_INTERFACE_DEFINED__
02444
02445 /* interface ISolpackGameLib */
02446 /* [unique][helpstring][dual][uuid][object] */
02447
02448
02449 EXTERN_C const IID IID_ISolpackGameLib;
02450
02451 #if defined(__cplusplus) && !defined(CINTERFACE)
02452
02453     MIDL_INTERFACE("0CBC4049-2CA8-11d6-8301-0020780D1875")
02454     ISolpackGameLib : public IDispatch
02455     {
02456     public:
02457         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Author(
02458             /* [retval][out] */ BSTR __RPC_FAR *p) = 0;
02459
02460         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Email(
02461             /* [retval][out] */ BSTR __RPC_FAR *p) = 0;
02462
02463         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_WebSite(
02464             /* [retval][out] */ BSTR __RPC_FAR *p) = 0;
02465
02466         virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NumGames(
02467             /* [retval][out] */ long __RPC_FAR *p) = 0;
02468
02469         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetGame(
02470             /* [in] */ long lIndex,
02471             /* [retval][out] */ ISolpackGame __RPC_FAR *__RPC_FAR *ppGame) = 0;
02472
02473         virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetGameInfo(
02474             /* [in] */ long lIndex,
02475             /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppGameInfo) = 0;
02476
02477     };
02478
02479 #else    /* C style interface */
02480
02481     typedef struct ISolpackGameLibVtbl
02482     {
02483         BEGIN_INTERFACE
02484
02485         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
02486             ISolpackGameLib __RPC_FAR * This,
02487             /* [in] */ REFIID riid,
02488             /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
02489
02490         ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
02491             ISolpackGameLib __RPC_FAR * This);
02492
02493         ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
02494             ISolpackGameLib __RPC_FAR * This);
02495
02496         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
02497             ISolpackGameLib __RPC_FAR * This,
02498             /* [out] */ UINT __RPC_FAR *pctinfo);
02499
02500         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
02501             ISolpackGameLib __RPC_FAR * This,
02502             /* [in] */ UINT iTInfo,
02503             /* [in] */ LCID lcid,
02504             /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
02505
02506         HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
02507             ISolpackGameLib __RPC_FAR * This,
02508             /* [in] */ REFIID riid,
02509             /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
02510             /* [in] */ UINT cNames,
02511             /* [in] */ LCID lcid,
02512             /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
02513
02514         /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
02515             ISolpackGameLib __RPC_FAR * This,
02516             /* [in] */ DISPID dispIdMember,
02517             /* [in] */ REFIID riid,
02518             /* [in] */ LCID lcid,
02519             /* [in] */ WORD wFlags,
02520             /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
02521             /* [out] */ VARIANT __RPC_FAR *pVarResult,
02522             /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
02523             /* [out] */ UINT __RPC_FAR *puArgErr);
02524
02525         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Author )(
02526             ISolpackGameLib __RPC_FAR * This,
02527             /* [retval][out] */ BSTR __RPC_FAR *p);
02528
02529         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Email )(
02530             ISolpackGameLib __RPC_FAR * This,
02531             /* [retval][out] */ BSTR __RPC_FAR *p);
02532
02533         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_WebSite )(
02534             ISolpackGameLib __RPC_FAR * This,
02535             /* [retval][out] */ BSTR __RPC_FAR *p);
02536
02537         /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_NumGames )(
02538             ISolpackGameLib __RPC_FAR * This,
02539             /* [retval][out] */ long __RPC_FAR *p);
02540
02541         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetGame )(
02542             ISolpackGameLib __RPC_FAR * This,
02543             /* [in] */ long lIndex,
02544             /* [retval][out] */ ISolpackGame __RPC_FAR *__RPC_FAR *ppGame);
02545
02546         /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetGameInfo )(
02547             ISolpackGameLib __RPC_FAR * This,
02548             /* [in] */ long lIndex,
02549             /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppGameInfo);
02550
02551         END_INTERFACE
02552     } ISolpackGameLibVtbl;
02553
02554     interface ISolpackGameLib
02555     {
02556         CONST_VTBL struct ISolpackGameLibVtbl __RPC_FAR *lpVtbl;
02557     };
02558
02559
02560
02561 #ifdef COBJMACROS
02562
02563
02564 #define ISolpackGameLib_QueryInterface(This,riid,ppvObject) \
02565     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
02566
02567 #define ISolpackGameLib_AddRef(This)   \
02568     (This)->lpVtbl -> AddRef(This)
02569
02570 #define ISolpackGameLib_Release(This)  \
02571     (This)->lpVtbl -> Release(This)
02572
02573
02574 #define ISolpackGameLib_GetTypeInfoCount(This,pctinfo)   \
02575     (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
02576
02577 #define ISolpackGameLib_GetTypeInfo(This,iTInfo,lcid,ppTInfo)  \
02578     (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
02579
02580 #define ISolpackGameLib_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)  \
02581     (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
02582
02583 #define ISolpackGameLib_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)  \
02584     (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
02585
02586
02587 #define ISolpackGameLib_get_Author(This,p)   \
02588     (This)->lpVtbl -> get_Author(This,p)
02589
02590 #define ISolpackGameLib_get_Email(This,p) \
02591     (This)->lpVtbl -> get_Email(This,p)
02592
02593 #define ISolpackGameLib_get_WebSite(This,p)  \
02594     (This)->lpVtbl -> get_WebSite(This,p)
02595
02596 #define ISolpackGameLib_get_NumGames(This,p) \
02597     (This)->lpVtbl -> get_NumGames(This,p)
02598
02599 #define ISolpackGameLib_GetGame(This,lIndex,ppGame)   \
02600     (This)->lpVtbl -> GetGame(This,lIndex,ppGame)
02601
02602 #define ISolpackGameLib_GetGameInfo(This,lIndex,ppGameInfo) \
02603     (This)->lpVtbl -> GetGameInfo(This,lIndex,ppGameInfo)
02604
02605 #endif /* COBJMACROS */
02606
02607
02608 #endif   /* C style interface */
02609
02610
02611
02612 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_Author_Proxy(
02613     ISolpackGameLib __RPC_FAR * This,
02614     /* [retval][out] */ BSTR __RPC_FAR *p);
02615
02616
02617 void __RPC_STUB ISolpackGameLib_get_Author_Stub(
02618     IRpcStubBuffer *This,
02619     IRpcChannelBuffer *_pRpcChannelBuffer,
02620     PRPC_MESSAGE _pRpcMessage,
02621     DWORD *_pdwStubPhase);
02622
02623
02624 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_Email_Proxy(
02625     ISolpackGameLib __RPC_FAR * This,
02626     /* [retval][out] */ BSTR __RPC_FAR *p);
02627
02628
02629 void __RPC_STUB ISolpackGameLib_get_Email_Stub(
02630     IRpcStubBuffer *This,
02631     IRpcChannelBuffer *_pRpcChannelBuffer,
02632     PRPC_MESSAGE _pRpcMessage,
02633     DWORD *_pdwStubPhase);
02634
02635
02636 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_WebSite_Proxy(
02637     ISolpackGameLib __RPC_FAR * This,
02638     /* [retval][out] */ BSTR __RPC_FAR *p);
02639
02640
02641 void __RPC_STUB ISolpackGameLib_get_WebSite_Stub(
02642     IRpcStubBuffer *This,
02643     IRpcChannelBuffer *_pRpcChannelBuffer,
02644     PRPC_MESSAGE _pRpcMessage,
02645     DWORD *_pdwStubPhase);
02646
02647
02648 /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_get_NumGames_Proxy(
02649     ISolpackGameLib __RPC_FAR * This,
02650     /* [retval][out] */ long __RPC_FAR *p);
02651
02652
02653 void __RPC_STUB ISolpackGameLib_get_NumGames_Stub(
02654     IRpcStubBuffer *This,
02655     IRpcChannelBuffer *_pRpcChannelBuffer,
02656     PRPC_MESSAGE _pRpcMessage,
02657     DWORD *_pdwStubPhase);
02658
02659
02660 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_GetGame_Proxy(
02661     ISolpackGameLib __RPC_FAR * This,
02662     /* [in] */ long lIndex,
02663     /* [retval][out] */ ISolpackGame __RPC_FAR *__RPC_FAR *ppGame);
02664
02665
02666 void __RPC_STUB ISolpackGameLib_GetGame_Stub(
02667     IRpcStubBuffer *This,
02668     IRpcChannelBuffer *_pRpcChannelBuffer,
02669     PRPC_MESSAGE _pRpcMessage,
02670     DWORD *_pdwStubPhase);
02671
02672
02673 /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISolpackGameLib_GetGameInfo_Proxy(
02674     ISolpackGameLib __RPC_FAR * This,
02675     /* [in] */ long lIndex,
02676     /* [retval][out] */ ISolpackGameInfo __RPC_FAR *__RPC_FAR *ppGameInfo);
02677
02678
02679 void __RPC_STUB ISolpackGameLib_GetGameInfo_Stub(
02680     IRpcStubBuffer *This,
02681     IRpcChannelBuffer *_pRpcChannelBuffer,
02682     PRPC_MESSAGE _pRpcMessage,
02683     DWORD *_pdwStubPhase);
02684
02685
02686
02687 #endif   /* __ISolpackGameLib_INTERFACE_DEFINED__ */
02688
02689 #endif /* __SolpackLib_LIBRARY_DEFINED__ */
02690
02691 /* Additional Prototypes for ALL interfaces */
02692
02693 /* end of Additional Prototypes */
02694
02695 #ifdef __cplusplus
02696 }
02697 #endif
02698
02699 #endif
02700
02701
Generated on Wed May 8 12:39:11 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.idl File Reference

#include "solpackdid.h"

Go to the source code of this file.

Namespaces

namespace SolpackLib

Functions

DEFINE_GUID (CATID_SolpackGameLibs, 0x0cbc4040, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75)

Function Documentation

DEFINE_GUID | ( | CATID_SolpackGameLibs | ,
 |  | 0x0cbc4040 | ,
 |  | 0x2ca8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x0 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0xd | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

Generated on Wed May 8 12:39:25 2002 for Solitaire Pack by doxygen 1.2.15


Solpack.idl Source File

Solpack.idl

Go to the documentation of this file.
00001 //
00002 // Solitaire Pack
00003 // Copyright (C) 2002 Bot Productions
00004 //
00005 // Solpack.idl
00006 // IDL source code
00007 //
00008
00009 cpp_quote("//--------------------------------------------------------------------------")
00010 cpp_quote("//")
00011 cpp_quote("//  Solitaire Pack")
00012 cpp_quote("//  Copyright (C) 2002 Bot Productions")
00013 cpp_quote("//")
00014 cpp_quote("//--------------------------------------------------------------------------")
00015
00016
00017 #include "solpackdid.h"
00018
00019 import "oaidl.idl";
00020
00021 cpp_quote("")
00022 cpp_quote("")
00023
00024 cpp_quote("// {0CBC4042-2CA8-11d6-8301-0020780D1875}")
00025 cpp_quote("DEFINE_GUID(CATID_SolpackGameLibs, 0x0cbc4040, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75);")
00026 cpp_quote("")
00027
00028
00029 //
00030 // Component and type library descriptions
00031 //
00032 [
00033    uuid(0CBC4043-2CA8-11d6-8301-0020780D1875),
00034    version(1.0),
00035    helpstring("Solitaire Pack 1.0 Type Library")
00036 ]
00037 library SolpackLib
00038 {
00039    importlib("stdole32.tlb");
00040
00041
00042 //----------------------------------------------------------------------------
00043 // Enumeration SOLPACKRANK
00044 //----------------------------------------------------------------------------
00045 typedef
00046 [
00047    helpstring("Rank of a card."),
00048    public
00049 ]
00050 enum tagSOLPACKRANK
00051 {
00052    RANK_ACE    = 1,
00053    RANK_2      = 2,
00054    RANK_3      = 3,
00055    RANK_4      = 4,
00056    RANK_5      = 5,
00057    RANK_6      = 6,
00058    RANK_7      = 7,
00059    RANK_8      = 8,
00060    RANK_9      = 9,
00061    RANK_10     = 10,
00062    RANK_JACK   = 11,
00063    RANK_QUEEN  = 12,
00064    RANK_KING   = 13
00065 } SOLPACKRANK;
00066
00067
00068 //----------------------------------------------------------------------------
00069 // Enumeration SOLPACKSUIT
00070 //----------------------------------------------------------------------------
00071 typedef
00072 [
00073    helpstring("Suit of a card."),
00074    public
00075 ]
00076 enum tagSOLPACKSUIT
00077 {
00078    SUIT_CLUB      = 1,
00079    SUIT_DIAMOND   = 2,
00080    SUIT_HEART     = 3,
00081    SUIT_SPADE     = 4
00082 } SOLPACKSUIT;
00083
00084
00085 //----------------------------------------------------------------------------
00086 // Enumeration SOLPACKDIFFICULTY
00087 //----------------------------------------------------------------------------
00088 typedef
00089 [
00090    helpstring("Difficulty ranking of a game."),
00091    public
00092 ]
00093 enum tagSOLPACKDIFFICULTY
00094 {
00095    [helpstring("The game is typically won at least one out of three times.")]
00096    DIFFICULTY_EASY   = 1,
00097
00098    [helpstring("The game is typically won once every four to ten times.")]
00099    DIFFICULTY_MEDIUM = 2,
00100
00101    [helpstring("The game is typically won less than once for every ten times.")]
00102    DIFFICULTY_HARD   = 3
00103
00104 } SOLPACKDIFFICULTY;
00105
00106
00107 //----------------------------------------------------------------------------
00108 // Enumeration SOLPACKPILETYPE
00109 //----------------------------------------------------------------------------
00110 typedef
00111 [
00112    helpstring("Shape and behavior of a pile."),
00113    public
00114 ]
00115 enum tagSOLPACKPILETYPE
00116 {
00117    [helpstring("The pile is a deck, created initially with 52 card objects. All cards are positioned at position (0,0).")]
00118    PILE_DECK         = 1,
00119
00120    [helpstring("A single, squared-up stack of cards, where every 8th card is offset to present a 3D stack look.")]
00121    PILE_STACK        = 2,
00122
00123    [helpstring("A spread pile of cards, in which all are visible. The spread is horizontal; the right-most card is on top.")]
00124    PILE_TABLEAURIGHT = 3,
00125
00126    [helpstring("A spread pile of cards, in which all are visible. The spread is vertical; the bottom-most card is on top.")]
00127    PILE_TABLEAUDOWN  = 4,
00128
00129    [helpstring("A single, squared-up stack of cards as turned up from a stack.")]
00130    PILE_TALON        = 5,
00131
00132    [helpstring("A stack of cards, as turned up three at a time from a stack.")]
00133    PILE_TALON3       = 6,
00134
00135    [helpstring("A fragment of cards, with no specific layout.")]
00136    PILE_FRAGMENT     = 7
00137
00138 } SOLPACKPILETYPE;
00139
00140
00141 //----------------------------------------------------------------------------
00142 // Enumeration SOLPACKBASETYPE
00143 //----------------------------------------------------------------------------
00144 typedef
00145 [
00146    helpstring("which image to use for the base of an empty pile."),
00147    public
00148 ]
00149 enum tagSOLPACKBASETYPE
00150 {
00151    [helpstring("No base image is shown.")]
00152    BASE_NONE         = 0,
00153
00154    [helpstring("A simple frame, commonly used for tableau piles.")]
00155    BASE_FRAME        = 1,
00156
00157    [helpstring("A dot-filled frame commonly used for foundations.")]
00158    BASE_FOUNDATION   = 2,
00159
00160    [helpstring("A frame with a circle, commonly used to represent a pile that can be cycled through again.")]
00161    BASE_REDEAL       = 3,
00162
00163    [helpstring("A frame with an X, commonly used to represent a pile that cannot be cycled through again.")]
00164    BASE_NOREDEAL     = 4
00165
00166 } SOLPACKBASETYPE;
00167
00168
00169 //----------------------------------------------------------------------------
00170 // Forward Declarations
00171 //----------------------------------------------------------------------------
00172 interface ISolpackPile;
00173 interface ISolpackFragment;
00174 interface ISolpackCard;
00175 interface ISolpackGameInfo;
00176 interface ISolpackGameData;
00177
00178
00179 //----------------------------------------------------------------------------
00180 // Interface ISolpackApp
00181 //----------------------------------------------------------------------------
00182 [
00183    object,
00184    uuid(0CBC4044-2CA8-11d6-8301-0020780D1875),
00185    dual,
00186    helpstring("ISolpackApp Interface"),
00187    pointer_default(unique)
00188 ]
00189 interface ISolpackApp : IDispatch
00190 {
00191    [
00192       propget,
00193       id(DISPID_SOLPACK_APP_CARDWIDTH),
00194       helpstring("Width of a card, in pixels.")
00195    ]
00196    HRESULT CardWidth([out, retval] long *p);
00197
00198    [
00199       propget,
00200       id(DISPID_SOLPACK_APP_CARDHEIGHT),
00201       helpstring("Height of a card, in pixels.")
00202    ]
00203    HRESULT CardHeight([out, retval] long *p);
00204
00205    [
00206       propget,
00207       id(DISPID_SOLPACK_APP_SCORE),
00208       helpstring("Score of the current game.")
00209    ]
00210    HRESULT Score([out, retval] long *p);
00211    [
00212       propput,
00213       id(DISPID_SOLPACK_APP_SCORE),
00214       helpstring("Score of the current game.")
00215    ]
00216    HRESULT Score([in] long v);
00217
00218    [
00219       propget,
00220       id(DISPID_SOLPACK_APP_WINDOWWIDTH),
00221       helpstring("Width of the available window space, in pixels.")
00222    ]
00223    HRESULT WindowWidth([out, retval] long *p);
00224
00225    [
00226       propget,
00227       id(DISPID_SOLPACK_APP_WINDOWHEIGHT),
00228       helpstring("Height of the available window space, in pixels.")
00229    ]
00230    HRESULT WindowHeight([out, retval] long *p);
00231
00232    [
00233       propget,
00234       id(DISPID_SOLPACK_APP_SPACINGX),
00235       helpstring("Recommended horizontal space, in pixels, between two piles.")
00236    ]
00237    HRESULT SpacingX([out, retval] long *p);
00238
00239    [
00240       propget,
00241       id(DISPID_SOLPACK_APP_SPACINGY),
00242       helpstring("Recommended horizontal space, in pixels, between two piles.")
00243    ]
00244    HRESULT SpacingY([out, retval] long *p);
00245
00246    [
00247       propget,
00248       id(DISPID_SOLPACK_APP_FRAGMENT),
00249       helpstring("The fragment used to transfer cards.")
00250    ]
00251    HRESULT Fragment([out, retval] ISolpackFragment **pp);
00252
00253    [
00254       id(DISPID_SOLPACK_APP_CREATEPILE),
00255       helpstring("Creates and returns a pile of the specified type.")
00256    ]
00257    HRESULT CreatePile([in] long lType, [out, retval] ISolpackPile **ppPile);
00258
00259    [
00260       id(DISPID_SOLPACK_APP_CREATEGAMEDATA),
00261       helpstring("Creates and returns an object to store game-specific variable data.")
00262    ]
00263    HRESULT CreateGameData([out, retval] ISolpackGameData **ppGameData);
00264
00265    [
00266       id(DISPID_SOLPACK_APP_ADDGAMECOMMAND),
00267       helpstring("Adds a custom command to be made available to the user.")
00268    ]
00269    HRESULT AddGameCommand([in] long lID, [in] BSTR bstrText, [in] BSTR bstrHelpText);
00270
00271    [
00272       id(DISPID_SOLPACK_APP_ENABLEGAMECOMMAND),
00273       helpstring("Enables or disables the user interface for a custom game command.")
00274    ]
00275    HRESULT EnableGameCommand([in] long lID, [in] VARIANT_BOOL bEnable);
00276
00277    [
00278       id(DISPID_SOLPACK_APP_GAMEWON),
00279       helpstring("Indicates that the user has won the Solitaire game.")
00280    ]
00281    HRESULT GameWon();
00282 }
00283
00284
00285 //----------------------------------------------------------------------------
00286 // Interface ISolpackGame
00287 //----------------------------------------------------------------------------
00288 [
00289    object,
00290    uuid(0CBC4045-2CA8-11d6-8301-0020780D1875),
00291    dual,
00292    helpstring("ISolpackGame Interface"),
00293    pointer_default(unique)
00294 ]
00295 interface ISolpackGame : IDispatch
00296 {
00297    [
00298       propget,
00299       id(DISPID_SOLPACK_GAME_INFO),
00300       helpstring("Static information about the game.")
00301    ]
00302    HRESULT Info([out, retval] ISolpackGameInfo **ppInfo);
00303
00304    [
00305       id(DISPID_SOLPACK_GAME_INITIALIZE),
00306       helpstring("Sets up decks and piles for the game.")
00307    ]
00308    HRESULT Initialize([in] ISolpackApp *pApp);
00309
00310    [
00311       id(DISPID_SOLPACK_GAME_UNINITIALIZE),
00312       helpstring("Releases all objects that were created.")
00313    ]
00314    HRESULT Uninitialize();
00315
00316    [
00317       id(DISPID_SOLPACK_GAME_DEAL),
00318       helpstring("Deals out a game of Solitaire.")
00319    ]
00320    HRESULT Deal();
00321
00322    [
00323       id(DISPID_SOLPACK_GAME_AUTOPLAY),
00324       helpstring("Plays all possible cards to foundations.")
00325    ]
00326    HRESULT AutoPlay();
00327
00328    [
00329       id(DISPID_SOLPACK_GAME_AUTOPLAYCARD),
00330       helpstring("Plays the specified card to a foundation, if possible.")
00331    ]
00332    HRESULT AutoPlayCard([in] ISolpackCard *pCard);
00333
00334    [
00335       id(DISPID_SOLPACK_GAME_HANDLECOMMAND),
00336       helpstring("Handles a custom game command previously added via AddGameCommand.")
00337    ]
00338    HRESULT HandleCommand([in] long lID);
00339
00340    [
00341       id(DISPID_SOLPACK_GAME_PILECLICKED),
00342       helpstring("Informs the game that a pile was single-clicked.")
00343    ]
00344    HRESULT PileClicked([in] ISolpackPile *pPile, [in] ISolpackCard *pCard);
00345
00346    [
00347       id(DISPID_SOLPACK_GAME_SETUPFRAGMENT),
00348       helpstring("Initiates a drag operation, adding cards to the specified fragment.")
00349    ]
00350    HRESULT SetupFragment([in] ISolpackPile *pPileSrc, [in] ISolpackCard *pCardSrc,
00351       [in] ISolpackFragment *pFrag);
00352
00353    [
00354       id(DISPID_SOLPACK_GAME_DROPFRAGMENT),
00355       helpstring("If possible, drops the cards from the specified fragment onto the specified pile.")
00356    ]
00357    HRESULT DropFragment([in] ISolpackFragment *pFrag, [in] ISolpackPile *pDest,
00358       [out, retval] VARIANT_BOOL *pbValid);
00359
00360    [
00361       id(DISPID_SOLPACK_GAME_CANCELMOVE),
00362       helpstring("Informs the game that the user has canceled the drag operation.")
00363    ]
00364    HRESULT CancelMove();
00365
00366    [
00367       id(DISPID_SOLPACK_GAME_RECALCLAYOUT),
00368       helpstring("Informs the game that an engine property, such as card or window dimensions, has changed.")
00369    ]
00370    HRESULT RecalcLayout();
00371 }
00372
00373
00374 //----------------------------------------------------------------------------
00375 // Interface ISolpackPile
00376 //----------------------------------------------------------------------------
00377 [
00378    object,
00379    uuid(0CBC4046-2CA8-11d6-8301-0020780D1875),
00380    dual,
00381    helpstring("ISolpackPile Interface"),
00382    pointer_default(unique)
00383 ]
00384 interface ISolpackPile : IDispatch
00385 {
00386    [
00387       propget,
00388       id(DISPID_SOLPACK_PILE_TYPE),
00389       helpstring("Type of the pile, defined when it is created.")
00390    ]
00391    HRESULT Type([out, retval] long *p);
00392
00393    [
00394       propget,
00395       id(DISPID_SOLPACK_PILE_X),
00396       helpstring("X-coordinate of the pile.")
00397    ]
00398    HRESULT X([out, retval] long *p);
00399    [
00400       propput,
00401       id(DISPID_SOLPACK_PILE_X),
00402       helpstring("X-coordinate of the pile.")
00403    ]
00404    HRESULT X([in] long v);
00405
00406    [
00407       propget,
00408       id(DISPID_SOLPACK_PILE_Y),
00409       helpstring("Y-coordinate of the pile.")
00410    ]
00411    HRESULT Y([out, retval] long *p);
00412    [
00413       propput,
00414       id(DISPID_SOLPACK_PILE_Y),
00415       helpstring("Y-coordinate of the pile.")
00416    ]
00417    HRESULT Y([in] long v);
00418
00419    [
00420       propget,
00421       id(DISPID_SOLPACK_PILE_WIDTH),
00422       helpstring("Current width of the pile, in pixels.")
00423    ]
00424    HRESULT Width([out, retval] long *p);
00425
00426    [
00427       propget,
00428       id(DISPID_SOLPACK_PILE_HEIGHT),
00429       helpstring("Current height of the pile, in pixels.")
00430    ]
00431    HRESULT Height([out, retval] long *p);
00432
00433    [
00434       propget,
00435       id(DISPID_SOLPACK_PILE_NUMCARDS),
00436       helpstring("Number of cards in the pile.")
00437    ]
00438    HRESULT NumCards([out, retval] long *p);
00439
00440    [
00441       propget,
00442       id(DISPID_SOLPACK_PILE_COMMENTTOOLTIP),
00443       helpstring("Text to display as the pile's tooltip.")
00444    ]
00445    HRESULT CommentTooltip([out, retval] BSTR *pbstrText);
00446    [
00447       propput,
00448       id(DISPID_SOLPACK_PILE_COMMENTTOOLTIP),
00449       helpstring("Text to display as the pile's tooltip.")
00450    ]
00451    HRESULT CommentTooltip([in] BSTR bstrText);
00452
00453    [
00454       propget,
00455       id(DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP),
00456       helpstring("Whether to display the count of cards in the pile's tooltip.")
00457    ]
00458    HRESULT ShowNumCardsTooltip([out, retval] VARIANT_BOOL *pbShow);
00459    [
00460       propput,
00461       id(DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP),
00462       helpstring("Whether to display the count of cards in the pile's tooltip.")
00463    ]
00464    HRESULT ShowNumCardsTooltip([in] VARIANT_BOOL bShowNum);
00465
00466    [
00467       propget,
00468       id(DISPID_SOLPACK_PILE_BASETYPE),
00469       helpstring("Base image the pile displays.")
00470    ]
00471    HRESULT BaseType([out, retval] long *p);
00472    [
00473       propput,
00474       id(DISPID_SOLPACK_PILE_BASETYPE),
00475       helpstring("Base image the pile displays.")
00476    ]
00477    HRESULT BaseType([in] long v);
00478
00479    [
00480       id(DISPID_SOLPACK_PILE_SHUFFLE),
00481       helpstring("Randomizes the positions of the cards in the pile.")
00482    ]
00483    HRESULT Shuffle();
00484
00485    [
00486       id(DISPID_SOLPACK_PILE_GETCARD),
00487       helpstring("Retrieves the card at the specified index.")
00488    ]
00489    HRESULT GetCard([in] long lIndex, [out, retval] ISolpackCard **ppCard);
00490
00491    [
00492       id(DISPID_SOLPACK_PILE_WIDTHWITH),
00493       helpstring("Retrieves the width the pile would have with a given number of cards.")
00494    ]
00495    HRESULT WidthWith([in] long lNumCards, [out, retval] long *plWidth);
00496
00497    [
00498       id(DISPID_SOLPACK_PILE_HEIGHTWITH),
00499       helpstring("Retrieves the height the pile would have with a given number of cards.")
00500    ]
00501    HRESULT HeightWith([in] long lNumCards, [out, retval] long *plHeight);
00502 }
00503
00504
00505 //----------------------------------------------------------------------------
00506 // Interface ISolpackCard
00507 //----------------------------------------------------------------------------
00508 [
00509    object,
00510    uuid(0CBC4047-2CA8-11d6-8301-0020780D1875),
00511    dual,
00512    helpstring("ISolpackCard Interface"),
00513    pointer_default(unique)
00514 ]
00515 interface ISolpackCard : IDispatch
00516 {
00517    [
00518       propget,
00519       id(DISPID_SOLPACK_CARD_ID),
00520       helpstring("Card's identifier, a number from 1 to 52.")
00521    ]
00522    HRESULT ID([out, retval] long *p);
00523
00524    [
00525       propget,
00526       id(DISPID_SOLPACK_CARD_RANK),
00527       helpstring("Rank of the card.")
00528    ]
00529    HRESULT Rank([out, retval] long *p);
00530
00531    [
00532       propget,
00533       id(DISPID_SOLPACK_CARD_SUIT),
00534       helpstring("Suit of the card.")
00535    ]
00536    HRESULT Suit([out, retval] long *p);
00537
00538    [
00539       propget,
00540       id(DISPID_SOLPACK_CARD_CANDRAG),
00541       helpstring("Whether the card can be dragged.")
00542    ]
00543    HRESULT CanDrag([out, retval] VARIANT_BOOL *pbCanDrag);
00544    [
00545       propput,
00546       id(DISPID_SOLPACK_CARD_CANDRAG),
00547       helpstring("Whether the card can be dragged.")
00548    ]
00549    HRESULT CanDrag([in] VARIANT_BOOL bCanDrag);
00550
00551    [
00552       propget,
00553       id(DISPID_SOLPACK_CARD_FACEUP),
00554       helpstring("Whether the card is face up.")
00555    ]
00556    HRESULT FaceUp([out, retval] VARIANT_BOOL *pbFaceUp);
00557    [
00558       propput,
00559       id(DISPID_SOLPACK_CARD_FACEUP),
00560       helpstring("Whether the card is face up.")
00561    ]
00562    HRESULT FaceUp([in] VARIANT_BOOL bFaceUp);
00563
00564    [
00565       propget,
00566       id(DISPID_SOLPACK_CARD_PILE),
00567       helpstring("Pile that currently contains the card")
00568    ]
00569    HRESULT Pile([out, retval] ISolpackPile **pp);
00570
00571    [
00572       propget,
00573       id(DISPID_SOLPACK_CARD_INDEX),
00574       helpstring("The index of the card within its pile.")
00575    ]
00576    HRESULT Index([out, retval] long *p);
00577
00578    [
00579       propput,
00580       id(DISPID_SOLPACK_CARD_INDEX),
00581       helpstring("The index of the card within its pile.")
00582    ]
00583    HRESULT Index([in] long v);
00584 };
00585
00586
00587 //----------------------------------------------------------------------------
00588 // Interface ISolpackFragment
00589 //----------------------------------------------------------------------------
00590 [
00591    object,
00592    uuid(0CBC4048-2CA8-11d6-8301-0020780D1875),
00593    dual,
00594    helpstring("ISolpackFragment Interface"),
00595    pointer_default(unique)
00596 ]
00597 interface ISolpackFragment : ISolpackPile
00598 {
00599    [
00600       id(DISPID_SOLPACK_FRAGMENT_ADDTOFRAGMENT),
00601       helpstring("Adds the specified card or pile to the fragment.")
00602    ]
00603    HRESULT AddToFragment([in] IDispatch *pObj);
00604
00605    [
00606       id(DISPID_SOLPACK_FRAGMENT_MOVETOPILE),
00607       helpstring("Adds the specified card or pile to the fragment.")
00608    ]
00609    HRESULT MoveToPile([in] ISolpackPile *pDest, [in] long lIndex, [in] VARIANT_BOOL bAnimate,
00610       [in] VARIANT_BOOL bToggleFace);
00611 }
00612
00613
00614 //----------------------------------------------------------------------------
00615 // Interface ISolpackGameLib
00616 //----------------------------------------------------------------------------
00617 [
00618    object,
00619    uuid(0CBC4049-2CA8-11d6-8301-0020780D1875),
00620    dual,
00621    helpstring("ISolpackGameLib Interface"),
00622    pointer_default(unique)
00623 ]
00624 interface ISolpackGameLib : IDispatch
00625 {
00626    [
00627       propget,
00628       id(DISPID_SOLPACK_GAMELIB_AUTHOR),
00629       helpstring("Name of the person or company who developed the game library.")
00630    ]
00631    HRESULT Author([out, retval] BSTR *p);
00632
00633    [
00634       propget,
00635       id(DISPID_SOLPACK_GAMELIB_EMAIL),
00636       helpstring("E-mail address of the author.")
00637    ]
00638    HRESULT Email([out, retval] BSTR *p);
00639
00640    [
00641       propget,
00642       id(DISPID_SOLPACK_GAMELIB_WEBSITE),
00643       helpstring("Web site address of the author.")
00644    ]
00645    HRESULT WebSite([out, retval] BSTR *p);
00646
00647    [
00648       propget,
00649       id(DISPID_SOLPACK_GAMELIB_NUMGAMES),
00650       helpstring("Count of games implemented in the game library.")
00651    ]
00652    HRESULT NumGames([out, retval] long *p);
00653
00654    [
00655       id(DISPID_SOLPACK_GAMELIB_GETGAME),
00656       helpstring("Creates and returns an instance of the specified game object.")
00657    ]
00658    HRESULT GetGame([in] long lIndex, [out, retval] ISolpackGame **ppGame);
00659
00660    [
00661       id(DISPID_SOLPACK_GAMELIB_GETGAMEINFO),
00662       helpstring("Retrieves static information about the specified game.")
00663    ]
00664    HRESULT GetGameInfo([in] long lIndex, [out, retval] ISolpackGameInfo **ppGameInfo);
00665 }
00666
00667
00668 //----------------------------------------------------------------------------
00669 // Interface ISolpackGameInfo
00670 //----------------------------------------------------------------------------
00671 [
00672    object,
00673    uuid(0CBC404A-2CA8-11d6-8301-0020780D1875),
00674    dual,
00675    helpstring("ISolpackGameInfo Interface"),
00676    pointer_default(unique)
00677 ]
00678 interface ISolpackGameInfo : IDispatch
00679 {
00680    [
00681       propget,
00682       id(DISPID_SOLPACK_GAMEINFO_TITLE),
00683       helpstring("Name of the Solitaire game.")
00684    ]
00685    HRESULT Title([out, retval] BSTR *p);
00686
00687    [
00688       propget,
00689       id(DISPID_SOLPACK_GAMEINFO_RULES),
00690       helpstring("Rules of the game.")
00691    ]
00692    HRESULT Rules([out, retval] BSTR *p);
00693
00694    [
00695       propget,
00696       id(DISPID_SOLPACK_GAMEINFO_DIFFICULTY),
00697       helpstring("Game's difficulty ranking.")
00698    ]
00699    HRESULT Difficulty([out, retval] long *p);
00700 }
00701
00702
00703 //----------------------------------------------------------------------------
00704 // Interface ISolpackGameData
00705 //----------------------------------------------------------------------------
00706 [
00707    object,
00708    uuid(0CBC404B-2CA8-11d6-8301-0020780D1875),
00709    dual,
00710    helpstring("ISolpackGameData Interface"),
00711    pointer_default(unique)
00712 ]
00713 interface ISolpackGameData : IDispatch
00714 {
00715    [
00716       propget,
00717       id(DISPID_SOLPACK_GAMEDATA_DATA),
00718       helpstring("Contained data object.")
00719    ]
00720    HRESULT Data([out, retval] VARIANT *p);
00721    [
00722       propput,
00723       id(DISPID_SOLPACK_GAMEDATA_DATA),
00724       helpstring("Contained data object.")
00725    ]
00726    HRESULT Data([in] VARIANT v);
00727 };
00728
00729
00730 };
00731
00732
00733 // Reserved GUIDs
00734 //{0CBC4050-2CA8-11d6-8301-0020780D1875}
00735 // through
00736 //{0CBC40C0-2CA8-11d6-8301-0020780D1875}
Generated on Wed May 8 12:39:11 2002 for Solitaire Pack by doxygen 1.2.15


Solpack_catid.c File Reference

Go to the source code of this file.

Compounds

struct | _IID

Typedefs

typedef _IID | IID
typedef IID | CLSID

Variables

const IID | CATID_SolpackGameLibs = {0x0cbc4040, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}

Typedef Documentation

typedef IID CLSID

Definition at line 23 of file Solpack_catid.c.

typedef struct _IID IID

Variable Documentation

const IID CATID_SolpackGameLibs = {0x0cbc4040, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}

Definition at line 26 of file Solpack_catid.c.

Referenced by DllRegisterServer(), DllUnregisterServer(), CLibMgr::Refresh(), CSolpackApp::Register(), and CSolpackApp::Unregister().

Generated on Wed May 8 12:39:25 2002 for Solitaire Pack by doxygen 1.2.15


Solpack_catid.c Source File

Solpack_catid.c

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 // Definition of Category ID
00003 //----------------------------------------------------------------------------
00004 #ifdef __cplusplus
00005 extern "C"{
00006 #endif
00007
00008 #ifndef __IID_DEFINED__
00009 #define __IID_DEFINED__
00010
00011 typedef struct _IID
00012 {
00013     unsigned long x;
00014     unsigned short s1;
00015     unsigned short s2;
00016     unsigned char  c[8];
00017 } IID;
00018
00019 #endif // __IID_DEFINED__
00020
00021 #ifndef CLSID_DEFINED
00022 #define CLSID_DEFINED
00023 typedef IID CLSID;
00024 #endif // CLSID_DEFINED
00025
00026 const IID CATID_SolpackGameLibs = {0x0cbc4040, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}};
00027
00028 #ifdef __cplusplus
00029 }
00030 #endif
00031
Generated on Wed May 8 12:39:11 2002 for Solitaire Pack by doxygen 1.2.15


Solpack_i.c File Reference

#include <rpc.h>
#include <rpcndr.h>

Go to the source code of this file.

Compounds

struct | _IID

Defines

#define | MIDL_DEFINE_GUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Typedefs

typedef _IID | IID
typedef IID | CLSID

Functions

MIDL_DEFINE_GUID (IID, LIBID_SolpackLib, 0x0CBC4043, 0x2CA8, 0x11d6, 0x83, 0x01, 0x00, 0x20, 0x78, 0x0D, 0x18, 0x75)
MIDL_DEFINE_GUID (IID, IID_ISolpackPile, 0x0CBC4046, 0x2CA8, 0x11d6, 0x83, 0x01, 0x00, 0x20, 0x78, 0x0D, 0x18, 0x75)

Define Documentation

#define MIDL_DEFINE_GUID | ( | type,
 |  | name,
 |  | l,
 |  | w1,
 |  | w2,
 |  | b1,
 |  | b2,
 |  | b3,
 |  | b4,
 |  | b5,
 |  | b6,
 |  | b7,
 |  | b8 | ) | const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Definition at line 64 of file Solpack_i.c.

Typedef Documentation

typedef IID CLSID

Definition at line 61 of file Solpack_i.c.

typedef struct _IID IID

Function Documentation

MIDL_DEFINE_GUID | ( | IID | ,
 |  | IID_ISolpackPile | ,
 |  | 0x0CBC4046 | ,
 |  | 0x2CA8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x00 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0x0D | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

MIDL_DEFINE_GUID | ( | IID | ,
 |  | LIBID_SolpackLib | ,
 |  | 0x0CBC4043 | ,
 |  | 0x2CA8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x00 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0x0D | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

Generated on Wed May 8 12:39:26 2002 for Solitaire Pack by doxygen 1.2.15


Solpack_i.c Source File

Solpack_i.c

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
00005
00006 /* link this file in with the server and any clients */
00007
00008
00009  /* File created by MIDL compiler version 5.03.0280 */
00010 /* at Tue May 07 23:01:26 2002
00011  */
00012 /* Compiler settings for C:\Programming\Microsoft Visual Studio\MyProjects\Solitaire Pack\SolpackTLB\Solpack.idl:
00013     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
00014     error checks: allocation ref bounds_check enum stub_data
00015     VC __declspec() decoration level:
00016          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00017          DECLSPEC_UUID(), MIDL_INTERFACE()
00018 */
00019 //@@MIDL_FILE_HEADING(  )
00020
00021 #if !defined(_M_IA64) && !defined(_M_AXP64)
00022
00023 #ifdef __cplusplus
00024 extern "C"{
00025 #endif
00026
00027
00028 #include <rpc.h>
00029 #include <rpcndr.h>
00030
00031 #ifdef _MIDL_USE_GUIDDEF_
00032
00033 #ifndef INITGUID
00034 #define INITGUID
00035 #include <guiddef.h>
00036 #undef INITGUID
00037 #else
00038 #include <guiddef.h>
00039 #endif
00040
00041 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00042         DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
00043
00044 #else // !_MIDL_USE_GUIDDEF_
00045
00046 #ifndef __IID_DEFINED__
00047 #define __IID_DEFINED__
00048
00049 typedef struct _IID
00050 {
00051     unsigned long x;
00052     unsigned short s1;
00053     unsigned short s2;
00054     unsigned char  c[8];
00055 } IID;
00056
00057 #endif // __IID_DEFINED__
00058
00059 #ifndef CLSID_DEFINED
00060 #define CLSID_DEFINED
00061 typedef IID CLSID;
00062 #endif // CLSID_DEFINED
00063
00064 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00065         const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
00066
00067 #endif !_MIDL_USE_GUIDDEF_
00068
00069 MIDL_DEFINE_GUID(IID, LIBID_SolpackLib,0x0CBC4043,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00070
00071
00072 MIDL_DEFINE_GUID(IID, IID_ISolpackPile,0x0CBC4046,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00073
00074
00075 MIDL_DEFINE_GUID(IID, IID_ISolpackFragment,0x0CBC4048,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00076
00077
00078 MIDL_DEFINE_GUID(IID, IID_ISolpackCard,0x0CBC4047,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00079
00080
00081 MIDL_DEFINE_GUID(IID, IID_ISolpackGameInfo,0x0CBC404A,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00082
00083
00084 MIDL_DEFINE_GUID(IID, IID_ISolpackGameData,0x0CBC404B,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00085
00086
00087 MIDL_DEFINE_GUID(IID, IID_ISolpackApp,0x0CBC4044,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00088
00089
00090 MIDL_DEFINE_GUID(IID, IID_ISolpackGame,0x0CBC4045,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00091
00092
00093 MIDL_DEFINE_GUID(IID, IID_ISolpackGameLib,0x0CBC4049,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00094
00095 #undef MIDL_DEFINE_GUID
00096
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100
00101
00102
00103 #endif /* !defined(_M_IA64) && !defined(_M_AXP64)*/
00104
Generated on Wed May 8 12:39:11 2002 for Solitaire Pack by doxygen 1.2.15


SolpackApp.cpp File Reference

#include "stdafx.h"
#include "SolpackApp.h"
#include "UserPrefs.h"
#include "..\SolpackTLB\Solpack.h"
#include <bmws_error.h>
#include <bmws_lib.h>
#include <bmws_string.h>
#include <bmws_registry.h>
#include <bmws_waitcursor.h>
#include <bmws_splashscreen.h>
#include <bmws_regservices.h>
#include <bmws_cpsounds.h>
#include <bmws_tlb.h>
#include <comcat.h>
#include <shlwapi.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Defines

#define | SPKREG_NONE 0
#define | SPKREG_REGISTER 1
#define | SPKREG_UNREGISTER 2

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
TCHAR | g_szAppTitle [64]
BOOL | g_bFatalExit
COOMExcep * g_pOOMExcep
BOOL | g_bExited
HWND | g_hWnd
CTSTR g_lpszUserName
ITypeLib * | g_pTypeLib = NULL

Define Documentation

#define SPKREG_NONE 0

Definition at line 48 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

#define SPKREG_REGISTER 1

Definition at line 49 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

#define SPKREG_UNREGISTER 2

Definition at line 50 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

Variable Documentation

BOOL g_bExited

Definition at line 39 of file SolpackApp.cpp.

Referenced by CSolpackApp::CSolpackApp(), CSolpackApp::EmptyMessageQueue(), CMainWindow::MainWndProc(), CMainWindow::OnCommand(), and CSolpackApp::Run().

BOOL g_bFatalExit

Definition at line 37 of file SolpackApp.cpp.

Referenced by HandleError(), InitErrorHandler(), and CSolpackApp::Run().

HINSTANCE g_hInst

Definition at line 34 of file SolpackApp.cpp.

Referenced by CSolpackApp::Register(), and CSolpackApp::Run().

HINSTANCE g_hInstLC

Definition at line 35 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

HWND g_hWnd

Definition at line 40 of file SolpackApp.cpp.

Referenced by CSolpackApp::CSolpackApp().

CTSTR g_lpszUserName

Definition at line 41 of file SolpackApp.cpp.

COOMExcep* g_pOOMExcep

Definition at line 38 of file SolpackApp.cpp.

ITypeLib* g_pTypeLib = NULL

Definition at line 42 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

TCHAR g_szAppTitle[64]

Definition at line 36 of file SolpackApp.cpp.

Referenced by CSolpackApp::Run().

Generated on Wed May 8 12:39:26 2002 for Solitaire Pack by doxygen 1.2.15


SolpackApp.cpp Source File

SolpackApp.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackApp.cpp
00004 //    Class to encapsulate the main application.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "SolpackApp.h"
00014 #include "UserPrefs.h"
00015 #include "..\SolpackTLB\Solpack.h"
00016 #include <bmws_error.h>
00017 #include <bmws_lib.h>
00018 #include <bmws_string.h>
00019 #include <bmws_registry.h>
00020 #include <bmws_waitcursor.h>
00021 #include <bmws_splashscreen.h>
00022 #include <bmws_regservices.h>
00023 #include <bmws_cpsounds.h>
00024 #include <bmws_tlb.h>
00025 #include <comcat.h>
00026 #include <shlwapi.h>
00027 #include "resource.h"
00028 #include "..\SolpckLC\resource.h"
00029
00030
00031 //----------------------------------------------------------------------------
00032 // Global and external variables
00033 //----------------------------------------------------------------------------
00034 HINSTANCE g_hInst;               // Application instance handle
00035 HINSTANCE g_hInstLC;             // Localized resources module handle
00036 extern TCHAR g_szAppTitle[64];   // The title bar text
00037 extern BOOL g_bFatalExit;        // Whether the application should shut down
00038 COOMExcep *g_pOOMExcep;          // Out of memory exception object
00039 BOOL g_bExited;                  // Whether the user has chosen to quit
00040 HWND g_hWnd;                     // Main window handle
00041 CTSTR g_lpszUserName;            // Registered user name
00042 ITypeLib *g_pTypeLib = NULL;     // The Solpack type library
00043
00044
00045 //----------------------------------------------------------------------------
00046 // Register flags, based on command-line flags
00047 //----------------------------------------------------------------------------
00048 #define SPKREG_NONE        0     // Run app normally
00049 #define SPKREG_REGISTER    1     // Register the app
00050 #define SPKREG_UNREGISTER  2     // Unregister the app
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // CSolpackApp constructor
00056 //
00057 // Parameters:       None.
00058 //
00059 //----------------------------------------------------------------------------
00060 CSolpackApp::CSolpackApp()
00061 {
00062    #ifdef BMWS_TRACKMEMALLOC
00063       BMWSMemInit();
00064    #endif
00065
00066    // Initialize member variables
00067    m_pMainWindow = NULL;
00068    g_hWnd = NULL;
00069    g_bExited = FALSE;
00070 }
00071
00072
00073 //----------------------------------------------------------------------------
00074 //
00075 // CSolpackApp destructor
00076 //
00077 //----------------------------------------------------------------------------
00078 CSolpackApp::~CSolpackApp()
00079 {
00080    // Track the number of Action objects created, just for fun
00081    #ifdef BMWS_TRACKMEMALLOC
00082       TCHAR szBuf[256];
00083       wsprintf(szBuf, TEXT("\nActions:\n  Allocated:  \t%d\n  Freed:      \t%d\n  Difference: \t%d\n  Maximum:    \t%d\n\n"),
00084          CAction::m_scTotalCreated, CAction::m_scTotalDeleted, CAction::m_scTotalCreated -
00085          CAction::m_scTotalDeleted, CAction::m_scMax);
00086       OutputDebugString(szBuf);
00087
00088       BMWSMemUninit();
00089    #endif
00090 }
00091
00092
00093 //----------------------------------------------------------------------------
00094 //
00095 // Run function
00096 //    Starts the application, creates the main window, and starts the message
00097 //    loop. Performs registration or unregistration if specified.
00098 //
00099 // Parameters:
00100 //    hInst:         Application instance.
00101 //    lpCmdLine:     Command line parameters. May contain a file name, or
00102 //                   flags for un/registration.
00103 //    nCmdShow:      Specifies how the main window should be showed.
00104 //
00105 // Returns:          The application's exit code; otherwise 0.
00106 //
00107 //----------------------------------------------------------------------------
00108 int CSolpackApp::Run(HINSTANCE hInst, LPSTR lpCmdLine, int nCmdShow)
00109 {
00110    // Set the global out-of-memory exception object
00111    COOMExcep e;
00112    g_pOOMExcep = &e;
00113
00114    int iReturn = -1;
00115    g_hInst = hInst;  // Store application instance handle
00116
00117    // Load the localized resource module
00118    CLib libLC(TEXT("SolpckLC.DLL"));
00119    g_hInstLC = libLC;
00120    if(!g_hInstLC)
00121    {
00122       // Couldn't load the module
00123       TCHAR szError[128];
00124       LoadString(g_hInst, IDS_ERR_LCNOTFOUND, szError, ARRAYSIZE(szError));
00125       MessageBox(GetFocus(), szError, NULL, MB_ICONHAND | MB_OK);
00126       return -1;
00127    }
00128
00129    // Load strings used by the error handling mechanism
00130    InitErrorHandler();
00131
00132    // Load the application title string
00133    LoadString(g_hInstLC, IDS_APP_TITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
00134
00135    // Parse command-line parameters
00136    if(__argc > 1)
00137    {
00138       // Valid command-line parameters: (begin with - or / character)
00139       //    register    - called during installation
00140       //    unregister  - called during uninstallation
00141       //    newver      - called during installation; says check for new versions on startup
00142       //    extras      - called during installation; says check for extra versions on startup
00143
00144       BOOL bInitCOM = FALSE;
00145       try
00146       {
00147          // Initialize COM
00148          CHECKHRCOM(CoInitialize(NULL));
00149          bInitCOM = TRUE;
00150
00151          DWORD dwRegister = SPKREG_NONE;
00152          BOOL bCheckNewVer = FALSE;
00153          BOOL bCheckExtras = FALSE;
00154
00155          // Go through command line parameters, one by one.
00156          for(int i = 1; i < __argc; i++)
00157          {
00158             LPSTR pszParam = __argv[i];
00159             BOOL bLast = ((i + 1) == __argc);
00160             if(pszParam[0] == '-' || pszParam[0] == '/')
00161             {
00162                ++pszParam;
00163                if(lstrcmpiA(pszParam, "register") == 0)
00164                   dwRegister = SPKREG_REGISTER;
00165                else if(lstrcmpiA(pszParam, "unregister") == 0)
00166                   dwRegister = SPKREG_UNREGISTER;
00167                else if(lstrcmpiA(pszParam, "newver") == 0)
00168                   bCheckNewVer = TRUE;
00169                else if(lstrcmpiA(pszParam, "extras") == 0)
00170                   bCheckExtras = TRUE;
00171             }
00172          }
00173
00174          // Handle register or unregister
00175          if(dwRegister == SPKREG_REGISTER)
00176             Register(bCheckNewVer, bCheckExtras);
00177          else if(dwRegister == SPKREG_UNREGISTER)
00178             Unregister();
00179
00180          CoUninitialize();
00181          return 0;
00182       }
00183       catch(CExcep *pE)
00184       {
00185          pE->Report();
00186          pE->Delete();
00187       }
00188
00189       if(bInitCOM)
00190          CoUninitialize();
00191       return -1;
00192    }
00193
00194    BOOL bContinue = TRUE;
00195    BOOL bSplashOpen = FALSE;
00196    BOOL bOLEOK = FALSE;
00197    CPointer<CSplashWindow> pSplash;
00198
00199    try
00200    {
00201       // See if program is registered
00202       {
00203          CKey hKey;
00204          GetProductKey(hKey, FALSE);
00205          g_lpszUserName = GetRegisteredName(hKey, CTSTR(IDS_APP_TITLE), SOLPACK_HASHVALUE);
00206       }
00207
00208       // Create splash window. Does not fail if it could not be displayed.
00209       pSplash = new CSplashWindow(g_lpszUserName, CTSTR(IDS_SPLASHVERSION),
00210          CTSTR(IDS_SPLASHCOPYRIGHT));
00211       ENSUREALLOC(pSplash);
00212       if(pSplash->Register())
00213          bSplashOpen = pSplash->Create();
00214       if(bSplashOpen)
00215       {
00216          pSplash->ShowWindow(SW_SHOW);
00217          UpdateWindow(pSplash->m_hWnd);
00218       }
00219
00220       // Initialize OLE
00221       bOLEOK = SUCCEEDED(OleInitialize(NULL));
00222       if(!bOLEOK)
00223          THROW(new CExcepEx(IDS_BMWS_ERROR_OLE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00224
00225       CHECKHRCOM(RegisterTLB(LIBID_SolpackLib, 1, 0));
00226       CHECKHRCOM(LoadRegTypeLib(LIBID_SolpackLib, 1, 0, 0x00, &g_pTypeLib));
00227
00228       // Create the main window object
00229       bContinue = CreateMainWindow(pSplash, nCmdShow);
00230    }
00231    catch(CExcep *pE)
00232    {
00233       pE->Report();
00234       pE->Delete();
00235       bContinue = FALSE;
00236    }
00237
00238    // We don't need splash screen any more. It will go away when main window deletes it.
00239    pSplash = NULL;
00240
00241    // If everything is okay so far, do the message loop.
00242    if(bContinue)
00243    {
00244       MSG msg;
00245       int i = GetMessage(&msg, NULL, 0, 0);
00246       while(i != 0 && i != -1)
00247       {
00248          // If we've quit for some reason, shut down
00249          if((g_bFatalExit || g_bExited) && m_pMainWindow->m_hWnd)
00250          {
00251             DestroyWindow(m_pMainWindow->m_hWnd);
00252             break;
00253          }
00254
00255          // Otherwise process the message
00256          ProcessMessage(&msg);
00257          i = GetMessage(&msg, NULL, 0, 0);
00258       }
00259       iReturn = (g_bFatalExit ? -1 : msg.wParam);
00260    }
00261
00262    // Delete objects
00263    SAFEDELETE(m_pMainWindow);
00264    g_lpszUserName = NULL;
00265    SAFERELEASE(g_pTypeLib);
00266
00267    // Uninitialize OLE
00268    if(bOLEOK)
00269       OleUninitialize();
00270
00271    return iReturn;
00272 }
00273
00274
00275 //----------------------------------------------------------------------------
00276 //
00277 // CreateMainWindow function
00278 //    Creates and displays the main application window.
00279 //
00280 // Parameters:
00281 //    pSplash:       Pointer to the splash window.
00282 //    nCmdShow:      Specifies how the main window should be showed.
00283 //
00284 // Returns:          TRUE if successful, or FALSE if an error occurred.
00285 //
00286 //----------------------------------------------------------------------------
00287 BOOL CSolpackApp::CreateMainWindow(CSplashWindow *pSplash, int nCmdShow)
00288 {
00289    CWaitCursor wait; // Could take a while
00290
00291    // Do actual creation and display of main window
00292    m_pMainWindow = new CMainWindow((IMsgProcessor*)this);
00293    ENSUREALLOC(m_pMainWindow);
00294    m_pMainWindow->Register();
00295    if(!m_pMainWindow->Create(pSplash, nCmdShow))
00296       return FALSE;
00297
00298    return TRUE;
00299 }
00300
00301
00302 //----------------------------------------------------------------------------
00303 //
00304 // IMsgProcessor::ProcessMessage method
00305 //    Processes a message from the message queue.
00306 //
00307 // Parameters:
00308 //    lpMsg:         Pointer to the message to translate.
00309 //
00310 // Returns:          None.
00311 //
00312 //----------------------------------------------------------------------------
00313 void CSolpackApp::ProcessMessage(LPMSG lpMsg)
00314 {
00315    // Let the main window have a crack at it first
00316    if(!m_pMainWindow->PreprocessMessage(lpMsg))
00317    {
00318       TranslateMessage(lpMsg);
00319       DispatchMessage(lpMsg);
00320    }
00321 }
00322
00323
00324 //----------------------------------------------------------------------------
00325 //
00326 // IMsgProcessor::EmptyMessageQueue method
00327 //    Removes and processes all pending messages from the message queue.
00328 //
00329 // Parameters:
00330 //    bCheckQuit:    Whether to throw a quit exception if the user chose to
00331 //                   quit during the process.
00332 //
00333 // Returns:          None.
00334 //
00335 //----------------------------------------------------------------------------
00336 void CSolpackApp::EmptyMessageQueue(BOOL bCheckQuit)
00337 {
00338    MSG msg;
00339    while(PeekMessage(&msg, NULL,  0, 0, PM_REMOVE))
00340       ProcessMessage(&msg);
00341    if(bCheckQuit && g_bExited)
00342       throw new CQuitExcep;
00343 }
00344
00345
00346 //----------------------------------------------------------------------------
00347 //
00348 // Register function
00349 //    Registers the Solpack type library, component category, and sets update
00350 //    notification settings.
00351 //
00352 // Parameters:
00353 //    bCheckNewVer:  Whether to check for new application versions.
00354 //    bCheckExtras:  Whether to check for new extra game libraries.
00355 //
00356 // Returns:          None.
00357 //
00358 //----------------------------------------------------------------------------
00359 void CSolpackApp::Register(BOOL bCheckNewVer, BOOL bCheckExtras)
00360 {
00361    // Register type library
00362    CHECKHRCOM(RegisterTLB(LIBID_SolpackLib, 1, 0));
00363
00364    // Register the Solpack Game Libraries component category
00365    ICatRegister *pcr = NULL;
00366    try
00367    {
00368       // Create and use the component category manager
00369       CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00370          IID_ICatRegister, (LPVOID*)&pcr));
00371
00372       CATEGORYINFO ci;
00373       ci.catid = CATID_SolpackGameLibs;
00374       ci.lcid = SOLPACK_LCID;
00375
00376       CBSTR bstrDesc(IDS_CATDESC);
00377       CopyMemory(&ci.szDescription, bstrDesc.m_bstr, sizeof(WCHAR) * min(bstrDesc.Len() + 1, 127));
00378
00379       CHECKHRCOM(pcr->RegisterCategories(1, &ci));
00380       SAFERELEASE(pcr);
00381    }
00382    catch(CExcep *pE)
00383    {
00384       SAFERELEASE(pcr);
00385       throw pE;
00386    }
00387
00388    // Default sound files are in the path with Solpack.exe
00389    CTSTR lpszFile(TRUE, MAX_PATH);
00390    GetModuleFileName(g_hInst, lpszFile, MAX_PATH);
00391    CTSTRArray alpszDefs;
00392    alpszDefs.SetSize(4);
00393
00394    // Load each default sound file name
00395    for(int i = 0; i < 4; i++)
00396    {
00397       PathRemoveFileSpec(lpszFile);
00398       PathAppend(lpszFile, CTSTR(IDS_SOUNDFILE_SHUFFLE+i));
00399       alpszDefs.SetAt(i, lpszFile);
00400    }
00401
00402    // Create a Control Panel Sounds Manager to set up the default sounds
00403    PathRemoveFileSpec(lpszFile);
00404    CCPSounds cps(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(CUserPrefs::s_auidSounds, 4),
00405       CUINTArray(CUserPrefs::s_auidDisplays, 4), lpszFile, &alpszDefs, TRUE);
00406    cps.Save();
00407
00408    // Set initial update notification preferences
00409    CKey hKeyProduct;
00410    if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00411    {
00412       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, (DWORD)bCheckNewVer);
00413       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, (DWORD)bCheckExtras);
00414    }
00415 }
00416
00417
00418 //----------------------------------------------------------------------------
00419 //
00420 // Unregister function
00421 //    Unregisters the Solpack type library and component category.
00422 //
00423 // Parameters:       None.
00424 //
00425 // Returns:          None.
00426 //
00427 //----------------------------------------------------------------------------
00428 void CSolpackApp::Unregister()
00429 {
00430    // Unregister the Solpack type library
00431    UnregisterTLB(LIBID_SolpackLib, 1, 0);
00432
00433    // Unregister the Solpack Game Libraries component category
00434    ICatRegister *pcr = NULL;
00435    try
00436    {
00437       // Create and use the component category manager
00438       CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00439          IID_ICatRegister, (LPVOID*)&pcr));
00440
00441       CATID IDs[1];
00442       IDs[0] = CATID_SolpackGameLibs;
00443       CHECKHRCOM(pcr->UnRegisterCategories(1, IDs));
00444       SAFERELEASE(pcr);
00445    }
00446    catch(CExcep *pE)
00447    {
00448       SAFERELEASE(pcr);
00449       throw pE;
00450    }
00451
00452    // Create a Control Panel Sounds Manager to remove sounds
00453    CCPSounds(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(CUserPrefs::s_auidSounds, 4),
00454       CUINTArray(CUserPrefs::s_auidDisplays, 4), CTSTR(), NULL, FALSE);
00455
00456    // Remove registry settings
00457    CKey     hKeySoftware;
00458    LONG     lResult;
00459    DWORD    dwDisp;
00460    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, CTSTR(IDS_REG_SOFTWARE), 0, NULL,
00461       REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKeySoftware, &dwDisp);
00462    if(lResult == NOERROR)
00463    {
00464       CKey hKeyCompany;
00465       CTSTR lpszCompany(IDS_COMPANY);
00466       lResult = RegCreateKeyEx(hKeySoftware, lpszCompany, 0, NULL, REG_OPTION_NON_VOLATILE,
00467          KEY_ALL_ACCESS, NULL, &hKeyCompany, &dwDisp);
00468       if(lResult == NOERROR)
00469          SHDeleteKey(hKeyCompany, CTSTR(IDS_APP_TITLE));
00470       hKeyCompany = NULL;
00471       SHDeleteEmptyKey(hKeySoftware, lpszCompany);
00472    }
00473 }
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SolpackApp.h File Reference

#include "ProcessMsg.h"
#include "MainWindow.h"

Go to the source code of this file.

Compounds

class | CSolpackApp

Defines

#define | AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file SolpackApp.h.

Generated on Wed May 8 12:39:26 2002 for Solitaire Pack by doxygen 1.2.15


SolpackApp.h Source File

SolpackApp.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackApp.h
00004 //    Class to encapsulate the main application.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "ProcessMsg.h"
00021 #include "MainWindow.h"
00022
00023
00024 //----------------------------------------------------------------------------
00025 //
00026 // CSolpackApp class.
00027 //    Encapsulates the main application. Created by the WinMain function;
00028 //    handles main window creation and low-level initialization; processes
00029 //    messages.
00030 //
00031 //----------------------------------------------------------------------------
00032 class CSolpackApp : public IMsgProcessor
00033 {
00034 public:
00035    CSolpackApp();
00036    virtual ~CSolpackApp();
00037
00038    int Run(HINSTANCE hInst, LPSTR lpCmdLine, int nCmdShow);
00039    BOOL CreateMainWindow(CSplashWindow *pSplash, int nCmdShow);
00040
00041    // IMsgProcessor methods
00042    void ProcessMessage(LPMSG lpMsg);
00043    void EmptyMessageQueue(BOOL bCheckQuit);
00044
00045 protected:
00046    void Register(BOOL bCheckNewVer, BOOL bCheckExtras);
00047    void Unregister();
00048
00049    CMainWindow *m_pMainWindow;   // Main window object
00050 };
00051
00052
00053 #endif // !defined(AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SolpackArrays.h File Reference

#include "..\SolpackTLB\SolpackIncl.h"
#include <bmws_array.h>

Go to the source code of this file.

Defines

#define AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_

Typedefs

typedef CPtrArray< ISolpackPile *,
ISolpackPile * > 		CSolpackPileArray
typedef CPtrArray< ISolpackCard *,
ISolpackCard * > 		CSolpackCardArray
typedef CPtrArray< ISolpackGameData *,
ISolpackGameData * > 		CSolpackGameDataArray

Define Documentation

#define AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file SolpackArrays.h.

Typedef Documentation

typedef CPtrArray<ISolpackCard*, ISolpackCard*> CSolpackCardArray

Definition at line 24 of file SolpackArrays.h.

typedef CPtrArray<ISolpackGameData*, ISolpackGameData*> CSolpackGameDataArray

Definition at line 25 of file SolpackArrays.h.

typedef CPtrArray<ISolpackPile*, ISolpackPile*> CSolpackPileArray

Definition at line 23 of file SolpackArrays.h.

Generated on Wed May 8 12:39:26 2002 for Solitaire Pack by doxygen 1.2.15


SolpackArrays.h Source File

SolpackArrays.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackArrays.h
00004 //    Type definitions for Solitaire Pack pointer arrays.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include "..\SolpackTLB\SolpackIncl.h"
00017 #include <bmws_array.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Array typedefs
00022 //----------------------------------------------------------------------------
00023 typedef CPtrArray<ISolpackPile*,		 ISolpackPile*>     CSolpackPileArray;
00024 typedef CPtrArray<ISolpackCard*,		 ISolpackCard*>     CSolpackCardArray;
00025 typedef CPtrArray<ISolpackGameData*, ISolpackGameData*>  CSolpackGameDataArray;
00026
00027
00028 #endif // !defined(AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


solpackdid.h File Reference

Go to the source code of this file.

Defines

#define | AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_
#define | DISPID_SOLPACK_APP 1000
#define | DISPID_SOLPACK_APP_CARDWIDTH (DISPID_SOLPACK_APP + 1)
#define | DISPID_SOLPACK_APP_CARDHEIGHT (DISPID_SOLPACK_APP + 2)
#define | DISPID_SOLPACK_APP_SCORE (DISPID_SOLPACK_APP + 3)
#define | DISPID_SOLPACK_APP_WINDOWWIDTH (DISPID_SOLPACK_APP + 4)
#define | DISPID_SOLPACK_APP_WINDOWHEIGHT (DISPID_SOLPACK_APP + 5)
#define | DISPID_SOLPACK_APP_SPACINGX (DISPID_SOLPACK_APP + 6)
#define | DISPID_SOLPACK_APP_SPACINGY (DISPID_SOLPACK_APP + 7)
#define | DISPID_SOLPACK_APP_FRAGMENT (DISPID_SOLPACK_APP + 8)
#define | DISPID_SOLPACK_APP_CREATEPILE (DISPID_SOLPACK_APP + 9)
#define | DISPID_SOLPACK_APP_CREATEGAMEDATA (DISPID_SOLPACK_APP + 10)
#define | DISPID_SOLPACK_APP_ADDGAMECOMMAND (DISPID_SOLPACK_APP + 11)
#define | DISPID_SOLPACK_APP_ENABLEGAMECOMMAND (DISPID_SOLPACK_APP + 12)
#define | DISPID_SOLPACK_APP_GAMEWON (DISPID_SOLPACK_APP + 13)
#define | DISPID_SOLPACK_GAME (DISPID_SOLPACK_APP + 100)
#define | DISPID_SOLPACK_GAME_INFO (DISPID_SOLPACK_GAME + 1)
#define | DISPID_SOLPACK_GAME_INITIALIZE (DISPID_SOLPACK_GAME + 2)
#define | DISPID_SOLPACK_GAME_UNINITIALIZE (DISPID_SOLPACK_GAME + 3)
#define | DISPID_SOLPACK_GAME_DEAL (DISPID_SOLPACK_GAME + 4)
#define | DISPID_SOLPACK_GAME_AUTOPLAY (DISPID_SOLPACK_GAME + 5)
#define | DISPID_SOLPACK_GAME_AUTOPLAYCARD (DISPID_SOLPACK_GAME + 6)
#define | DISPID_SOLPACK_GAME_HANDLECOMMAND (DISPID_SOLPACK_GAME + 7)
#define | DISPID_SOLPACK_GAME_PILECLICKED (DISPID_SOLPACK_GAME + 8)
#define | DISPID_SOLPACK_GAME_SETUPFRAGMENT (DISPID_SOLPACK_GAME + 9)
#define | DISPID_SOLPACK_GAME_DROPFRAGMENT (DISPID_SOLPACK_GAME + 10)
#define | DISPID_SOLPACK_GAME_CANCELMOVE (DISPID_SOLPACK_GAME + 11)
#define | DISPID_SOLPACK_GAME_RECALCLAYOUT (DISPID_SOLPACK_GAME + 12)
#define | DISPID_SOLPACK_PILE (DISPID_SOLPACK_GAME + 100)
#define | DISPID_SOLPACK_PILE_TYPE (DISPID_SOLPACK_PILE + 1)
#define | DISPID_SOLPACK_PILE_X (DISPID_SOLPACK_PILE + 2)
#define | DISPID_SOLPACK_PILE_Y (DISPID_SOLPACK_PILE + 3)
#define | DISPID_SOLPACK_PILE_WIDTH (DISPID_SOLPACK_PILE + 4)
#define | DISPID_SOLPACK_PILE_HEIGHT (DISPID_SOLPACK_PILE + 5)
#define | DISPID_SOLPACK_PILE_NUMCARDS (DISPID_SOLPACK_PILE + 6)
#define | DISPID_SOLPACK_PILE_COMMENTTOOLTIP (DISPID_SOLPACK_PILE + 7)
#define | DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP (DISPID_SOLPACK_PILE + 8)
#define | DISPID_SOLPACK_PILE_BASETYPE (DISPID_SOLPACK_PILE + 9)
#define | DISPID_SOLPACK_PILE_SHUFFLE (DISPID_SOLPACK_PILE + 10)
#define | DISPID_SOLPACK_PILE_GETCARD (DISPID_SOLPACK_PILE + 11)
#define | DISPID_SOLPACK_PILE_WIDTHWITH (DISPID_SOLPACK_PILE + 12)
#define | DISPID_SOLPACK_PILE_HEIGHTWITH (DISPID_SOLPACK_PILE + 13)
#define | DISPID_SOLPACK_CARD (DISPID_SOLPACK_PILE + 100)
#define | DISPID_SOLPACK_CARD_ID (DISPID_SOLPACK_CARD + 1)
#define | DISPID_SOLPACK_CARD_RANK (DISPID_SOLPACK_CARD + 2)
#define | DISPID_SOLPACK_CARD_SUIT (DISPID_SOLPACK_CARD + 3)
#define | DISPID_SOLPACK_CARD_CANDRAG (DISPID_SOLPACK_CARD + 4)
#define | DISPID_SOLPACK_CARD_FACEUP (DISPID_SOLPACK_CARD + 5)
#define | DISPID_SOLPACK_CARD_PILE (DISPID_SOLPACK_CARD + 6)
#define | DISPID_SOLPACK_CARD_INDEX (DISPID_SOLPACK_CARD + 7)
#define | DISPID_SOLPACK_FRAGMENT (DISPID_SOLPACK_CARD + 100)
#define | DISPID_SOLPACK_FRAGMENT_ADDTOFRAGMENT (DISPID_SOLPACK_FRAGMENT + 1)
#define | DISPID_SOLPACK_FRAGMENT_MOVETOPILE (DISPID_SOLPACK_FRAGMENT + 2)
#define | DISPID_SOLPACK_GAMELIB (DISPID_SOLPACK_FRAGMENT + 100)
#define | DISPID_SOLPACK_GAMELIB_AUTHOR (DISPID_SOLPACK_GAMELIB + 1)
#define | DISPID_SOLPACK_GAMELIB_EMAIL (DISPID_SOLPACK_GAMELIB + 2)
#define | DISPID_SOLPACK_GAMELIB_WEBSITE (DISPID_SOLPACK_GAMELIB + 3)
#define | DISPID_SOLPACK_GAMELIB_NUMGAMES (DISPID_SOLPACK_GAMELIB + 4)
#define | DISPID_SOLPACK_GAMELIB_GETGAME (DISPID_SOLPACK_GAMELIB + 5)
#define | DISPID_SOLPACK_GAMELIB_GETGAMEINFO (DISPID_SOLPACK_GAMELIB + 6)
#define | DISPID_SOLPACK_GAMEINFO (DISPID_SOLPACK_GAMELIB + 100)
#define | DISPID_SOLPACK_GAMEINFO_TITLE (DISPID_SOLPACK_GAMEINFO + 1)
#define | DISPID_SOLPACK_GAMEINFO_RULES (DISPID_SOLPACK_GAMEINFO + 2)
#define | DISPID_SOLPACK_GAMEINFO_DIFFICULTY (DISPID_SOLPACK_GAMEINFO + 3)
#define | DISPID_SOLPACK_GAMEDATA (DISPID_SOLPACK_GAMEINFO + 100)
#define | DISPID_SOLPACK_GAMEDATA_DATA (DISPID_SOLPACK_GAMEDATA + 1)

Define Documentation

#define AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file solpackdid.h.

#define DISPID_SOLPACK_APP 1000

Definition at line 16 of file solpackdid.h.

#define DISPID_SOLPACK_APP_ADDGAMECOMMAND (DISPID_SOLPACK_APP + 11)

Definition at line 27 of file solpackdid.h.

#define DISPID_SOLPACK_APP_CARDHEIGHT (DISPID_SOLPACK_APP + 2)

Definition at line 18 of file solpackdid.h.

#define DISPID_SOLPACK_APP_CARDWIDTH (DISPID_SOLPACK_APP + 1)

Definition at line 17 of file solpackdid.h.

#define DISPID_SOLPACK_APP_CREATEGAMEDATA (DISPID_SOLPACK_APP + 10)

Definition at line 26 of file solpackdid.h.

#define DISPID_SOLPACK_APP_CREATEPILE (DISPID_SOLPACK_APP + 9)

Definition at line 25 of file solpackdid.h.

#define DISPID_SOLPACK_APP_ENABLEGAMECOMMAND (DISPID_SOLPACK_APP + 12)

Definition at line 28 of file solpackdid.h.

#define DISPID_SOLPACK_APP_FRAGMENT (DISPID_SOLPACK_APP + 8)

Definition at line 24 of file solpackdid.h.

#define DISPID_SOLPACK_APP_GAMEWON (DISPID_SOLPACK_APP + 13)

Definition at line 29 of file solpackdid.h.

#define DISPID_SOLPACK_APP_SCORE (DISPID_SOLPACK_APP + 3)

Definition at line 19 of file solpackdid.h.

#define DISPID_SOLPACK_APP_SPACINGX (DISPID_SOLPACK_APP + 6)

Definition at line 22 of file solpackdid.h.

#define DISPID_SOLPACK_APP_SPACINGY (DISPID_SOLPACK_APP + 7)

Definition at line 23 of file solpackdid.h.

#define DISPID_SOLPACK_APP_WINDOWHEIGHT (DISPID_SOLPACK_APP + 5)

Definition at line 21 of file solpackdid.h.

#define DISPID_SOLPACK_APP_WINDOWWIDTH (DISPID_SOLPACK_APP + 4)

Definition at line 20 of file solpackdid.h.

#define DISPID_SOLPACK_CARD (DISPID_SOLPACK_PILE + 100)

Definition at line 72 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_CANDRAG (DISPID_SOLPACK_CARD + 4)

Definition at line 76 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_FACEUP (DISPID_SOLPACK_CARD + 5)

Definition at line 77 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_ID (DISPID_SOLPACK_CARD + 1)

Definition at line 73 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_INDEX (DISPID_SOLPACK_CARD + 7)

Definition at line 79 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_PILE (DISPID_SOLPACK_CARD + 6)

Definition at line 78 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_RANK (DISPID_SOLPACK_CARD + 2)

Definition at line 74 of file solpackdid.h.

#define DISPID_SOLPACK_CARD_SUIT (DISPID_SOLPACK_CARD + 3)

Definition at line 75 of file solpackdid.h.

#define DISPID_SOLPACK_FRAGMENT (DISPID_SOLPACK_CARD + 100)

Definition at line 85 of file solpackdid.h.

#define DISPID_SOLPACK_FRAGMENT_ADDTOFRAGMENT (DISPID_SOLPACK_FRAGMENT + 1)

Definition at line 86 of file solpackdid.h.

#define DISPID_SOLPACK_FRAGMENT_MOVETOPILE (DISPID_SOLPACK_FRAGMENT + 2)

Definition at line 87 of file solpackdid.h.

#define DISPID_SOLPACK_GAME (DISPID_SOLPACK_APP + 100)

Definition at line 35 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_AUTOPLAY (DISPID_SOLPACK_GAME + 5)

Definition at line 40 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_AUTOPLAYCARD (DISPID_SOLPACK_GAME + 6)

Definition at line 41 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_CANCELMOVE (DISPID_SOLPACK_GAME + 11)

Definition at line 46 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_DEAL (DISPID_SOLPACK_GAME + 4)

Definition at line 39 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_DROPFRAGMENT (DISPID_SOLPACK_GAME + 10)

Definition at line 45 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_HANDLECOMMAND (DISPID_SOLPACK_GAME + 7)

Definition at line 42 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_INFO (DISPID_SOLPACK_GAME + 1)

Definition at line 36 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_INITIALIZE (DISPID_SOLPACK_GAME + 2)

Definition at line 37 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_PILECLICKED (DISPID_SOLPACK_GAME + 8)

Definition at line 43 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_RECALCLAYOUT (DISPID_SOLPACK_GAME + 12)

Definition at line 47 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_SETUPFRAGMENT (DISPID_SOLPACK_GAME + 9)

Definition at line 44 of file solpackdid.h.

#define DISPID_SOLPACK_GAME_UNINITIALIZE (DISPID_SOLPACK_GAME + 3)

Definition at line 38 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEDATA (DISPID_SOLPACK_GAMEINFO + 100)

Definition at line 114 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEDATA_DATA (DISPID_SOLPACK_GAMEDATA + 1)

Definition at line 115 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEINFO (DISPID_SOLPACK_GAMELIB + 100)

Definition at line 105 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEINFO_DIFFICULTY (DISPID_SOLPACK_GAMEINFO + 3)

Definition at line 108 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEINFO_RULES (DISPID_SOLPACK_GAMEINFO + 2)

Definition at line 107 of file solpackdid.h.

#define DISPID_SOLPACK_GAMEINFO_TITLE (DISPID_SOLPACK_GAMEINFO + 1)

Definition at line 106 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB (DISPID_SOLPACK_FRAGMENT + 100)

Definition at line 93 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_AUTHOR (DISPID_SOLPACK_GAMELIB + 1)

Definition at line 94 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_EMAIL (DISPID_SOLPACK_GAMELIB + 2)

Definition at line 95 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_GETGAME (DISPID_SOLPACK_GAMELIB + 5)

Definition at line 98 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_GETGAMEINFO (DISPID_SOLPACK_GAMELIB + 6)

Definition at line 99 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_NUMGAMES (DISPID_SOLPACK_GAMELIB + 4)

Definition at line 97 of file solpackdid.h.

#define DISPID_SOLPACK_GAMELIB_WEBSITE (DISPID_SOLPACK_GAMELIB + 3)

Definition at line 96 of file solpackdid.h.

#define DISPID_SOLPACK_PILE (DISPID_SOLPACK_GAME + 100)

Definition at line 53 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_BASETYPE (DISPID_SOLPACK_PILE + 9)

Definition at line 62 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_COMMENTTOOLTIP (DISPID_SOLPACK_PILE + 7)

Definition at line 60 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_GETCARD (DISPID_SOLPACK_PILE + 11)

Definition at line 64 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_HEIGHT (DISPID_SOLPACK_PILE + 5)

Definition at line 58 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_HEIGHTWITH (DISPID_SOLPACK_PILE + 13)

Definition at line 66 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_NUMCARDS (DISPID_SOLPACK_PILE + 6)

Definition at line 59 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP (DISPID_SOLPACK_PILE + 8)

Definition at line 61 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_SHUFFLE (DISPID_SOLPACK_PILE + 10)

Definition at line 63 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_TYPE (DISPID_SOLPACK_PILE + 1)

Definition at line 54 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_WIDTH (DISPID_SOLPACK_PILE + 4)

Definition at line 57 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_WIDTHWITH (DISPID_SOLPACK_PILE + 12)

Definition at line 65 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_X (DISPID_SOLPACK_PILE + 2)

Definition at line 55 of file solpackdid.h.

#define DISPID_SOLPACK_PILE_Y (DISPID_SOLPACK_PILE + 3)

Definition at line 56 of file solpackdid.h.

Generated on Wed May 8 12:39:26 2002 for Solitaire Pack by doxygen 1.2.15


solpackdid.h Source File

solpackdid.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // solpackdid.h
00004 //    Dispatch identifiers for Solpack methods and properties.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // ISolpackApp
00015 //----------------------------------------------------------------------------
00016 #define DISPID_SOLPACK_APP                         1000
00017 #define DISPID_SOLPACK_APP_CARDWIDTH               (DISPID_SOLPACK_APP + 1)
00018 #define DISPID_SOLPACK_APP_CARDHEIGHT              (DISPID_SOLPACK_APP + 2)
00019 #define DISPID_SOLPACK_APP_SCORE                   (DISPID_SOLPACK_APP + 3)
00020 #define DISPID_SOLPACK_APP_WINDOWWIDTH             (DISPID_SOLPACK_APP + 4)
00021 #define DISPID_SOLPACK_APP_WINDOWHEIGHT            (DISPID_SOLPACK_APP + 5)
00022 #define DISPID_SOLPACK_APP_SPACINGX                (DISPID_SOLPACK_APP + 6)
00023 #define DISPID_SOLPACK_APP_SPACINGY                (DISPID_SOLPACK_APP + 7)
00024 #define DISPID_SOLPACK_APP_FRAGMENT                (DISPID_SOLPACK_APP + 8)
00025 #define DISPID_SOLPACK_APP_CREATEPILE              (DISPID_SOLPACK_APP + 9)
00026 #define DISPID_SOLPACK_APP_CREATEGAMEDATA          (DISPID_SOLPACK_APP + 10)
00027 #define DISPID_SOLPACK_APP_ADDGAMECOMMAND          (DISPID_SOLPACK_APP + 11)
00028 #define DISPID_SOLPACK_APP_ENABLEGAMECOMMAND       (DISPID_SOLPACK_APP + 12)
00029 #define DISPID_SOLPACK_APP_GAMEWON                 (DISPID_SOLPACK_APP + 13)
00030
00031
00032 //----------------------------------------------------------------------------
00033 // ISolpackGame
00034 //----------------------------------------------------------------------------
00035 #define DISPID_SOLPACK_GAME                        (DISPID_SOLPACK_APP + 100)
00036 #define DISPID_SOLPACK_GAME_INFO                   (DISPID_SOLPACK_GAME + 1)
00037 #define DISPID_SOLPACK_GAME_INITIALIZE             (DISPID_SOLPACK_GAME + 2)
00038 #define DISPID_SOLPACK_GAME_UNINITIALIZE           (DISPID_SOLPACK_GAME + 3)
00039 #define DISPID_SOLPACK_GAME_DEAL                   (DISPID_SOLPACK_GAME + 4)
00040 #define DISPID_SOLPACK_GAME_AUTOPLAY               (DISPID_SOLPACK_GAME + 5)
00041 #define DISPID_SOLPACK_GAME_AUTOPLAYCARD           (DISPID_SOLPACK_GAME + 6)
00042 #define DISPID_SOLPACK_GAME_HANDLECOMMAND          (DISPID_SOLPACK_GAME + 7)
00043 #define DISPID_SOLPACK_GAME_PILECLICKED            (DISPID_SOLPACK_GAME + 8)
00044 #define DISPID_SOLPACK_GAME_SETUPFRAGMENT          (DISPID_SOLPACK_GAME + 9)
00045 #define DISPID_SOLPACK_GAME_DROPFRAGMENT           (DISPID_SOLPACK_GAME + 10)
00046 #define DISPID_SOLPACK_GAME_CANCELMOVE             (DISPID_SOLPACK_GAME + 11)
00047 #define DISPID_SOLPACK_GAME_RECALCLAYOUT           (DISPID_SOLPACK_GAME + 12)
00048
00049
00050 //----------------------------------------------------------------------------
00051 // ISolpackPile
00052 //----------------------------------------------------------------------------
00053 #define DISPID_SOLPACK_PILE                        (DISPID_SOLPACK_GAME + 100)
00054 #define DISPID_SOLPACK_PILE_TYPE                   (DISPID_SOLPACK_PILE + 1)
00055 #define DISPID_SOLPACK_PILE_X                      (DISPID_SOLPACK_PILE + 2)
00056 #define DISPID_SOLPACK_PILE_Y                      (DISPID_SOLPACK_PILE + 3)
00057 #define DISPID_SOLPACK_PILE_WIDTH                  (DISPID_SOLPACK_PILE + 4)
00058 #define DISPID_SOLPACK_PILE_HEIGHT                 (DISPID_SOLPACK_PILE + 5)
00059 #define DISPID_SOLPACK_PILE_NUMCARDS               (DISPID_SOLPACK_PILE + 6)
00060 #define DISPID_SOLPACK_PILE_COMMENTTOOLTIP         (DISPID_SOLPACK_PILE + 7)
00061 #define DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP    (DISPID_SOLPACK_PILE + 8)
00062 #define DISPID_SOLPACK_PILE_BASETYPE               (DISPID_SOLPACK_PILE + 9)
00063 #define DISPID_SOLPACK_PILE_SHUFFLE                (DISPID_SOLPACK_PILE + 10)
00064 #define DISPID_SOLPACK_PILE_GETCARD                (DISPID_SOLPACK_PILE + 11)
00065 #define DISPID_SOLPACK_PILE_WIDTHWITH              (DISPID_SOLPACK_PILE + 12)
00066 #define DISPID_SOLPACK_PILE_HEIGHTWITH             (DISPID_SOLPACK_PILE + 13)
00067
00068
00069 //----------------------------------------------------------------------------
00070 // ISolpackCard
00071 //----------------------------------------------------------------------------
00072 #define DISPID_SOLPACK_CARD                        (DISPID_SOLPACK_PILE + 100)
00073 #define DISPID_SOLPACK_CARD_ID                     (DISPID_SOLPACK_CARD + 1)
00074 #define DISPID_SOLPACK_CARD_RANK                   (DISPID_SOLPACK_CARD + 2)
00075 #define DISPID_SOLPACK_CARD_SUIT                   (DISPID_SOLPACK_CARD + 3)
00076 #define DISPID_SOLPACK_CARD_CANDRAG                (DISPID_SOLPACK_CARD + 4)
00077 #define DISPID_SOLPACK_CARD_FACEUP                 (DISPID_SOLPACK_CARD + 5)
00078 #define DISPID_SOLPACK_CARD_PILE                   (DISPID_SOLPACK_CARD + 6)
00079 #define DISPID_SOLPACK_CARD_INDEX                  (DISPID_SOLPACK_CARD + 7)
00080
00081
00082 //----------------------------------------------------------------------------
00083 // ISolpackFragment
00084 //----------------------------------------------------------------------------
00085 #define DISPID_SOLPACK_FRAGMENT                    (DISPID_SOLPACK_CARD + 100)
00086 #define DISPID_SOLPACK_FRAGMENT_ADDTOFRAGMENT      (DISPID_SOLPACK_FRAGMENT + 1)
00087 #define DISPID_SOLPACK_FRAGMENT_MOVETOPILE         (DISPID_SOLPACK_FRAGMENT + 2)
00088
00089
00090 //----------------------------------------------------------------------------
00091 // ISolpackGameLib
00092 //----------------------------------------------------------------------------
00093 #define DISPID_SOLPACK_GAMELIB                     (DISPID_SOLPACK_FRAGMENT + 100)
00094 #define DISPID_SOLPACK_GAMELIB_AUTHOR              (DISPID_SOLPACK_GAMELIB + 1)
00095 #define DISPID_SOLPACK_GAMELIB_EMAIL               (DISPID_SOLPACK_GAMELIB + 2)
00096 #define DISPID_SOLPACK_GAMELIB_WEBSITE             (DISPID_SOLPACK_GAMELIB + 3)
00097 #define DISPID_SOLPACK_GAMELIB_NUMGAMES            (DISPID_SOLPACK_GAMELIB + 4)
00098 #define DISPID_SOLPACK_GAMELIB_GETGAME             (DISPID_SOLPACK_GAMELIB + 5)
00099 #define DISPID_SOLPACK_GAMELIB_GETGAMEINFO         (DISPID_SOLPACK_GAMELIB + 6)
00100
00101
00102 //----------------------------------------------------------------------------
00103 // ISolpackGameInfo
00104 //----------------------------------------------------------------------------
00105 #define DISPID_SOLPACK_GAMEINFO                    (DISPID_SOLPACK_GAMELIB + 100)
00106 #define DISPID_SOLPACK_GAMEINFO_TITLE              (DISPID_SOLPACK_GAMEINFO + 1)
00107 #define DISPID_SOLPACK_GAMEINFO_RULES              (DISPID_SOLPACK_GAMEINFO + 2)
00108 #define DISPID_SOLPACK_GAMEINFO_DIFFICULTY         (DISPID_SOLPACK_GAMEINFO + 3)
00109
00110
00111 //----------------------------------------------------------------------------
00112 // ISolpackGameData
00113 //----------------------------------------------------------------------------
00114 #define DISPID_SOLPACK_GAMEDATA                    (DISPID_SOLPACK_GAMEINFO + 100)
00115 #define DISPID_SOLPACK_GAMEDATA_DATA               (DISPID_SOLPACK_GAMEDATA + 1)
00116
00117
00118 #endif // !defined(AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SolpackIncl.h File Reference

#include "Solpack.h"
#include <bmws_ptr.h>

Go to the source code of this file.

Defines

#define AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_

Typedefs

typedef CPtr< ISolpackApp,
&IID_ISolpackApp > 		CSolpackAppPtr
typedef CPtr< ISolpackGame,
&IID_ISolpackGame > 		CSolpackGamePtr
typedef CPtr< ISolpackPile,
&IID_ISolpackPile > 		CSolpackPilePtr
typedef CPtr< ISolpackFragment,
&IID_ISolpackFragment > 		CSolpackFragmentPtr
typedef CPtr< ISolpackCard,
&IID_ISolpackCard > 		CSolpackCardPtr
typedef CPtr< ISolpackGameData,
&IID_ISolpackGameData > 		CSolpackGameDataPtr
typedef CPtr< ISolpackGameLib,
&IID_ISolpackGameLib > 		CSolpackGameLibPtr
typedef CPtr< ISolpackGameInfo,
&IID_ISolpackGameInfo > 		CSolpackGameInfoPtr

Define Documentation

#define AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file SolpackIncl.h.

Typedef Documentation

typedef CPtr<ISolpackApp, &IID_ISolpackApp> CSolpackAppPtr

Definition at line 23 of file SolpackIncl.h.

typedef CPtr<ISolpackCard, &IID_ISolpackCard> CSolpackCardPtr

Definition at line 27 of file SolpackIncl.h.

typedef CPtr<ISolpackFragment, &IID_ISolpackFragment> CSolpackFragmentPtr

Definition at line 26 of file SolpackIncl.h.

typedef CPtr<ISolpackGameData, &IID_ISolpackGameData> CSolpackGameDataPtr

Definition at line 28 of file SolpackIncl.h.

typedef CPtr<ISolpackGameInfo, &IID_ISolpackGameInfo> CSolpackGameInfoPtr

Definition at line 30 of file SolpackIncl.h.

typedef CPtr<ISolpackGameLib, &IID_ISolpackGameLib> CSolpackGameLibPtr

Definition at line 29 of file SolpackIncl.h.

typedef CPtr<ISolpackGame, &IID_ISolpackGame> CSolpackGamePtr

Definition at line 24 of file SolpackIncl.h.

typedef CPtr<ISolpackPile, &IID_ISolpackPile> CSolpackPilePtr

Definition at line 25 of file SolpackIncl.h.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SolpackIncl.h Source File

SolpackIncl.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackIncl.h
00004 //    Type definitions for Solitaire Pack smart pointers.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 //----------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------
00016 #include "Solpack.h"
00017 #include <bmws_ptr.h>
00018
00019
00020 //----------------------------------------------------------------------------
00021 // Smart pointer typedefs
00022 //----------------------------------------------------------------------------
00023 typedef CPtr<ISolpackApp,			&IID_ISolpackApp>         CSolpackAppPtr;
00024 typedef CPtr<ISolpackGame,			&IID_ISolpackGame>    CSolpackGamePtr;
00025 typedef CPtr<ISolpackPile,			&IID_ISolpackPile>    CSolpackPilePtr;
00026 typedef CPtr<ISolpackFragment,	&IID_ISolpackFragment> CSolpackFragmentPtr;
00027 typedef CPtr<ISolpackCard,			&IID_ISolpackCard>    CSolpackCardPtr;
00028 typedef CPtr<ISolpackGameData,	&IID_ISolpackGameData> CSolpackGameDataPtr;
00029 typedef CPtr<ISolpackGameLib,		&IID_ISolpackGameLib>  CSolpackGameLibPtr;
00030 typedef CPtr<ISolpackGameInfo,	&IID_ISolpackGameInfo> CSolpackGameInfoPtr;
00031
00032
00033 #endif // !defined(AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SolpackInternal.h File Reference

Go to the source code of this file.

Defines

#define AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Functions

DEFINE_GUID (IID_IInternalPile, 0x0cbc404e, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75)

Define Documentation

#define AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file SolpackInternal.h.

Function Documentation

DEFINE_GUID | ( | IID_IInternalPile | ,
 |  | 0x0cbc404e | ,
 |  | 0x2ca8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x0 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0xd | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SolpackInternal.h Source File

SolpackInternal.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackInternal.h
00004 //    Declarations of internal IIDs.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012
00013 // {0CBC404E-2CA8-11d6-8301-0020780D1875}
00014 DEFINE_GUID(IID_IInternalPile, 0x0cbc404e, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75);
00015
00016 // {0CBC404F-2CA8-11d6-8301-0020780D1875}
00017 DEFINE_GUID(IID_IInternalCard, 0x0cbc404f, 0x2ca8, 0x11d6, 0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75);
00018
00019
00020 #endif // !defined(AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SolpackInternal_i.c File Reference

Go to the source code of this file.

Compounds

struct | _IID

Typedefs

typedef _IID | IID
typedef IID | CLSID

Variables

const IID | IID_IInternalPile = {0x0cbc404e, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}
const IID | IID_IInternalCard = {0x0cbc404f, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}

Typedef Documentation

typedef IID CLSID

Definition at line 30 of file SolpackInternal_i.c.

typedef struct _IID IID

Variable Documentation

const IID IID_IInternalCard = {0x0cbc404f, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}

Definition at line 34 of file SolpackInternal_i.c.

const IID IID_IInternalPile = {0x0cbc404e, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}}

Definition at line 33 of file SolpackInternal_i.c.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SolpackInternal_i.c Source File

SolpackInternal_i.c

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SolpackInternal_i.c
00004 //    Definitions of internal IIDs. These are used to get the CCard object
00005 //    pointer from an ISolpackCard interface pointer and to get the CPile
00006 //    object pointer from an ISolpackPile interface pointer.
00007 //
00008 //----------------------------------------------------------------------------
00009
00010
00011 #ifdef __cplusplus
00012 extern "C"{
00013 #endif
00014
00015 #ifndef __IID_DEFINED__
00016 #define __IID_DEFINED__
00017
00018 typedef struct _IID
00019 {
00020     unsigned long x;
00021     unsigned short s1;
00022     unsigned short s2;
00023     unsigned char  c[8];
00024 } IID;
00025
00026 #endif // __IID_DEFINED__
00027
00028 #ifndef CLSID_DEFINED
00029 #define CLSID_DEFINED
00030 typedef IID CLSID;
00031 #endif // CLSID_DEFINED
00032
00033 const IID IID_IInternalPile = {0x0cbc404e, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}};
00034 const IID IID_IInternalCard = {0x0cbc404f, 0x2ca8, 0x11d6, {0x83, 0x01, 0x0, 0x20, 0x78, 0xd, 0x18, 0x75}};
00035
00036 #ifdef __cplusplus
00037 }
00038 #endif
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.cpp File Reference

#include "stdafx.h"
#include "SPGames.h"
#include "..\SolpackTLB\Solpack.h"
#include "GameLib.h"
#include <bmws_comserver.h>
#include <bmws_tlb.h>
#include <bmws_error.h>
#include <bmws_ptr.h>
#include <comcat.h>
#include "resource.h"
#include "..\SPGameLC\resource.h"
#include "SPGames_i.c"
#include "..\SolpackTLB\Solpack_i.c"
#include "..\SolpackTLB\Solpack_catid.c"

Go to the source code of this file.

Functions

BOOL APIENTRY | DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
void | InitModule ()
STDAPI | DllCanUnloadNow ()
STDAPI | DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
STDAPI | DllRegisterServer ()
STDAPI | DllUnregisterServer ()

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
TCHAR | g_szAppTitle [64]
long | g_cActiveComponents = 0
BOOL | g_bInitted = FALSE
HWND | g_hWnd = NULL
COOMExcep g_OOMExcep
COOMExcep * g_pOOMExcep = &g_OOMExcep
ITypeLib * | g_pTypeLib = NULL
CFactoryData g_aFactoryData []
int | g_cFactoryDataEntries = sizeof(g_aFactoryData) / sizeof(CFactoryData)

Function Documentation

STDAPI DllCanUnloadNow ( )

Definition at line 153 of file SPGames.cpp.

References CFactory::CanUnloadNow(), and InitModule().

00154 {
00155    InitModule();
00156    return CFactory::CanUnloadNow();
00157 }

STDAPI DllGetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppv
 | ) |

Definition at line 179 of file SPGames.cpp.

References CFactory::GetClassObject(), and InitModule().

00180 {
00181    InitModule();
00182    return CFactory::GetClassObject(rclsid, riid, ppv);
00183 }

BOOL APIENTRY DllMain | ( | HINSTANCE | hinstDLL,
 |  | DWORD | fdwReason,
 |  | LPVOID | lpvReserved
 | ) |

Definition at line 87 of file SPGames.cpp.

References BMWSMemUninit(), g_bInitted, g_cActiveComponents, g_hInst, g_hInstLC, g_pTypeLib, ODS, ODS2, and SAFERELEASE.

00088 {
00089    if(fdwReason == DLL_PROCESS_ATTACH)
00090    {
00091       // The DLL is being loaded by a process
00092       ODS("SPGames:  Attaching\n");
00093       g_hInst = hinstDLL;
00094       g_hInstLC = LoadLibraryEx(TEXT("SPGameLC.DLL"), NULL, LOAD_LIBRARY_AS_DATAFILE);
00095       g_bInitted = FALSE;
00096    } else if(fdwReason == DLL_PROCESS_DETACH)
00097    {
00098       // The DLL is being unloaded by a process
00099       SAFERELEASE(g_pTypeLib);
00100       if(g_hInstLC)
00101          FreeLibrary(g_hInstLC);
00102       #ifdef _DEBUG
00103          TCHAR szBuf[256];
00104          wsprintf(szBuf, TEXT("SPGames:  Detaching  (%d objects still exist)"),
00105             g_cActiveComponents);
00106          ODS2(szBuf);
00107       #endif
00108       #ifdef BMWS_TRACKMEMALLOC
00109          BMWSMemUninit();
00110       #endif
00111    }
00112    return TRUE;
00113 }

STDAPI DllRegisterServer ( )

Definition at line 197 of file SPGames.cpp.

References CATID_SolpackGameLibs, g_cFactoryDataEntries, InitModule(), LIBID_SPGamesLib, CFactory::RegisterAll(), RegisterTLB(), and SAFERELEASE.

00198 {
00199    InitModule();
00200
00201    HRESULT hr = RegisterTLB(LIBID_SPGamesLib, 1, 0);
00202    if(FAILED(hr))
00203       return hr;
00204
00205    ICatRegister *pcr = NULL;
00206    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00207       IID_ICatRegister, (LPVOID*)&pcr);
00208    if(FAILED(hr))
00209       return hr;
00210
00211    // Register this category as being "implemented" by the COM object(s)
00212    CATID rgcatid[1];
00213    rgcatid[0] = CATID_SolpackGameLibs;
00214    for(int i = 0; i < g_cFactoryDataEntries && SUCCEEDED(hr); i++)
00215    {
00216       hr = pcr->RegisterClassImplCategories(*(g_aFactoryData[i].m_pCLSID), 1, rgcatid);
00217    }
00218
00219    SAFERELEASE(pcr);
00220    if(FAILED(hr))
00221       return hr;
00222
00223    // Register the contained COM object(s)
00224    return CFactory::RegisterAll();
00225 }

STDAPI DllUnregisterServer ( )

Definition at line 239 of file SPGames.cpp.

References CATID_SolpackGameLibs, g_cFactoryDataEntries, InitModule(), LIBID_SPGamesLib, SAFERELEASE, CFactory::UnregisterAll(), and UnregisterTLB().

00240 {
00241    InitModule();
00242
00243    UnregisterTLB(LIBID_SPGamesLib, 1, 0);
00244
00245    ICatRegister *pcr = NULL;
00246    HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00247       IID_ICatRegister, (LPVOID*)&pcr);
00248    if(FAILED(hr))
00249       return hr;
00250
00251    // Unregister COM object(s) from cateogory
00252    CATID rgcatid[1];
00253    rgcatid[0] = CATID_SolpackGameLibs;
00254    for(int i = 0; i < g_cFactoryDataEntries && SUCCEEDED(hr); i++)
00255    {
00256       pcr->UnRegisterClassImplCategories(*(g_aFactoryData[i].m_pCLSID), 1, rgcatid);
00257    }
00258
00259    SAFERELEASE(pcr);
00260
00261    // Register the contained COM object(s)
00262    return CFactory::UnregisterAll();
00263 }

void InitModule ( )

Definition at line 127 of file SPGames.cpp.

References ARRAYSIZE, BMWSMemInit(), g_bInitted, g_hInstLC, g_szAppTitle, and InitErrorHandler().

Referenced by DllCanUnloadNow(), DllGetClassObject(), DllRegisterServer(), and DllUnregisterServer().

00128 {
00129    if(g_bInitted)
00130       return;
00131    g_bInitted = TRUE;
00132
00133    #ifdef BMWS_TRACKMEMALLOC
00134       BMWSMemInit();
00135    #endif
00136
00137    LoadString(g_hInstLC, IDS_APP_TITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
00138    InitErrorHandler();
00139 }

Variable Documentation

CFactoryData g_aFactoryData[]

Initial value:

{
   {
      &CLSID_SPGames,
      CGameLib::CreateInstance,
      0,
      &LIBID_SolpackLib,
      IDS_PERCENTS,
      IDS_REG_PROGIDHOLDER,
      IDS_REG_PROGIDVIHOLDER,
      IDS_REG_LIBDESC,
      IDS_REG_SPGAMESPROGID,
      1,
      0
   }
}

Definition at line 51 of file SPGames.cpp.

BOOL g_bInitted = FALSE

Definition at line 36 of file SPGames.cpp.

Referenced by DllMain(), and InitModule().

long g_cActiveComponents = 0

Definition at line 35 of file SPGames.cpp.

Referenced by CUnkBase::CUnkBase(), DllMain(), and CUnkBase::~CUnkBase().

int g_cFactoryDataEntries = sizeof(g_aFactoryData) / sizeof(CFactoryData)

Definition at line 68 of file SPGames.cpp.

Referenced by DllRegisterServer(), DllUnregisterServer(), CFactory::GetClassObject(), CFactory::RegisterAll(), and CFactory::UnregisterAll().

HINSTANCE g_hInst

Definition at line 32 of file SPGames.cpp.

Referenced by DllMain().

HINSTANCE g_hInstLC

Definition at line 33 of file SPGames.cpp.

Referenced by DllMain(), and InitModule().

HWND g_hWnd = NULL

Definition at line 37 of file SPGames.cpp.

COOMExcep g_OOMExcep

Definition at line 38 of file SPGames.cpp.

COOMExcep* g_pOOMExcep = &g_OOMExcep

Definition at line 39 of file SPGames.cpp.

ITypeLib* g_pTypeLib = NULL

Definition at line 40 of file SPGames.cpp.

Referenced by CGameLib::CreateInstance(), DllMain(), and CGameLib::InitGameLib().

TCHAR g_szAppTitle[64]

Definition at line 34 of file SPGames.cpp.

Referenced by InitModule(), and CAppearanceDlg::OptionsAppearanceProc().

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.cpp Source File

SPGames.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SPGames.cpp
00004 //    Defines the entry points for the DLL module.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "SPGames.h"
00014 #include "..\SolpackTLB\Solpack.h"
00015 #include "GameLib.h"
00016 #include <bmws_comserver.h>
00017 #include <bmws_tlb.h>
00018 #include <bmws_error.h>
00019 #include <bmws_ptr.h>
00020 #include <comcat.h>
00021 #include "resource.h"
00022 #include "..\SPGameLC\resource.h"
00023
00024 #include "SPGames_i.c"
00025 #include "..\SolpackTLB\Solpack_i.c"
00026 #include "..\SolpackTLB\Solpack_catid.c"
00027
00028
00029 //----------------------------------------------------------------------------
00030 // Global variables
00031 //----------------------------------------------------------------------------
00032 HINSTANCE g_hInst;                     // DLL instance handle
00033 HINSTANCE g_hInstLC;                   // Localized resources module handle
00034 TCHAR g_szAppTitle[64];                // Module title
00035 long g_cActiveComponents = 0;          // Count of active COM components
00036 BOOL g_bInitted = FALSE;               // Whether module has been initialized
00037 HWND g_hWnd = NULL;                    // Main window handle
00038 COOMExcep g_OOMExcep;                  // Out of memory object
00039 COOMExcep *g_pOOMExcep = &g_OOMExcep;  // Pointer to out of memory object
00040 ITypeLib *g_pTypeLib = NULL;           // The Solpack type library
00041
00042 #ifdef BMWS_TRACKMEMALLOC
00043 TCHAR g_szModule[10] = "SPGames ";     // Name for debugging purposes
00044 #endif
00045
00046
00047 //----------------------------------------------------------------------------
00048 // Information about contained COM objects
00049 //----------------------------------------------------------------------------
00050
00051 CFactoryData g_aFactoryData[] =
00052 {
00053    {
00054       &CLSID_SPGames,
00055       CGameLib::CreateInstance,
00056       0,
00057       &LIBID_SolpackLib,
00058       IDS_PERCENTS,
00059       IDS_REG_PROGIDHOLDER,
00060       IDS_REG_PROGIDVIHOLDER,
00061       IDS_REG_LIBDESC,
00062       IDS_REG_SPGAMESPROGID,
00063       1,
00064       0
00065    }
00066 };
00067
00068 int g_cFactoryDataEntries = sizeof(g_aFactoryData) / sizeof(CFactoryData);
00069
00070
00071 //----------------------------------------------------------------------------
00072 //
00073 // DllMain function
00074 //    Defines the entry point for the library.
00075 //
00076 // Parameters:
00077 //    hinstDLL:      [in] Handle to the DLL module. The value is the base
00078 //                   address of the DLL.
00079 //    fdwReason:     [in] Specifies a flag indicating why the DLL entry-point
00080 //                   function is being called
00081 //    lpvReserved:   [in] Specifies further aspects of DLL initialization and
00082 //                   cleanup.
00083 //
00084 // Returns:          TRUE in all cases.
00085 //
00086 //----------------------------------------------------------------------------
00087 BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
00088 {
00089    if(fdwReason == DLL_PROCESS_ATTACH)
00090    {
00091       // The DLL is being loaded by a process
00092       ODS("SPGames:  Attaching\n");
00093       g_hInst = hinstDLL;
00094       g_hInstLC = LoadLibraryEx(TEXT("SPGameLC.DLL"), NULL, LOAD_LIBRARY_AS_DATAFILE);
00095       g_bInitted = FALSE;
00096    } else if(fdwReason == DLL_PROCESS_DETACH)
00097    {
00098       // The DLL is being unloaded by a process
00099       SAFERELEASE(g_pTypeLib);
00100       if(g_hInstLC)
00101          FreeLibrary(g_hInstLC);
00102       #ifdef _DEBUG
00103          TCHAR szBuf[256];
00104          wsprintf(szBuf, TEXT("SPGames:  Detaching  (%d objects still exist)"),
00105             g_cActiveComponents);
00106          ODS2(szBuf);
00107       #endif
00108       #ifdef BMWS_TRACKMEMALLOC
00109          BMWSMemUninit();
00110       #endif
00111    }
00112    return TRUE;
00113 }
00114
00115
00116 //----------------------------------------------------------------------------
00117 //
00118 // InitModule function
00119 //    Called by all exported functions to ensure that module initialization is
00120 //    performed.
00121 //
00122 // Parameters:       None.
00123 //
00124 // Returns:          None.
00125 //
00126 //----------------------------------------------------------------------------
00127 void InitModule()
00128 {
00129    if(g_bInitted)
00130       return;
00131    g_bInitted = TRUE;
00132
00133    #ifdef BMWS_TRACKMEMALLOC
00134       BMWSMemInit();
00135    #endif
00136
00137    LoadString(g_hInstLC, IDS_APP_TITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
00138    InitErrorHandler();
00139 }
00140
00141
00142 //----------------------------------------------------------------------------
00143 //
00144 // DllCanUnloadNow function
00145 //    Determines whether this DLL is in use. If not, the caller can safely
00146 //    unload this DLL from memory.
00147 //
00148 // Parameters:       None.
00149 //
00150 // Returns:          S_OK if this DLL can be unloaded; S_FALSE if not.
00151 //
00152 //----------------------------------------------------------------------------
00153 STDAPI DllCanUnloadNow()
00154 {
00155    InitModule();
00156    return CFactory::CanUnloadNow();
00157 }
00158
00159
00160 //----------------------------------------------------------------------------
00161 //
00162 // DllGetClassObject function
00163 //    Retrieves the class object from a DLL object handler or object
00164 //    application.
00165 //
00166 // Parameters:
00167 //    rclsid:        [in] CLSID that will associate the correct data and code.
00168 //    riid:          [in] Reference to the identifier of the interface that
00169 //                   the caller is to use to communicate with the class
00170 //                   object. Usually, this is IID_IClassFactory.
00171 //    ppv:           [out] Address of pointer variable that receives the
00172 //                   interface pointer requested in riid. Upon successful
00173 //                   return, *ppv contains the requested interface pointer. If
00174 //                   an error occurs, the interface pointer is NULL.
00175 //
00176 // Returns:          A standard COM success or error value.
00177 //
00178 //----------------------------------------------------------------------------
00179 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
00180 {
00181    InitModule();
00182    return CFactory::GetClassObject(rclsid, riid, ppv);
00183 }
00184
00185
00186 //----------------------------------------------------------------------------
00187 //
00188 // DllRegisterServer function
00189 //    Instructs an in-process server to create its registry entries for all
00190 //    classes supported in this server module.
00191 //
00192 // Parameters:       None.
00193 //
00194 // Returns:          A standard COM success or error value.
00195 //
00196 //----------------------------------------------------------------------------
00197 STDAPI DllRegisterServer()
00198 {
00199    InitModule();
00200
00201    HRESULT hr = RegisterTLB(LIBID_SPGamesLib, 1, 0);
00202    if(FAILED(hr))
00203       return hr;
00204
00205    ICatRegister *pcr = NULL;
00206    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00207       IID_ICatRegister, (LPVOID*)&pcr);
00208    if(FAILED(hr))
00209       return hr;
00210
00211    // Register this category as being "implemented" by the COM object(s)
00212    CATID rgcatid[1];
00213    rgcatid[0] = CATID_SolpackGameLibs;
00214    for(int i = 0; i < g_cFactoryDataEntries && SUCCEEDED(hr); i++)
00215    {
00216       hr = pcr->RegisterClassImplCategories(*(g_aFactoryData[i].m_pCLSID), 1, rgcatid);
00217    }
00218
00219    SAFERELEASE(pcr);
00220    if(FAILED(hr))
00221       return hr;
00222
00223    // Register the contained COM object(s)
00224    return CFactory::RegisterAll();
00225 }
00226
00227
00228 //----------------------------------------------------------------------------
00229 //
00230 // DllUnregisterServer function
00231 //    Instructs an in-process server to remove only those entries created
00232 //    through DllRegisterServer.
00233 //
00234 // Parameters:       None.
00235 //
00236 // Returns:          A standard COM success or error value.
00237 //
00238 //----------------------------------------------------------------------------
00239 STDAPI DllUnregisterServer()
00240 {
00241    InitModule();
00242
00243    UnregisterTLB(LIBID_SPGamesLib, 1, 0);
00244
00245    ICatRegister *pcr = NULL;
00246    HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00247       IID_ICatRegister, (LPVOID*)&pcr);
00248    if(FAILED(hr))
00249       return hr;
00250
00251    // Unregister COM object(s) from cateogory
00252    CATID rgcatid[1];
00253    rgcatid[0] = CATID_SolpackGameLibs;
00254    for(int i = 0; i < g_cFactoryDataEntries && SUCCEEDED(hr); i++)
00255    {
00256       pcr->UnRegisterClassImplCategories(*(g_aFactoryData[i].m_pCLSID), 1, rgcatid);
00257    }
00258
00259    SAFERELEASE(pcr);
00260
00261    // Register the contained COM object(s)
00262    return CFactory::UnregisterAll();
00263 }
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.h File Reference

#include "rpc.h"
#include "rpcndr.h"
#include "oaidl.h"

Go to the source code of this file.

Defines

#define | __REQUIRED_RPCNDR_H_VERSION__ 440

Typedefs

typedef SPGames | SPGames

Functions

void __RPC_FAR *__RPC_USER | MIDL_user_allocate (size_t)
void __RPC_USER | MIDL_user_free (void __RPC_FAR *)

Variables

RPC_IF_HANDLE | __MIDL_itf_SPGames_0000_v0_0_c_ifspec
RPC_IF_HANDLE | __MIDL_itf_SPGames_0000_v0_0_s_ifspec
EXTERN_C const IID | LIBID_SPGamesLib
EXTERN_C const CLSID | CLSID_SPGames

Define Documentation

#define __REQUIRED_RPCNDR_H_VERSION__ 440

Definition at line 22 of file SPGames.h.

Typedef Documentation

typedef struct SPGames SPGames

Definition at line 39 of file SPGames.h.

Function Documentation

void __RPC_FAR* __RPC_USER MIDL_user_allocate ( size_t )

void __RPC_USER MIDL_user_free ( void __RPC_FAR * )

Variable Documentation

RPC_IF_HANDLE __MIDL_itf_SPGames_0000_v0_0_c_ifspec

Definition at line 66 of file SPGames.h.

RPC_IF_HANDLE __MIDL_itf_SPGames_0000_v0_0_s_ifspec

Definition at line 67 of file SPGames.h.

EXTERN_C const CLSID CLSID_SPGames

Definition at line 79 of file SPGames.h.

EXTERN_C const IID LIBID_SPGamesLib

Definition at line 77 of file SPGames.h.

Referenced by DllRegisterServer(), and DllUnregisterServer().

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.h Source File

SPGames.h

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the definitions for the interfaces */
00005
00006
00007  /* File created by MIDL compiler version 5.03.0280 */
00008 /* at Tue May 07 23:01:30 2002
00009  */
00010 /* Compiler settings for C:\Programming\Microsoft Visual Studio\MyProjects\Solitaire Pack\SPGames\SPGames.idl:
00011     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
00012     error checks: allocation ref bounds_check enum stub_data
00013     VC __declspec() decoration level:
00014          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00015          DECLSPEC_UUID(), MIDL_INTERFACE()
00016 */
00017 //@@MIDL_FILE_HEADING(  )
00018
00019
00020 /* verify that the <rpcndr.h> version is high enough to compile this file*/
00021 #ifndef __REQUIRED_RPCNDR_H_VERSION__
00022 #define __REQUIRED_RPCNDR_H_VERSION__ 440
00023 #endif
00024
00025 #include "rpc.h"
00026 #include "rpcndr.h"
00027
00028 #ifndef __SPGames_h__
00029 #define __SPGames_h__
00030
00031 /* Forward Declarations */
00032
00033 #ifndef __SPGames_FWD_DEFINED__
00034 #define __SPGames_FWD_DEFINED__
00035
00036 #ifdef __cplusplus
00037 typedef class SPGames SPGames;
00038 #else
00039 typedef struct SPGames SPGames;
00040 #endif /* __cplusplus */
00041
00042 #endif   /* __SPGames_FWD_DEFINED__ */
00043
00044
00045 /* header files for imported files */
00046 #include "oaidl.h"
00047
00048 #ifdef __cplusplus
00049 extern "C"{
00050 #endif
00051
00052 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
00053 void __RPC_USER MIDL_user_free( void __RPC_FAR * );
00054
00055 /* interface __MIDL_itf_SPGames_0000 */
00056 /* [local] */
00057
00058 //--------------------------------------------------------------------------
00059 //
00060 //  Solitaire Pack
00061 //  Copyright (C) 2002 Bot Productions
00062 //
00063 //--------------------------------------------------------------------------
00064
00065
00066 extern RPC_IF_HANDLE __MIDL_itf_SPGames_0000_v0_0_c_ifspec;
00067 extern RPC_IF_HANDLE __MIDL_itf_SPGames_0000_v0_0_s_ifspec;
00068
00069
00070 #ifndef __SPGamesLib_LIBRARY_DEFINED__
00071 #define __SPGamesLib_LIBRARY_DEFINED__
00072
00073 /* library SPGamesLib */
00074 /* [helpstring][version][uuid] */
00075
00076
00077 EXTERN_C const IID LIBID_SPGamesLib;
00078
00079 EXTERN_C const CLSID CLSID_SPGames;
00080
00081 #ifdef __cplusplus
00082
00083 class DECLSPEC_UUID("0CBC404D-2CA8-11d6-8301-0020780D1875")
00084 SPGames;
00085 #endif
00086 #endif /* __SPGamesLib_LIBRARY_DEFINED__ */
00087
00088 /* Additional Prototypes for ALL interfaces */
00089
00090 /* end of Additional Prototypes */
00091
00092 #ifdef __cplusplus
00093 }
00094 #endif
00095
00096 #endif
00097
00098
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.idl File Reference

Go to the source code of this file.

Namespaces

namespace SPGamesLib

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SPGames.idl Source File

SPGames.idl

Go to the documentation of this file.
00001 //
00002 // Solitaire Pack
00003 // Copyright (C) 2002 Bot Productions
00004 //
00005 // SPGames.idl
00006 // IDL source code for SPGames.dll
00007 //
00008
00009 cpp_quote("//--------------------------------------------------------------------------")
00010 cpp_quote("//")
00011 cpp_quote("//  Solitaire Pack")
00012 cpp_quote("//  Copyright (C) 2002 Bot Productions")
00013 cpp_quote("//")
00014 cpp_quote("//--------------------------------------------------------------------------")
00015
00016
00017 import "oaidl.idl";
00018
00019 //
00020 // Component and type library descriptions
00021 //
00022 [
00023    uuid(0CBC404C-2CA8-11d6-8301-0020780D1875),
00024    version(1.0),
00025    helpstring("Solitaire Pack 1.0 Game Library Type Library")
00026 ]
00027 library SPGamesLib
00028 {
00029 #ifdef _DEBUG
00030    importlib("..\Debug\solpack.tlb");
00031 #else
00032    importlib("..\Release\solpack.tlb");
00033 #endif
00034
00035    // Game Library component
00036    [
00037       uuid(0CBC404D-2CA8-11d6-8301-0020780D1875),
00038       helpstring("Solitaire Pack Game Library")
00039    ]
00040    coclass SPGames
00041    {
00042       [default] interface ISolpackGameLib;
00043    };
00044 };
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames_i.c File Reference

#include <rpc.h>
#include <rpcndr.h>

Go to the source code of this file.

Compounds

struct | _IID

Defines

#define | MIDL_DEFINE_GUID(type, name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Typedefs

typedef _IID | IID
typedef IID | CLSID

Functions

MIDL_DEFINE_GUID (IID, LIBID_SPGamesLib, 0x0CBC404C, 0x2CA8, 0x11d6, 0x83, 0x01, 0x00, 0x20, 0x78, 0x0D, 0x18, 0x75)
MIDL_DEFINE_GUID (CLSID, CLSID_SPGames, 0x0CBC404D, 0x2CA8, 0x11d6, 0x83, 0x01, 0x00, 0x20, 0x78, 0x0D, 0x18, 0x75)

Define Documentation

#define MIDL_DEFINE_GUID | ( | type,
 |  | name,
 |  | l,
 |  | w1,
 |  | w2,
 |  | b1,
 |  | b2,
 |  | b3,
 |  | b4,
 |  | b5,
 |  | b6,
 |  | b7,
 |  | b8 | ) | const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Definition at line 64 of file SPGames_i.c.

Typedef Documentation

typedef IID CLSID

Definition at line 61 of file SPGames_i.c.

typedef struct _IID IID

Function Documentation

MIDL_DEFINE_GUID | ( | CLSID | ,
 |  | CLSID_SPGames | ,
 |  | 0x0CBC404D | ,
 |  | 0x2CA8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x00 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0x0D | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

MIDL_DEFINE_GUID | ( | IID | ,
 |  | LIBID_SPGamesLib | ,
 |  | 0x0CBC404C | ,
 |  | 0x2CA8 | ,
 |  | 0x11d6 | ,
 |  | 0x83 | ,
 |  | 0x01 | ,
 |  | 0x00 | ,
 |  | 0x20 | ,
 |  | 0x78 | ,
 |  | 0x0D | ,
 |  | 0x18 | ,
 |  | 0x75 |
 | ) |

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SPGames_i.c Source File

SPGames_i.c

Go to the documentation of this file.
00001
00002 #pragma warning( disable: 4049 )  /* more than 64k source lines */
00003
00004 /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
00005
00006 /* link this file in with the server and any clients */
00007
00008
00009  /* File created by MIDL compiler version 5.03.0280 */
00010 /* at Tue May 07 23:01:30 2002
00011  */
00012 /* Compiler settings for C:\Programming\Microsoft Visual Studio\MyProjects\Solitaire Pack\SPGames\SPGames.idl:
00013     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
00014     error checks: allocation ref bounds_check enum stub_data
00015     VC __declspec() decoration level:
00016          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
00017          DECLSPEC_UUID(), MIDL_INTERFACE()
00018 */
00019 //@@MIDL_FILE_HEADING(  )
00020
00021 #if !defined(_M_IA64) && !defined(_M_AXP64)
00022
00023 #ifdef __cplusplus
00024 extern "C"{
00025 #endif
00026
00027
00028 #include <rpc.h>
00029 #include <rpcndr.h>
00030
00031 #ifdef _MIDL_USE_GUIDDEF_
00032
00033 #ifndef INITGUID
00034 #define INITGUID
00035 #include <guiddef.h>
00036 #undef INITGUID
00037 #else
00038 #include <guiddef.h>
00039 #endif
00040
00041 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00042         DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
00043
00044 #else // !_MIDL_USE_GUIDDEF_
00045
00046 #ifndef __IID_DEFINED__
00047 #define __IID_DEFINED__
00048
00049 typedef struct _IID
00050 {
00051     unsigned long x;
00052     unsigned short s1;
00053     unsigned short s2;
00054     unsigned char  c[8];
00055 } IID;
00056
00057 #endif // __IID_DEFINED__
00058
00059 #ifndef CLSID_DEFINED
00060 #define CLSID_DEFINED
00061 typedef IID CLSID;
00062 #endif // CLSID_DEFINED
00063
00064 #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
00065         const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
00066
00067 #endif !_MIDL_USE_GUIDDEF_
00068
00069 MIDL_DEFINE_GUID(IID, LIBID_SPGamesLib,0x0CBC404C,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00070
00071
00072 MIDL_DEFINE_GUID(CLSID, CLSID_SPGames,0x0CBC404D,0x2CA8,0x11d6,0x83,0x01,0x00,0x20,0x78,0x0D,0x18,0x75);
00073
00074 #undef MIDL_DEFINE_GUID
00075
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079
00080
00081
00082 #endif /* !defined(_M_IA64) && !defined(_M_AXP64)*/
00083
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SplashWindow.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SolpckLC\resource.h"
#include <bmws_splashscreen.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


SplashWindow.cpp Source File

SplashWindow.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // SplashWindow.cpp
00004 //    Includes component source files related to the splash window.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include "resource.h"
00011 #include "..\SolpckLC\resource.h"
00012
00013 #include <bmws_splashscreen.cpp>
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


StatusBar.cpp File Reference

#include "stdafx.h"
#include "StatusBar.h"
#include <commctrl.h>
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Variables

HINSTANCE | g_hInst
HINSTANCE | g_hInstLC

Variable Documentation

HINSTANCE g_hInst

Definition at line 21 of file StatusBar.cpp.

HINSTANCE g_hInstLC

Definition at line 22 of file StatusBar.cpp.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


StatusBar.cpp Source File

StatusBar.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // StatusBar.cpp
00004 //    Class to encapsulate the main window's status bar.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "StatusBar.h"
00014 #include <commctrl.h>
00015 #include "..\SolpckLC\resource.h"
00016
00017
00018 //----------------------------------------------------------------------------
00019 // Global and external variables
00020 //----------------------------------------------------------------------------
00021 extern HINSTANCE g_hInst;              // Application instance handle
00022 extern HINSTANCE g_hInstLC;            // Localized resources module handle
00023
00024
00025 //----------------------------------------------------------------------------
00026 //
00027 // CStatusBar constructor
00028 //
00029 // Parameters:       None.
00030 //
00031 //----------------------------------------------------------------------------
00032 CStatusBar::CStatusBar()
00033 {
00034    // Set initial values for member variables
00035    m_pProgressWnd = NULL;
00036    m_bShowingHelp = FALSE;
00037 }
00038
00039
00040 //----------------------------------------------------------------------------
00041 //
00042 // CStatusBar destructor
00043 //
00044 //----------------------------------------------------------------------------
00045 CStatusBar::~CStatusBar()
00046 {
00047    SAFEDELETE(m_pProgressWnd);
00048 }
00049
00050
00051 //----------------------------------------------------------------------------
00052 //
00053 // Create function
00054 //    Creates the status bar window.
00055 //
00056 // Parameters:
00057 //    hwndParent:    Handle to the parent for the pane window.
00058 //
00059 // Returns:          TRUE or FALSE: whether the window was successfully
00060 //                   created or not.
00061 //
00062 //----------------------------------------------------------------------------
00063 BOOL CStatusBar::Create(HWND hwndParent)
00064 {
00065    // Load the score formatter
00066    m_lpszScoreHolder.Assign(IDS_STATUS_SCORE);
00067
00068    // Create the window itself
00069    CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
00070       hwndParent, NULL, (LPVOID)this);
00071
00072    // Divide the status bar
00073    int aiWidths[2];
00074    aiWidths[0] = 100;
00075    aiWidths[1] = -1;
00076    SendMessage(SB_SETPARTS, 2, (LPARAM)(LPINT)aiWidths);
00077
00078    // Create and set up the embedded progress bar (first pane of status bar)
00079    m_pProgressWnd = new CHWND();
00080    ENSUREALLOC(m_pProgressWnd);
00081
00082    m_pProgressWnd->CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | PBS_SMOOTH | WS_VISIBLE,
00083       3, 3, 94, 14, m_hWnd, NULL, NULL);
00084    SetWindowLong(*m_pProgressWnd, GWL_EXSTYLE, GetWindowLong(*m_pProgressWnd, GWL_EXSTYLE) &
00085       ~WS_EX_STATICEDGE);
00086
00087    m_pProgressWnd->SendMessage(PBM_SETRANGE, 0, MAKELPARAM(0, 32768));
00088    m_pProgressWnd->SendMessage(PBM_SETPOS, (WPARAM)0, 0);
00089
00090    return TRUE;
00091 }
00092
00093
00094 //----------------------------------------------------------------------------
00095 //
00096 // SetScore function
00097 //    Updates the score displayed in the status bar.
00098 //
00099 // Parameters:
00100 //    lScore:        The new score to display.
00101 //
00102 // Returns:          None.
00103 //
00104 //----------------------------------------------------------------------------
00105 void CStatusBar::SetScore(long lScore)
00106 {
00107    // Format the score display string and display the text in the second pane
00108    SendMessage(SB_SETTEXT, (WPARAM)1,
00109       (LPARAM)(LPTSTR)(CTSTR().Format(m_lpszScoreHolder, lScore)));
00110 }
00111
00112
00113 //----------------------------------------------------------------------------
00114 //
00115 // SetStatusText function
00116 //    Sets the text to display to the right of the progress bar.
00117 //
00118 // Parameters:
00119 //    lpszStatus:    The text to display.
00120 //
00121 // Returns:          None.
00122 //
00123 //----------------------------------------------------------------------------
00124 void CStatusBar::SetStatusText(CTSTR& lpszStatus)
00125 {
00126    SendMessage(SB_SETTEXT, (WPARAM)1, (LPARAM)(LPTSTR)lpszStatus);
00127 }
00128
00129
00130 //----------------------------------------------------------------------------
00131 //
00132 // SetProgress function
00133 //    Updates the position of the progress bar.
00134 //
00135 // Parameters:
00136 //    iProgress:     A number from 0 to 32768 that represents the progress.
00137 //                   0 indicates that an operation has completed.
00138 //
00139 // Returns:          None.
00140 //
00141 //----------------------------------------------------------------------------
00142 void CStatusBar::SetProgress(int iProgress)
00143 {
00144    if(iProgress > 32768)
00145       iProgress = 32768;
00146    m_pProgressWnd->SendMessage(PBM_SETPOS, (WPARAM)iProgress, 0);
00147 }
00148
00149
00150 //----------------------------------------------------------------------------
00151 //
00152 // SetHelpText function
00153 //    Displays help for a menu item.
00154 //
00155 // Parameters:
00156 //    uidText:       String resource identifier of the help string; -1 if no
00157 //                   text should be displayed (i.e., over a separator).
00158 //
00159 // Returns:          None.
00160 //
00161 //----------------------------------------------------------------------------
00162 void CStatusBar::SetHelpText(UINT uidText)
00163 {
00164    if(!m_bShowingHelp)
00165    {
00166       // We're not yet showing help, so put scroll bar in simple mode
00167       m_pProgressWnd->ShowWindow(SW_HIDE);
00168       SendMessage(SB_SIMPLE, (WPARAM)TRUE, 0);
00169       m_bShowingHelp = TRUE;
00170    }
00171
00172    // Load the string, if uidText is not -1. Set the text.
00173    SendMessage(SB_SETTEXT, (WPARAM)(SB_SIMPLEID | SBT_NOBORDERS),
00174       (LPARAM)(uidText == (UINT)-1 ? NULL : (LPTSTR)(CTSTR(uidText))));
00175 }
00176
00177
00178 //----------------------------------------------------------------------------
00179 //
00180 // CancelHelpText function
00181 //    Hides menu help text and restores the normal status bar.
00182 //
00183 // Parameters:       None.
00184 //
00185 // Returns:          None.
00186 //
00187 //----------------------------------------------------------------------------
00188 void CStatusBar::CancelHelpText()
00189 {
00190    if(m_bShowingHelp)
00191    {
00192       // Restore status bar to normal mode and display progress bar
00193       SendMessage(SB_SIMPLE, (WPARAM)FALSE, 0);
00194       m_pProgressWnd->ShowWindow(SW_SHOWNA);
00195       m_bShowingHelp = FALSE;
00196       return;
00197    }
00198 }
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


StatusBar.h File Reference

#include <bmws_window.h>

Go to the source code of this file.

Compounds

class | CStatusBar

Defines

#define | AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file StatusBar.h.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


StatusBar.h Source File

StatusBar.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // StatusBar.h
00004 //    Class to encapsulate the main window's status bar.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_window.h>
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // CStatusBar class
00026 //    Encapsulates the main window's status bar. Manages score display and
00027 //    lengthy-process progress display (i.e., creating a deck).
00028 //
00029 //----------------------------------------------------------------------------
00030 class CStatusBar : public CHWND
00031 {
00032 public:
00033    CStatusBar();
00034    virtual ~CStatusBar();
00035
00036    BOOL Create(HWND hwndParent);
00037
00038    void SetScore(long lScore);
00039    void SetStatusText(CTSTR& lpszStatus);
00040    void SetProgress(int iProgress);
00041    void SetHelpText(UINT uidText);
00042    void CancelHelpText();
00043
00044 protected:
00045    CHWND *m_pProgressWnd;     // Embedded progress bar window
00046    CTSTR m_lpszScoreHolder;   // "Score: %d" string
00047    BOOL m_bShowingHelp;       // Whether menu help is being displayed
00048 };
00049
00050
00051 #endif // !defined(AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


StatusBarMgr.h File Reference

#include <bmws_string.h>

Go to the source code of this file.

Compounds

class | IStatusBarMgr

Defines

#define | AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file StatusBarMgr.h.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


StatusBarMgr.h Source File

StatusBarMgr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // StatusBarMgr.h
00004 //    Abstract class to enable objects to access the status bar.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_string.h>
00021
00022
00023 //----------------------------------------------------------------------------
00024 //
00025 // IStatusBarMgr abstract class
00026 //    Enables objects to access the status bar. Implemented by the main window
00027 //    class. Used by the game menu and engine objects to show progress while
00028 //    creating game menu items and card objects.
00029 //
00030 //----------------------------------------------------------------------------
00031 class IStatusBarMgr
00032 {
00033 public:
00034    virtual void SBSetText(CTSTR& lpszStatus) = 0;
00035    virtual void SBUpdateTasks(int cAdd, int cCompleted) = 0;
00036 };
00037
00038
00039 #endif // !defined(AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Solpack/StdAfx.cpp File Reference

StdAfx.cpp File Reference

#include "stdafx.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


StdAfx.cpp Source File

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 // Solpack.pch will be the pre-compiled header
00003 // stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames/StdAfx.cpp File Reference

StdAfx.cpp File Reference

#include "stdafx.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:27 2002 for Solitaire Pack by doxygen 1.2.15


StdAfx.cpp Source File

StdAfx.cpp

Go to the documentation of this file.
00001 // stdafx.cpp : source file that includes just the standard includes
00002 // SPGames.pch will be the pre-compiled header
00003 // stdafx.obj will contain the pre-compiled type information
00004
00005 #include "stdafx.h"
00006
00007 // TODO: reference any additional headers you need in STDAFX.H
00008 // and not in this file
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Solpack/StdAfx.h File Reference

StdAfx.h File Reference

#include <windows.h>
#include <ole2.h>
#include <objbase.h>
#include <bmws_common.h>

Go to the source code of this file.

Defines

#define | AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#define | WINVER 0x0400
#define | _WIN32_IE 0x0500
#define | WIN32_LEAN_AND_MEAN
#define | BMWS_APP_VER (1.0)
#define | BMWS_APPID TEXT("0CBC40402CA811d683010020780D1875")
#define | BMWS_ERROR_INCLUDEIE
#define | BMWS_STRING_DLGITEM
#define | BMWS_STRING_EXTRACTSUBSTRING
#define | BMWS_USEEVENTHANDLER
#define | BMWS_USEEVENTSINK
#define | BMWS_USEUNKBASE
#define | BMWS_USEDISPBASE
#define | BMWS_USEPOINTER
#define | BMWS_XML_MINIMAL
#define | BMWS_WINDOWPLACEMENT
#define | BMWS_HTMLHELPERS_PROTECTUI
#define | BMWS_HTMLHELPERS_ADDSTYLE
#define | BMWS_HTMLHELPERS_INCLUDEELINT
#define | BMWS_BROWSERCONTAINER_GETLOCATION
#define | SOLPACK_HASHVALUE 43
#define | SOLPACK_LCID 0x0409
#define | CARDWIDTH 71
#define | CARDHEIGHT 96

Typedefs

typedef long | SHANDLE_PTR

Define Documentation

#define _WIN32_IE 0x0500

Definition at line 14 of file Solpack/StdAfx.h.

#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

Definition at line 7 of file Solpack/StdAfx.h.

#define BMWS_APP_VER (1.0)

Definition at line 27 of file Solpack/StdAfx.h.

#define BMWS_APPID TEXT("0CBC40402CA811d683010020780D1875")

Definition at line 28 of file Solpack/StdAfx.h.

#define BMWS_BROWSERCONTAINER_GETLOCATION

Definition at line 43 of file Solpack/StdAfx.h.

#define BMWS_ERROR_INCLUDEIE

Definition at line 30 of file Solpack/StdAfx.h.

#define BMWS_HTMLHELPERS_ADDSTYLE

Definition at line 41 of file Solpack/StdAfx.h.

#define BMWS_HTMLHELPERS_INCLUDEELINT

Definition at line 42 of file Solpack/StdAfx.h.

#define BMWS_HTMLHELPERS_PROTECTUI

Definition at line 40 of file Solpack/StdAfx.h.

#define BMWS_STRING_DLGITEM

Definition at line 31 of file Solpack/StdAfx.h.

#define BMWS_STRING_EXTRACTSUBSTRING

Definition at line 32 of file Solpack/StdAfx.h.

#define BMWS_USEDISPBASE

Definition at line 36 of file Solpack/StdAfx.h.

#define BMWS_USEEVENTHANDLER

Definition at line 33 of file Solpack/StdAfx.h.

#define BMWS_USEEVENTSINK

Definition at line 34 of file Solpack/StdAfx.h.

#define BMWS_USEPOINTER

Definition at line 37 of file Solpack/StdAfx.h.

#define BMWS_USEUNKBASE

Definition at line 35 of file Solpack/StdAfx.h.

#define BMWS_WINDOWPLACEMENT

Definition at line 39 of file Solpack/StdAfx.h.

#define BMWS_XML_MINIMAL

Definition at line 38 of file Solpack/StdAfx.h.

#define CARDHEIGHT 96

Definition at line 50 of file Solpack/StdAfx.h.

Referenced by CPile::GetSizeWith(), and CPile::UpdateLayout().

#define CARDWIDTH 71

Definition at line 49 of file Solpack/StdAfx.h.

Referenced by CPile::GetSizeWith(), and CPile::UpdateLayout().

#define SOLPACK_HASHVALUE 43

Definition at line 45 of file Solpack/StdAfx.h.

Referenced by CMainWindow::OnCommand(), and CSolpackApp::Run().

#define SOLPACK_LCID 0x0409

Definition at line 47 of file Solpack/StdAfx.h.

Referenced by CSolpackApp::Register().

#define WIN32_LEAN_AND_MEAN

Definition at line 15 of file Solpack/StdAfx.h.

#define WINVER 0x0400

Definition at line 13 of file Solpack/StdAfx.h.

Typedef Documentation

typedef long SHANDLE_PTR

Definition at line 21 of file Solpack/StdAfx.h.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


StdAfx.h Source File

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
00007 #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013 #define WINVER 0x0400
00014 #define _WIN32_IE 0x0500
00015 #define WIN32_LEAN_AND_MEAN      // Exclude rarely-used stuff from Windows headers
00016
00017 #include <windows.h>
00018 #include <ole2.h>
00019 #include <objbase.h>
00020
00021 typedef long SHANDLE_PTR;
00022
00023 #ifdef _DEBUG
00024 #define BMWS_TRACKMEMALLOC
00025 #endif
00026
00027 #define BMWS_APP_VER          (1.0)
00028 #define BMWS_APPID            TEXT("0CBC40402CA811d683010020780D1875")
00029 //#define BMWS_CONTEXTHELP
00030 #define BMWS_ERROR_INCLUDEIE
00031 #define BMWS_STRING_DLGITEM
00032 #define BMWS_STRING_EXTRACTSUBSTRING
00033 #define BMWS_USEEVENTHANDLER
00034 #define BMWS_USEEVENTSINK
00035 #define BMWS_USEUNKBASE
00036 #define BMWS_USEDISPBASE
00037 #define BMWS_USEPOINTER
00038 #define BMWS_XML_MINIMAL
00039 #define BMWS_WINDOWPLACEMENT
00040 #define BMWS_HTMLHELPERS_PROTECTUI
00041 #define BMWS_HTMLHELPERS_ADDSTYLE
00042 #define BMWS_HTMLHELPERS_INCLUDEELINT
00043 #define BMWS_BROWSERCONTAINER_GETLOCATION
00044
00045 #define SOLPACK_HASHVALUE  43
00046
00047 #define SOLPACK_LCID       0x0409
00048
00049 #define CARDWIDTH          71
00050 #define CARDHEIGHT         96
00051
00052 #include <bmws_common.h>
00053
00054 //{{AFX_INSERT_LOCATION}}
00055 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00056
00057 #endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames/StdAfx.h File Reference

StdAfx.h File Reference

#include <windows.h>
#include <ole2.h>
#include <bmws_common.h>
#include <bmws_string.h>
#include <bmws_error.h>
#include "GameIDs.h"

Go to the source code of this file.

Defines

#define | AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_
#define | WINVER 0x0400
#define | _WIN32_IE 0x0500
#define | WIN32_LEAN_AND_MEAN
#define | BMWS_APP_VER (1.0)
#define | BMWS_APPID TEXT("0CBC40412CA811d683010020780D1875")
#define | BMWS_REGISTRY_SETKEYANDVALUE
#define | BMWS_USEDISPBASE
#define | BMWS_ERROR_DLL

Define Documentation

#define _WIN32_IE 0x0500

Definition at line 14 of file SPGames/StdAfx.h.

#define AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_

Definition at line 7 of file SPGames/StdAfx.h.

#define BMWS_APP_VER (1.0)

Definition at line 24 of file SPGames/StdAfx.h.

#define BMWS_APPID TEXT("0CBC40412CA811d683010020780D1875")

Definition at line 25 of file SPGames/StdAfx.h.

#define BMWS_ERROR_DLL

Definition at line 28 of file SPGames/StdAfx.h.

#define BMWS_REGISTRY_SETKEYANDVALUE

Definition at line 26 of file SPGames/StdAfx.h.

#define BMWS_USEDISPBASE

Definition at line 27 of file SPGames/StdAfx.h.

#define WIN32_LEAN_AND_MEAN

Definition at line 15 of file SPGames/StdAfx.h.

#define WINVER 0x0400

Definition at line 13 of file SPGames/StdAfx.h.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


StdAfx.h Source File

StdAfx.h

Go to the documentation of this file.
00001 // stdafx.h : include file for standard system include files,
00002 //  or project specific include files that are used frequently, but
00003 //      are changed infrequently
00004 //
00005
00006 #if !defined(AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_)
00007 #define AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif // _MSC_VER > 1000
00012
00013 #define WINVER 0x0400
00014 #define _WIN32_IE 0x0500
00015 #define WIN32_LEAN_AND_MEAN      // Exclude rarely-used stuff from Windows headers
00016
00017 #include <windows.h>
00018 #include <ole2.h>
00019
00020 #ifdef _DEBUG
00021 #define BMWS_TRACKMEMALLOC
00022 #endif
00023
00024 #define BMWS_APP_VER                   (1.0)
00025 #define BMWS_APPID                     TEXT("0CBC40412CA811d683010020780D1875")
00026 #define BMWS_REGISTRY_SETKEYANDVALUE
00027 #define BMWS_USEDISPBASE
00028 #define BMWS_ERROR_DLL
00029
00030 #include <bmws_common.h>
00031 #include <bmws_string.h>
00032 #include <bmws_error.h>
00033 #include "GameIDs.h"
00034
00035 //{{AFX_INSERT_LOCATION}}
00036 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00037
00038 #endif // !defined(AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Solpack/String.cpp File Reference

String.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SolpckLC\resource.h"
#include <bmws_string.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 13 of file Solpack/String.cpp.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


String.cpp Source File

String.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // String.cpp
00004 //    Includes component source files related to strings.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include "resource.h"
00011 #include "..\SolpckLC\resource.h"
00012
00013 extern HINSTANCE g_hInst;
00014
00015 #include <bmws_string.cpp>
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


SPGames/String.cpp File Reference

String.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "..\SolpckLC\resource.h"
#include <bmws_string.cpp>

Go to the source code of this file.

Variables

HINSTANCE g_hInst

Variable Documentation

HINSTANCE g_hInst

Definition at line 6 of file SPGames/String.cpp.

Referenced by DllMain().

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


String.cpp Source File

String.cpp

Go to the documentation of this file.
00001
00002 #include "stdafx.h"
00003 #include "resource.h"
00004 #include "..\SolpckLC\resource.h"
00005
00006 extern HINSTANCE g_hInst;
00007
00008 #include <bmws_string.cpp>
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Turn.cpp File Reference

#include "stdafx.h"
#include "Turn.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Turn.cpp Source File

Turn.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Turn.cpp
00004 //    Class to contain actions of a turn.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "Turn.h"
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CTurn constructor
00019 //
00020 // Parameters:       None.
00021 //
00022 //----------------------------------------------------------------------------
00023 CTurn::CTurn()
00024 {
00025    // Set initial values of member variables
00026    m_pNext = NULL;
00027    m_pPrev = NULL;
00028    m_pFirst = NULL;
00029    m_pLast = NULL;
00030    ODS("CTurn constructor");
00031 }
00032
00033
00034 //----------------------------------------------------------------------------
00035 //
00036 // CTurn destructor
00037 //
00038 //----------------------------------------------------------------------------
00039 CTurn::~CTurn()
00040 {
00041    // Clear all stored actions
00042    CAction *pTemp = m_pFirst;
00043    while(m_pFirst)
00044    {
00045       pTemp = m_pFirst->m_pNext;
00046       SAFEDELETE(m_pFirst);
00047       m_pFirst = pTemp;
00048    }
00049    ODS("CTurn destructor");
00050 }
00051
00052
00053 //----------------------------------------------------------------------------
00054 //
00055 // AddAction function
00056 //    Stores the specifed action within this turn.
00057 //
00058 // Parameters:
00059 //    pAction:       The action to store.
00060 //
00061 // Returns:          None.
00062 //
00063 //----------------------------------------------------------------------------
00064 void CTurn::AddAction(CAction *pAction)
00065 {
00066    ODS("CTurn::AddAction");
00067    if(!m_pFirst)
00068    {
00069       // Create first action
00070       m_pFirst = pAction;
00071       m_pLast = pAction;
00072    } else
00073    {
00074       // Add action to end of turn
00075       m_pLast->m_pNext = pAction;
00076       pAction->m_pPrev = m_pLast;
00077       m_pLast = pAction;
00078    }
00079 }
00080
00081
00082 //----------------------------------------------------------------------------
00083 //
00084 // Undo function
00085 //    Undoes the turn by undoing all individual actions.
00086 //
00087 // Parameters:       None.
00088 //
00089 // Returns:          None.
00090 //
00091 //----------------------------------------------------------------------------
00092 void CTurn::Undo()
00093 {
00094    // Undo each action in the turn, starting at the end
00095    CAction *pTemp = m_pLast;
00096    while(pTemp)
00097    {
00098       pTemp->Undo();
00099       pTemp = pTemp->m_pPrev;
00100    }
00101 }
00102
00103
00104 //----------------------------------------------------------------------------
00105 //
00106 // Redo function
00107 //    Redoes the action.
00108 //
00109 // Parameters:       None.
00110 //
00111 // Returns:          None.
00112 //
00113 //----------------------------------------------------------------------------
00114 void CTurn::Redo()
00115 {
00116    // Redo each action in the turn, starting with the first
00117    CAction *pTemp = m_pFirst;
00118    while(pTemp)
00119    {
00120       pTemp->Redo();
00121       pTemp = pTemp->m_pNext;
00122    }
00123 }
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Turn.h File Reference

#include "Action.h"
#include "..\SolpackTLB\Solpack.h"
#include <bmws_string.h>
#include <bmws_array.h>
#include <bmws_ptr.h>

Go to the source code of this file.

Compounds

class | CTurn

Defines

#define | AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file Turn.h.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Turn.h Source File

Turn.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Turn.h
00004 //    Class to contain actions of a turn.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "Action.h"
00021 #include "..\SolpackTLB\Solpack.h"
00022 #include <bmws_string.h>
00023 #include <bmws_array.h>
00024 #include <bmws_ptr.h>
00025
00026
00027 //----------------------------------------------------------------------------
00028 //
00029 // CTurn class
00030 //    Contains actions for an individual turn.
00031 //
00032 //----------------------------------------------------------------------------
00033 class CTurn
00034 {
00035 public:
00036    CTurn();
00037    virtual ~CTurn();
00038
00039    void AddAction(CAction *pAction);
00040    void Undo();
00041    void Redo();
00042
00043    CTurn *m_pNext;      // The next turn
00044    CTurn *m_pPrev;      // The previous turn
00045
00046 protected:
00047    CAction *m_pFirst;   // Head node of actions list
00048    CAction *m_pLast;    // Tail node of actions list
00049 };
00050
00051
00052 #endif // !defined(AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


UndoMgr.cpp File Reference

#include "stdafx.h"
#include "UndoMgr.h"

Go to the source code of this file.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


UndoMgr.cpp Source File

UndoMgr.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // UndoMgr.cpp
00004 //    Class to manage undo and redo operations.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "UndoMgr.h"
00014
00015
00016 //----------------------------------------------------------------------------
00017 //
00018 // CUndoMgr constructor
00019 //
00020 // Parameters:       None.
00021 //
00022 //----------------------------------------------------------------------------
00023 CUndoMgr::CUndoMgr()
00024 {
00025    // Set initial values of member variables
00026    m_bDirty = FALSE;
00027    m_pFirst = NULL;
00028    m_pMostRecent = NULL;
00029    m_pCurrent = NULL;
00030    m_bCanRecord = FALSE;
00031    ODS("CUndoMgr constructor");
00032 }
00033
00034
00035 //----------------------------------------------------------------------------
00036 //
00037 // CUndoMgr destructor
00038 //
00039 //----------------------------------------------------------------------------
00040 CUndoMgr::~CUndoMgr()
00041 {
00042    // Clear all stored turns
00043    Clear(m_pFirst);
00044    ODS("CUndoMgr destructor");
00045 }
00046
00047
00048 //----------------------------------------------------------------------------
00049 //
00050 // Undo function
00051 //    Undoes the most recent turn.
00052 //
00053 // Parameters:       None.
00054 //
00055 // Returns:          None.
00056 //
00057 //----------------------------------------------------------------------------
00058 void CUndoMgr::Undo()
00059 {
00060    ODS("CUndoMgr::Undo");
00061    if(!CanUndo())
00062       return;
00063
00064    // While undoing, we don't record any actions
00065    BOOL bOld = SetCanRecord(FALSE);
00066
00067    ClearWorkingTurn();
00068
00069    // Undo the most recent turn and step back in the list
00070    m_pMostRecent->Undo();
00071    m_pMostRecent = m_pMostRecent->m_pPrev;
00072
00073    SetCanRecord(bOld);
00074 }
00075
00076
00077 //----------------------------------------------------------------------------
00078 //
00079 // Redo function
00080 //    Redoes the most recently undone turn.
00081 //
00082 // Parameters:       None.
00083 //
00084 // Returns:          None.
00085 //
00086 //----------------------------------------------------------------------------
00087 void CUndoMgr::Redo()
00088 {
00089    ODS("CUndoMgr::Redo");
00090    if(!CanRedo())
00091       return;
00092
00093    // While redoing, we don't record any actions
00094    BOOL bOld = SetCanRecord(FALSE);
00095
00096    // Redo the next turn and step forward in the list
00097    m_pMostRecent->m_pNext->Redo();
00098    m_pMostRecent = m_pMostRecent->m_pNext;
00099
00100    ClearWorkingTurn();
00101    SetCanRecord(bOld);
00102 }
00103
00104
00105 //----------------------------------------------------------------------------
00106 //
00107 // Init function
00108 //    Sets up the undo manager by creating an initial turn.
00109 //
00110 // Parameters:       None.
00111 //
00112 // Returns:          None.
00113 //
00114 //----------------------------------------------------------------------------
00115 void CUndoMgr::Init()
00116 {
00117    // Create the first turn and the current (working) turn
00118    m_bDirty = FALSE;
00119    m_pFirst = new CTurn();
00120    ENSUREALLOC(m_pFirst);
00121    m_pMostRecent = m_pFirst;
00122    m_pCurrent = new CTurn();
00123    ENSUREALLOC(m_pCurrent);
00124    SetCanRecord(TRUE);
00125 }
00126
00127
00128 //----------------------------------------------------------------------------
00129 //
00130 // PushNewTurn function
00131 //    Adds the specified action to the current turn object.
00132 //
00133 // Parameters:       None.
00134 //
00135 // Returns:          None.
00136 //
00137 //----------------------------------------------------------------------------
00138 void CUndoMgr::PushNewTurn()
00139 {
00140    // Only push a new turn on the stack if actions have been recorded to the
00141    // current turn
00142    if(m_bDirty)
00143    {
00144       ODS("----- Push New Turn ----------------------------------------------");
00145       if(m_pMostRecent)
00146       {
00147          if(m_pMostRecent->m_pNext)
00148             Clear(m_pMostRecent->m_pNext);
00149          m_pMostRecent->m_pNext = m_pCurrent;
00150          m_pCurrent->m_pPrev = m_pMostRecent;
00151       }
00152       m_pMostRecent = m_pCurrent;
00153
00154       // Create a new working turn
00155       m_pCurrent = new CTurn();
00156       ENSUREALLOC(m_pCurrent);
00157       m_bDirty = FALSE;
00158    }
00159 }
00160
00161
00162 //----------------------------------------------------------------------------
00163 //
00164 // RecordAction function
00165 //    Adds the specified action to the current turn object.
00166 //
00167 // Parameters:
00168 //    pSite:         Interface of the object that handles the action.
00169 //    dwType:        The type of undoable action.
00170 //    dwData:        Type-specific data.
00171 //
00172 // Returns:          The created action, or NULL if the action was not
00173 //                   recorded.
00174 //
00175 //----------------------------------------------------------------------------
00176 CAction* CUndoMgr::RecordAction(IActionSite *pSite, DWORD dwType, DWORD dwData)
00177 {
00178    // Create a new generic action object with the specified type and data
00179    CAction *pAction = new CAction(pSite, dwType, dwData);
00180    ENSUREALLOC(pAction);
00181
00182    return RecordAction(pAction);
00183 }
00184
00185
00186 //----------------------------------------------------------------------------
00187 //
00188 // RecordAction function
00189 //    Adds the specified action to the current turn object.
00190 //
00191 // Parameters:
00192 //    pMove:         The action to store.
00193 //
00194 // Returns:          The action, or NULL if the action was not recorded.
00195 //
00196 //----------------------------------------------------------------------------
00197 CAction* CUndoMgr::RecordAction(CAction *pAction)
00198 {
00199    // Perform the action
00200    pAction->Redo();
00201    if(m_bCanRecord && m_pCurrent)
00202    {
00203       // Add the action to the current turn
00204       m_bDirty = TRUE;
00205       m_pCurrent->AddAction(pAction);
00206    } else
00207       // Delete the action if we're not recording it
00208       SAFEDELETE(pAction);
00209
00210    return pAction;
00211 }
00212
00213
00214 //----------------------------------------------------------------------------
00215 //
00216 // Clear function
00217 //    Deletes a turn and all its followers.
00218 //
00219 // Parameters:
00220 //    pTurn:         Specifies the first turn to delete; NULL to clear all.
00221 //
00222 // Returns:          None.
00223 //
00224 //----------------------------------------------------------------------------
00225 void CUndoMgr::Clear(CTurn *pTurn)
00226 {
00227    if(pTurn)
00228    {
00229       // Clear the turn and all successors
00230       CTurn *pTemp = NULL;
00231       while(pTurn)
00232       {
00233          pTemp = pTurn->m_pNext;
00234          SAFEDELETE(pTurn);
00235          pTurn = pTemp;
00236       }
00237    } else
00238    {
00239       // After clearing the undo manager, cannot record until Init is called
00240       SetCanRecord(FALSE);
00241
00242       // Clear all nodes
00243       if(m_pFirst)
00244       {
00245          Clear(m_pFirst);
00246          m_pFirst = NULL;
00247          m_pMostRecent = NULL;
00248       }
00249       SAFEDELETE(m_pCurrent);
00250    }
00251 }
00252
00253
00254 //----------------------------------------------------------------------------
00255 //
00256 // ClearWorkingTurn function
00257 //    Deletes the working turn and creates a new one.
00258 //
00259 // Parameters:       None.
00260 //
00261 // Returns:          None.
00262 //
00263 //----------------------------------------------------------------------------
00264 void CUndoMgr::ClearWorkingTurn()
00265 {
00266    // Create a new working turn
00267    SAFEDELETE(m_pCurrent);
00268    m_pCurrent = new CTurn();
00269    ENSUREALLOC(m_pCurrent);
00270 }
00271
00272
00273 //----------------------------------------------------------------------------
00274 //
00275 // SetCanRecord function
00276 //    Tells the undo manager whether it can record incoming actions.
00277 //
00278 // Parameters:
00279 //    bCanRecord:    TRUE if actions can be recorded, else FALSE.
00280 //
00281 // Returns:          The previous record state.
00282 //
00283 //----------------------------------------------------------------------------
00284 BOOL CUndoMgr::SetCanRecord(BOOL bCanRecord)
00285 {
00286    BOOL bReturn = m_bCanRecord;
00287    m_bCanRecord = bCanRecord;
00288    return bReturn;
00289 }
00290
00291
00292 //----------------------------------------------------------------------------
00293 //
00294 // CanUndo function
00295 //    Retrieves whether a turn can currently be undone.
00296 //
00297 // Parameters:       None.
00298 //
00299 // Returns:          TRUE if there is a turn that can be undone, else FALSE.
00300 //
00301 //----------------------------------------------------------------------------
00302 BOOL CUndoMgr::CanUndo()
00303 {
00304    return (m_pMostRecent && m_pMostRecent->m_pPrev);
00305 }
00306
00307
00308 //----------------------------------------------------------------------------
00309 //
00310 // CanUndo function
00311 //    Retrieves whether a turn can currently be redone.
00312 //
00313 // Parameters:       None.
00314 //
00315 // Returns:          TRUE if there is a turn that can be redone, else FALSE.
00316 //
00317 //----------------------------------------------------------------------------
00318 BOOL CUndoMgr::CanRedo()
00319 {
00320    return (m_pMostRecent && m_pMostRecent->m_pNext);
00321 }
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


UndoMgr.h File Reference

#include "Turn.h"
#include "Action.h"
#include "..\SolpackTLB\Solpack.h"
#include <bmws_string.h>
#include <bmws_array.h>
#include <bmws_ptr.h>

Go to the source code of this file.

Compounds

class | CUndoMgr
class | IUndoMgrOwner

Defines

#define | AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Define Documentation

#define AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_

Definition at line 10 of file UndoMgr.h.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


UndoMgr.h Source File

UndoMgr.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // UndoMgr.h
00004 //    Class to manage undo and redo operations.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
00010 #define AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include "Turn.h"
00021 #include "Action.h"
00022 #include "..\SolpackTLB\Solpack.h"
00023 #include <bmws_string.h>
00024 #include <bmws_array.h>
00025 #include <bmws_ptr.h>
00026
00027
00028 //----------------------------------------------------------------------------
00029 //
00030 // CUndoMgr class
00031 //    Manages the Undo-Redo stack.
00032 //
00033 //----------------------------------------------------------------------------
00034 class CUndoMgr
00035 {
00036 public:
00037    CUndoMgr();
00038    virtual ~CUndoMgr();
00039
00040    void Undo();
00041    void Redo();
00042
00043    void Init();
00044    void PushNewTurn();
00045    CAction* RecordAction(IActionSite *pSite, DWORD dwType, DWORD dwData);
00046    CAction* RecordAction(CAction *pAction);
00047    void Clear(CTurn *pTurn);
00048    void ClearWorkingTurn();
00049    BOOL SetCanRecord(BOOL bCanRecord);
00050    BOOL CanUndo();
00051    BOOL CanRedo();
00052
00053 protected:
00054    BOOL m_bDirty;          // Whether any actions have been recorded
00055    CTurn *m_pFirst;        // The first turn
00056    CTurn *m_pMostRecent;   // Most recently completed turn
00057    CTurn *m_pCurrent;      // The current turn being processed
00058    BOOL m_bCanRecord;      // Whether incoming actions can be recorded
00059 };
00060
00061
00062 //----------------------------------------------------------------------------
00063 //
00064 // IUndoMgrOwner abstract class
00065 //    Enables objects to retrieve the undo manager. Implemented by the CEngine
00066 //    class.
00067 //
00068 //----------------------------------------------------------------------------
00069 class IUndoMgrOwner
00070 {
00071 public:
00072    virtual CUndoMgr* GetUndoMgr() = 0;
00073 };
00074
00075
00076 #endif // !defined(AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


Update.cpp File Reference

#include "stdafx.h"
#include <bmws_update.cpp>
#include <bmws_updatedlg.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Update.cpp Source File

Update.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Update.cpp
00004 //    Includes component source files related to checking for and displaying
00005 //    product updates.
00006 //
00007 //----------------------------------------------------------------------------
00008
00009
00010 #include "stdafx.h"
00011 #include <bmws_update.cpp>
00012 #include <bmws_updatedlg.cpp>
Generated on Wed May 8 12:39:12 2002 for Solitaire Pack by doxygen 1.2.15


UserPrefs.cpp File Reference

#include "stdafx.h"
#include "UserPrefs.h"
#include <bmws_registry.h>
#include <bmws_error.h>
#include <bmws_choosecolor.h>
#include <bmws_variant.h>
#include <bmws_singleofn.h>
#include <shlwapi.h>
#include "resource.h"
#include "..\SolpckLC\resource.h"

Go to the source code of this file.

Compounds

class | CAppearanceDlg

Defines

#define | CY_HELPPANE_DEFAULT 116
#define | CY_HELPPANE_MIN 24
#define | DEFAULTBKCOLOR RGB(0, 128, 0)
#define | DEFAULTTEXTCOLOR RGB(255, 255, 255)
#define | SETCHK(ctl, b)
#define | GETCHK(ctl) (IsDlgButtonChecked(hwndDlg, (ctl)) == BST_CHECKED)

Variables

TCHAR | g_szAppTitle [64]
HINSTANCE | g_hInst
HINSTANCE | g_hInstLC
HWND | g_hWnd
COOMExcep * g_pOOMExcep

Define Documentation

#define CY_HELPPANE_DEFAULT 116

Definition at line 37 of file UserPrefs.cpp.

Referenced by CUserPrefs::CUserPrefs(), and CUserPrefs::ReadRegistry().

#define CY_HELPPANE_MIN 24

Definition at line 38 of file UserPrefs.cpp.

Referenced by CUserPrefs::ReadRegistry().

#define DEFAULTBKCOLOR RGB(0, 128, 0)

Definition at line 44 of file UserPrefs.cpp.

Referenced by CUserPrefs::CUserPrefs(), and CAppearanceDlg::OptionsAppearanceProc().

#define DEFAULTTEXTCOLOR RGB(255, 255, 255)

Definition at line 45 of file UserPrefs.cpp.

Referenced by CUserPrefs::CUserPrefs(), and CAppearanceDlg::OptionsAppearanceProc().

#define GETCHK ( ctl ) (IsDlgButtonChecked(hwndDlg, (ctl)) == BST_CHECKED)

Definition at line 53 of file UserPrefs.cpp.

Referenced by CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::OptionsGeneralProc().

#define SETCHK | ( | ctl,
 |  | b | )

Value:

CheckDlgButton(hwndDlg, (ctl), \
   (WPARAM)((b) ? BST_CHECKED : BST_UNCHECKED));

Definition at line 51 of file UserPrefs.cpp.

Referenced by CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::OptionsGeneralProc().

Variable Documentation

HINSTANCE g_hInst

Definition at line 28 of file UserPrefs.cpp.

HINSTANCE g_hInstLC

Definition at line 29 of file UserPrefs.cpp.

Referenced by CUserPrefs::DoOptions().

HWND g_hWnd

Definition at line 30 of file UserPrefs.cpp.

COOMExcep* g_pOOMExcep

Definition at line 31 of file UserPrefs.cpp.

TCHAR g_szAppTitle[64]

Definition at line 27 of file UserPrefs.cpp.

Referenced by InitModule(), and CAppearanceDlg::OptionsAppearanceProc().

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


UserPrefs.cpp Source File

UserPrefs.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // UserPrefs.cpp
00004 //    Class to encapsulate managing user preferences.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 //----------------------------------------------------------------------------
00010 // Includes
00011 //----------------------------------------------------------------------------
00012 #include "stdafx.h"
00013 #include "UserPrefs.h"
00014 #include <bmws_registry.h>
00015 #include <bmws_error.h>
00016 #include <bmws_choosecolor.h>
00017 #include <bmws_variant.h>
00018 #include <bmws_singleofn.h>
00019 #include <shlwapi.h>
00020 #include "resource.h"
00021 #include "..\SolpckLC\resource.h"
00022
00023
00024 //----------------------------------------------------------------------------
00025 // Global and external variables
00026 //----------------------------------------------------------------------------
00027 extern TCHAR g_szAppTitle[64];         // The title bar text
00028 extern HINSTANCE g_hInst;              // Application instance handle
00029 extern HINSTANCE g_hInstLC;            // Localized resources module handle
00030 extern HWND g_hWnd;                    // Main window handle
00031 extern COOMExcep *g_pOOMExcep;         // Out of memory exception object
00032
00033
00034 //----------------------------------------------------------------------------
00035 // Size constants for the help pane and browser container
00036 //----------------------------------------------------------------------------
00037 #define CY_HELPPANE_DEFAULT   116
00038 #define CY_HELPPANE_MIN       24
00039
00040
00041 //----------------------------------------------------------------------------
00042 // Default colors
00043 //----------------------------------------------------------------------------
00044 #define DEFAULTBKCOLOR        RGB(0, 128, 0)
00045 #define DEFAULTTEXTCOLOR      RGB(255, 255, 255)
00046
00047
00048 //----------------------------------------------------------------------------
00049 // Check button helper macros
00050 //----------------------------------------------------------------------------
00051 #define SETCHK(ctl, b)  CheckDlgButton(hwndDlg, (ctl), \
00052    (WPARAM)((b) ? BST_CHECKED : BST_UNCHECKED));
00053 #define GETCHK(ctl)     (IsDlgButtonChecked(hwndDlg, (ctl)) == BST_CHECKED)
00054
00055
00056 //----------------------------------------------------------------------------
00057 // CPSounds string IDs
00058 //----------------------------------------------------------------------------
00059 UINT CUserPrefs::s_auidSounds[] = { IDS_REG_SOUND_SHUFFLE, IDS_REG_SOUND_FLIP,
00060    IDS_REG_SOUND_DROP, IDS_REG_SOUND_WON };
00061 UINT CUserPrefs::s_auidDisplays[] = { IDS_SOUND_SHUFFLE, IDS_SOUND_FLIP, IDS_SOUND_DROP,
00062    IDS_SOUND_WON };
00063
00064
00065 //----------------------------------------------------------------------------
00066 //
00067 // CAppearanceDlg class
00068 //    Manages the Appearance dialog box.
00069 //
00070 //----------------------------------------------------------------------------
00071 class CAppearanceDlg
00072 {
00073 public:
00074    CAppearanceDlg(CUserPrefs *pPrefs);
00075    virtual ~CAppearanceDlg();
00076
00077    // Appearance dialog box procedure
00078    static INT_PTR CALLBACK OptionsAppearanceProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00079       LPARAM lParam);
00080
00081    friend class CUserPrefs;
00082
00083 protected:
00084    void DoChooseColor(WORD wCtl);
00085    void TryUpdateColor(WORD wCtl, COLORREF colorNew, COLORREF *pColorDest,
00086       HBRUSH *phBrush, DWORD dwChanged);
00087    void DoBkImgChk();
00088
00089    CUserPrefs *m_pPrefs;   // The user preferences object
00090    CTSTR m_lpszBkImg;      // The initial background image
00091    COLORREF m_bkColor;     // The initial background color
00092    COLORREF m_textColor;   // The initial text color
00093    HBRUSH m_hbrBk;         // The background color brush
00094    HBRUSH m_hbrText;       // The text color brush
00095    DWORD m_dwChanged;      // What settings have changed
00096    HWND m_hwndDlg;         // The dialog box window handle
00097 };
00098
00099
00100 //----------------------------------------------------------------------------
00101 //
00102 // CAppearanceDlg constructor
00103 //
00104 // Parameters:
00105 //    pPrefs:        The user preferences object.
00106 //
00107 //----------------------------------------------------------------------------
00108 CAppearanceDlg::CAppearanceDlg(CUserPrefs *pPrefs)
00109 {
00110    // Initialize member variables
00111    m_pPrefs = pPrefs;
00112    m_textColor = pPrefs->m_colorText;
00113    m_bkColor = pPrefs->m_colorBkg;
00114    m_lpszBkImg.Assign(pPrefs->m_lpszBkgImg);
00115    m_dwChanged = 0;
00116    m_hwndDlg = NULL;
00117
00118    // Create brushes for the text and background colors
00119    m_hbrText = CreateSolidBrush(m_textColor);
00120    m_hbrBk = CreateSolidBrush(m_bkColor);
00121 }
00122
00123
00124 //----------------------------------------------------------------------------
00125 //
00126 // CAppearanceDlg destructor
00127 //
00128 //----------------------------------------------------------------------------
00129 CAppearanceDlg::~CAppearanceDlg()
00130 {
00131    // Delete the brushes
00132    DeleteObject((HGDIOBJ)m_hbrText);
00133    DeleteObject((HGDIOBJ)m_hbrBk);
00134 }
00135
00136
00137 //----------------------------------------------------------------------------
00138 //
00139 // OptionsAppearanceProc function
00140 //    Callback function that handles messages to the appearance options
00141 //    property page.
00142 //
00143 // Parameters:
00144 //    hwndDlg:       The dialog box window handle.
00145 //    uMsg:          Message identifer.
00146 //    wParam:        Message-specific parameter.
00147 //    lParam:        Message-specific parameter.
00148 //
00149 // Returns:          TRUE if the message was handled, otherwise FALSE.
00150 //
00151 //----------------------------------------------------------------------------
00152 INT_PTR CALLBACK CAppearanceDlg::OptionsAppearanceProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00153                                                        LPARAM lParam)
00154 {
00155    CAppearanceDlg *pThis = (CAppearanceDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00156
00157    try   // Windows-called code
00158    {
00159       switch(uMsg)
00160       {
00161          // Called when the dialog box is created
00162          case WM_INITDIALOG:
00163             pThis = (CAppearanceDlg*)((LPPROPSHEETPAGE)lParam)->lParam;
00164             SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00165             pThis->m_hwndDlg = hwndDlg;
00166
00167             // Set current settings
00168             SetDlgItemText(hwndDlg, IDC_OPTAPP_BKIMGEDIT, pThis->m_lpszBkImg);
00169             SETCHK(IDC_OPTAPP_BKIMGCHK, pThis->m_lpszBkImg.Len() > 0);
00170             pThis->DoBkImgChk();
00171             return TRUE;
00172
00173          // Called when a button or check box is clicked
00174          case WM_COMMAND:
00175             if(HIWORD(wParam) == EN_CHANGE)
00176             {
00177                CTSTR lpsz(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00178                if(lstrcmp(lpsz, pThis->m_lpszBkImg) != 0)
00179                   ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00180             } else if(HIWORD(wParam) == BN_CLICKED)
00181             {
00182                switch(LOWORD(wParam))  // Which button was clicked?
00183                {
00184                   case IDC_OPTAPP_BROWSEBKIMG:
00185                   {
00186                      // Present Open dialog box to browse for background image
00187                      CTSTR lpsz(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00188                      if(SingleOFN(lpsz, IDS_IMGFILTER, NULL, hwndDlg, OFN_FILEMUSTEXIST |
00189                         OFN_HIDEREADONLY, CTSTR(IDS_BROWSEBKIMG), CTSTR(), (UINT)-1,
00190                         SINGLE_OFN_INITFILETITLE) == 1)
00191                      {
00192                         // Set the edit field contents to the new file name
00193                         SetDlgItemText(hwndDlg, IDC_OPTAPP_BKIMGEDIT, lpsz);
00194                         ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00195                      }
00196                   } break;
00197
00198                   case IDC_OPTAPP_RESTORE:
00199                   {
00200                      // Set the old colors
00201                      pThis->TryUpdateColor(IDC_OPTAPP_TEXTCOLOR, DEFAULTTEXTCOLOR,
00202                         &pThis->m_textColor, &pThis->m_hbrText, UA_TEXTCOLOR);
00203                      pThis->TryUpdateColor(IDC_OPTAPP_BKCOLOR, DEFAULTBKCOLOR, &pThis->m_bkColor,
00204                         &pThis->m_hbrBk, UA_BKCOLOR);
00205
00206                   } break;
00207
00208                   case IDC_OPTAPP_BKIMGCHK:
00209                      pThis->DoBkImgChk();
00210                      break;
00211
00212                   case IDC_OPTAPP_TEXTCOLOR:
00213                   case IDC_OPTAPP_BKCOLOR:
00214                      // Present the choose color dialog box
00215                      pThis->DoChooseColor(LOWORD(wParam));
00216                      break;
00217                }
00218             }
00219             break;
00220
00221          // Called when a color-picker button needs to be drawn
00222          case WM_DRAWITEM:
00223          {
00224             LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
00225             FillRect(lpdis->hDC, &lpdis->rcItem, (wParam == IDC_OPTAPP_BKCOLOR ? pThis->m_hbrBk :
00226                pThis->m_hbrText));
00227             if((lpdis->itemAction & ODA_FOCUS) || (lpdis->itemState & ODS_FOCUS))
00228             {
00229                RECT rc;
00230                CopyRect(&rc, &lpdis->rcItem);
00231                InflateRect(&rc, -2, -2);
00232                DrawFocusRect(lpdis->hDC, &rc);
00233             }
00234          } break;
00235
00236          // Called when a common control event takes place
00237          case WM_NOTIFY:
00238             switch(((LPNMHDR)lParam)->code)
00239             {
00240                // The property sheet is being activated
00241                case PSN_SETACTIVE:
00242                   return 0;
00243
00244                // The property sheet is being deactivated
00245                case PSN_KILLACTIVE:
00246                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00247                   if(GETCHK(IDC_OPTAPP_BKIMGCHK))
00248                   {
00249                      CTSTR lpszNewBkImg(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00250                      if(!PathFileExists(lpszNewBkImg))
00251                      {
00252                         // Tell user the background image file can't be found
00253                         CTSTR lpszHolder(IDS_FILENOTFOUND);
00254                         CTSTR lpszTotal(TRUE, lstrlen(lpszHolder) + lstrlen(lpszNewBkImg) + 1);
00255                         wsprintf(lpszTotal, lpszHolder, lpszNewBkImg);
00256                         MessageBox(hwndDlg, lpszTotal, g_szAppTitle, MB_OK | MB_ICONHAND);
00257                         SetFocus(GetDlgItem(hwndDlg, IDC_OPTAPP_BKIMGEDIT));
00258                         SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE);
00259                      }
00260                   }
00261                   return TRUE;
00262
00263                // The Apply or OK button has been clicked
00264                case PSN_APPLY:
00265                {
00266                   // Store the new settings
00267                   if(pThis->m_dwChanged & UA_TEXTCOLOR)
00268                      pThis->m_pPrefs->m_colorText = pThis->m_textColor;
00269                   if(pThis->m_dwChanged & UA_BKCOLOR)
00270                      pThis->m_pPrefs->m_colorBkg = pThis->m_bkColor;
00271                   if(GETCHK(IDC_OPTAPP_BKIMGCHK))
00272                      pThis->m_lpszBkImg.Assign(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00273                   else
00274                      pThis->m_lpszBkImg = NULL;
00275                   if(lstrcmp(pThis->m_pPrefs->m_lpszBkgImg, pThis->m_lpszBkImg) != 0)
00276                   {
00277                      pThis->m_pPrefs->m_lpszBkgImg.Assign(pThis->m_lpszBkImg);
00278                      pThis->m_dwChanged |= UA_BKIMG;
00279                   }
00280
00281                   // Apply and save the new settings
00282                   pThis->m_pPrefs->UpdateAppearance(pThis->m_dwChanged);
00283                   pThis->m_pPrefs->WriteRegistry(SETTING_APPEARANCE);
00284                   pThis->m_dwChanged = 0;
00285                } break;
00286             }
00287             return TRUE;
00288
00289          case WM_HELP:
00290          case WM_CONTEXTMENU:
00291 //          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, CTSTR(),
00292 //             pThis->s_adwOptionsPopupHelp);
00293             break;
00294       }
00295    }
00296    catch(CExcep *pE)
00297    {
00298       pE->Report();
00299       pE->Delete();
00300       EndDialog(hwndDlg, IDCANCEL);
00301    }
00302    return FALSE;
00303 }
00304
00305
00306 //----------------------------------------------------------------------------
00307 //
00308 // DoChooseColor function
00309 //    Lets the user choose a text or background color.
00310 //
00311 // Parameters:
00312 //    wCtl:          Identifier of the color control.
00313 //
00314 // Returns:          None.
00315 //
00316 //----------------------------------------------------------------------------
00317 void CAppearanceDlg::DoChooseColor(WORD wCtl)
00318 {
00319    COLORREF *pColor = (wCtl == IDC_OPTAPP_TEXTCOLOR ? (&m_textColor) : (&m_bkColor));
00320
00321    // Load the dialog box title string
00322    CTSTR lpszHolder(IDS_CHOOSECOLOR_TITLE);
00323    CTSTR lpszIns(wCtl == IDC_OPTAPP_TEXTCOLOR ? IDS_COLOR_TEXT : IDS_COLOR_BKG);
00324    CTSTR lpszTitle(TRUE, lpszHolder.Len() + lpszIns.Len() + 4);
00325    wsprintf(lpszTitle, lpszHolder, lpszIns);
00326
00327    // Present the choose color dialog box
00328    COLORREF colorNew = *pColor;
00329    if(ChooseColorEx(&colorNew, m_hwndDlg, lpszTitle))
00330    {
00331       // Store and update the new color
00332       HBRUSH *phBrush;
00333       DWORD dwChanged;
00334       if(wCtl == IDC_OPTAPP_TEXTCOLOR)
00335       {
00336          phBrush = &m_hbrText;
00337          dwChanged = UA_TEXTCOLOR;
00338       } else
00339       {
00340          phBrush = &m_hbrBk;
00341          dwChanged = UA_BKCOLOR;
00342       }
00343       TryUpdateColor(wCtl, colorNew, pColor, phBrush, dwChanged);
00344    }
00345 }
00346
00347
00348 //----------------------------------------------------------------------------
00349 //
00350 // TryUpdateColor function
00351 //    If the new color is different than the old, update the color, repaint
00352 //    the color chooser, and enables the property sheet's Apply button.
00353 //
00354 // Parameters:
00355 //    wCtl:          Identifier of the color control.
00356 //    colorNew:      The new color for the control.
00357 //    pColorDest:    Pointer to where to put the new color.
00358 //    phBrush:       Pointer to the brush to be changed.
00359 //    dwChanged:     Specifies which color value is changing.
00360 //
00361 // Returns:          None.
00362 //
00363 //----------------------------------------------------------------------------
00364 void CAppearanceDlg::TryUpdateColor(WORD wCtl, COLORREF colorNew, COLORREF *pColorDest,
00365                                     HBRUSH *phBrush, DWORD dwChanged)
00366 {
00367    if(colorNew == *pColorDest)
00368       return;
00369
00370    *pColorDest = colorNew;
00371    m_dwChanged |= dwChanged;
00372
00373    // Create new brush and redraw color picker
00374    DeleteObject((HGDIOBJ)phBrush);
00375    *phBrush = CreateSolidBrush(colorNew);
00376    InvalidateRect(GetDlgItem(m_hwndDlg, wCtl), NULL, TRUE);
00377
00378    // Enable the Apply button
00379    ::SendMessage(GetParent(m_hwndDlg), PSM_CHANGED, (WPARAM)m_hwndDlg, 0);
00380 }
00381
00382
00383 //----------------------------------------------------------------------------
00384 //
00385 // DoBkImgChk function
00386 //    Handles the user clicking the "Background image" check box. Enables or
00387 //    disables the background color edit and browser button controls.
00388 //
00389 // Parameters:       None.
00390 //
00391 // Returns:          None.
00392 //
00393 //----------------------------------------------------------------------------
00394 void CAppearanceDlg::DoBkImgChk()
00395 {
00396    BOOL bChecked = (IsDlgButtonChecked(m_hwndDlg, IDC_OPTAPP_BKIMGCHK) == BST_CHECKED);
00397    EnableWindow(GetDlgItem(m_hwndDlg, IDC_OPTAPP_BKIMGEDIT), bChecked);
00398    EnableWindow(GetDlgItem(m_hwndDlg, IDC_OPTAPP_BROWSEBKIMG), bChecked);
00399    ::SendMessage(GetParent(m_hwndDlg), PSM_CHANGED, (WPARAM)m_hwndDlg, 0);
00400 }
00401
00402
00403 //----------------------------------------------------------------------------
00404 //
00405 // CUserPrefs constructor
00406 //
00407 // Parameters:       None.
00408 //
00409 //----------------------------------------------------------------------------
00410 CUserPrefs::CUserPrefs()
00411 {
00412    // Set default settings
00413    m_pSite = NULL;
00414    m_bCheckVer = FALSE;
00415    m_bCheckExtras = FALSE;
00416    m_bStatusBar = TRUE;
00417    m_bTooltips = TRUE;
00418    m_bAnimWon = TRUE;
00419    m_bAnimCards = TRUE;
00420    m_bHelpPane = FALSE;
00421    m_cyHelpPane = CY_HELPPANE_DEFAULT;
00422    m_colorBkg = DEFAULTBKCOLOR;
00423    m_colorText = DEFAULTTEXTCOLOR;
00424    m_pCPSounds = NULL;
00425 }
00426
00427
00428 //----------------------------------------------------------------------------
00429 //
00430 // CUserPrefs destructor
00431 //
00432 //----------------------------------------------------------------------------
00433 CUserPrefs::~CUserPrefs()
00434 {
00435    SAFEDELETE(m_pCPSounds);
00436 }
00437
00438
00439 //----------------------------------------------------------------------------
00440 //
00441 // SetSite function
00442 //    Sets the object which should be notified of setting changes, and
00443 //    performs other initialization.
00444 //
00445 // Parameters:
00446 //    pSite:         Main window object interface.
00447 //
00448 //----------------------------------------------------------------------------
00449 void CUserPrefs::SetSite(IUserPrefsSite *pSite)
00450 {
00451    _ASSERT(pSite);
00452    m_pSite = pSite;
00453
00454    // Create Control Panel sounds component
00455    CTSTR lpszTemp(TRUE, MAX_PATH);
00456    GetModuleFileName(NULL, lpszTemp, MAX_PATH);
00457    PathRemoveFileSpec(lpszTemp);
00458    m_pCPSounds = new CCPSounds(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(s_auidSounds, 4),
00459       CUINTArray(s_auidDisplays, 4), lpszTemp);
00460    ENSUREALLOC(m_pCPSounds);
00461 }
00462
00463
00464 //----------------------------------------------------------------------------
00465 //
00466 // ReadRegistry function
00467 //    Reads all user settings from the registry.
00468 //
00469 // Parameters:       None.
00470 //
00471 // Returns:          None.
00472 //
00473 //----------------------------------------------------------------------------
00474 void CUserPrefs::ReadRegistry()
00475 {
00476    // Retrieve the registry key for storing user-specific settings
00477    CKey hKeyProduct;
00478    if(FAILED(GetProductKey(hKeyProduct, TRUE)))
00479       return;
00480
00481    DWORD dwTemp = 0;
00482
00483    // Load general settings
00484    m_bAnimWon = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_ANIMWON, &dwTemp)) ?
00485       (dwTemp == 1) : TRUE;
00486    m_bAnimCards = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_ANIMCARDS, &dwTemp)) ?
00487       (dwTemp == 1) : TRUE;
00488    m_bStatusBar = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_STATUSBAR, &dwTemp)) ?
00489       (dwTemp == 1) : TRUE;
00490    m_bHelpPane = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANE, &dwTemp)) ?
00491       (dwTemp == 1) : FALSE;
00492    GetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANEHEIGHT, &dwTemp);
00493    if((int)dwTemp == 0)
00494       m_cyHelpPane = CY_HELPPANE_DEFAULT;
00495    else if((int)dwTemp < CY_HELPPANE_MIN)
00496       m_cyHelpPane = CY_HELPPANE_MIN;
00497    else
00498       m_cyHelpPane = (int)dwTemp;
00499
00500    // Load update notification settings
00501    m_bCheckVer = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, &dwTemp)) ?
00502       (dwTemp == 1) : TRUE;
00503    m_bCheckExtras = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, &dwTemp)) ?
00504       (dwTemp == 1) : TRUE;
00505
00506    // Load appearance settings
00507    m_lpszBkgImg = GetRegStringValue(hKeyProduct, IDS_REG_BGIMG);
00508    if(SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_BGCOLOR, &dwTemp)))
00509       m_colorBkg = dwTemp;
00510    if(SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_TEXTCOLOR, &dwTemp)))
00511       m_colorText = dwTemp;
00512
00513    // Load custom colors for choose color common dialog box
00514    ChooseColorReadReg(hKeyProduct, IDS_REG_CUSTCOLORS);
00515 }
00516
00517
00518 //----------------------------------------------------------------------------
00519 //
00520 // WriteRegistry function
00521 //    Writes specified user settings to the registry.
00522 //
00523 // Parameters:
00524 //    dwFlags:       Specifies which settings to write.
00525 //
00526 // Returns:          None.
00527 //
00528 //----------------------------------------------------------------------------
00529 void CUserPrefs::WriteRegistry(DWORD dwFlags)
00530 {
00531    // Retrieve the registry key for storing user-specific settings
00532    CKey hKeyProduct;
00533    if(FAILED(GetProductKey(hKeyProduct, TRUE)))
00534       return;
00535
00536    if(dwFlags & SETTING_GENERAL)
00537    {
00538       // Save general settings
00539       SetRegDWORDValue(hKeyProduct, IDS_REG_ANIMWON, (DWORD)m_bAnimWon);
00540       SetRegDWORDValue(hKeyProduct, IDS_REG_ANIMCARDS, (DWORD)m_bAnimCards);
00541       SetRegDWORDValue(hKeyProduct, IDS_REG_STATUSBAR, (DWORD)m_bStatusBar);
00542       SetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANE, (DWORD)m_bHelpPane);
00543       SetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANEHEIGHT, (DWORD)m_cyHelpPane);
00544    }
00545
00546    if(dwFlags & SETTING_NOTIFY)
00547    {
00548       // Save update notification settings
00549       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, (DWORD)m_bCheckVer);
00550       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, (DWORD)m_bCheckExtras);
00551    }
00552
00553    if(dwFlags & SETTING_APPEARANCE)
00554    {
00555       // Save appearance settings
00556       SetRegStringValue(hKeyProduct, IDS_REG_BGIMG, m_lpszBkgImg);
00557       SetRegDWORDValue(hKeyProduct, IDS_REG_BGCOLOR, (DWORD)m_colorBkg);
00558       SetRegDWORDValue(hKeyProduct, IDS_REG_TEXTCOLOR, (DWORD)m_colorText);
00559
00560       // Save custom colors for choose color common dialog box
00561       ChooseColorWriteReg(hKeyProduct, IDS_REG_CUSTCOLORS);
00562    }
00563 }
00564
00565
00566 //----------------------------------------------------------------------------
00567 //
00568 // UpdateAppearance function
00569 //    Applies the user's appearance settings to the HTML document.
00570 //
00571 // Parameters:
00572 //    dwFlags:       Specifies which appearance settings to update.
00573 //
00574 // Returns:          None.
00575 //
00576 //----------------------------------------------------------------------------
00577 void CUserPrefs::UpdateAppearance(DWORD dwFlags)
00578 {
00579    CHTMLHelper *pHH = m_pSite->GetHH();
00580    if(!pHH)
00581       return;
00582
00583    // Retrieve the body element's style object
00584    CHTMLElementPtr spBody(TRUE, pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00585    CHTMLStylePtr spStyle;
00586    CHECKHRCOM(spBody->get_style(&spStyle));
00587
00588    if((dwFlags & UA_BKCOLOR) || (dwFlags & UA_TEXTCOLOR))
00589    {
00590       // Some color setting is to be updated
00591       CTSTR lpszHex(IDS_HEXCOLORHOLDER);
00592       CTSTR lpszColor(TRUE, 24);
00593
00594       if(dwFlags & UA_BKCOLOR)
00595       {
00596          // Set background color
00597          wsprintf(lpszColor, lpszHex, GetRValue(m_colorBkg), GetGValue(m_colorBkg),
00598             GetBValue(m_colorBkg));
00599          CHECKHRCOM(spStyle->put_backgroundColor(CVariant(CBSTR(lpszColor))));
00600       }
00601
00602       if(dwFlags & UA_TEXTCOLOR)
00603       {
00604          // Set text color
00605          wsprintf(lpszColor, lpszHex, GetRValue(m_colorText), GetGValue(m_colorText),
00606             GetBValue(m_colorText));
00607          CHECKHRCOM(spStyle->put_color(CVariant(CBSTR(lpszColor))));
00608
00609          // Set link color to be the same as text color
00610          pHH->SetHlinkColor(m_colorText, IDS_STYLE_COLOR);
00611
00612          // Set pile base image filter, so images are in text color
00613          CTSTR lpszFilterHolder(IDS_STYLE_PILEBASEFILTER);
00614          CTSTR lpszFilter(TRUE, lpszFilterHolder.Len() + 16);
00615          wsprintf(lpszFilter, lpszFilterHolder, GetRValue(m_colorText), GetGValue(m_colorText),
00616             GetBValue(m_colorText));
00617          pHH->AddStyle(CBSTR(IDS_SEL_PILEBASECLASS), CBSTR(lpszFilter));
00618       }
00619    }
00620
00621    if(dwFlags & UA_BKIMG)
00622    {
00623       // Set background image
00624       CHECKHRCOM(spStyle->put_backgroundImage(m_lpszBkgImg ? CBSTR().Format(CTSTR(IDS_IMGHOLDER),
00625          m_lpszBkgImg) : CBSTR()));
00626    }
00627 }
00628
00629
00630 //----------------------------------------------------------------------------
00631 //
00632 // DoOptions function
00633 //    Displays the options property sheet.
00634 //
00635 // Parameters:
00636 //    hwndParent:    Parent window handle.
00637 //
00638 // Returns:          None.
00639 //
00640 //----------------------------------------------------------------------------
00641 void CUserPrefs::DoOptions(HWND hwndParent)
00642 {
00643    PROPSHEETPAGE psp[3];
00644    PROPSHEETHEADER psh;
00645
00646    // Fill in the first property page
00647    psp[0].dwSize = sizeof(PROPSHEETPAGE);
00648    psp[0].dwFlags = 0;
00649    psp[0].hInstance = g_hInstLC;
00650    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS_GENERAL);
00651    psp[0].pfnDlgProc = OptionsGeneralProc;
00652    psp[0].lParam = (LPARAM)this;
00653
00654    // Fill in APPPROCDATA structure for appearance page
00655    CAppearanceDlg apd(this);
00656
00657    // Fill in the second property page
00658    psp[1].dwSize = sizeof(PROPSHEETPAGE);
00659    psp[1].dwFlags = 0;
00660    psp[1].hInstance = g_hInstLC;
00661    psp[1].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS_APPEARANCE);
00662    psp[1].pfnDlgProc = CAppearanceDlg::OptionsAppearanceProc;
00663    psp[1].lParam = (LPARAM)&apd;
00664
00665    // Let the CPSounds component fill in the second page
00666    m_pCPSounds->FillPropPage(&psp[2]);
00667
00668    // Set property sheet structure members
00669    psh.dwSize = sizeof(PROPSHEETHEADER);
00670    psh.dwFlags = PSH_PROPSHEETPAGE;
00671    psh.hwndParent = hwndParent;
00672    psh.hInstance = g_hInstLC;
00673    psh.ppsp = (LPCPROPSHEETPAGE)&psp;
00674    psh.pszCaption = MAKEINTRESOURCE(IDS_OPTIONSDLGTITLE);
00675    psh.nPages = 3;
00676    psh.nStartPage = 0;
00677
00678    // Display property sheet
00679    int i = PropertySheet(&psh);
00680
00681    m_pCPSounds->CleanupPropPage(&psp[2]);
00682
00683    if(i == -1)
00684       THROW(new CWinExcep(GetLastError()), CWinExcep*);
00685 }
00686
00687
00688 //----------------------------------------------------------------------------
00689 //
00690 // OptionsGeneralProc function
00691 //    Callback function that handles messages to the general options property
00692 //    page.
00693 //
00694 // Parameters:
00695 //    hwndDlg:       The dialog box window handle.
00696 //    uMsg:          Message identifer.
00697 //    wParam:        Message-specific parameter.
00698 //    lParam:        Message-specific parameter.
00699 //
00700 // Returns:          TRUE if the message was handled, otherwise FALSE.
00701 //
00702 //----------------------------------------------------------------------------
00703 INT_PTR CALLBACK CUserPrefs::OptionsGeneralProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00704                                                 LPARAM lParam)
00705 {
00706    CUserPrefs *pThis = (CUserPrefs*)GetWindowLong(hwndDlg, GWL_USERDATA);
00707
00708    try   // Windows-called code
00709    {
00710       switch(uMsg)
00711       {
00712          // Called when the dialog box is created
00713          case WM_INITDIALOG:
00714             pThis = (CUserPrefs*)((LPPROPSHEETPAGE)lParam)->lParam;
00715             SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00716             return TRUE;
00717
00718          // Called when a check box is clicked
00719          case WM_COMMAND:
00720             if(HIWORD(wParam) == BN_CLICKED)
00721             {
00722                // Enable the Apply button
00723                ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00724             }
00725             break;
00726
00727          // Called when a common control event takes place
00728          case WM_NOTIFY:
00729             switch(((LPNMHDR)lParam)->code)
00730             {
00731                // The property sheet is being activated
00732                case PSN_SETACTIVE:
00733                   // Set check boxes
00734                   SETCHK(IDC_OPTGENERAL_STATUSBAR, pThis->m_bStatusBar);
00735                   SETCHK(IDC_OPTGENERAL_TOOLTIPS, pThis->m_bTooltips);
00736                   SETCHK(IDC_OPTGENERAL_ANIMCARDS, pThis->m_bAnimCards);
00737                   SETCHK(IDC_OPTGENERAL_ANIMATEWON, pThis->m_bAnimWon);
00738                   SETCHK(IDC_OPTGENERAL_CHECKNEWVER, pThis->m_bCheckVer);
00739                   SETCHK(IDC_OPTGENERAL_CHECKEXTRAS, pThis->m_bCheckExtras);
00740                   return 0;
00741
00742                // The property sheet is being deactivated
00743                case PSN_KILLACTIVE:
00744                {
00745                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00746                } return TRUE;
00747
00748                // The Apply or OK button has been clicked
00749                case PSN_APPLY:
00750                {
00751                   BOOL bNew = GETCHK(IDC_OPTGENERAL_STATUSBAR);
00752                   if(bNew != pThis->m_bStatusBar)
00753                      pThis->m_pSite->OptionStatusBar(bNew);
00754                   bNew = GETCHK(IDC_OPTGENERAL_TOOLTIPS);
00755                   if(bNew != pThis->m_bTooltips)
00756                      pThis->m_pSite->OptionTooltips(bNew);
00757                   pThis->m_bAnimCards = GETCHK(IDC_OPTGENERAL_ANIMCARDS);
00758                   pThis->m_bAnimWon = GETCHK(IDC_OPTGENERAL_ANIMATEWON);
00759                   pThis->m_bCheckVer = GETCHK(IDC_OPTGENERAL_CHECKNEWVER);
00760                   pThis->m_bCheckExtras = GETCHK(IDC_OPTGENERAL_CHECKEXTRAS);
00761                   pThis->WriteRegistry(SETTING_GENERAL | SETTING_NOTIFY);
00762                } break;
00763             }
00764             return TRUE;
00765
00766          case WM_HELP:
00767          case WM_CONTEXTMENU:
00768 //          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, CTSTR(),
00769 //             pThis->s_adwOptionsPopupHelp);
00770             break;
00771       }
00772    }
00773    catch(CExcep *pE)
00774    {
00775       pE->Report();
00776       pE->Delete();
00777       EndDialog(hwndDlg, IDCANCEL);
00778    }
00779    return FALSE;
00780 }
Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


UserPrefs.h File Reference

#include <bmws_cpsounds.h>
#include <bmws_htmlhelpers.h>

Go to the source code of this file.

Compounds

class | CUserPrefs
class | IUserPrefsSite

Defines

#define | AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_
#define | SETTING_GENERAL 0x00000001
#define | SETTING_NOTIFY 0x00000002
#define | SETTING_APPEARANCE 0x00000004
#define | SETTING_ALL 0xFFFFFFFF
#define | UA_TEXTCOLOR 0x00000001
#define | UA_BKCOLOR 0x00000002
#define | UA_BKIMG 0x00000004
#define | UA_ALL 0x00000007

Define Documentation

#define AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_

Definition at line 10 of file UserPrefs.h.

#define SETTING_ALL 0xFFFFFFFF

Definition at line 30 of file UserPrefs.h.

Referenced by CMainWindow::OnDestroy().

#define SETTING_APPEARANCE 0x00000004

Definition at line 29 of file UserPrefs.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::WriteRegistry().

#define SETTING_GENERAL 0x00000001

Definition at line 27 of file UserPrefs.h.

Referenced by CMainWindow::DoHelpPane(), CUserPrefs::OptionsGeneralProc(), and CUserPrefs::WriteRegistry().

#define SETTING_NOTIFY 0x00000002

Definition at line 28 of file UserPrefs.h.

Referenced by CUserPrefs::OptionsGeneralProc(), CMainWindow::SetCheckUpdate(), and CUserPrefs::WriteRegistry().

#define UA_ALL 0x00000007

Definition at line 39 of file UserPrefs.h.

Referenced by CMainWindow::HTMLComplete().

#define UA_BKCOLOR 0x00000002

Definition at line 37 of file UserPrefs.h.

Referenced by CAppearanceDlg::DoChooseColor(), CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::UpdateAppearance().

#define UA_BKIMG 0x00000004

Definition at line 38 of file UserPrefs.h.

Referenced by CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::UpdateAppearance().

#define UA_TEXTCOLOR 0x00000001

Definition at line 36 of file UserPrefs.h.

Referenced by CAppearanceDlg::DoChooseColor(), CAppearanceDlg::OptionsAppearanceProc(), and CUserPrefs::UpdateAppearance().

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


UserPrefs.h Source File

UserPrefs.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // UserPrefs.h
00004 //    Class to encapsulate managing user preferences.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #if !defined(AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
00010 #define AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_
00011
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015
00016
00017 //----------------------------------------------------------------------------
00018 // Includes
00019 //----------------------------------------------------------------------------
00020 #include <bmws_cpsounds.h>
00021 #include <bmws_htmlhelpers.h>
00022
00023
00024 //----------------------------------------------------------------------------
00025 // Settings flags, used by WriteRegistry function
00026 //----------------------------------------------------------------------------
00027 #define SETTING_GENERAL       0x00000001
00028 #define SETTING_NOTIFY        0x00000002
00029 #define SETTING_APPEARANCE    0x00000004
00030 #define SETTING_ALL           0xFFFFFFFF
00031
00032
00033 //----------------------------------------------------------------------------
00034 // Appearance flags, used by UpdateAppearance function
00035 //----------------------------------------------------------------------------
00036 #define UA_TEXTCOLOR    0x00000001  // The text color should be updated
00037 #define UA_BKCOLOR      0x00000002  // The background color should be updated
00038 #define UA_BKIMG        0x00000004  // The background image should be updated
00039 #define UA_ALL          0x00000007  // All properties should be updated
00040
00041
00042 //----------------------------------------------------------------------------
00043 //
00044 // IUserPrefsSite abstract class
00045 //    Implemented by the main window so it can be notified of preference
00046 //    changes.
00047 //
00048 //----------------------------------------------------------------------------
00049 class IUserPrefsSite
00050 {
00051 public:
00052    virtual void OptionStatusBar(BOOL bShow) = 0;
00053    virtual void OptionTooltips(BOOL bShow) = 0;
00054    virtual CHTMLHelper* GetHH() = 0;
00055 };
00056
00057
00058 //----------------------------------------------------------------------------
00059 //
00060 // CUserPrefs class
00061 //    Encapsulates managing user preferences. The MainWindow uses this object
00062 //    to retrieve and store preferences and to manage the options dialog box.
00063 //    Not all settings are settable via the options box; some, such as the
00064 //    help pane visibility/height depend on the user's using of the pane.
00065 //
00066 //----------------------------------------------------------------------------
00067 class CUserPrefs
00068 {
00069 public:
00070    CUserPrefs();
00071    virtual ~CUserPrefs();
00072
00073    void SetSite(IUserPrefsSite *pSite);
00074    void ReadRegistry();
00075    void WriteRegistry(DWORD dwFlags);
00076
00077    void UpdateAppearance(DWORD dwFlags);
00078    void DoOptions(HWND hwndParent);
00079
00080    // Options property page dialog box procedure
00081    static INT_PTR CALLBACK OptionsGeneralProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
00082       LPARAM lParam);
00083
00084    // General preferences
00085    BOOL m_bStatusBar;            // Show status bar?
00086    BOOL m_bHelpPane;             // Show help pane?
00087    int m_cyHelpPane;             // Height of help pane
00088    BOOL m_bAnimWon;              // Whether to animate when a game is won
00089    BOOL m_bAnimCards;            // Whether to animate cards
00090    BOOL m_bTooltips;             // Whether pile tooltips are enabled
00091
00092    // Update notification
00093    BOOL m_bCheckVer;             // Check for new version?
00094    BOOL m_bCheckExtras;          // Check for new features?
00095
00096    // Appearance
00097    CTSTR m_lpszBkgImg;           // Background image
00098    COLORREF m_colorBkg;          // Background color
00099    COLORREF m_colorText;         // Text/pile base color
00100
00101    // Sounds
00102    CCPSounds *m_pCPSounds;       // Control panel sounds component
00103    static UINT s_auidSounds[];   // Array of registry string IDs
00104    static UINT s_auidDisplays[]; // Array of display string IDs
00105
00106 protected:
00107    IUserPrefsSite *m_pSite;      // Main window interface
00108 };
00109
00110
00111 #endif // !defined(AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_)
Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


VersionNo.h File Reference

Go to the source code of this file.

Defines

#define | FILEVER 1,0,120,0
#define | PRODUCTVER 1,0,120,0
#define | STRFILEVER "1.00.120.0\0"
#define | STRPRODUCTVER "1.00.120.0\0"

Define Documentation

#define FILEVER 1,0,120,0

Definition at line 1 of file VersionNo.h.

#define PRODUCTVER 1,0,120,0

Definition at line 2 of file VersionNo.h.

#define STRFILEVER "1.00.120.0\0"

Definition at line 3 of file VersionNo.h.

#define STRPRODUCTVER "1.00.120.0\0"

Definition at line 4 of file VersionNo.h.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


VersionNo.h Source File

VersionNo.h

Go to the documentation of this file.
00001 #define FILEVER         1,0,120,0
00002 #define PRODUCTVER      1,0,120,0
00003 #define STRFILEVER      "1.00.120.0\0"
00004 #define STRPRODUCTVER   "1.00.120.0\0"
00005
Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


Window.cpp File Reference

#include "stdafx.h"
#include <bmws_window.cpp>
#include <bmws_dlg.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Window.cpp Source File

Window.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // Window.cpp
00004 //    Includes component source files related to windows and dialog boxes.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_window.cpp>
00011 #include <bmws_dlg.cpp>
Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


xml.cpp File Reference

#include "stdafx.h"
#include <bmws_xml.cpp>

Go to the source code of this file.

Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


xml.cpp Source File

xml.cpp

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 //
00003 // xml.cpp
00004 //    Includes component source files related to XML documents and elements.
00005 //
00006 //----------------------------------------------------------------------------
00007
00008
00009 #include "stdafx.h"
00010 #include <bmws_xml.cpp>
Generated on Wed May 8 12:39:13 2002 for Solitaire Pack by doxygen 1.2.15


_IID Struct Reference

List of all members.

Public Attributes

unsigned long | x
unsigned short | s1
unsigned short | s2
unsigned char | c [8]

Member Data Documentation

unsigned char c

Definition at line 54 of file SPGames_i.c.

unsigned short s1

Definition at line 52 of file SPGames_i.c.

unsigned short s2

Definition at line 53 of file SPGames_i.c.

unsigned long x

Definition at line 51 of file SPGames_i.c.

The documentation for this struct was generated from the following files:
  • SolpackInternal_i.c
  • Solpack_catid.c
  • Solpack_i.c
  • SPGames_i.c
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


Member List

_IID Member List

This is the complete list of members for _IID, including all inherited members.
c | _IID
s1 | _IID
s2 | _IID
x | _IID
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


C3DShatter Class Reference

#include <bmws_3dshatter.h>

Inheritance diagram for C3DShatter:

IEventSinkSite List of all members.

Public Methods

C3DShatter (CHTMLHelper *pHH, UINT uidDAVC)
virtual | ~C3DShatter ()
DWORD | DoAnimation (UINT uidElement, CBSTR &bstrImg, int cx, int cy, CBSTR &bstrBkColor, double dHold1=3.0, double dForward=5.0, double dHold2=1.0, double dBack=5.0)
void | EndAnimation ()
BOOL | IsAnimating ()
HRESULT | EventSink (LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)

Protected Attributes

CHTMLHelper * m_pHH
CEventSink * m_pDAVCEvent
CPtr< IDAViewerControl,&IID_IDAViewerControl > | m_spDAVC
UINT | m_uidDAVC
BOOL | m_bAnimating
UINT | m_uidElement

Constructor & Destructor Documentation

C3DShatter | ( | CHTMLHelper * | pHH,
 |  | UINT | uidDAVC
 | ) |

Definition at line 51 of file bmws_3dshatter.cpp.

References CPtr< IDAViewerControl,&IID_IDAViewerControl >::Assign(), ENSUREALLOC, CHTMLHelper::GetNamedEl(), m_bAnimating, m_pDAVCEvent, m_pHH, m_spDAVC, m_uidDAVC, and m_uidElement.

00052 {
00053    m_bAnimating = FALSE;
00054    m_uidDAVC = uidDAVC;
00055    m_pHH = pHH;
00056    m_pDAVCEvent = NULL;
00057
00058    CPtr<IHTMLObjectElement, &IID_IHTMLObjectElement> spObjEl(TRUE, m_pHH->GetNamedEl(uidDAVC,
00059       IID_IHTMLObjectElement));
00060    CPtr<IDispatch, &IID_IDispatch> spDispObj;
00061    if(SUCCEEDED(spObjEl->get_object(&spDispObj)))
00062    {
00063       m_spDAVC.Assign(spDispObj);
00064    }
00065    CPtr<IUnknown, &IID_IUnknown> spUnkDAVC = spObjEl;
00066    m_pDAVCEvent = new CEventSink((IEventSinkSite*)this, 0, spUnkDAVC,
00067       DIID__IDAViewerControlEvents);
00068    ENSUREALLOC(m_pDAVCEvent);
00069
00070    m_uidElement = (UINT)-1;
00071 }

~C3DShatter ( ) [virtual]

Definition at line 79 of file bmws_3dshatter.cpp.

References CEventSink::Disconnect(), and m_pDAVCEvent.

00080 {
00081    if(m_pDAVCEvent)
00082       m_pDAVCEvent->Disconnect();
00083    m_pDAVCEvent = NULL;
00084 }

Member Function Documentation

DWORD DoAnimation | ( | UINT | uidElement,
 |  | CBSTR & | bstrImg,
 |  | int | cx,
 |  | int | cy,
 |  | CBSTR & | bstrBkColor,
 |  | double | dHold1 = 3.0,
 |  | double | dForward = 5.0,
 |  | double | dHold2 = 1.0,
 |  | double | dBack = 5.0
 | ) |

Definition at line 108 of file bmws_3dshatter.cpp.

References ANIM_3DSHATTER_NODAVC, ANIM_3DSHATTER_NOTRANSFORM, ANIM_3DSHATTER_OK, ANIM_3DSHATTER_OTHER, CPtr::Assign(), CHECKCOMOOM, CHECKHRCOM, EndAnimation(), CHTMLHelper::GetNamedEl(), m_bAnimating, m_pHH, m_spDAVC, m_uidDAVC, m_uidElement, SAFERELEASE, CHTMLHelper::ShowElementEx(), and THROW.

00111 {
00112    if(!m_spDAVC)
00113       return ANIM_3DSHATTER_NODAVC;
00114
00115    if(m_bAnimating)
00116       EndAnimation();
00117
00118    DWORD dwResult = ANIM_3DSHATTER_OTHER;
00119    m_bAnimating = TRUE;
00120 #ifdef BMWS_3DSHATTER_ELEMENT
00121    IDispRedirectEffect *pRedirectEffect = NULL;
00122    IDXTRedirect *pRedirect = NULL;
00123 #endif
00124    VARIANT vOut, vImg;
00125    VariantInit(&vOut);
00126    VariantInit(&vImg);
00127
00128    try
00129    {
00130       CPtr<IDAStatics, &IID_IDAStatics> m;
00131       CHECKHRCOM(m_spDAVC->get_MeterLibrary(&m));
00132       CPtr<IDA2Statics, &IID_IDA2Statics> m2 = m;
00133       CPtr<IDA3Statics, &IID_IDA3Statics> m3 = m;
00134
00135       CPtr<IDANumber, &IID_IDANumber> spPixel;
00136       CHECKHRCOM(m->get_Pixel(&spPixel));
00137       double dPixel;
00138       CHECKHRCOM(spPixel->Extract(&dPixel));
00139
00140       CPtr<IDAGeometry, &IID_IDAGeometry> pEmptyGeo;
00141       CHECKHRCOM(m->get_EmptyGeometry(&pEmptyGeo));
00142       CPtr<IDABehavior, &IID_IDABehavior> pEmptyGeoBehavior = pEmptyGeo;
00143       CPtr<IDABehavior, &IID_IDABehavior> pSWGeo;
00144       CHECKHRCOM(m->ModifiableBehavior(pEmptyGeo, &pSWGeo));
00145
00146       CPtr<IDAImage, &IID_IDAImage> pEmptyImage;
00147       CHECKHRCOM(m->get_EmptyImage(&pEmptyImage));
00148       CPtr<IDABehavior, &IID_IDABehavior> pEmptyImageBehavior = pEmptyImage;
00149       CPtr<IDABehavior, &IID_IDABehavior> pSWImg;
00150       CHECKHRCOM(m->ModifiableBehavior(pEmptyImageBehavior, &pSWImg));
00151
00152       CPtr<IDAImage, &IID_IDAImage> pRawImg;
00153       m_uidElement = uidElement;
00154       if(uidElement == (UINT)-1)
00155       {
00156          CHECKHRCOM(m->ImportImage(bstrImg, &pRawImg));
00157       } else
00158       {
00159 #ifdef BMWS_3DSHATTER_ELEMENT
00160          CPtr<IHTMLElement, &IID_IHTMLElement> spEl(TRUE, m_pHH->GetNamedEl(uidElement,
00161             IID_IHTMLElement));
00162          CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00163          CHECKHRCOM(spEl->get_style(&spStyle));
00164          CHECKHRCOM(spStyle->put_filter(CBSTR(TEXT("redirect"))));
00165          CPtr<IHTMLFiltersCollection, &IID_IHTMLFiltersCollection> spFilters;
00166          CHECKHRCOM(spEl->get_filters(&spFilters));
00167          VARIANT vInd;
00168          vInd.vt = VT_UINT;
00169          vInd.lVal = 0;
00170          VariantInit(&vOut);
00171          CHECKHRCOM(spFilters->item(&vInd, &vOut));
00172          if(vOut.vt != VT_DISPATCH)
00173             THROW(new CCOMExcep(E_FAIL));
00174          if(SUCCEEDED(vOut.pdispVal->QueryInterface(IID_IDispRedirectEffect,
00175             (LPVOID*)&pRedirectEffect)))
00176          {
00177             CHECKHRCOM(pRedirectEffect->ElementImage(&vImg));
00178             SAFERELEASE(pRedirectEffect);
00179          } else if(SUCCEEDED(vOut.pdispVal->QueryInterface(IID_IDXTRedirect,
00180             (LPVOID*)&pRedirect)))
00181          {
00182             CHECKHRCOM(pRedirect->ElementImage(&vImg));
00183             SAFERELEASE(pRedirect);
00184          } else
00185          {
00186             DISPID dispid;
00187             OLECHAR *lpwszMember = L"ElementImage";
00188             CHECKHRCOM(vOut.pdispVal->GetIDsOfNames(IID_NULL, &lpwszMember, 1,
00189                LOCALE_SYSTEM_DEFAULT, &dispid));
00190             DISPPARAMS dp = { NULL, NULL, 0, 0 };
00191             VariantInit(&vImg);
00192             CHECKHRCOM(vOut.pdispVal->Invoke(dispid, IID_NULL, GetUserDefaultLCID(),
00193                DISPATCH_METHOD, &dp, &vImg, NULL, NULL));
00194          }
00195          if(vImg.vt != VT_DISPATCH)
00196             THROW(new CCOMExcep(E_FAIL));
00197          pRawImg.Assign(vImg.pdispVal);
00198          VariantClear(&vImg);
00199          VariantClear(&vOut);
00200 #endif
00201       }
00202       CPtr<IDABehavior, &IID_IDABehavior> pRawImgBehavior = pRawImg;
00203
00204       dwResult = ANIM_3DSHATTER_NOTRANSFORM;
00205
00206       CPtr<IUnknown, &IID_IUnknown> xf;
00207       CHECKHRCOM(CoCreateInstance(CLSID_CrShatter, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown,
00208          (LPVOID*)&xf));
00209
00210       CPtr<ICrShatter, &IID_ICrShatter> xfShatter = xf;
00211
00212       dwResult = ANIM_3DSHATTER_OTHER;
00213
00214       CHECKHRCOM(xfShatter->put_depth(0.5));
00215       if(bstrBkColor)
00216          CHECKHRCOM(xfShatter->put_backColor(bstrBkColor));
00217       CHECKHRCOM(xfShatter->put_evacuateX(1));
00218       CHECKHRCOM(xfShatter->put_evacuateY(1));
00219       CHECKHRCOM(xfShatter->put_evacuateZ(1));
00220       CHECKHRCOM(xfShatter->put_evacuateDeltaX(0));
00221       CHECKHRCOM(xfShatter->put_evacuateDeltaY(0));
00222       CHECKHRCOM(xfShatter->put_evacuateDeltaZ(0));
00223
00224       CPtr<IDANumber, &IID_IDANumber> pDANumber;
00225       CHECKHRCOM(m->DANumber(0, &pDANumber));
00226       CPtr<IDABehavior, &IID_IDABehavior> pHoldTime;
00227       CHECKHRCOM(pDANumber->Duration(dHold1, &pHoldTime));
00228       CPtr<IDANumber, &IID_IDANumber> pDANumber2;
00229       CHECKHRCOM(m->DANumber(1, &pDANumber2));
00230       CPtr<IDABehavior, &IID_IDABehavior> pHoldTime2;
00231       CHECKHRCOM(pDANumber2->Duration(dHold2, &pHoldTime2));
00232       CPtr<IDANumber, &IID_IDANumber> pForward;
00233       CPtr<IDANumber, &IID_IDANumber> pBack;
00234       CHECKHRCOM(m->Interpolate(0, 1, dForward, &pForward));
00235       CHECKHRCOM(m->Interpolate(1, 0, dBack, &pBack));
00236       CPtr<IDABehavior, &IID_IDABehavior> pForwardBehavior = pForward;
00237       CPtr<IDABehavior, &IID_IDABehavior> pBackBehavior = pBack;
00238
00239       CPtr<IDABehavior, &IID_IDABehavior> pFinalSequence;
00240       IDABehavior* aBvrs[4];
00241       aBvrs[0] = pHoldTime;
00242       aBvrs[1] = pForwardBehavior;
00243       aBvrs[2] = pHoldTime2;
00244       aBvrs[3] = pBackBehavior;
00245
00246       CHECKHRCOM(m3->SequenceArrayEx(4, aBvrs, &pFinalSequence));
00247
00248       CPtr<IDABehavior, &IID_IDABehavior> pEvaluator;
00249       CHECKHRCOM(pFinalSequence->RepeatForever(&pEvaluator));
00250       CPtr<IDANumber, &IID_IDANumber> pEvaluatorNumber = pEvaluator;
00251
00252       CPtr<IDADXTransformResult, &IID_IDADXTransformResult> pResult;
00253       CHECKHRCOM(m2->ApplyDXTransformEx(xf, 1, &pRawImgBehavior, pEvaluatorNumber, &pResult));
00254       CPtr<IDABehavior, &IID_IDABehavior> pRealGeo;
00255       CHECKHRCOM(pResult->get_OutputBvr(&pRealGeo));
00256       CPtr<IDAGeometry, &IID_IDAGeometry> pRealGeoGeometry = pRealGeo;
00257
00258       CPtr<IDATransform3, &IID_IDATransform3> pRealTransScale;
00259       CHECKHRCOM(m->Scale3(cx*.5*dPixel, cy*.5*dPixel, 0.1, &pRealTransScale));
00260
00261       CPtr<IDAGeometry, &IID_IDAGeometry> pRealGeoGeometry2;
00262       CHECKHRCOM(pRealGeoGeometry->Transform(pRealTransScale, &pRealGeoGeometry2));
00263       CPtr<IDABehavior, &IID_IDABehavior> pRealGeo2 = pRealGeoGeometry2;
00264
00265       CHECKHRCOM(pSWGeo->SwitchTo(pRealGeo2));
00266
00267       CPtr<IDACamera, &IID_IDACamera> pCamera;
00268       CHECKHRCOM(m->PerspectiveCamera(0.12, 0.066, &pCamera));
00269       CPtr<IDAGeometry, &IID_IDAGeometry> pAmbientLight;
00270       CHECKHRCOM(m->get_AmbientLight(&pAmbientLight));
00271       CPtr<IDAGeometry, &IID_IDAGeometry> pDirectionalLight;
00272       CHECKHRCOM(m->get_DirectionalLight(&pDirectionalLight));
00273       CPtr<IDAVector3, &IID_IDAVector3> pXVector3;
00274       CHECKHRCOM(m->get_XVector3(&pXVector3));
00275       CPtr<IDATransform3, &IID_IDATransform3> pXRotTrans;
00276       CHECKHRCOM(m->Rotate3Degrees(pXVector3, 90, &pXRotTrans));
00277       CPtr<IDAGeometry, &IID_IDAGeometry> pTransDirLightGeometry;
00278       CHECKHRCOM(pDirectionalLight->Transform(pXRotTrans, &pTransDirLightGeometry));
00279       CPtr<IDAGeometry, &IID_IDAGeometry> pLight;
00280       CHECKHRCOM(m->UnionGeometry(pAmbientLight, pTransDirLightGeometry, &pLight));
00281       CPtr<IDAGeometry, &IID_IDAGeometry> pSWGeoGeometry = pSWGeo;
00282       CPtr<IDAGeometry, &IID_IDAGeometry> pLightAndGeo;
00283       CHECKHRCOM(m->UnionGeometry(pSWGeoGeometry, pLight, &pLightAndGeo));
00284
00285       CPtr<IDAImage, &IID_IDAImage> pFinalImg;
00286       CHECKHRCOM(pLightAndGeo->Render(pCamera, &pFinalImg));
00287       CPtr<IDABehavior, &IID_IDABehavior> pFinalImgBehavior = pFinalImg;
00288       CHECKHRCOM(pSWImg->SwitchTo(pFinalImgBehavior));
00289       CPtr<IDAImage, &IID_IDAImage> pSWImgImage = pSWImg;
00290
00291       CHECKHRCOM(m_spDAVC->put_Image(pSWImgImage));
00292       dwResult = ANIM_3DSHATTER_OK;
00293    }
00294    catch(CCOMExcep *pCOMExcep)
00295    {
00296       VariantClear(&vOut);
00297       VariantClear(&vImg);
00298 #ifdef BMWS_3DSHATTER_ELEMENT
00299       SAFERELEASE(pRedirectEffect);
00300       SAFERELEASE(pRedirect);
00301 #endif
00302       CHECKCOMOOM(pCOMExcep);
00303       pCOMExcep->Delete();
00304       EndAnimation();
00305       return dwResult;
00306    }
00307
00308    m_spDAVC->Start();
00309    m_pHH->ShowElementEx(m_uidDAVC, TRUE);
00310    return dwResult;
00311 }

void EndAnimation ( )

Definition at line 324 of file bmws_3dshatter.cpp.

References CHECKHRCOM, CHTMLHelper::GetNamedEl(), m_bAnimating, m_pHH, m_spDAVC, m_uidDAVC, m_uidElement, and CHTMLHelper::ShowElementEx().

Referenced by DoAnimation(), CEngine::TryCommand(), and CEngine::Uninit().

00325 {
00326    if(!m_bAnimating)
00327       return;
00328    if(m_spDAVC)
00329    {
00330       if(m_uidElement != (UINT)-1)
00331       {
00332          CPtr<IHTMLElement, &IID_IHTMLElement> spEl(TRUE, m_pHH->GetNamedEl(m_uidElement,
00333             IID_IHTMLElement));
00334          CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00335          CHECKHRCOM(spEl->get_style(&spStyle));
00336          CHECKHRCOM(spStyle->put_filter(CBSTR()));
00337       }
00338       CPtr<IDA3ViewerControl, &IID_IDA3ViewerControl> spDAVC3 = m_spDAVC;
00339       spDAVC3->Stop();
00340    }
00341    m_pHH->ShowElementEx(m_uidDAVC, FALSE);
00342    m_bAnimating = FALSE;
00343 }

HRESULT EventSink | ( | LPARAM | lParam,
 |  | DISPID | dispid,
 |  | DISPPARAMS FAR * | pdispparams
 | ) | [virtual]

Implements IEventSinkSite.

BOOL IsAnimating ( )

Definition at line 356 of file bmws_3dshatter.cpp.

References m_bAnimating.

00357 {
00358    return m_bAnimating;
00359 }

Member Data Documentation

BOOL m_bAnimating [protected]

Definition at line 56 of file bmws_3dshatter.h.

Referenced by C3DShatter(), DoAnimation(), EndAnimation(), and IsAnimating().

CEventSink* m_pDAVCEvent [protected]

Definition at line 53 of file bmws_3dshatter.h.

Referenced by C3DShatter(), and ~C3DShatter().

CHTMLHelper* m_pHH [protected]

Definition at line 52 of file bmws_3dshatter.h.

Referenced by C3DShatter(), DoAnimation(), and EndAnimation().

CPtr<IDAViewerControl, &IID_IDAViewerControl> m_spDAVC [protected]

Definition at line 54 of file bmws_3dshatter.h.

Referenced by C3DShatter(), DoAnimation(), and EndAnimation().

UINT m_uidDAVC [protected]

Definition at line 55 of file bmws_3dshatter.h.

Referenced by C3DShatter(), DoAnimation(), and EndAnimation().

UINT m_uidElement [protected]

Definition at line 57 of file bmws_3dshatter.h.

Referenced by C3DShatter(), DoAnimation(), and EndAnimation().

The documentation for this class was generated from the following files:
  • bmws_3dshatter.h
  • bmws_3dshatter.cpp
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


Member List

C3DShatter Member List

This is the complete list of members for C3DShatter, including all inherited members.
C3DShatter(CHTMLHelper *pHH, UINT uidDAVC) | C3DShatter |
DoAnimation(UINT uidElement, CBSTR &bstrImg, int cx, int cy, CBSTR &bstrBkColor, double dHold1=3.0, double dForward=5.0, double dHold2=1.0, double dBack=5.0) | C3DShatter |
EndAnimation() | C3DShatter |
EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams) | C3DShatter | [virtual]
IsAnimating() | C3DShatter |
m_bAnimating | C3DShatter | [protected]
m_pDAVCEvent | C3DShatter | [protected]
m_pHH | C3DShatter | [protected]
m_spDAVC | C3DShatter | [protected]
m_uidDAVC | C3DShatter | [protected]
m_uidElement | C3DShatter | [protected]
~C3DShatter() | C3DShatter | [virtual]
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


CAboutDlg Class Reference

#include <AboutDlg.h>

Inheritance diagram for CAboutDlg:

CDlg List of all members.

Public Methods

CAboutDlg ()
~CAboutDlg ()
INT_PTR | DlgProc (UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Attributes

HICON | m_hIcon
CHlinkWindowMgrPtr m_pHlinkWndMgr

Constructor & Destructor Documentation

CAboutDlg ( )

Definition at line 51 of file AboutDlg.cpp.

References g_hInst, IDD_ABOUTBOX, IDI_SOLPACK, and m_hIcon.

00051                      : CDlg(IDD_ABOUTBOX)
00052 {
00053    // Loads the icon
00054    m_hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_SOLPACK), IMAGE_ICON, 48, 48,
00055       LR_DEFAULTCOLOR);
00056 }

~CAboutDlg ( )

Definition at line 64 of file AboutDlg.cpp.

References m_hIcon.

00065 {
00066    DestroyIcon(m_hIcon);
00067 }

Member Function Documentation

INT_PTR DlgProc | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CDlg.

Definition at line 83 of file AboutDlg.cpp.

References CTSTR::Assign(), ENSUREALLOC, CTSTR::Format(), g_colorHlink, HLINK_PPM_RETURNDIRECT, HLINK_PPM_RETURNNORMAL, IDC_ABOUT_BMWSURL, IDC_ABOUT_REG, IDC_ABOUT_REGISTER, IDC_ABOUT_SOLPACKICON, IDS_UNREGISTERED, m_hIcon, CDlg::m_hwndDlg, and m_pHlinkWndMgr.

00084 {
00085    // Filter out HlinkWindow messages
00086    LRESULT lResult;
00087    if(m_pHlinkWndMgr)
00088    {
00089       DWORD dwReturn = m_pHlinkWndMgr->PreprocessMsg(m_hwndDlg, uMsg, wParam, lParam, &lResult);
00090       if(dwReturn == HLINK_PPM_RETURNDIRECT)
00091          return lResult;
00092       if(dwReturn == HLINK_PPM_RETURNNORMAL)
00093       {
00094          SetWindowLong(m_hwndDlg, DWL_MSGRESULT, lResult);
00095          return TRUE;
00096       }
00097    }
00098
00099    switch(uMsg)
00100    {
00101       // Called when the dialog box is created
00102       case WM_INITDIALOG:
00103       {
00104          // Set the Solitaire Pack icon in place
00105          SendDlgItemMessage(m_hwndDlg, IDC_ABOUT_SOLPACKICON, STM_SETIMAGE, (WPARAM)IMAGE_ICON,
00106             (LPARAM)m_hIcon);
00107
00108          // Add the hyperlink for Bot Productions's web site
00109          CTSTR lpszBMWSUrl(m_hwndDlg, IDC_ABOUT_BMWSURL);
00110          m_pHlinkWndMgr = new CHlinkWindowMgr(1, g_colorHlink);
00111          ENSUREALLOC(m_pHlinkWndMgr);
00112          m_pHlinkWndMgr->AddWnd(GetDlgItem(m_hwndDlg, IDC_ABOUT_BMWSURL), lpszBMWSUrl);
00113
00114          // Set user name, or unregistered message
00115          CTSTR lpszReg;
00116          if(g_lpszUserName)
00117          {
00118             lpszReg.Format(CTSTR(m_hwndDlg, IDC_ABOUT_REG), g_lpszUserName);
00119             ShowWindow(GetDlgItem(m_hwndDlg, IDC_ABOUT_REGISTER), SW_HIDE);
00120          } else
00121             lpszReg.Assign(IDS_UNREGISTERED);
00122          SetDlgItemText(m_hwndDlg, IDC_ABOUT_REG, lpszReg);
00123       } return TRUE;
00124
00125       // Called when a button is clicked
00126       case WM_COMMAND:
00127          if((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL) ||
00128             (LOWORD(wParam) == IDC_ABOUT_REGISTER))
00129          {
00130             EndDialog(m_hwndDlg, LOWORD(wParam));
00131             return 0;
00132          }
00133          break;
00134
00135       case WM_HELP:
00136       case WM_CONTEXTMENU:
00137          //g_pHelp->DialogCSHelp(m_hwndDlg, uMsg, wParam, lParam, CTSTR(), s_adwPopupHelp);
00138          break;
00139    }
00140    return FALSE;
00141 }

Member Data Documentation

HICON m_hIcon [protected]

Definition at line 43 of file AboutDlg.h.

Referenced by CAboutDlg(), DlgProc(), and ~CAboutDlg().

CHlinkWindowMgrPtr m_pHlinkWndMgr [protected]

Definition at line 44 of file AboutDlg.h.

Referenced by DlgProc().

The documentation for this class was generated from the following files:
  • AboutDlg.h
  • AboutDlg.cpp
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CAboutDlg Member List

This is the complete list of members for CAboutDlg, including all inherited members.
BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CDlg | [static]
CAboutDlg() | CAboutDlg |
CDlg(UINT uidDlg) | CDlg |
DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) | CAboutDlg | [virtual]
m_hIcon | CAboutDlg | [protected]
m_hwndDlg | CDlg | [protected]
m_pHlinkWndMgr | CAboutDlg | [protected]
m_uidDlg | CDlg | [protected]
Run(HWND hWndParent) | CDlg |
~CAboutDlg() | CAboutDlg |
~CDlg() | CDlg | [inline, virtual]
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


CAction Class Reference

#include <Action.h>

Inheritance diagram for CAction:

CCardIndexAction CFragmentAction CGameDataAction CPileCommentAction CPileShuffleAction List of all members.

Public Methods

CAction (IActionSite *pSite, DWORD dwType, DWORD dwData)
virtual | ~CAction ()
void | Undo ()
void | Redo ()

Public Attributes

CAction * | m_pPrev
CAction * | m_pNext
DWORD | m_dwType
DWORD | m_dwData

Protected Attributes

IActionSite * m_pSite

Constructor & Destructor Documentation

CAction | ( | IActionSite * | pSite,
 |  | DWORD | dwType,
 |  | DWORD | dwData
 | ) |

Definition at line 40 of file Action.cpp.

References m_dwData, m_dwType, m_pNext, m_pPrev, m_pSite, and ODS.

00041 {
00042    // Set initial values for member variables
00043    m_pSite = pSite;
00044    m_dwType = dwType;
00045    m_dwData = dwData;
00046    m_pNext = NULL;
00047    m_pPrev = NULL;
00048    ODS("CAction constructor");
00049
00050 #ifdef BMWS_TRACKMEMALLOC
00051    m_scTotalCreated++;
00052    if(m_scTotalCreated - m_scTotalDeleted > m_scMax)
00053       m_scMax = (m_scTotalCreated - m_scTotalDeleted);
00054 #endif
00055 }

~CAction ( ) [virtual]

Definition at line 63 of file Action.cpp.

References ODS.

00064 {
00065    ODS("CAction destructor");
00066 #ifdef BMWS_TRACKMEMALLOC
00067    m_scTotalDeleted++;
00068 #endif
00069 }

Member Function Documentation

void Redo ( )

Definition at line 99 of file Action.cpp.

References IActionSite::DoAction(), and m_pSite.

Referenced by CUndoMgr::RecordAction(), and CTurn::Redo().

00100 {
00101    // Tell the owner object to redo this action
00102    m_pSite->DoAction(this);
00103 }

void Undo ( )

Definition at line 82 of file Action.cpp.

References m_pSite, and IActionSite::UndoAction().

Referenced by CTurn::Undo().

00083 {
00084    // Tell the owner object to undo this action
00085    m_pSite->UndoAction(this);
00086 }

Member Data Documentation

DWORD m_dwData

Definition at line 65 of file Action.h.

Referenced by CAction(), CPile::DoAction(), CEngine::DoAction(), CCard::DoAction(), CPile::UndoAction(), CEngine::UndoAction(), and CCard::UndoAction().

DWORD m_dwType

Definition at line 64 of file Action.h.

Referenced by CAction(), CPile::DoAction(), CFragment::DoAction(), CEngine::DoAction(), CCard::DoAction(), CPile::UndoAction(), CFragment::UndoAction(), CEngine::UndoAction(), and CCard::UndoAction().

CAction* m_pNext

Definition at line 62 of file Action.h.

Referenced by CTurn::AddAction(), CAction(), CTurn::Redo(), and CTurn::~CTurn().

CAction* m_pPrev

Definition at line 61 of file Action.h.

Referenced by CTurn::AddAction(), CAction(), and CTurn::Undo().

IActionSite* m_pSite [protected]

Definition at line 75 of file Action.h.

Referenced by CAction(), Redo(), and Undo().

The documentation for this class was generated from the following files:
  • Action.h
  • Action.cpp
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CAction Member List

This is the complete list of members for CAction, including all inherited members.
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
m_dwData | CAction |
m_dwType | CAction |
m_pNext | CAction |
m_pPrev | CAction |
m_pSite | CAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


CAppearanceDlg Class Reference

List of all members.

Public Methods

CAppearanceDlg (CUserPrefs *pPrefs)
virtual | ~CAppearanceDlg ()

Static Public Methods

INT_PTR CALLBACK | OptionsAppearanceProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Methods

void | DoChooseColor (WORD wCtl)
void | TryUpdateColor (WORD wCtl, COLORREF colorNew, COLORREF *pColorDest, HBRUSH *phBrush, DWORD dwChanged)
void | DoBkImgChk ()

Protected Attributes

CUserPrefs * m_pPrefs
CTSTR m_lpszBkImg
COLORREF | m_bkColor
COLORREF | m_textColor
HBRUSH | m_hbrBk
HBRUSH | m_hbrText
DWORD | m_dwChanged
HWND | m_hwndDlg

Friends

class | CUserPrefs

Constructor & Destructor Documentation

CAppearanceDlg ( CUserPrefs * pPrefs )

Definition at line 108 of file UserPrefs.cpp.

References CTSTR::Assign(), m_bkColor, CUserPrefs::m_colorBkg, CUserPrefs::m_colorText, m_dwChanged, m_hbrBk, m_hbrText, m_hwndDlg, CUserPrefs::m_lpszBkgImg, m_lpszBkImg, m_pPrefs, and m_textColor.

00109 {
00110    // Initialize member variables
00111    m_pPrefs = pPrefs;
00112    m_textColor = pPrefs->m_colorText;
00113    m_bkColor = pPrefs->m_colorBkg;
00114    m_lpszBkImg.Assign(pPrefs->m_lpszBkgImg);
00115    m_dwChanged = 0;
00116    m_hwndDlg = NULL;
00117
00118    // Create brushes for the text and background colors
00119    m_hbrText = CreateSolidBrush(m_textColor);
00120    m_hbrBk = CreateSolidBrush(m_bkColor);
00121 }

~CAppearanceDlg ( ) [virtual]

Definition at line 129 of file UserPrefs.cpp.

References m_hbrBk, and m_hbrText.

00130 {
00131    // Delete the brushes
00132    DeleteObject((HGDIOBJ)m_hbrText);
00133    DeleteObject((HGDIOBJ)m_hbrBk);
00134 }

Member Function Documentation

void DoBkImgChk ( ) [protected]

Definition at line 394 of file UserPrefs.cpp.

References IDC_OPTAPP_BKIMGCHK, IDC_OPTAPP_BKIMGEDIT, IDC_OPTAPP_BROWSEBKIMG, and m_hwndDlg.

Referenced by OptionsAppearanceProc().

00395 {
00396    BOOL bChecked = (IsDlgButtonChecked(m_hwndDlg, IDC_OPTAPP_BKIMGCHK) == BST_CHECKED);
00397    EnableWindow(GetDlgItem(m_hwndDlg, IDC_OPTAPP_BKIMGEDIT), bChecked);
00398    EnableWindow(GetDlgItem(m_hwndDlg, IDC_OPTAPP_BROWSEBKIMG), bChecked);
00399    ::SendMessage(GetParent(m_hwndDlg), PSM_CHANGED, (WPARAM)m_hwndDlg, 0);
00400 }

void DoChooseColor ( WORD wCtl ) [protected]

Definition at line 317 of file UserPrefs.cpp.

References ChooseColorEx(), IDC_OPTAPP_TEXTCOLOR, IDS_CHOOSECOLOR_TITLE, IDS_COLOR_BKG, IDS_COLOR_TEXT, CTSTR::Len(), m_bkColor, m_hbrBk, m_hbrText, m_hwndDlg, m_textColor, TryUpdateColor(), UA_BKCOLOR, and UA_TEXTCOLOR.

Referenced by OptionsAppearanceProc().

00318 {
00319    COLORREF *pColor = (wCtl == IDC_OPTAPP_TEXTCOLOR ? (&m_textColor) : (&m_bkColor));
00320
00321    // Load the dialog box title string
00322    CTSTR lpszHolder(IDS_CHOOSECOLOR_TITLE);
00323    CTSTR lpszIns(wCtl == IDC_OPTAPP_TEXTCOLOR ? IDS_COLOR_TEXT : IDS_COLOR_BKG);
00324    CTSTR lpszTitle(TRUE, lpszHolder.Len() + lpszIns.Len() + 4);
00325    wsprintf(lpszTitle, lpszHolder, lpszIns);
00326
00327    // Present the choose color dialog box
00328    COLORREF colorNew = *pColor;
00329    if(ChooseColorEx(&colorNew, m_hwndDlg, lpszTitle))
00330    {
00331       // Store and update the new color
00332       HBRUSH *phBrush;
00333       DWORD dwChanged;
00334       if(wCtl == IDC_OPTAPP_TEXTCOLOR)
00335       {
00336          phBrush = &m_hbrText;
00337          dwChanged = UA_TEXTCOLOR;
00338       } else
00339       {
00340          phBrush = &m_hbrBk;
00341          dwChanged = UA_BKCOLOR;
00342       }
00343       TryUpdateColor(wCtl, colorNew, pColor, phBrush, dwChanged);
00344    }
00345 }

INT_PTR CALLBACK OptionsAppearanceProc | ( | HWND | hwndDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 152 of file UserPrefs.cpp.

References CTSTR::Assign(), DEFAULTBKCOLOR, DEFAULTTEXTCOLOR, DoBkImgChk(), DoChooseColor(), g_szAppTitle, GETCHK, IDC_OPTAPP_BKCOLOR, IDC_OPTAPP_BKIMGCHK, IDC_OPTAPP_BKIMGEDIT, IDC_OPTAPP_BROWSEBKIMG, IDC_OPTAPP_RESTORE, IDC_OPTAPP_TEXTCOLOR, IDS_BROWSEBKIMG, IDS_FILENOTFOUND, IDS_IMGFILTER, CTSTR::Len(), m_bkColor, CUserPrefs::m_colorBkg, CUserPrefs::m_colorText, m_dwChanged, m_hbrBk, m_hbrText, m_hwndDlg, CUserPrefs::m_lpszBkgImg, m_lpszBkImg, m_pPrefs, m_textColor, SETCHK, SETTING_APPEARANCE, SINGLE_OFN_INITFILETITLE, SingleOFN(), TryUpdateColor(), UA_BKCOLOR, UA_BKIMG, UA_TEXTCOLOR, CUserPrefs::UpdateAppearance(), and CUserPrefs::WriteRegistry().

Referenced by CUserPrefs::DoOptions().

00154 {
00155    CAppearanceDlg *pThis = (CAppearanceDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00156
00157    try   // Windows-called code
00158    {
00159       switch(uMsg)
00160       {
00161          // Called when the dialog box is created
00162          case WM_INITDIALOG:
00163             pThis = (CAppearanceDlg*)((LPPROPSHEETPAGE)lParam)->lParam;
00164             SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00165             pThis->m_hwndDlg = hwndDlg;
00166
00167             // Set current settings
00168             SetDlgItemText(hwndDlg, IDC_OPTAPP_BKIMGEDIT, pThis->m_lpszBkImg);
00169             SETCHK(IDC_OPTAPP_BKIMGCHK, pThis->m_lpszBkImg.Len() > 0);
00170             pThis->DoBkImgChk();
00171             return TRUE;
00172
00173          // Called when a button or check box is clicked
00174          case WM_COMMAND:
00175             if(HIWORD(wParam) == EN_CHANGE)
00176             {
00177                CTSTR lpsz(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00178                if(lstrcmp(lpsz, pThis->m_lpszBkImg) != 0)
00179                   ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00180             } else if(HIWORD(wParam) == BN_CLICKED)
00181             {
00182                switch(LOWORD(wParam))  // Which button was clicked?
00183                {
00184                   case IDC_OPTAPP_BROWSEBKIMG:
00185                   {
00186                      // Present Open dialog box to browse for background image
00187                      CTSTR lpsz(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00188                      if(SingleOFN(lpsz, IDS_IMGFILTER, NULL, hwndDlg, OFN_FILEMUSTEXIST |
00189                         OFN_HIDEREADONLY, CTSTR(IDS_BROWSEBKIMG), CTSTR(), (UINT)-1,
00190                         SINGLE_OFN_INITFILETITLE) == 1)
00191                      {
00192                         // Set the edit field contents to the new file name
00193                         SetDlgItemText(hwndDlg, IDC_OPTAPP_BKIMGEDIT, lpsz);
00194                         ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00195                      }
00196                   } break;
00197
00198                   case IDC_OPTAPP_RESTORE:
00199                   {
00200                      // Set the old colors
00201                      pThis->TryUpdateColor(IDC_OPTAPP_TEXTCOLOR, DEFAULTTEXTCOLOR,
00202                         &pThis->m_textColor, &pThis->m_hbrText, UA_TEXTCOLOR);
00203                      pThis->TryUpdateColor(IDC_OPTAPP_BKCOLOR, DEFAULTBKCOLOR, &pThis->m_bkColor,
00204                         &pThis->m_hbrBk, UA_BKCOLOR);
00205
00206                   } break;
00207
00208                   case IDC_OPTAPP_BKIMGCHK:
00209                      pThis->DoBkImgChk();
00210                      break;
00211
00212                   case IDC_OPTAPP_TEXTCOLOR:
00213                   case IDC_OPTAPP_BKCOLOR:
00214                      // Present the choose color dialog box
00215                      pThis->DoChooseColor(LOWORD(wParam));
00216                      break;
00217                }
00218             }
00219             break;
00220
00221          // Called when a color-picker button needs to be drawn
00222          case WM_DRAWITEM:
00223          {
00224             LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
00225             FillRect(lpdis->hDC, &lpdis->rcItem, (wParam == IDC_OPTAPP_BKCOLOR ? pThis->m_hbrBk :
00226                pThis->m_hbrText));
00227             if((lpdis->itemAction & ODA_FOCUS) || (lpdis->itemState & ODS_FOCUS))
00228             {
00229                RECT rc;
00230                CopyRect(&rc, &lpdis->rcItem);
00231                InflateRect(&rc, -2, -2);
00232                DrawFocusRect(lpdis->hDC, &rc);
00233             }
00234          } break;
00235
00236          // Called when a common control event takes place
00237          case WM_NOTIFY:
00238             switch(((LPNMHDR)lParam)->code)
00239             {
00240                // The property sheet is being activated
00241                case PSN_SETACTIVE:
00242                   return 0;
00243
00244                // The property sheet is being deactivated
00245                case PSN_KILLACTIVE:
00246                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00247                   if(GETCHK(IDC_OPTAPP_BKIMGCHK))
00248                   {
00249                      CTSTR lpszNewBkImg(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00250                      if(!PathFileExists(lpszNewBkImg))
00251                      {
00252                         // Tell user the background image file can't be found
00253                         CTSTR lpszHolder(IDS_FILENOTFOUND);
00254                         CTSTR lpszTotal(TRUE, lstrlen(lpszHolder) + lstrlen(lpszNewBkImg) + 1);
00255                         wsprintf(lpszTotal, lpszHolder, lpszNewBkImg);
00256                         MessageBox(hwndDlg, lpszTotal, g_szAppTitle, MB_OK | MB_ICONHAND);
00257                         SetFocus(GetDlgItem(hwndDlg, IDC_OPTAPP_BKIMGEDIT));
00258                         SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE);
00259                      }
00260                   }
00261                   return TRUE;
00262
00263                // The Apply or OK button has been clicked
00264                case PSN_APPLY:
00265                {
00266                   // Store the new settings
00267                   if(pThis->m_dwChanged & UA_TEXTCOLOR)
00268                      pThis->m_pPrefs->m_colorText = pThis->m_textColor;
00269                   if(pThis->m_dwChanged & UA_BKCOLOR)
00270                      pThis->m_pPrefs->m_colorBkg = pThis->m_bkColor;
00271                   if(GETCHK(IDC_OPTAPP_BKIMGCHK))
00272                      pThis->m_lpszBkImg.Assign(hwndDlg, IDC_OPTAPP_BKIMGEDIT);
00273                   else
00274                      pThis->m_lpszBkImg = NULL;
00275                   if(lstrcmp(pThis->m_pPrefs->m_lpszBkgImg, pThis->m_lpszBkImg) != 0)
00276                   {
00277                      pThis->m_pPrefs->m_lpszBkgImg.Assign(pThis->m_lpszBkImg);
00278                      pThis->m_dwChanged |= UA_BKIMG;
00279                   }
00280
00281                   // Apply and save the new settings
00282                   pThis->m_pPrefs->UpdateAppearance(pThis->m_dwChanged);
00283                   pThis->m_pPrefs->WriteRegistry(SETTING_APPEARANCE);
00284                   pThis->m_dwChanged = 0;
00285                } break;
00286             }
00287             return TRUE;
00288
00289          case WM_HELP:
00290          case WM_CONTEXTMENU:
00291 //          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, CTSTR(),
00292 //             pThis->s_adwOptionsPopupHelp);
00293             break;
00294       }
00295    }
00296    catch(CExcep *pE)
00297    {
00298       pE->Report();
00299       pE->Delete();
00300       EndDialog(hwndDlg, IDCANCEL);
00301    }
00302    return FALSE;
00303 }

void TryUpdateColor | ( | WORD | wCtl,
 |  | COLORREF | colorNew,
 |  | COLORREF * | pColorDest,
 |  | HBRUSH * | phBrush,
 |  | DWORD | dwChanged
 | ) | [protected]

Definition at line 364 of file UserPrefs.cpp.

References m_dwChanged, and m_hwndDlg.

Referenced by DoChooseColor(), and OptionsAppearanceProc().

00366 {
00367    if(colorNew == *pColorDest)
00368       return;
00369
00370    *pColorDest = colorNew;
00371    m_dwChanged |= dwChanged;
00372
00373    // Create new brush and redraw color picker
00374    DeleteObject((HGDIOBJ)phBrush);
00375    *phBrush = CreateSolidBrush(colorNew);
00376    InvalidateRect(GetDlgItem(m_hwndDlg, wCtl), NULL, TRUE);
00377
00378    // Enable the Apply button
00379    ::SendMessage(GetParent(m_hwndDlg), PSM_CHANGED, (WPARAM)m_hwndDlg, 0);
00380 }

Friends And Related Function Documentation

friend class CUserPrefs [friend]

Definition at line 81 of file UserPrefs.cpp.

Member Data Documentation

COLORREF m_bkColor [protected]

Definition at line 91 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), DoChooseColor(), and OptionsAppearanceProc().

DWORD m_dwChanged [protected]

Definition at line 95 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), OptionsAppearanceProc(), and TryUpdateColor().

HBRUSH m_hbrBk [protected]

Definition at line 93 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), DoChooseColor(), OptionsAppearanceProc(), and ~CAppearanceDlg().

HBRUSH m_hbrText [protected]

Definition at line 94 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), DoChooseColor(), OptionsAppearanceProc(), and ~CAppearanceDlg().

HWND m_hwndDlg [protected]

Definition at line 96 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), DoBkImgChk(), DoChooseColor(), OptionsAppearanceProc(), and TryUpdateColor().

CTSTR m_lpszBkImg [protected]

Definition at line 90 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), and OptionsAppearanceProc().

CUserPrefs* m_pPrefs [protected]

Definition at line 89 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), and OptionsAppearanceProc().

COLORREF m_textColor [protected]

Definition at line 92 of file UserPrefs.cpp.

Referenced by CAppearanceDlg(), DoChooseColor(), and OptionsAppearanceProc().

The documentation for this class was generated from the following file:
  • UserPrefs.cpp
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CAppearanceDlg Member List

This is the complete list of members for CAppearanceDlg, including all inherited members.
CAppearanceDlg(CUserPrefs *pPrefs) | CAppearanceDlg |
CUserPrefs class | CAppearanceDlg | [friend]
DoBkImgChk() | CAppearanceDlg | [protected]
DoChooseColor(WORD wCtl) | CAppearanceDlg | [protected]
m_bkColor | CAppearanceDlg | [protected]
m_dwChanged | CAppearanceDlg | [protected]
m_hbrBk | CAppearanceDlg | [protected]
m_hbrText | CAppearanceDlg | [protected]
m_hwndDlg | CAppearanceDlg | [protected]
m_lpszBkImg | CAppearanceDlg | [protected]
m_pPrefs | CAppearanceDlg | [protected]
m_textColor | CAppearanceDlg | [protected]
OptionsAppearanceProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CAppearanceDlg | [static]
TryUpdateColor(WORD wCtl, COLORREF colorNew, COLORREF *pColorDest, HBRUSH *phBrush, DWORD dwChanged) | CAppearanceDlg | [protected]
~CAppearanceDlg() | CAppearanceDlg | [virtual]
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


TemplateCArray class Reference

CArray Class Template Reference

#include <bmws_array.h>

List of all members.

Public Methods

CArray ()
CArray (T *a, int nCount)
virtual | ~CArray ()
int | GetSize () const
void | RemoveAll ()
T | GetAt (int nIndex) const
T & | ElementAt (int nIndex)
virtual void | SetAt (int nIndex, TA newElement)
const T * | GetData () const
T * | GetData ()
int | Add (TA newElement)
T | operator[] (int nIndex) const
T & | operator[] (int nIndex)
void | InsertAt (int nIndex, TA newElement, int nCount=1)
void | InsertAt (int nIndex, CArray *pNewArray)
virtual void | RemoveAt (int nIndex, int nCount=1)
void | SetSize (int nNewSize, int nGrowBy=-1)
void | SetAtGrow (int nIndex, TA newElement)
int | Append (const CArray &src)
void | Copy (const CArray &src)

Protected Attributes

T * | m_pData
int | m_nSize
int | m_nMaxSize
int | m_nGrowBy

template<class T, class TA>
class CArray< T, TA >

Constructor & Destructor Documentation

CArray ( )

Definition at line 211 of file bmws_array.h.

References m_nGrowBy, m_nMaxSize, m_nSize, and m_pData.

00212 {
00213    m_pData = NULL;
00214    m_nSize = m_nMaxSize = m_nGrowBy = 0;
00215 }

CArray | ( | T * | a,
 |  | int | nCount
 | ) |

Definition at line 227 of file bmws_array.h.

References m_nGrowBy, m_nMaxSize, m_nSize, m_pData, and SetSize().

00228 {
00229    m_pData = NULL;
00230    m_nSize = m_nMaxSize = m_nGrowBy = 0;
00231    SetSize(nCount);
00232    CopyElements<T>(m_pData, a, nCount);
00233 }

~CArray ( ) [virtual]

Definition at line 241 of file bmws_array.h.

References m_nSize, m_pData, RemoveAt(), and SAFEFREEMEMORY.

00242 {
00243    if(m_pData != NULL)
00244    {
00245       RemoveAt(0, m_nSize);
00246       SAFEFREEMEMORY(m_pData);
00247    }
00248 }

Member Function Documentation

int Add ( TA newElement ) [inline]

Definition at line 159 of file bmws_array.h.

00160    {
00161       int nIndex = m_nSize;
00162       SetAtGrow(nIndex, newElement);
00163       return nIndex;
00164    }

int Append ( const CArray< T, TA > & src )

Definition at line 351 of file bmws_array.h.

References _ASSERT, m_nSize, m_pData, and SetSize().

00352 {
00353    _ASSERT(this != &src);   // cannot append to itself
00354
00355    int nOldSize = m_nSize;
00356    SetSize(m_nSize + src.m_nSize);
00357    CopyElements<T>(m_pData + nOldSize, src.m_pData, src.m_nSize);
00358    return nOldSize;
00359 }

void Copy ( const CArray< T, TA > & src )

Definition at line 373 of file bmws_array.h.

References _ASSERT, m_nSize, m_pData, and SetSize().

00374 {
00375    _ASSERT(this != &src);   // cannot append to itself
00376
00377    SetSize(src.m_nSize);
00378    CopyElements<T>(m_pData, src.m_pData, src.m_nSize);
00379 }

T& ElementAt ( int nIndex ) [inline]

Definition at line 98 of file bmws_array.h.

Referenced by CArray< CFragmentAdd *, CFragmentAdd * >::operator[]().

00099    {
00100       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00101       return m_pData[nIndex];
00102    }

T GetAt ( int nIndex ) const [inline]

Definition at line 80 of file bmws_array.h.

Referenced by InsertAt(), and CArray< CFragmentAdd *, CFragmentAdd * >::operator[]().

00081    {
00082       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00083       return m_pData[nIndex];
00084    }

T* GetData ( ) [inline]

Definition at line 142 of file bmws_array.h.

00143    {
00144       return (T*)m_pData;
00145    }

const T* GetData ( ) const [inline]

Definition at line 137 of file bmws_array.h.

00138    {
00139       return (const T*)m_pData;
00140    }

int GetSize ( ) const [inline]

Definition at line 47 of file bmws_array.h.

Referenced by InsertAt().

00048    {
00049       return m_nSize;
00050    }

void InsertAt | ( | int | nIndex,
 |  | CArray< T, TA > * | pNewArray
 | ) |

Definition at line 460 of file bmws_array.h.

References _ASSERT, GetAt(), GetSize(), m_nSize, m_pData, SetAt(), and SetSize().

00461 {
00462    _ASSERT(pNewArray != NULL);
00463    _ASSERT(nIndex >= 0);
00464
00465    if(pNewArray->GetSize() > 0)
00466    {
00467       int nOldSize = m_nSize;
00468       int nCount = pNewArray->GetSize();
00469       SetSize(m_nSize + nCount, -1);
00470       // shift old data up to fill gap
00471       MoveMemory(&m_pData[nIndex+nCount], &m_pData[nIndex], (nOldSize-nIndex) * sizeof(T));
00472       // re-init slots we copied from
00473       ConstructElements<T>(&m_pData[nIndex], nCount);
00474       //InsertAt(nIndex, pNewArray->GetAt(0), pNewArray->GetSize());
00475       for(int i = 0; i < pNewArray->GetSize(); i++)
00476          SetAt(nIndex + i, pNewArray->GetAt(i));
00477    }
00478 }

void InsertAt | ( | int | nIndex,
 |  | TA | newElement,
 |  | int | nCount = 1
 | ) |

Definition at line 418 of file bmws_array.h.

References _ASSERT, m_nSize, m_pData, and SetSize().

00419 {
00420    _ASSERT(nIndex >= 0);    // will expand to meet need
00421    _ASSERT(nCount > 0);     // zero or negative size not allowed
00422
00423    if(nIndex >= m_nSize)
00424    {
00425       // adding after the end of the array
00426       SetSize(nIndex + nCount, -1);   // grow so nIndex is valid
00427    } else
00428    {
00429       // inserting in the middle of the array
00430       int nOldSize = m_nSize;
00431       SetSize(m_nSize + nCount, -1);  // grow it to new size
00432       // destroy intial data before copying over it
00433       //RemoveAt(nOldSize, nCount);
00434       // shift old data up to fill gap
00435       MoveMemory(&m_pData[nIndex+nCount], &m_pData[nIndex], (nOldSize-nIndex) * sizeof(T));
00436
00437       // re-init slots we copied from
00438       ConstructElements<T>(&m_pData[nIndex], nCount);
00439    }
00440
00441    // insert new value in the gap
00442    _ASSERT(nIndex + nCount <= m_nSize);
00443    while(nCount--)
00444       m_pData[nIndex++] = newElement;
00445 }

T& operator[] ( int nIndex ) [inline]

Definition at line 182 of file bmws_array.h.

00183    {
00184       return ElementAt(nIndex);
00185    }

T operator[] ( int nIndex ) const [inline]

Definition at line 177 of file bmws_array.h.

00178    {
00179       return GetAt(nIndex);
00180    }

void RemoveAll ( ) [inline]

Definition at line 63 of file bmws_array.h.

00064    {
00065       SetSize(0, -1);
00066    }

void RemoveAt | ( | int | nIndex,
 |  | int | nCount = 1
 | ) | [virtual]

Reimplemented in CPtrArray, CPtrArray< CHlinkWindow *, CHlinkWindow * >, CPtrArray< ISolpackGameLib *, ISolpackGameLib * >, CPtrArray< ISolpackGameData *, ISolpackGameData * >, CPtrArray< CGameInfo *, CGameInfo * >, CPtrArray< CGameCommand *, CGameCommand * >, CPtrArray< CPile *, CPile * >, CPtrArray< ISolpackPile *, ISolpackPile * >, CPtrArray< IHTMLInputElement *, IHTMLInputElement * >, CPtrArray< CHTMLChk *, CHTMLChk * >, CPtrArray< CCard *, CCard * >, CPtrArray< CDeck *, CDeck * >, CPtrArray< CGameMenuItem *, CGameMenuItem * >, and CPtrArray< CFragmentAdd *, CFragmentAdd * >.

Definition at line 493 of file bmws_array.h.

References _ASSERT, m_nSize, and m_pData.

Referenced by SetSize(), and ~CArray().

00494 {
00495    _ASSERT(nIndex >= 0);
00496    _ASSERT(nCount >= 0);
00497    _ASSERT((nIndex + nCount) <= m_nSize);
00498
00499    // just remove a range
00500    int nMoveCount = m_nSize - (nIndex + nCount);
00501    int nCount2 = nCount;
00502    T* pElements = &m_pData[nIndex];
00503    for (; nCount2--; pElements++)
00504       pElements->~T();
00505    if(nMoveCount)
00506       MoveMemory(&m_pData[nIndex], &m_pData[nIndex + nCount], nMoveCount * sizeof(T));
00507    m_nSize -= nCount;
00508 }

virtual void SetAt | ( | int | nIndex,
 |  | TA | newElement
 | ) | [inline, virtual]

Reimplemented in CPtrArray, CPtrArray< CHlinkWindow *, CHlinkWindow * >, CPtrArray< ISolpackGameLib *, ISolpackGameLib * >, CPtrArray< ISolpackGameData *, ISolpackGameData * >, CPtrArray< CGameInfo *, CGameInfo * >, CPtrArray< CGameCommand *, CGameCommand * >, CPtrArray< CPile *, CPile * >, CPtrArray< ISolpackPile *, ISolpackPile * >, CPtrArray< IHTMLInputElement *, IHTMLInputElement * >, CPtrArray< CHTMLChk *, CHTMLChk * >, CPtrArray< CCard *, CCard * >, CPtrArray< CDeck *, CDeck * >, CPtrArray< CGameMenuItem *, CGameMenuItem * >, and CPtrArray< CFragmentAdd *, CFragmentAdd * >.

Definition at line 117 of file bmws_array.h.

Referenced by CFragment::FragToPile(), InsertAt(), CPtrArray< CFragmentAdd *, CFragmentAdd * >::SetAt(), SetAtGrow(), CFragmentAddCard::SetDestAndIndex(), and CFragmentAddPile::SetDestAndIndex().

00118    {
00119       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00120       T* pElement = &m_pData[nIndex];
00121       if(pElement)
00122          pElement->~T();
00123       m_pData[nIndex] = newElement;
00124    }

void SetAtGrow | ( | int | nIndex,
 |  | TA | newElement
 | ) |

Definition at line 394 of file bmws_array.h.

References _ASSERT, m_nSize, SetAt(), and SetSize().

Referenced by CArray< CFragmentAdd *, CFragmentAdd * >::Add().

00395 {
00396    _ASSERT(nIndex >= 0);
00397
00398    if(nIndex >= m_nSize)
00399       SetSize(nIndex+1, -1);
00400    SetAt(nIndex, newElement);
00401 }

void SetSize | ( | int | nNewSize,
 |  | int | nGrowBy = -1
 | ) |

Definition at line 266 of file bmws_array.h.

References _ASSERT, m_nGrowBy, m_nMaxSize, m_nSize, m_pData, RemoveAt(), SAFEALLOCMEMORY, and SAFEFREEMEMORY.

Referenced by CFragment::Animate(), Append(), CArray(), Copy(), CFragment::FragToPile(), InsertAt(), CFragment::PileToFrag(), CArray< CFragmentAdd *, CFragmentAdd * >::RemoveAll(), and SetAtGrow().

00267 {
00268    _ASSERT(nNewSize >= 0);
00269
00270    if(nGrowBy != -1)
00271       m_nGrowBy = nGrowBy;  // set new grow by value
00272
00273    if(nNewSize == 0)
00274    {
00275       // shrink to nothing
00276       if(m_pData != NULL)
00277       {
00278          RemoveAt(0, m_nSize);
00279          SAFEFREEMEMORY(m_pData);
00280       }
00281       m_nSize = m_nMaxSize = 0;
00282    }
00283    else if(m_pData == NULL)
00284    {
00285       // create one with exact size
00286       m_pData = (T*)SAFEALLOCMEMORY(nNewSize * sizeof(T));
00287       ConstructElements<T>(m_pData, nNewSize);
00288       m_nSize = m_nMaxSize = nNewSize;
00289    }
00290    else if (nNewSize <= m_nMaxSize)
00291    {
00292       // it fits
00293       if(nNewSize > m_nSize)
00294       {
00295          // initialize the new elements
00296          ConstructElements<T>(&m_pData[m_nSize], nNewSize-m_nSize);
00297       }
00298       else if (m_nSize > nNewSize)
00299       {
00300          // destroy the old elements
00301          RemoveAt(nNewSize, m_nSize - nNewSize);
00302       }
00303       m_nSize = nNewSize;
00304    }
00305    else
00306    {
00307       // otherwise, grow array
00308       int nGrowBy = m_nGrowBy;
00309       if(nGrowBy == 0)
00310       {
00311          // heuristically determine growth when nGrowBy == 0
00312          //  (this avoids heap fragmentation in many situations)
00313          nGrowBy = m_nSize / 8;
00314          nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
00315       }
00316       int nNewMax;
00317       if (nNewSize < m_nMaxSize + nGrowBy)
00318          nNewMax = m_nMaxSize + nGrowBy;  // granularity
00319       else
00320          nNewMax = nNewSize;  // no slush
00321
00322       _ASSERT(nNewMax >= m_nMaxSize); // no wrap around
00323       T* pNewData = (T*)SAFEALLOCMEMORY(nNewMax * sizeof(T));
00324       // copy new data from old
00325       CopyMemory(pNewData, m_pData, m_nSize * sizeof(T));
00326
00327       // construct remaining elements
00328       _ASSERT(nNewSize > m_nSize);
00329       ConstructElements<T>(&pNewData[m_nSize], nNewSize-m_nSize);
00330
00331       // get rid of old stuff (note: no destructors called)
00332       SAFEFREEMEMORY(m_pData);
00333       m_pData = pNewData;
00334       m_nSize = nNewSize;
00335       m_nMaxSize = nNewMax;
00336    }
00337 }

Member Data Documentation

int m_nGrowBy [protected]

Definition at line 200 of file bmws_array.h.

Referenced by CArray(), and SetSize().

int m_nMaxSize [protected]

Definition at line 199 of file bmws_array.h.

Referenced by CArray(), and SetSize().

int m_nSize [protected]

Definition at line 198 of file bmws_array.h.

Referenced by CArray< CFragmentAdd *, CFragmentAdd * >::Add(), Append(), CArray(), Copy(), CArray< CFragmentAdd *, CFragmentAdd * >::ElementAt(), CArray< CFragmentAdd *, CFragmentAdd * >::GetAt(), CArray< CFragmentAdd *, CFragmentAdd * >::GetSize(), InsertAt(), RemoveAt(), CArray< CFragmentAdd *, CFragmentAdd * >::SetAt(), SetAtGrow(), SetSize(), and ~CArray().

T* m_pData [protected]

Definition at line 197 of file bmws_array.h.

Referenced by Append(), CArray(), Copy(), CArray< CFragmentAdd *, CFragmentAdd * >::ElementAt(), CArray< CFragmentAdd *, CFragmentAdd * >::GetAt(), CArray< CFragmentAdd *, CFragmentAdd * >::GetData(), InsertAt(), RemoveAt(), CArray< CFragmentAdd *, CFragmentAdd * >::SetAt(), SetSize(), and ~CArray().

The documentation for this class was generated from the following file:
  • bmws_array.h
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CArray Member List

This is the complete list of members for CArray, including all inherited members.
Add(TA newElement) | CArray | [inline]
Append(const CArray &src) | CArray |
CArray() | CArray |
CArray(T *a, int nCount) | CArray |
Copy(const CArray &src) | CArray |
ElementAt(int nIndex) | CArray | [inline]
GetAt(int nIndex) const | CArray | [inline]
GetData() const | CArray | [inline]
GetData() | CArray | [inline]
GetSize() const | CArray | [inline]
InsertAt(int nIndex, TA newElement, int nCount=1) | CArray |
InsertAt(int nIndex, CArray *pNewArray) | CArray |
m_nGrowBy | CArray | [protected]
m_nMaxSize | CArray | [protected]
m_nSize | CArray | [protected]
m_pData | CArray | [protected]
operator[](int nIndex) const | CArray | [inline]
operator[](int nIndex) | CArray | [inline]
RemoveAll() | CArray | [inline]
RemoveAt(int nIndex, int nCount=1) | CArray | [virtual]
SetAt(int nIndex, TA newElement) | CArray | [inline, virtual]
SetAtGrow(int nIndex, TA newElement) | CArray |
SetSize(int nNewSize, int nGrowBy=-1) | CArray |
~CArray() | CArray | [virtual]
Generated on Wed May 8 12:39:30 2002 for Solitaire Pack by doxygen 1.2.15


CBrowserContainer Class Reference

#include <bmws_browsercontainer.h>

Inheritance diagram for CBrowserContainer:

CUnkBase INDUnknown List of all members.

Public Methods

CBrowserContainer (BOOL bNoBorder, BOOL bScroll=FALSE)
STDMETHOD (SaveObject)()
STDMETHOD (GetMoniker)(DWORD dwAssign
STDMETHOD (GetContainer)(LPOLECONTAINER *ppContainer)
STDMETHOD (ShowObject)()
STDMETHOD (OnShowWindow)(BOOL fShow)
STDMETHOD (RequestNewObjectLayout)()
STDMETHOD (GetWindow)(HWND *phwnd)
STDMETHOD (ContextSensitiveHelp)(BOOL fEnterMode)
STDMETHOD (CanInPlaceActivate)()
STDMETHOD (OnInPlaceActivate)()
STDMETHOD (OnUIActivate)()
STDMETHOD (GetWindowContext)(IOleInPlaceFrame **ppFrame
STDMETHOD (Scroll)(SIZE scrollExtent)
STDMETHOD (OnUIDeactivate)(BOOL fUndoable)
STDMETHOD (OnInPlaceDeactivate)()
STDMETHOD (DiscardUndoState)()
STDMETHOD (DeactivateAndUndo)()
STDMETHOD (OnPosRectChange)(LPCRECT lprcPosRect)
STDMETHOD (ShowContextMenu)(DWORD dwID
STDMETHOD (GetHostInfo)(DOCHOSTUIINFO *pInfo)
STDMETHOD (ShowUI)(DWORD dwID
STDMETHOD (HideUI)()
STDMETHOD (UpdateUI)()
STDMETHOD (EnableModeless)(BOOL fEnable)
STDMETHOD (OnDocWindowActivate)(BOOL fActivate)
STDMETHOD (OnFrameWindowActivate)(BOOL fActivate)
STDMETHOD (ResizeBorder)(LPCRECT prcBorder
STDMETHOD (TranslateAccelerator)(LPMSG lpMsg
STDMETHOD (GetOptionKeyPath)(LPOLESTR *pchKey
STDMETHOD (GetDropTarget)(IDropTarget *pDropTarget
STDMETHOD (GetExternal)(IDispatch **ppDispatch)
STDMETHOD (TranslateUrl)(DWORD dwTranslate
STDMETHOD (FilterDataObject)(IDataObject *pDO
STDMETHOD (NDQueryInterface)(REFIID riid
void | Init (HWND hwndParent, IWebBrowser2 **ppWBOut, IEventSinkSite *pSite, DWORD dwSinkType)
void | Uninit ()
void | SetLocation (int x, int y, int width, int height)
void | SetVisible (BOOL bShow)
void | SetFocus ()
HRESULT | TranslateKey (LPMSG lpMsg)

Public Attributes

DECLARE_IUNKNOWN
DWORD | dwWhichMoniker
DWORD LPMONIKER * | ppmk
IOleInPlaceUIWindow ** | ppDoc
IOleInPlaceUIWindow LPRECT | lprcPosRect
IOleInPlaceUIWindow LPRECT
LPRECT 		lprcClipRect
IOleInPlaceUIWindow LPRECT
LPRECT LPOLEINPLACEFRAMEINFO 		lpFrameInfo
POINT * | ppt
POINT IUnknown * | pcmdtReserved
POINT IUnknown IDispatch * | pdispReserved
IOleInPlaceActiveObject * | pActiveObject
IOleInPlaceActiveObject IOleCommandTarget * | pCommandTarget
IOleInPlaceActiveObject IOleCommandTarget
IOleInPlaceFrame * 		pFrame
IOleInPlaceActiveObject IOleCommandTarget
IOleInPlaceFrame IOleInPlaceUIWindow * 		pDoc
IOleInPlaceUIWindow * | pUIWindow
IOleInPlaceUIWindow BOOL | fRameWindow
const GUID * | pguidCmdGroup
const GUID DWORD | nCmdID
DWORD | dw
IDropTarget ** | ppDropTarget
OLECHAR * | pchURLIn
OLECHAR OLECHAR ** | ppchURLOut
IDataObject ** | ppDORet
LPVOID * | ppvObject

Protected Attributes

HWND | m_hWnd
RECT | m_rect
BOOL | m_bInPlaceActive
CEventSink * m_pEvent
CPtr< IOleObject,&IID_IOleObject > | m_spioo
CPtr< IOleInPlaceObject,&IID_IOleInPlaceObject > | m_spipo
BOOL | m_bNoBorder
BOOL | m_bScroll

Constructor & Destructor Documentation

CBrowserContainer | ( | BOOL | bNoBorder,
 |  | BOOL | bScroll = FALSE
 | ) |

Definition at line 44 of file bmws_browsercontainer.cpp.

References m_bInPlaceActive, m_bNoBorder, m_bScroll, m_hWnd, m_pEvent, and m_rect.

00045 {
00046    SetRectEmpty(&m_rect);
00047    m_bNoBorder = bNoBorder;
00048    m_bScroll = bScroll;
00049    m_hWnd = NULL;
00050    m_bInPlaceActive = FALSE;
00051    m_pEvent = NULL;
00052 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00053    m_pDispSite = NULL;
00054 #endif
00055 }

Member Function Documentation

void Init | ( | HWND | hwndParent,
 |  | IWebBrowser2 ** | ppWBOut,
 |  | IEventSinkSite * | pSite,
 |  | DWORD | dwSinkType
 | ) |

Definition at line 955 of file bmws_browsercontainer.cpp.

References _ASSERT, CPtr< IOleInPlaceObject,&IID_IOleInPlaceObject >::Assign(), CHECKHRCOM, ENSUREALLOC, IDS_BMWS_BROWSERCONTAINER_E_WBCREATE, m_hWnd, m_pEvent, m_rect, m_spioo, m_spipo, and THROW.

Referenced by CMainWindow::OnCreate(), and CHelpPane::OnCreatePane().

00964 {
00965    _ASSERT(!m_hWnd);
00966    _ASSERT(hwndParent && pSite);
00967
00968    m_hWnd = hwndParent;
00969
00970 #ifdef BMWS_BROWSERCONTAINER_DISPATCH
00971    m_pDispSite = pDispSite;
00972 #endif
00973
00974    try
00975    {
00976 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
00977       m_spDispExternal.Assign(pExternal);
00978 #endif
00979
00980       HRESULT hr = CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER |
00981          CLSCTX_LOCAL_SERVER, IID_IOleObject, (LPVOID*)&m_spioo);
00982       CHECKHRCOM(hr);
00983
00984       MSG msg;
00985       m_spipo.Assign(m_spioo);
00986       CHECKHRCOM(m_spioo->SetClientSite((IOleClientSite*)this));
00987       CHECKHRCOM(m_spioo->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, (IOleClientSite*)this, 0,
00988          m_hWnd, &m_rect));
00989
00990       CPtr<IUnknown, &IID_IUnknown> spUnk(m_spioo);
00991       m_pEvent = new CEventSink(pSite, dwSinkType, spUnk,
00992          DIID_DWebBrowserEvents2);
00993       ENSUREALLOC(m_pEvent);
00994
00995       if(ppWBOut)
00996          CHECKHRCOM(m_spioo->QueryInterface(IID_IWebBrowser2, (LPVOID*)ppWBOut));
00997    } catch(CCOMExcep *pCOMExcep)
00998    {
00999       pCOMExcep->Delete();
01000       THROW(new CExcepEx(IDS_BMWS_BROWSERCONTAINER_E_WBCREATE, IDS_BMWS_REMEDY_IE), CExcepEx*);
01001    }
01002 }

void SetFocus ( )

Definition at line 1102 of file bmws_browsercontainer.cpp.

References m_hWnd, m_rect, and m_spioo.

Referenced by CMainWindow::PreprocessMessage().

01103 {
01104    m_spioo->DoVerb(OLEIVERB_UIACTIVATE, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01105 }

void SetLocation | ( | int | x,
 |  | int | y,
 |  | int | width,
 |  | int | height
 | ) |

Definition at line 1056 of file bmws_browsercontainer.cpp.

References m_bInPlaceActive, m_rect, and m_spipo.

Referenced by CMainWindow::OnSize(), and CHelpPane::OnSizePane().

01057 {
01058    if(!m_bInPlaceActive)
01059       return;
01060
01061    m_rect.left     = x;
01062    m_rect.top      = y;
01063    m_rect.right    = width;
01064    m_rect.bottom   = height;
01065
01066    m_spipo->SetObjectRects(&m_rect, &m_rect);
01067 }

void SetVisible ( BOOL bShow )

Definition at line 1081 of file bmws_browsercontainer.cpp.

References m_hWnd, m_rect, and m_spioo.

01082 {
01083    if(bShow)
01084    {
01085       m_spioo->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01086       m_spioo->DoVerb(OLEIVERB_SHOW, NULL, (IOleClientSite*)this, 0, m_hWnd, &m_rect);
01087    } else
01088       m_spioo->DoVerb(OLEIVERB_HIDE, NULL, (IOleClientSite*)this, 0, m_hWnd, NULL);
01089 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CUnkBase.

STDMETHOD ( FilterDataObject )

STDMETHOD ( TranslateUrl )

STDMETHOD ( GetExternal )

STDMETHOD ( GetDropTarget )

STDMETHOD ( GetOptionKeyPath )

STDMETHOD ( TranslateAccelerator )

STDMETHOD ( ResizeBorder )

STDMETHOD ( OnFrameWindowActivate )

STDMETHOD ( OnDocWindowActivate )

STDMETHOD ( EnableModeless )

STDMETHOD ( UpdateUI )

STDMETHOD ( HideUI )

STDMETHOD ( ShowUI )

STDMETHOD ( GetHostInfo )

STDMETHOD ( ShowContextMenu )

STDMETHOD ( OnPosRectChange )

STDMETHOD ( DeactivateAndUndo )

STDMETHOD ( DiscardUndoState )

STDMETHOD ( OnInPlaceDeactivate )

STDMETHOD ( OnUIDeactivate )

STDMETHOD ( Scroll )

STDMETHOD ( GetWindowContext )

STDMETHOD ( OnUIActivate )

STDMETHOD ( OnInPlaceActivate )

STDMETHOD ( CanInPlaceActivate )

STDMETHOD ( ContextSensitiveHelp )

STDMETHOD ( GetWindow )

STDMETHOD ( RequestNewObjectLayout )

STDMETHOD ( OnShowWindow )

STDMETHOD ( ShowObject )

STDMETHOD ( GetContainer )

STDMETHOD ( GetMoniker )

STDMETHOD ( SaveObject )

HRESULT TranslateKey ( LPMSG lpMsg )

Definition at line 1120 of file bmws_browsercontainer.cpp.

References m_spioo.

Referenced by CMainWindow::PreprocessMessage().

01121 {
01122    if((lpmsg->message >= WM_KEYFIRST) && (lpmsg->message <= WM_KEYLAST))
01123    {
01124       CPtr<IOleInPlaceActiveObject, &IID_IOleInPlaceActiveObject> spao(m_spioo);
01125       return spao->TranslateAccelerator(lpmsg);
01126    }
01127    return S_FALSE;
01128 }

void Uninit ( )

Definition at line 1016 of file bmws_browsercontainer.cpp.

References BCINTERNALERR, CHECKHRCOM, CEventSink::Disconnect(), m_pEvent, m_spioo, and m_spipo.

Referenced by CMainWindow::OnDestroy(), and CHelpPane::OnDestroyPane().

01017 {
01018 #ifdef BMWS_BROWSERCONTAINER_EXTERNAL
01019    m_spDispExternal.Release();
01020 #endif
01021
01022    if(m_pEvent)
01023       m_pEvent->Disconnect();
01024    m_pEvent = NULL;
01025
01026    try
01027    {
01028       CHECKHRCOM(m_spipo->UIDeactivate());
01029       CHECKHRCOM(m_spipo->InPlaceDeactivate());
01030       m_spipo = NULL;
01031       CHECKHRCOM(m_spioo->Close(OLECLOSE_NOSAVE));
01032       CHECKHRCOM(m_spioo->SetClientSite(NULL));
01033       m_spioo = NULL;
01034    } catch(CCOMExcep* pE)
01035    {
01036       pE->Delete();
01037       BCINTERNALERR(20003);
01038    }
01039 }

Member Data Documentation

DECLARE_IUNKNOWN

Definition at line 68 of file bmws_browsercontainer.h.

DWORD dw

Definition at line 109 of file bmws_browsercontainer.h.

DWORD dwWhichMoniker

Definition at line 72 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow BOOL fRameWindow

Definition at line 106 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow LPRECT LPRECT LPOLEINPLACEFRAMEINFO lpFrameInfo

Definition at line 86 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow LPRECT LPRECT lprcClipRect

Definition at line 86 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow LPRECT lprcPosRect

Definition at line 86 of file bmws_browsercontainer.h.

BOOL m_bInPlaceActive [protected]

Definition at line 149 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer(), and SetLocation().

BOOL m_bNoBorder [protected]

Definition at line 160 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer().

BOOL m_bScroll [protected]

Definition at line 161 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer().

HWND m_hWnd [protected]

Definition at line 147 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer(), Init(), SetFocus(), and SetVisible().

CEventSink* m_pEvent [protected]

Definition at line 150 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer(), Init(), and Uninit().

RECT m_rect [protected]

Definition at line 148 of file bmws_browsercontainer.h.

Referenced by CBrowserContainer(), Init(), SetFocus(), SetLocation(), and SetVisible().

CPtr<IOleObject, &IID_IOleObject> m_spioo [protected]

Definition at line 151 of file bmws_browsercontainer.h.

Referenced by Init(), SetFocus(), SetVisible(), TranslateKey(), and Uninit().

CPtr<IOleInPlaceObject, &IID_IOleInPlaceObject> m_spipo [protected]

Definition at line 153 of file bmws_browsercontainer.h.

Referenced by Init(), SetLocation(), and Uninit().

const GUID DWORD nCmdID

Definition at line 108 of file bmws_browsercontainer.h.

IOleInPlaceActiveObject* pActiveObject

Definition at line 99 of file bmws_browsercontainer.h.

OLECHAR* pchURLIn

Definition at line 112 of file bmws_browsercontainer.h.

POINT IUnknown* pcmdtReserved

Definition at line 96 of file bmws_browsercontainer.h.

IOleInPlaceActiveObject IOleCommandTarget* pCommandTarget

Definition at line 99 of file bmws_browsercontainer.h.

POINT IUnknown IDispatch* pdispReserved

Definition at line 96 of file bmws_browsercontainer.h.

IOleInPlaceActiveObject IOleCommandTarget IOleInPlaceFrame IOleInPlaceUIWindow* pDoc

Definition at line 99 of file bmws_browsercontainer.h.

IOleInPlaceActiveObject IOleCommandTarget IOleInPlaceFrame* pFrame

Definition at line 99 of file bmws_browsercontainer.h.

const GUID* pguidCmdGroup

Definition at line 108 of file bmws_browsercontainer.h.

OLECHAR OLECHAR** ppchURLOut

Definition at line 112 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow** ppDoc

Definition at line 86 of file bmws_browsercontainer.h.

IDataObject** ppDORet

Definition at line 113 of file bmws_browsercontainer.h.

IDropTarget** ppDropTarget

Definition at line 110 of file bmws_browsercontainer.h.

DWORD LPMONIKER* ppmk

Definition at line 72 of file bmws_browsercontainer.h.

POINT* ppt

Definition at line 96 of file bmws_browsercontainer.h.

LPVOID* ppvObject

Reimplemented from CUnkBase.

Definition at line 127 of file bmws_browsercontainer.h.

IOleInPlaceUIWindow* pUIWindow

Definition at line 106 of file bmws_browsercontainer.h.

The documentation for this class was generated from the following files:
  • bmws_browsercontainer.h
  • bmws_browsercontainer.cpp
Generated on Wed May 8 12:39:31 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CBrowserContainer Member List

This is the complete list of members for CBrowserContainer, including all inherited members.
CBrowserContainer(BOOL bNoBorder, BOOL bScroll=FALSE) | CBrowserContainer |
CUnkBase() | CUnkBase |
DECLARE_IUNKNOWN | CBrowserContainer |
dw | CBrowserContainer |
dwWhichMoniker | CBrowserContainer |
fRameWindow | CBrowserContainer |
GetOuterUnknown() const | CUnkBase | [inline, protected]
Init(HWND hwndParent, IWebBrowser2 **ppWBOut, IEventSinkSite *pSite, DWORD dwSinkType) | CBrowserContainer |
lpFrameInfo | CBrowserContainer |
lprcClipRect | CBrowserContainer |
lprcPosRect | CBrowserContainer |
m_bInPlaceActive | CBrowserContainer | [protected]
m_bNoBorder | CBrowserContainer | [protected]
m_bScroll | CBrowserContainer | [protected]
m_hWnd | CBrowserContainer | [protected]
m_pEvent | CBrowserContainer | [protected]
m_rect | CBrowserContainer | [protected]
m_spioo | CBrowserContainer | [protected]
m_spipo | CBrowserContainer | [protected]
nCmdID | CBrowserContainer |
pActiveObject | CBrowserContainer |
pchURLIn | CBrowserContainer |
pcmdtReserved | CBrowserContainer |
pCommandTarget | CBrowserContainer |
pdispReserved | CBrowserContainer |
pDoc | CBrowserContainer |
pFrame | CBrowserContainer |
pguidCmdGroup | CBrowserContainer |
ppchURLOut | CBrowserContainer |
ppDoc | CBrowserContainer |
ppDORet | CBrowserContainer |
ppDropTarget | CBrowserContainer |
ppmk | CBrowserContainer |
ppt | CBrowserContainer |
ppvObject | CBrowserContainer |
pUIWindow | CBrowserContainer |
PURE | INDUnknown |
SetFocus() | CBrowserContainer |
SetLocation(int x, int y, int width, int height) | CBrowserContainer |
SetVisible(BOOL bShow) | CBrowserContainer |
STDMETHOD(SaveObject)() | CBrowserContainer |
STDMETHOD(GetMoniker)(DWORD dwAssign | CBrowserContainer |
STDMETHOD(GetContainer)(LPOLECONTAINER *ppContainer) | CBrowserContainer |
STDMETHOD(ShowObject)() | CBrowserContainer |
STDMETHOD(OnShowWindow)(BOOL fShow) | CBrowserContainer |
STDMETHOD(RequestNewObjectLayout)() | CBrowserContainer |
STDMETHOD(GetWindow)(HWND *phwnd) | CBrowserContainer |
STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) | CBrowserContainer |
STDMETHOD(CanInPlaceActivate)() | CBrowserContainer |
STDMETHOD(OnInPlaceActivate)() | CBrowserContainer |
STDMETHOD(OnUIActivate)() | CBrowserContainer |
STDMETHOD(GetWindowContext)(IOleInPlaceFrame **ppFrame | CBrowserContainer |
STDMETHOD(Scroll)(SIZE scrollExtent) | CBrowserContainer |
STDMETHOD(OnUIDeactivate)(BOOL fUndoable) | CBrowserContainer |
STDMETHOD(OnInPlaceDeactivate)() | CBrowserContainer |
STDMETHOD(DiscardUndoState)() | CBrowserContainer |
STDMETHOD(DeactivateAndUndo)() | CBrowserContainer |
STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect) | CBrowserContainer |
STDMETHOD(ShowContextMenu)(DWORD dwID | CBrowserContainer |
STDMETHOD(GetHostInfo)(DOCHOSTUIINFO *pInfo) | CBrowserContainer |
STDMETHOD(ShowUI)(DWORD dwID | CBrowserContainer |
STDMETHOD(HideUI)() | CBrowserContainer |
STDMETHOD(UpdateUI)() | CBrowserContainer |
STDMETHOD(EnableModeless)(BOOL fEnable) | CBrowserContainer |
STDMETHOD(OnDocWindowActivate)(BOOL fActivate) | CBrowserContainer |
STDMETHOD(OnFrameWindowActivate)(BOOL fActivate) | CBrowserContainer |
STDMETHOD(ResizeBorder)(LPCRECT prcBorder | CBrowserContainer |
STDMETHOD(TranslateAccelerator)(LPMSG lpMsg | CBrowserContainer |
STDMETHOD(GetOptionKeyPath)(LPOLESTR *pchKey | CBrowserContainer |
STDMETHOD(GetDropTarget)(IDropTarget *pDropTarget | CBrowserContainer |
STDMETHOD(GetExternal)(IDispatch **ppDispatch) | CBrowserContainer |
STDMETHOD(TranslateUrl)(DWORD dwTranslate | CBrowserContainer |
STDMETHOD(FilterDataObject)(IDataObject *pDO | CBrowserContainer |
STDMETHOD(NDQueryInterface)(REFIID riid | CBrowserContainer |
STDMETHOD_(ULONG, NDAddRef)() | CUnkBase |
STDMETHOD_(ULONG, NDRelease)() | CUnkBase |
TranslateKey(LPMSG lpMsg) | CBrowserContainer |
Uninit() | CBrowserContainer |
~CUnkBase() | CUnkBase | [virtual]
Generated on Wed May 8 12:39:31 2002 for Solitaire Pack by doxygen 1.2.15


CBSTR Class Reference

#include <bmws_string.h>

List of all members.

Public Methods

CBSTR ()
CBSTR (UINT uID)
CBSTR (BSTR bstr, BOOL bAssign=FALSE)
CBSTR (const CTSTR &bmwslocal)
CBSTR (const CBSTR &bmwsbstr)
CBSTR (LPTSTR lpszFormatter, int iVal)
~CBSTR ()
operator BSTR () const
BSTR * | Addr ()
int | Len ()
const CBSTR & | operator= (const CBSTR &bstrSrc)
const CBSTR & | operator= (const BSTR bstr)
void | Assign (UINT uID)
void | Assign (LPTSTR lpsz)
void | AssignW (LPWSTR lpwsz, int iLen=-1)
BOOL | Equals (BSTR bstr)
void | CopyString (BSTR bstr)
BSTR | Detach ()
CBSTR & | Format (LPTSTR lpszFormatter, LPTSTR lpszInsert)

Public Attributes

BSTR | m_bstr

Constructor & Destructor Documentation

CBSTR ( )

Definition at line 595 of file bmws_string.cpp.

References m_bstr.

00596 {
00597    m_bstr = NULL;
00598 }

CBSTR ( UINT uID )

Definition at line 609 of file bmws_string.cpp.

References Assign(), and m_bstr.

00610 {
00611    m_bstr = NULL;
00612    Assign(uID);
00613 }

CBSTR | ( | BSTR | bstr,
 |  | BOOL | bAssign = FALSE
 | ) |

Definition at line 626 of file bmws_string.cpp.

References CopyString(), and m_bstr.

00627 {
00628    m_bstr = NULL;
00629    if(bAssign)
00630       m_bstr = bstr;
00631    else
00632       CopyString(bstr);
00633 }

CBSTR ( const CTSTR & bmwslocal )

Definition at line 644 of file bmws_string.cpp.

References Assign(), m_bstr, and CTSTR::m_lpsz.

00645 {
00646    m_bstr = NULL;
00647    Assign(bmwslocal.m_lpsz);
00648 }

CBSTR ( const CBSTR & bmwsbstr )

Definition at line 659 of file bmws_string.cpp.

References CopyString(), and m_bstr.

00660 {
00661    m_bstr = NULL;
00662    CopyString(bmwsbstr.m_bstr);
00663 }

CBSTR | ( | LPTSTR | lpszFormatter,
 |  | int | iVal
 | ) |

Definition at line 675 of file bmws_string.cpp.

References Assign(), and m_bstr.

00676 {
00677    m_bstr = NULL;
00678    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + 8);
00679    wsprintf(lpszFinal, lpszFormatter, iVal);
00680    Assign(lpszFinal);
00681 }

~CBSTR ( )

Definition at line 689 of file bmws_string.cpp.

References m_bstr, and SAFEFREESTRING.

00690 {
00691    SAFEFREESTRING(m_bstr);
00692 }

Member Function Documentation

BSTR* Addr ( ) [inline]

Definition at line 173 of file bmws_string.h.

References m_bstr.

Referenced by CGameMenu::FillGameInfo(), CMainWindow::GameSelected(), CHTMLHelper::GetElTextWithEl(), CXMLElement::GetTagName(), CXMLElement::GetText(), CEngine::PlayGame(), CGameMenu::Refresh(), and CMainWindow::UpdateInstr().

00174    {
00175       return &m_bstr;
00176    }

void Assign ( LPTSTR lpsz )

Definition at line 759 of file bmws_string.cpp.

References ENSUREALLOC, m_bstr, SAFEALLOCW, SAFEFREEMEMORY, and SAFEFREESTRING.

00760 {
00761    SAFEFREESTRING(m_bstr);
00762    if(!lpsz)
00763       return;
00764
00765 #ifdef UNICODE
00766    m_bstr = SysAllocString(lpsz);
00767    ENSUREALLOC(m_bstr);
00768 #else
00769    int iLen = lstrlenA(lpsz) + 1;
00770    LPWSTR lpwsz = SAFEALLOCW(iLen);
00771    ENSUREALLOC(lpwsz);
00772    MultiByteToWideChar(CP_ACP, 0, lpsz, -1, lpwsz, iLen);
00773    lpwsz[iLen-1] = 0;
00774    m_bstr = SysAllocString(lpwsz);
00775    SAFEFREEMEMORY(lpwsz);
00776    ENSUREALLOC(m_bstr);
00777 #endif
00778 }

void Assign ( UINT uID )

Definition at line 742 of file bmws_string.cpp.

Referenced by CBSTR(), CHTMLHelper::CHTMLHelper(), Format(), CGameInfo::InitGameInfo(), and CHTMLHelper::ShowElement().

00743 {
00744    Assign(CTSTR(uID));
00745 }

void AssignW | ( | LPWSTR | lpwsz,
 |  | int | iLen = -1
 | ) |

Definition at line 793 of file bmws_string.cpp.

References ENSUREALLOC, m_bstr, and SAFEFREESTRING.

00794 {
00795    SAFEFREESTRING(m_bstr);
00796    if(!lpwsz)
00797       return;
00798
00799    if(iLen == -1)
00800       m_bstr = SysAllocString(lpwsz);
00801    else
00802       m_bstr = SysAllocStringLen(lpwsz, (UINT)iLen);
00803    ENSUREALLOC(m_bstr);
00804 }

void CopyString ( BSTR bstr )

Definition at line 843 of file bmws_string.cpp.

References ENSUREALLOC, m_bstr, and SAFEFREESTRING.

Referenced by CBSTR(), and operator=().

00844 {
00845    SAFEFREESTRING(m_bstr);
00846    if(bstr)
00847    {
00848       m_bstr = SysAllocStringLen(bstr, SysStringLen(bstr));
00849       ENSUREALLOC(m_bstr);
00850    }
00851 }

BSTR Detach ( )

Definition at line 864 of file bmws_string.cpp.

References m_bstr.

00865 {
00866    BSTR bstr = m_bstr;
00867    m_bstr = NULL;
00868    return bstr;
00869 }

BOOL Equals ( BSTR bstr )

Definition at line 818 of file bmws_string.cpp.

References m_bstr.

Referenced by CHTMLEdit::Changed(), and CXMLElement::IsTag().

00819 {
00820    if(!m_bstr && !bstr)
00821       return TRUE;
00822    if(!m_bstr || !bstr)
00823       return FALSE;
00824
00825    if(SysStringLen(m_bstr) != SysStringLen(bstr))
00826       return FALSE;
00827
00828    return (lstrcmp(CTSTR(m_bstr), CTSTR(bstr)) == 0);
00829 }

CBSTR & Format | ( | LPTSTR | lpszFormatter,
 |  | LPTSTR | lpszInsert
 | ) |

Definition at line 884 of file bmws_string.cpp.

References _ASSERT, and Assign().

00885 {
00886    _ASSERT(lpszFormatter);
00887    _ASSERT(lpszInsert);
00888    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + lstrlen(lpszInsert));
00889    wsprintf(lpszFinal, lpszFormatter, lpszInsert);
00890    Assign(lpszFinal);
00891    return *this;
00892 }

int Len ( ) [inline]

Definition at line 188 of file bmws_string.h.

References m_bstr.

Referenced by CMainWindow::GameSelected(), and CSolpackApp::Register().

00189    {
00190       return (m_bstr ? SysStringLen(m_bstr) : 0);
00191    }

operator BSTR ( ) const [inline]

Definition at line 158 of file bmws_string.h.

References m_bstr.

00159    {
00160       return m_bstr;
00161    }

const CBSTR & operator= ( const BSTR bstr )

Definition at line 723 of file bmws_string.cpp.

References CopyString(), and m_bstr.

00724 {
00725    if(m_bstr != bstr)
00726       CopyString(bstr);
00727    return *this;
00728 }

const CBSTR & operator= ( const CBSTR & bstrSrc )

Definition at line 705 of file bmws_string.cpp.

References CopyString(), and m_bstr.

00706 {
00707    if(m_bstr != bstrSrc.m_bstr)
00708       CopyString(bstrSrc.m_bstr);
00709    return *this;
00710 }

Member Data Documentation

BSTR m_bstr

Definition at line 205 of file bmws_string.h.

Referenced by Addr(), Assign(), AssignW(), CBSTR(), CopyString(), Detach(), Equals(), Len(), operator BSTR(), operator=(), CSolpackApp::Register(), and ~CBSTR().

The documentation for this class was generated from the following files:
  • bmws_string.h
  • bmws_string.cpp
Generated on Wed May 8 12:39:31 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CBSTR Member List

This is the complete list of members for CBSTR, including all inherited members.
Addr() | CBSTR | [inline]
Assign(UINT uID) | CBSTR |
Assign(LPTSTR lpsz) | CBSTR |
AssignW(LPWSTR lpwsz, int iLen=-1) | CBSTR |
CBSTR() | CBSTR |
CBSTR(UINT uID) | CBSTR |
CBSTR(BSTR bstr, BOOL bAssign=FALSE) | CBSTR |
CBSTR(const CTSTR &bmwslocal) | CBSTR |
CBSTR(const CBSTR &bmwsbstr) | CBSTR |
CBSTR(LPTSTR lpszFormatter, int iVal) | CBSTR |
CopyString(BSTR bstr) | CBSTR |
Detach() | CBSTR |
Equals(BSTR bstr) | CBSTR |
Format(LPTSTR lpszFormatter, LPTSTR lpszInsert) | CBSTR |
Len() | CBSTR | [inline]
m_bstr | CBSTR |
operator BSTR() const | CBSTR | [inline]
operator=(const CBSTR &bstrSrc) | CBSTR |
operator=(const BSTR bstr) | CBSTR |
~CBSTR() | CBSTR |
Generated on Wed May 8 12:39:31 2002 for Solitaire Pack by doxygen 1.2.15


CCard Class Reference

#include <Card.h>

Inheritance diagram for CCard:

CDispBase CEngineObj IActionSite INDUnknownAndDispatch IEventHandlerSite List of all members.

Public Methods

CCard (long lID)
virtual | ~CCard ()
STDMETHOD (get_ID)(long *p)
STDMETHOD (get_Rank)(long *p)
STDMETHOD (get_Suit)(long *p)
STDMETHOD (get_CanDrag)(VARIANT_BOOL *pbCanDrag)
STDMETHOD (put_CanDrag)(VARIANT_BOOL bCanDrag)
STDMETHOD (get_FaceUp)(VARIANT_BOOL *pbFaceUp)
STDMETHOD (put_FaceUp)(VARIANT_BOOL bFaceUp)
STDMETHOD (get_Pile)(ISolpackPile **pp)
STDMETHOD (get_Index)(long *p)
STDMETHOD (put_Index)(long v)
STDMETHOD (NDQueryInterface)(REFIID riid
void | DoAction (CAction *pAction)
void | UndoAction (CAction *pAction)
void | InitCard (ICardSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
void | SetPile (ICardPileSite *pPileSite, CHTMLElement2Ptr &spEl2Pile)
ICardPileSite * GetPile ()
long | GetIndex ()
void | SetIndex (long lIndex)
void | SetPosition (long lX, long lY)
POINT | GetPosition ()
CHTMLElementPtr & GetElement ()
void | ToggleFace ()

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
LPVOID * | ppvObject
BOOL | m_bCanDrag

Protected Methods

void | UpdateImg ()
void | SetElCapture ()
void | ReleaseElCapture ()

Protected Attributes

ICardSite * m_pSite
ICardPileSite * m_pPileSite
CTSTR m_lpszImgFile
long | m_lID
BOOL | m_bFaceUp
long | m_lIndex
long | m_lX
long | m_lY

Constructor & Destructor Documentation

CCard ( long lID )

Definition at line 81 of file Card.cpp.

References ENGOBJ_CARD, m_bCanDrag, m_bFaceUp, CEngineObj::m_dwEngObjType, m_lID, m_lIndex, m_lX, m_lY, m_pPileSite, m_pSite, and ODS.

00082 {
00083    // Set initial values for member variables
00084    m_dwEngObjType = ENGOBJ_CARD;
00085    m_pSite = NULL;
00086    m_pPileSite = NULL;
00087    m_lID = lID;
00088    m_bCanDrag = FALSE;
00089    m_bFaceUp = FALSE;
00090    m_lX = 0;
00091    m_lY = 0;
00092    m_lIndex = -1;
00093    ODS("CCard constructor");
00094 }

~CCard ( ) [virtual]

Definition at line 102 of file Card.cpp.

References ODS.

00103 {
00104    ODS("CCard destructor");
00105 }

Member Function Documentation

void DoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 381 of file Card.cpp.

References ACTION_CANDRAG, ACTION_FACEUP, ACTION_INDEX, m_bCanDrag, m_bFaceUp, CAction::m_dwData, CAction::m_dwType, CCardIndexAction::m_lDestIndex, m_lIndex, CCardIndexAction::m_lSrcIndex, m_pPileSite, ICardPileSite::SetCardIndex(), and UpdateImg().

00382 {
00383    switch(pAction->m_dwType)
00384    {
00385       case ACTION_FACEUP:
00386          // Turn the card face up or down, and update the displayed image
00387          m_bFaceUp = (BOOL)(pAction->m_dwData);
00388          UpdateImg();
00389          break;
00390
00391       case ACTION_CANDRAG:
00392          // Set whether or not the card can be dragged
00393          m_bCanDrag = (BOOL)(pAction->m_dwData);
00394          break;
00395
00396       case ACTION_INDEX:
00397       {
00398          // Move the card to its new index
00399          CCardIndexAction *pCIAction = (CCardIndexAction*)pAction;
00400          long lNew = pCIAction->m_lDestIndex;
00401          m_pPileSite->SetCardIndex(this, pCIAction->m_lSrcIndex, &lNew);
00402          pCIAction->m_lDestIndex = lNew;
00403          m_lIndex = lNew;
00404       } break;
00405    }
00406 }

CHTMLElementPtr & GetElement ( )

Definition at line 618 of file Card.cpp.

References CEngineObj::m_spEl.

Referenced by CPile::SetCardIndex().

00619 {
00620    return m_spEl;
00621 }

long GetIndex ( )

Definition at line 537 of file Card.cpp.

References m_lIndex.

00538 {
00539    return m_lIndex;
00540 }

ICardPileSite * GetPile ( )

Definition at line 521 of file Card.cpp.

References m_pPileSite.

Referenced by CEngine::MouseDown().

00522 {
00523    return m_pPileSite;
00524 }

POINT GetPosition ( )

Definition at line 598 of file Card.cpp.

References m_lX, and m_lY.

Referenced by CFragmentAddCard::Setup().

00599 {
00600    POINT pt;
00601    pt.x = m_lX;
00602    pt.y = m_lY;
00603    return pt;
00604 }

void InitCard | ( | ICardSite * | pSite,
 |  | IEngineObjSite * | pEngObjSite,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 460 of file Card.cpp.

References _ASSERT, CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CHTMLHelper::CreateElement(), CTSTR::Format(), g_pTypeLib, IDS_CLASS_CARD, IDS_TAG_SPAN, IID_ISolpackCard, CDispBase::Init(), CEngineObj::InitEngineObj(), ISolpackCard, m_lID, m_lpszImgFile, m_pSite, CEngineObj::m_spEl, CEngineObj::m_spStyle, ODS, CEngineObj::SetEventHandlers(), and UpdateImg().

Referenced by CDeck::InitDeck().

00461 {
00462    ODS("CCard::InitCard");
00463    InitEngineObj(pEngObjSite, pHH);
00464
00465    // Set member variables' values
00466    _ASSERT(pSite);
00467    m_pSite = pSite;
00468    m_lpszImgFile.Format(TEXT("c%d.gif"), m_lID);
00469
00470    Init(g_pTypeLib, IID_ISolpackCard, (LPDISPATCH)((ISolpackCard*)this));
00471
00472    // Create the Span element
00473    m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_SPAN, IID_IHTMLElement));
00474    CHECKHRCOM(m_spEl->put_className(CBSTR(IDS_CLASS_CARD)));
00475    CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00476
00477    UpdateImg();
00478
00479    // Create and attach handlers for mouse events
00480    SetEventHandlers();
00481 }

void ReleaseElCapture ( ) [inline, protected, virtual]

Implements CEngineObj.

Definition at line 114 of file Card.h.

References m_pPileSite, and ICardPileSite::PileReleaseElCapture().

00114 { m_pPileSite->PileReleaseElCapture(); }

void SetElCapture ( ) [inline, protected, virtual]

Implements CEngineObj.

Definition at line 113 of file Card.h.

References m_pPileSite, and ICardPileSite::PileSetElCapture().

00113 { m_pPileSite->PileSetElCapture();     }

void SetIndex ( long lIndex )

Definition at line 554 of file Card.cpp.

References m_lIndex.

Referenced by CDeck::InitDeck(), and CFragmentAddCard::Setup().

00555 {
00556    m_lIndex = lIndex;
00557 }

void SetPile | ( | ICardPileSite * | pPileSite,
 |  | CHTMLElement2Ptr & | spEl2Pile
 | ) |

Definition at line 498 of file Card.cpp.

References _ASSERT, CHECKHRCOM, CHTMLHelper::m_bstrBeforeEnd, CEngineObj::m_pHH, m_pPileSite, CEngineObj::m_spEl, and ODS.

Referenced by CDeck::InitDeck(), and CFragmentAddCard::Setup().

00499 {
00500    ODS("CCard::SetPile");
00501
00502    _ASSERT(pPileSite);
00503    m_pPileSite = pPileSite;
00504
00505    // Add the card span element to the pile's element
00506    if(spEl2Pile)
00507       CHECKHRCOM(spEl2Pile->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, m_spEl, NULL));
00508 }

void SetPosition | ( | long | lX,
 |  | long | lY
 | ) |

Definition at line 572 of file Card.cpp.

References CHECKHRCOM, m_lX, m_lY, and CEngineObj::m_spStyle.

Referenced by CFragmentAddCard::Setup().

00573 {
00574    // Only update the HTML element's position if the coordinate changed
00575    if(lX != m_lX)
00576    {
00577       m_lX = lX;
00578       CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00579    }
00580    if(lY != m_lY)
00581    {
00582       m_lY = lY;
00583       CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00584    }
00585 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( put_Index )

STDMETHOD ( get_Index )

STDMETHOD ( get_Pile )

STDMETHOD ( put_FaceUp )

STDMETHOD ( get_FaceUp )

STDMETHOD ( put_CanDrag )

STDMETHOD ( get_CanDrag )

STDMETHOD ( get_Suit )

STDMETHOD ( get_Rank )

STDMETHOD ( get_ID )

void ToggleFace ( )

Definition at line 635 of file Card.cpp.

References m_bFaceUp, and UpdateImg().

00636 {
00637    m_bFaceUp = !m_bFaceUp;
00638    UpdateImg();
00639 }

void UndoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 420 of file Card.cpp.

References ACTION_CANDRAG, ACTION_FACEUP, ACTION_INDEX, m_bCanDrag, m_bFaceUp, CAction::m_dwData, CAction::m_dwType, CCardIndexAction::m_lDestIndex, m_lIndex, CCardIndexAction::m_lSrcIndex, m_pPileSite, ICardPileSite::SetCardIndex(), and UpdateImg().

00421 {
00422    switch(pAction->m_dwType)
00423    {
00424       case ACTION_FACEUP:
00425          // Turn the card face up or down, and update the displayed image
00426          m_bFaceUp = !(BOOL)(pAction->m_dwData);
00427          UpdateImg();
00428          break;
00429
00430       case ACTION_CANDRAG:
00431          // Set whether or not the card can be dragged
00432          m_bCanDrag = !(BOOL)(pAction->m_dwData);
00433          break;
00434
00435       case ACTION_INDEX:
00436       {
00437          // Move the card to its previous index
00438          CCardIndexAction *pCIAction = (CCardIndexAction*)pAction;
00439          long lNew = pCIAction->m_lSrcIndex;
00440          m_pPileSite->SetCardIndex(this, pCIAction->m_lDestIndex, &lNew);
00441          m_lIndex = lNew;
00442       } break;
00443    }
00444 }

void UpdateImg ( ) [protected]

Definition at line 653 of file Card.cpp.

References CHECKHRCOM, ICardSite::GetFaceDownImg(), IDS_IMGHOLDER, m_bFaceUp, m_lpszImgFile, m_pSite, and CEngineObj::m_spStyle.

Referenced by DoAction(), InitCard(), ToggleFace(), and UndoAction().

00654 {
00655    CHECKHRCOM(m_spStyle->put_backgroundImage(CBSTR().Format(CTSTR(IDS_IMGHOLDER), m_bFaceUp ?
00656       m_lpszImgFile : m_pSite->GetFaceDownImg())));
00657 }

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 76 of file Card.h.

BOOL m_bCanDrag

Definition at line 107 of file Card.h.

Referenced by CCard(), DoAction(), CEngine::MouseMove(), and UndoAction().

BOOL m_bFaceUp [protected]

Definition at line 122 of file Card.h.

Referenced by CCard(), DoAction(), ToggleFace(), UndoAction(), and UpdateImg().

long m_lID [protected]

Definition at line 121 of file Card.h.

Referenced by CCard(), and InitCard().

long m_lIndex [protected]

Definition at line 124 of file Card.h.

Referenced by CCard(), DoAction(), GetIndex(), SetIndex(), and UndoAction().

CTSTR m_lpszImgFile [protected]

Definition at line 119 of file Card.h.

Referenced by InitCard(), and UpdateImg().

long m_lX [protected]

Definition at line 125 of file Card.h.

Referenced by CCard(), GetPosition(), and SetPosition().

long m_lY [protected]

Definition at line 126 of file Card.h.

Referenced by CCard(), GetPosition(), and SetPosition().

ICardPileSite* m_pPileSite [protected]

Definition at line 117 of file Card.h.

Referenced by CCard(), DoAction(), GetPile(), ReleaseElCapture(), SetElCapture(), SetPile(), and UndoAction().

ICardSite* m_pSite [protected]

Definition at line 116 of file Card.h.

Referenced by CCard(), InitCard(), and UpdateImg().

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 91 of file Card.h.

The documentation for this class was generated from the following files:
  • Card.h
  • Card.cpp
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCard Member List

This is the complete list of members for CCard, including all inherited members.
CCard(long lID) | CCard |
CDispBase() | CDispBase |
CEngineObj() | CEngineObj |
cNames | CDispBase |
DECLARE_IUNKNOWN_AND_IDISPATCH | CCard |
DoAction(CAction *pAction) | CCard | [virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngineObj | [virtual]
GetDispatch() const | CDispBase | [inline, protected]
GetElement() | CCard |
GetIndex() | CCard |
GetOuterUnknown() const | CDispBase | [inline, protected]
GetPile() | CCard |
GetPosition() | CCard |
GetType() | CEngineObj |
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitCard(ICardSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CCard |
InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CEngineObj |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_bCanDrag | CCard |
m_bFaceUp | CCard | [protected]
m_dwEngObjType | CEngineObj | [protected]
m_lID | CCard | [protected]
m_lIndex | CCard | [protected]
m_lpszImgFile | CCard | [protected]
m_lX | CCard | [protected]
m_lY | CCard | [protected]
m_pEngObjSite | CEngineObj | [protected]
m_pHH | CEngineObj | [protected]
m_pPileSite | CCard | [protected]
m_pSite | CCard | [protected]
m_spEl | CEngineObj | [protected]
m_spStyle | CEngineObj | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
ppTInfo | CDispBase |
ppvObject | CCard |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
ReleaseElCapture() | CCard | [inline, protected, virtual]
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
SetElCapture() | CCard | [inline, protected, virtual]
SetEventHandlers() | CEngineObj | [protected]
SetIndex(long lIndex) | CCard |
SetPile(ICardPileSite *pPileSite, CHTMLElement2Ptr &spEl2Pile) | CCard |
SetPosition(long lX, long lY) | CCard |
STDMETHOD(get_ID)(long *p) | CCard |
STDMETHOD(get_Rank)(long *p) | CCard |
STDMETHOD(get_Suit)(long *p) | CCard |
STDMETHOD(get_CanDrag)(VARIANT_BOOL *pbCanDrag) | CCard |
STDMETHOD(put_CanDrag)(VARIANT_BOOL bCanDrag) | CCard |
STDMETHOD(get_FaceUp)(VARIANT_BOOL *pbFaceUp) | CCard |
STDMETHOD(put_FaceUp)(VARIANT_BOOL bFaceUp) | CCard |
STDMETHOD(get_Pile)(ISolpackPile **pp) | CCard |
STDMETHOD(get_Index)(long *p) | CCard |
STDMETHOD(put_Index)(long v) | CCard |
STDMETHOD(NDQueryInterface)(REFIID riid | CCard |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
ToggleFace() | CCard |
UndoAction(CAction *pAction) | CCard | [virtual]
UpdateImg() | CCard | [protected]
wFlags | CDispBase |
~CCard() | CCard | [virtual]
~CDispBase() | CDispBase | [virtual]
~CEngineObj() | CEngineObj | [virtual]
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


CCardIndexAction Class Reference

Inheritance diagram for CCardIndexAction:

CAction List of all members.

Public Methods

CCardIndexAction (IActionSite *pSite, long lSrcIndex, long lDestIndex)
virtual | ~CCardIndexAction ()

Protected Attributes

long | m_lSrcIndex
long | m_lDestIndex

Friends

class | CCard

Constructor & Destructor Documentation

CCardIndexAction | ( | IActionSite * | pSite,
 |  | long | lSrcIndex,
 |  | long | lDestIndex
 | ) |

Definition at line 64 of file Card.cpp.

References ACTION_INDEX, m_lDestIndex, and m_lSrcIndex.

00064                                                                                       :
00065    CAction(pSite, ACTION_INDEX, 0)
00066 {
00067    // Set initial values for member variables
00068    m_lSrcIndex = lSrcIndex;
00069    m_lDestIndex = lDestIndex;
00070 }

virtual ~CCardIndexAction ( ) [inline, virtual]

Definition at line 44 of file Card.cpp.

00044 {}

Friends And Related Function Documentation

friend class CCard [friend]

Definition at line 46 of file Card.cpp.

Member Data Documentation

long m_lDestIndex [protected]

Definition at line 50 of file Card.cpp.

Referenced by CCardIndexAction(), CCard::DoAction(), and CCard::UndoAction().

long m_lSrcIndex [protected]

Definition at line 49 of file Card.cpp.

Referenced by CCardIndexAction(), CCard::DoAction(), and CCard::UndoAction().

The documentation for this class was generated from the following file:
  • Card.cpp
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCardIndexAction Member List

This is the complete list of members for CCardIndexAction, including all inherited members.
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
CCard class | CCardIndexAction | [friend]
CCardIndexAction(IActionSite *pSite, long lSrcIndex, long lDestIndex) | CCardIndexAction |
m_dwData | CAction |
m_dwType | CAction |
m_lDestIndex | CCardIndexAction | [protected]
m_lSrcIndex | CCardIndexAction | [protected]
m_pNext | CAction |
m_pPrev | CAction |
m_pSite | CAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
~CCardIndexAction() | CCardIndexAction | [inline, virtual]
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


CCOMExcep Class Reference

#include <bmws_error.h>

Inheritance diagram for CCOMExcep:

CExcep List of all members.

Public Methods

CCOMExcep (HRESULT hr)
void | Report ()

Public Attributes

HRESULT | m_hr

Constructor & Destructor Documentation

CCOMExcep ( HRESULT hr ) [inline]

Definition at line 302 of file bmws_error.h.

References IDS_BMWS_ERROR_COMERROR, and m_hr.

00302                          : CExcep(IDS_BMWS_ERROR_COMERROR)
00303    {
00304       m_hr = hr;
00305    }

Member Function Documentation

void Report ( ) [inline, virtual]

Reimplemented from CExcep.

Definition at line 308 of file bmws_error.h.

References ERROR_ERRORINS_INT, g_hWnd, HandleError(), IDS_BMWS_REMEDY_RESTART, CExcep::m_code, and m_hr.

00313    {
00314 #ifdef _DEBUG
00315       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, m_hr, 0, ERROR_ERRORINS_INT |
00316          (bFirst ? ERROR_FIRSTCHANCE : 0));
00317 #else
00318       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, m_hr, 0, ERROR_ERRORINS_INT);
00319 #endif
00320    }

Member Data Documentation

HRESULT m_hr

Definition at line 323 of file bmws_error.h.

Referenced by CCOMExcep(), and Report().

The documentation for this class was generated from the following file:
  • bmws_error.h
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCOMExcep Member List

This is the complete list of members for CCOMExcep, including all inherited members.
CCOMExcep(HRESULT hr) | CCOMExcep | [inline]
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
m_hr | CCOMExcep |
Report() | CCOMExcep | [inline, virtual]
Generated on Wed May 8 12:39:32 2002 for Solitaire Pack by doxygen 1.2.15


CCompoundXMLDocument Class Reference

#include <bmws_compound_xml.h>

Inheritance diagram for CCompoundXMLDocument:

CXMLDocument IXMLDocumentSite CRefCount IEventHandlerSite List of all members.

Public Methods

CCompoundXMLDocument (ICompoundXMLDocumentSite *pCompoundSite, CTSTR &lpszSpewPath)
virtual | ~CCompoundXMLDocument ()
HRESULT | SpewFiles ()
void | CleanupFiles ()
HRESULT | AddFile (CTSTR &lpszFile, CTSTR &lpszName, CTSTR &lpszData, DWORD dwFlags, CTSTR &lpszNewName)
HRESULT | RemoveFile (CTSTR &lpszName, BOOL bCleanup)
BOOL | FileExists (CTSTR &lpszName)
UINT | GetNumFiles ()
CTSTR | GetFileName (UINT iFile)
BOOL | IsValidCompoundXML ()
long | GetFileIndex (CTSTR &lpszFile)
virtual void | XMLDone (CXMLDocument *pDoc)

Private Methods

BOOL | SpewFile (long l)

Private Attributes

ICompoundXMLDocumentSite * m_pCompoundSite
CBOOLArray m_abFilesSpewed
CTSTRArray m_alpszFileNames
CTSTR m_lpszSpewPath
long | m_cFiles
CXMLElementPtr m_pFilesEl
BOOL | m_bCompoundValid

Constructor & Destructor Documentation

CCompoundXMLDocument | ( | ICompoundXMLDocumentSite * | pCompoundSite,
 |  | CTSTR & | lpszSpewPath
 | ) |

Definition at line 50 of file bmws_compound_xml.cpp.

References CXMLDocument::InitXMLDocument(), m_abFilesSpewed, m_alpszFileNames, m_bCompoundValid, m_cFiles, m_lpszSpewPath, m_pCompoundSite, m_pFilesEl, CArray< CTSTR, CTSTR & >::SetSize(), and CArray< BOOL, BOOL >::SetSize().

00052 {
00053    m_bCompoundValid = FALSE;
00054    m_cFiles = 0;
00055    m_abFilesSpewed.SetSize(0);
00056    m_alpszFileNames.SetSize(0);
00057    m_pFilesEl = NULL;
00058    m_pCompoundSite = pCompoundSite;
00059    m_lpszSpewPath = lpszSpewPath;
00060    InitXMLDocument((IXMLDocumentSite*)this);
00061 }

~CCompoundXMLDocument ( ) [virtual]

Definition at line 69 of file bmws_compound_xml.cpp.

References CleanupFiles().

00070 {
00071    CleanupFiles();
00072 }

Member Function Documentation

HRESULT AddFile | ( | CTSTR & | lpszFile,
 |  | CTSTR & | lpszName,
 |  | CTSTR & | lpszData,
 |  | DWORD | dwFlags,
 |  | CTSTR & | lpszNewName
 | ) |

Definition at line 221 of file bmws_compound_xml.cpp.

References _ASSERT, CArray< BOOL, BOOL >::Add(), CArray< CTSTR, CTSTR & >::Add(), CTSTR::Alloc(), CTSTR::Assign(), BinaryToBase64(), BMWS_COMPOUND_XML_CONTENTS, BMWS_COMPOUND_XML_RENAME, BMWS_COMPOUND_XML_SPEW, COMPOUND_XML_MAXFILESIZE, CXMLElementPtr, ENSUREALLOC, FileExists(), CXMLDocument::GetRootElement(), IDS_BMWS_COMPOUND_XML_ATTR_DATA, IDS_BMWS_COMPOUND_XML_ATTR_NAME, IDS_BMWS_COMPOUND_XML_EL_FILE, IDS_BMWS_COMPOUND_XML_EL_FILES, IDS_BMWS_COMPOUND_XML_RENFORMAT, m_abFilesSpewed, m_alpszFileNames, m_cFiles, m_pFilesEl, SAFEALLOCMEMORY, SAFEFREEMEMORY, and SpewFile().

00223 {
00224    if(!m_pFilesEl)
00225    {
00226       m_pFilesEl = CXMLElementPtr(GetRootElement())->AddChild(IDS_BMWS_COMPOUND_XML_EL_FILES,
00227          -1);
00228    }
00229    if(!m_pFilesEl)
00230       return E_FAIL;
00231    _ASSERT(lpszFile && lpszName);
00232    if(!PathIsFileSpec(lpszName))
00233       return E_INVALIDARG;
00234
00235    if(FileExists(lpszName))
00236    {
00237       if(dwFlags & BMWS_COMPOUND_XML_RENAME)
00238       {
00239          CTSTR lpszFormatter(IDS_BMWS_COMPOUND_XML_RENFORMAT);
00240          CTSTR lpszExt(PathFindExtension(lpszName));
00241          PathRemoveExtension(lpszName);
00242          BOOL bExists = TRUE;
00243          int iCount = 2;
00244          while(bExists && (iCount < 1024))
00245          {
00246             lpszNewName.Alloc(lstrlen(lpszFormatter) + lstrlen(lpszName) + lstrlen(lpszExt) + 8);
00247             wsprintf(lpszNewName, lpszFormatter, lpszName, iCount, lpszExt);
00248             bExists = FileExists(lpszNewName);
00249             iCount++;
00250          }
00251          lpszName = lpszNewName;
00252       } else
00253          return E_ABORT;
00254    }
00255
00256    LPSTR lpszContents = NULL;
00257    UINT iLen = 0;
00258    if(dwFlags & BMWS_COMPOUND_XML_CONTENTS)
00259    {
00260       #ifdef UNICODE
00261          iLen = lstrlen(lpszFile);
00262          lpszContents = SAFEALLOCMEMORY((iLen + 1) * sizeof(CHAR));
00263          ENSUREALLOC(lpszContents);
00264          LocalToANSI(lpszContents, lpszFile, iLen);
00265       #else
00266          lpszContents = (LPSTR)lpszFile;
00267          iLen = lstrlenA(lpszContents);
00268       #endif
00269    } else
00270    {
00271       CHandle hFile(CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
00272          FILE_ATTRIBUTE_NORMAL, NULL), CloseHandle);
00273       if(hFile == INVALID_HANDLE_VALUE)
00274          return E_NOINTERFACE;
00275
00276       DWORD dwSize = GetFileSize(hFile, NULL);
00277       if(dwSize > COMPOUND_XML_MAXFILESIZE)
00278          return E_UNEXPECTED;
00279
00280       LPSTR lpszBuf = (LPSTR)SAFEALLOCMEMORY(dwSize * sizeof(char));
00281       ENSUREALLOC(lpszBuf);
00282
00283       DWORD dwTotal = 0;
00284       DWORD dwBytesRead;
00285       char buff[4096];
00286       do
00287       {
00288          if(ReadFile(hFile, buff, 4096, &dwBytesRead, NULL))
00289          {
00290             CopyMemory(lpszBuf+dwTotal, buff, dwBytesRead);
00291             dwTotal += dwBytesRead;
00292          } else
00293             return E_NOINTERFACE;
00294       } while(dwBytesRead == 4096);
00295       lpszContents = lpszBuf;
00296       iLen = dwTotal;
00297    }
00298
00299    UINT iLenOut = 0;
00300    LPSTR lpszEncodedContents = NULL;
00301    CExcep *pThrowE = NULL;
00302    try
00303    {
00304       lpszEncodedContents = BinaryToBase64(lpszContents, iLen, &iLenOut);
00305       CXMLElementPtr pFileEl = m_pFilesEl->AddChild(IDS_BMWS_COMPOUND_XML_EL_FILE, -1);
00306       pFileEl->SetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_NAME, CBSTR(lpszName));
00307       if(lpszData)
00308          pFileEl->SetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR(lpszData));
00309       #ifdef UNICODE
00310          CTSTR lpszLocalEncoded;
00311          lpszLocalEncoded.Assign(lpszEncodedContents);
00312          pFileEl->SetText(CBSTR(lpszLocalEncoded));
00313       #else
00314          pFileEl->SetText(CBSTR(lpszEncodedContents));
00315       #endif
00316
00317       m_alpszFileNames.Add(lpszName);
00318       m_abFilesSpewed.Add(FALSE);
00319       if(dwFlags & BMWS_COMPOUND_XML_SPEW)
00320       {
00321          if(SpewFile(m_cFiles))
00322             m_cFiles++;
00323       } else
00324          m_cFiles++;
00325    }
00326    catch(CExcep *pE)
00327    {
00328       pThrowE = pE;
00329    }
00330
00331    SAFEFREEMEMORY(lpszEncodedContents);
00332    if(!(dwFlags & BMWS_COMPOUND_XML_CONTENTS))
00333       SAFEFREEMEMORY(lpszContents);
00334    #ifdef UNICODE
00335       SAFEFREEMEMORY(lspzContents);
00336    #endif
00337
00338    if(pThrowE)
00339       throw pThrowE;
00340
00341    return S_OK;
00342 }

void CleanupFiles ( )

Definition at line 174 of file bmws_compound_xml.cpp.

References CHILDOF_NULLIFNOTFOUND, ICompoundXMLDocumentSite::DelCallback(), CArray< BOOL, BOOL >::GetSize(), IDS_BMWS_COMPOUND_XML_ATTR_DATA, IDS_BMWS_COMPOUND_XML_EL_FILE, m_abFilesSpewed, m_alpszFileNames, m_cFiles, m_lpszSpewPath, m_pCompoundSite, m_pFilesEl, and CArray< BOOL, BOOL >::SetAt().

Referenced by ~CCompoundXMLDocument().

00175 {
00176    if(m_abFilesSpewed.GetSize() == 0)
00177       return;
00178    for(long l = 0; l < m_cFiles; l++)
00179    {
00180       if(m_abFilesSpewed[l])
00181       {
00182          CTSTR lpszData;
00183          CXMLElementPtr pEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l,
00184             CHILDOF_NULLIFNOTFOUND);
00185          if(pEl)
00186          {
00187             CBSTR bstrData = pEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR());
00188             lpszData = (BSTR)bstrData;
00189          }
00190          if(m_pCompoundSite->DelCallback(l, m_alpszFileNames[l], lpszData))
00191          {
00192             int iLen = lstrlen(m_alpszFileNames[l]) + lstrlen(m_lpszSpewPath) + 2;
00193             CTSTR lpszTotal(TRUE, iLen);
00194             lstrcpy(lpszTotal, m_lpszSpewPath);
00195             PathAppend(lpszTotal, m_alpszFileNames[l]);
00196             DeleteFile(lpszTotal);
00197             m_abFilesSpewed.SetAt(l, FALSE);
00198          }
00199       }
00200    }
00201 }

BOOL FileExists ( CTSTR & lpszName )

Definition at line 398 of file bmws_compound_xml.cpp.

References GetFileIndex().

Referenced by AddFile().

00399 {
00400    return (GetFileIndex(lpszName) != -1);
00401 }

long GetFileIndex ( CTSTR & lpszFile )

Definition at line 531 of file bmws_compound_xml.cpp.

References m_alpszFileNames, and m_cFiles.

Referenced by FileExists(), and RemoveFile().

00532 {
00533    if(!lpszFile || (m_cFiles == 0) || !PathIsFileSpec(lpszFile))
00534       return -1;
00535
00536    for(long l = 0; l < m_cFiles; l++)
00537    {
00538       if(m_alpszFileNames[l])
00539          if(lstrcmpi(lpszFile, m_alpszFileNames[l]) == 0)
00540             return l;
00541    }
00542    return -1;
00543 }

CTSTR GetFileName ( UINT iFile )

Definition at line 431 of file bmws_compound_xml.cpp.

References m_alpszFileNames, and m_cFiles.

00432 {
00433    if(iFile < (UINT)m_cFiles)
00434       return m_alpszFileNames[iFile];
00435    return CTSTR();
00436 }

UINT GetNumFiles ( )

Definition at line 414 of file bmws_compound_xml.cpp.

References m_cFiles.

00415 {
00416    return m_cFiles;
00417 }

BOOL IsValidCompoundXML ( )

Definition at line 556 of file bmws_compound_xml.cpp.

References m_bCompoundValid.

00557 {
00558    return m_bCompoundValid;
00559 }

HRESULT RemoveFile | ( | CTSTR & | lpszName,
 |  | BOOL | bCleanup
 | ) |

Definition at line 357 of file bmws_compound_xml.cpp.

References GetFileIndex(), IDS_BMWS_COMPOUND_XML_EL_FILE, m_abFilesSpewed, m_alpszFileNames, m_cFiles, m_lpszSpewPath, m_pFilesEl, CArray< BOOL, BOOL >::RemoveAt(), and CArray< CTSTR, CTSTR & >::RemoveAt().

00358 {
00359    if(!m_pFilesEl)
00360       return E_FAIL;
00361    if(!lpszName || !PathIsFileSpec(lpszName))
00362       return E_INVALIDARG;
00363
00364    long lIndex = GetFileIndex(lpszName);
00365    if(lIndex == -1)
00366       return E_INVALIDARG;
00367
00368    HRESULT hr = E_FAIL;
00369
00370    m_pFilesEl->DeleteChild(IDS_BMWS_COMPOUND_XML_EL_FILE, lIndex);
00371    if(bCleanup)
00372    {
00373       int iLen = lstrlen(m_alpszFileNames[lIndex]) + lstrlen(m_lpszSpewPath) + 2;
00374       CTSTR lpszTotal(TRUE, iLen);
00375       lstrcpy(lpszTotal, m_lpszSpewPath);
00376       PathAppend(lpszTotal, m_alpszFileNames[lIndex]);
00377       DeleteFile(lpszTotal);
00378    }
00379    m_alpszFileNames.RemoveAt(lIndex);
00380    m_abFilesSpewed.RemoveAt(lIndex);
00381    m_cFiles--;
00382
00383    return S_OK;
00384 }

BOOL SpewFile ( long l ) [private]

Definition at line 450 of file bmws_compound_xml.cpp.

References Base64ToBinary(), IDS_BMWS_COMPOUND_XML_ATTR_DATA, IDS_BMWS_COMPOUND_XML_EL_FILE, IDS_BMWS_REMEDY_RESTART, m_abFilesSpewed, m_alpszFileNames, m_lpszSpewPath, m_pCompoundSite, m_pFilesEl, SAFEFREEMEMORY, CArray< BOOL, BOOL >::SetAt(), and ICompoundXMLDocumentSite::SpewCallback().

Referenced by AddFile(), and SpewFiles().

00451 {
00452    m_abFilesSpewed.SetAt(l, FALSE);
00453    if(!m_lpszSpewPath || !m_alpszFileNames[l])
00454       return FALSE;
00455
00456    BOOL bReturn = FALSE;
00457
00458    LPSTR lpszDecodedContents = NULL;
00459
00460    try
00461    {
00462       CXMLElementPtr pFileEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l);
00463       CBSTR bstrData = pFileEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_DATA, CBSTR());
00464       CBSTR bstrContents = pFileEl->GetText(CBSTR());
00465       if(!bstrContents)
00466          return FALSE;
00467       CTSTR lpszContents(bstrContents);
00468       CTSTR lpszData(bstrData);
00469       BOOL bSpew = TRUE;
00470       if(m_pCompoundSite)
00471          bSpew = m_pCompoundSite->SpewCallback(l, m_alpszFileNames[l], lpszData, lpszContents);
00472       if(bSpew && lpszContents)
00473       {
00474          int iLen = lstrlen(m_alpszFileNames[l]) + lstrlen(m_lpszSpewPath) + 2;
00475          CTSTR lpszTotal(TRUE, iLen);
00476          lstrcpy(lpszTotal, m_lpszSpewPath);
00477          PathAppend(lpszTotal, m_alpszFileNames[l]);
00478          UINT uiLen = lstrlen(lpszContents);
00479          UINT iLenOut;
00480          #ifdef UNICODE
00481             THIS CODE IS NOT UNICODE COMPATIBLE
00482 /*          LPSTR lpszANSIContents = SAFEALLOCMEMORY((uiLen + 1) * sizeof(CHAR));
00483             ENSUREALLOC(lpszANSIContents);
00484             LocalToANSI(lpszANSIContents, lpszContents, uiLen);
00485             lpszDecodedContents = Base64ToBinary(lpszANSIContents, uiLen, &iLenOut);
00486             SAFEFREEMEMORY(lpszANSIContents);*/
00487          #else
00488             lpszDecodedContents = Base64ToBinary(lpszContents, uiLen, &iLenOut);
00489          #endif
00490          CHandle hFile(CreateFile(lpszTotal, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
00491             FILE_ATTRIBUTE_NORMAL, NULL), CloseHandle);
00492          if(hFile != INVALID_HANDLE_VALUE)
00493          {
00494             DWORD dwWritten = 0;
00495             if(WriteFile(hFile, (LPCVOID)lpszDecodedContents, iLenOut, &dwWritten, NULL))
00496             {
00497                bReturn = TRUE;
00498             } else
00499             {
00500                CWinExcep(GetLastError(), IDS_BMWS_REMEDY_RESTART, FALSE).Report();
00501                bReturn = FALSE;
00502             }
00503             m_abFilesSpewed.SetAt(l, bReturn);
00504          } else
00505          {
00506             CWinExcep(GetLastError(), IDS_BMWS_REMEDY_RESTART, FALSE).Report();
00507          }
00508          SAFEFREEMEMORY(lpszDecodedContents);
00509       }
00510    }
00511    catch(CExcep *pE)
00512    {
00513       SAFEFREEMEMORY(lpszDecodedContents);
00514       throw pE;
00515    }
00516    return bReturn;
00517 }

HRESULT SpewFiles ( )

Definition at line 147 of file bmws_compound_xml.cpp.

References CArray< CTSTR, CTSTR & >::GetSize(), CArray< BOOL, BOOL >::GetSize(), m_abFilesSpewed, m_alpszFileNames, m_cFiles, m_pFilesEl, CArray< BOOL, BOOL >::SetSize(), and SpewFile().

00148 {
00149    if((m_abFilesSpewed.GetSize() > 0) || !m_pFilesEl)
00150       return E_FAIL;
00151    if((m_cFiles == 0) || (m_alpszFileNames.GetSize() == 0))
00152       return S_FALSE;
00153
00154    m_abFilesSpewed.SetSize(m_cFiles);
00155    BOOL bOkay = TRUE;
00156    for(long l = 0; l < m_cFiles; l++)
00157    {
00158       bOkay &= SpewFile(l);
00159    }
00160    return (bOkay ? S_OK : E_FAIL);
00161 }

void XMLDone ( CXMLDocument * pDoc ) [virtual]

Implements IXMLDocumentSite.

Definition at line 88 of file bmws_compound_xml.cpp.

References CHILDOF_NULLIFNOTFOUND, CXMLDocument::GetRootElement(), IDS_BMWS_COMPOUND_XML_ATTR_NAME, IDS_BMWS_COMPOUND_XML_EL_FILE, IDS_BMWS_COMPOUND_XML_EL_FILES, m_alpszFileNames, m_bCompoundValid, m_cFiles, m_pCompoundSite, m_pFilesEl, CArray< CTSTR, CTSTR & >::SetAt(), CArray< CTSTR, CTSTR & >::SetSize(), and IXMLDocumentSite::XMLDone().

00089 {
00090    m_bCompoundValid = FALSE;
00091    m_cFiles = 0;
00092
00093    try
00094    {
00095       CXMLElementPtr pRootEl = GetRootElement();
00096
00097       m_cFiles = 0;
00098       m_pFilesEl = pRootEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILES, 0, CHILDOF_NULLIFNOTFOUND);
00099       if(!m_pFilesEl)
00100       {
00101          if(m_pCompoundSite)
00102             m_pCompoundSite->XMLDone(pDoc);
00103          return;
00104       }
00105       long cFileEls = m_pFilesEl->NumChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE);
00106       if(cFileEls > 0)
00107       {
00108          m_alpszFileNames.SetSize(cFileEls);
00109          m_bCompoundValid = TRUE;
00110          for(long l = 0; l < cFileEls && m_bCompoundValid; l++, m_cFiles++)
00111          {
00112             m_bCompoundValid = FALSE;
00113             CXMLElementPtr pFileEl = m_pFilesEl->ChildOf(IDS_BMWS_COMPOUND_XML_EL_FILE, l);
00114             CBSTR bstrName = pFileEl->GetStrAttr(IDS_BMWS_COMPOUND_XML_ATTR_NAME, CBSTR());
00115             if(bstrName)
00116             {
00117                CTSTR lpszTemp(bstrName);
00118                if(PathIsFileSpec(lpszTemp))
00119                   m_alpszFileNames.SetAt(l, lpszTemp);
00120                m_bCompoundValid = TRUE;
00121             }
00122          }
00123       }
00124       m_bCompoundValid = TRUE;
00125    }
00126    catch(CExcep *pE)
00127    {
00128       pE->Report();
00129       pE->Delete();
00130    }
00131
00132    if(m_pCompoundSite)
00133       m_pCompoundSite->XMLDone(pDoc);
00134 }

Member Data Documentation

CBOOLArray m_abFilesSpewed [private]

Definition at line 82 of file bmws_compound_xml.h.

Referenced by AddFile(), CCompoundXMLDocument(), CleanupFiles(), RemoveFile(), SpewFile(), and SpewFiles().

CTSTRArray m_alpszFileNames [private]

Definition at line 83 of file bmws_compound_xml.h.

Referenced by AddFile(), CCompoundXMLDocument(), CleanupFiles(), GetFileIndex(), GetFileName(), RemoveFile(), SpewFile(), SpewFiles(), and XMLDone().

BOOL m_bCompoundValid [private]

Definition at line 87 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument(), IsValidCompoundXML(), and XMLDone().

long m_cFiles [private]

Definition at line 85 of file bmws_compound_xml.h.

Referenced by AddFile(), CCompoundXMLDocument(), CleanupFiles(), GetFileIndex(), GetFileName(), GetNumFiles(), RemoveFile(), SpewFiles(), and XMLDone().

CTSTR m_lpszSpewPath [private]

Definition at line 84 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument(), CleanupFiles(), RemoveFile(), and SpewFile().

ICompoundXMLDocumentSite* m_pCompoundSite [private]

Definition at line 81 of file bmws_compound_xml.h.

Referenced by CCompoundXMLDocument(), CleanupFiles(), SpewFile(), and XMLDone().

CXMLElementPtr m_pFilesEl [private]

Definition at line 86 of file bmws_compound_xml.h.

Referenced by AddFile(), CCompoundXMLDocument(), CleanupFiles(), RemoveFile(), SpewFile(), SpewFiles(), and XMLDone().

The documentation for this class was generated from the following files:
  • bmws_compound_xml.h
  • bmws_compound_xml.cpp
Generated on Wed May 8 12:39:33 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCompoundXMLDocument Member List

This is the complete list of members for CCompoundXMLDocument, including all inherited members.
Abort() | CXMLDocument |
AddFile(CTSTR &lpszFile, CTSTR &lpszName, CTSTR &lpszData, DWORD dwFlags, CTSTR &lpszNewName) | CCompoundXMLDocument |
CCompoundXMLDocument(ICompoundXMLDocumentSite *pCompoundSite, CTSTR &lpszSpewPath) | CCompoundXMLDocument |
CleanupFiles() | CCompoundXMLDocument |
CreateRootElement(UINT uidTagName) | CXMLDocument |
CRefCount() | CRefCount | [inline]
CXMLDocument() | CXMLDocument |
downcount() | CRefCount | [inline]
EventHandler(DWORD dwEventID, LPARAM lParam) | CXMLDocument | [virtual]
FileExists(CTSTR &lpszName) | CCompoundXMLDocument |
GetFileIndex(CTSTR &lpszFile) | CCompoundXMLDocument |
GetFileName(UINT iFile) | CCompoundXMLDocument |
CXMLDocument::GetFileName() | CXMLDocument |
GetNumFiles() | CCompoundXMLDocument |
GetRootElement() | CXMLDocument |
InitXMLDocument(IXMLDocumentSite *pSite) | CXMLDocument |
IsValidCompoundXML() | CCompoundXMLDocument |
IsValidXML() | CXMLDocument |
LoadFromFile(CBSTR &bstrFile, BOOL bAsync=TRUE) | CXMLDocument |
m_abFilesSpewed | CCompoundXMLDocument | [private]
m_alpszFileNames | CCompoundXMLDocument | [private]
m_bCompoundValid | CCompoundXMLDocument | [private]
m_bPutHandler | CXMLDocument | [protected]
m_bstrFile | CXMLDocument | [protected]
m_bValidLoaded | CXMLDocument | [protected]
m_cFiles | CCompoundXMLDocument | [private]
m_hFile | CXMLDocument | [protected]
m_lpszSpewPath | CCompoundXMLDocument | [private]
m_pCompoundSite | CCompoundXMLDocument | [private]
m_pFilesEl | CCompoundXMLDocument | [private]
m_pSite | CXMLDocument | [protected]
m_spDoc | CXMLDocument | [protected]
RemoveFile(CTSTR &lpszName, BOOL bCleanup) | CCompoundXMLDocument |
SaveToFile(CBSTR &bstrFile) | CXMLDocument |
SpewFile(long l) | CCompoundXMLDocument | [private]
SpewFiles() | CCompoundXMLDocument |
upcount() | CRefCount | [inline]
XMLDone(CXMLDocument *pDoc) | CCompoundXMLDocument | [virtual]
~CCompoundXMLDocument() | CCompoundXMLDocument | [virtual]
~CRefCount() | CRefCount | [inline, virtual]
~CXMLDocument() | CXMLDocument | [virtual]
Generated on Wed May 8 12:39:33 2002 for Solitaire Pack by doxygen 1.2.15


CCPSounds Class Reference

#include <bmws_cpsounds.h>

List of all members.

Public Methods

CCPSounds (UINT uidBase, UINT uidDisplay, CUINTArray &auidSounds, CUINTArray &auidDisplays, CTSTR &lpszDefPath, CTSTRArray *palpszDefs=NULL, BOOL bRegister=TRUE)
void | Save ()
void | Play (UINT uIndex)
void | FillPropPage (LPPROPSHEETPAGE lppsp)
void | CleanupPropPage (LPPROPSHEETPAGE lppsp)

Protected Attributes

CTSTR m_lpszDefPath
CTSTR m_lpszBase
CUINTArray m_auidSounds
CTSTRArray m_alpszSoundFiles
CTSTRArray m_alpszDisplays

Friends

class | CCPSoundsDlg

Constructor & Destructor Documentation

CCPSounds | ( | UINT | uidBase,
 |  | UINT | uidDisplay,
 |  | CUINTArray & | auidSounds,
 |  | CUINTArray & | auidDisplays,
 |  | CTSTR & | lpszDefPath,
 |  | CTSTRArray * | palpszDefs = NULL,
 |  | BOOL | bRegister = TRUE
 | ) |

Definition at line 683 of file bmws_cpsounds.cpp.

References ARRAYSIZE, CTSTR::Assign(), CArray< UINT, UINT >::Copy(), g_hInst, CArray< CTSTR, CTSTR & >::GetAt(), GetRegStringValue(), CArray< UINT, UINT >::GetSize(), IDS_BMWS_CPSOUNDS_APPEVENTS, IDS_BMWS_CPSOUNDS_CURRENT, IDS_BMWS_CPSOUNDS_EVENTLABELS, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, m_alpszDisplays, m_alpszSoundFiles, m_auidSounds, m_lpszBase, m_lpszDefPath, CArray< CTSTR, CTSTR & >::SetAt(), SetRegStringValue(), and CArray< CTSTR, CTSTR & >::SetSize().

00686 {
00687    m_lpszDefPath.Assign(lpszDefPath);
00688    m_lpszBase.Assign(uidBase);
00689    CTSTR lpszDisplay(uidDisplay);
00690
00691    m_auidSounds.Copy(auidSounds);
00692
00693    int cSounds = auidSounds.GetSize();
00694    m_alpszDisplays.SetSize(cSounds);
00695    m_alpszSoundFiles.SetSize(cSounds);
00696
00697    int iLenBase = lstrlen(m_lpszBase);
00698    BOOL bFailed = FALSE;
00699    LONG lResult;
00700    DWORD dwDisp;
00701    TCHAR szAppEvents[64];
00702    TCHAR szSchemesApps[64];
00703    TCHAR szEventLabels[64];
00704    TCHAR szCurrent[64];
00705    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_APPEVENTS, szAppEvents, ARRAYSIZE(szAppEvents));
00706    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, szSchemesApps, ARRAYSIZE(szSchemesApps));
00707    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_EVENTLABELS, szEventLabels, ARRAYSIZE(szEventLabels));
00708    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_CURRENT, szCurrent, ARRAYSIZE(szCurrent));
00709
00710    CKey hKeyAppEvents;
00711
00712    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, szAppEvents, 0, NULL, REG_OPTION_NON_VOLATILE,
00713       KEY_READ, NULL, &hKeyAppEvents, &dwDisp);
00714    if(lResult == NOERROR)
00715    {
00716       // Initialize application label
00717       CKey hKeyApps;
00718       lResult = RegCreateKeyEx(hKeyAppEvents, szSchemesApps, 0, NULL, REG_OPTION_NON_VOLATILE,
00719             KEY_READ, NULL, &hKeyApps, &dwDisp);
00720       if(lResult == NOERROR)
00721       {
00722          CKey hKeyEventsTitle;
00723          if(bRegister)
00724          {
00725             lResult = RegCreateKeyEx(hKeyApps, m_lpszBase, 0, NULL, REG_OPTION_NON_VOLATILE,
00726                   KEY_READ, NULL, &hKeyEventsTitle, &dwDisp);
00727             if(lResult == NOERROR)
00728             {
00729                SetRegStringValue(hKeyEventsTitle, (UINT)-1, lpszDisplay);
00730
00731                // Read in individual sounds
00732                for(int i = 0; i < cSounds; i++)
00733                {
00734                   CTSTR lpszIndiv(auidSounds[i]);
00735                   CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00736
00737                   lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00738                   lstrcat(lpszCombo, lpszIndiv);
00739
00740                   CKey hKeyInd;
00741                   lResult = RegCreateKeyEx(hKeyEventsTitle, lpszCombo, 0, NULL,
00742                      REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00743                   if(lResult == NOERROR)
00744                   {
00745                      CKey hKeyCurrent;
00746                      lResult = RegCreateKeyEx(hKeyInd, szCurrent, 0, NULL, REG_OPTION_NON_VOLATILE,
00747                            KEY_READ, NULL, &hKeyCurrent, &dwDisp);
00748                      if(lResult == NOERROR)
00749                      {
00750                         CTSTR lpszTempValue = GetRegStringValue(hKeyCurrent, (UINT)-1);
00751                         if((!lpszTempValue || lstrlen(lpszTempValue) == 0) && palpszDefs)
00752                         {
00753                            lpszTempValue.Assign(palpszDefs->GetAt(i));
00754                         }
00755                         m_alpszSoundFiles.SetAt(i, lpszTempValue);
00756                      }
00757                   }
00758                }
00759             }
00760          } else
00761          {
00762             SHDeleteKey(hKeyApps, m_lpszBase);
00763          }
00764       }
00765
00766       // Initialize individual labels
00767       CKey hKeyLabels;
00768       lResult = RegCreateKeyEx(hKeyAppEvents, szEventLabels, 0, NULL, REG_OPTION_NON_VOLATILE,
00769             KEY_READ, NULL, &hKeyLabels, &dwDisp);
00770       if(lResult == NOERROR)
00771       {
00772          for(int i = 0; i < cSounds; i++)
00773          {
00774             CTSTR lpszIndiv(auidSounds[i]);
00775             CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00776
00777             lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00778             lstrcat(lpszCombo, lpszIndiv);
00779
00780             if(bRegister)
00781             {
00782                CKey hKeyInd;
00783                lResult = RegCreateKeyEx(hKeyLabels, lpszCombo, 0, NULL,
00784                   REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00785                if(lResult == NOERROR)
00786                {
00787                   m_alpszDisplays.SetAt(i, CTSTR(auidDisplays[i]));
00788                   SetRegStringValue(hKeyInd, (UINT)-1, m_alpszDisplays[i]);
00789                }
00790             } else
00791             {
00792                SHDeleteKey(hKeyLabels, lpszCombo);
00793             }
00794          }
00795
00796       }
00797    }
00798 }

Member Function Documentation

void CleanupPropPage ( LPPROPSHEETPAGE lppsp )

Definition at line 927 of file bmws_cpsounds.cpp.

Referenced by CUserPrefs::DoOptions().

00928 {
00929    if(lppsp->lParam)
00930       delete ((CCPSoundsDlg*)lppsp->lParam);
00931 }

void FillPropPage ( LPPROPSHEETPAGE lppsp )

Definition at line 902 of file bmws_cpsounds.cpp.

References CCPSoundsDlg, CCPSoundsDlg::CPSoundsProc(), ENSUREALLOC, g_hInstLC, and IDD_BMWS_CPSOUNDSDLG.

Referenced by CUserPrefs::DoOptions().

00903 {
00904    CCPSoundsDlg *pDlg = new CCPSoundsDlg(this);
00905    ENSUREALLOC(pDlg);
00906    lppsp->dwSize = sizeof(PROPSHEETPAGE);
00907    lppsp->dwFlags = 0;
00908    lppsp->hInstance = g_hInstLC;
00909    lppsp->pszTemplate = MAKEINTRESOURCE(IDD_BMWS_CPSOUNDSDLG);
00910    lppsp->pfnDlgProc = pDlg->CPSoundsProc;
00911    lppsp->lParam = (LPARAM)pDlg;
00912 }

void Play ( UINT uIndex )

Definition at line 883 of file bmws_cpsounds.cpp.

References CArray< CTSTR, CTSTR & >::GetSize(), and m_alpszSoundFiles.

Referenced by CMainWindow::PlayCPSound().

00884 {
00885    if(uIndex > (UINT)m_alpszSoundFiles.GetSize())
00886       return;
00887    PlaySound(m_alpszSoundFiles[uIndex], NULL, SND_FILENAME | SND_ASYNC | SND_NODEFAULT);
00888 }

void Save ( )

Definition at line 811 of file bmws_cpsounds.cpp.

References ARRAYSIZE, g_hInst, CArray< UINT, UINT >::GetSize(), IDS_BMWS_CPSOUNDS_APPEVENTS, IDS_BMWS_CPSOUNDS_CURRENT, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, m_alpszSoundFiles, m_auidSounds, m_lpszBase, and SetRegStringValue().

Referenced by CCPSoundsDlg::CPSoundsProc(), and CSolpackApp::Register().

00812 {
00813    int cSounds = m_auidSounds.GetSize();
00814
00815    int iLenBase = lstrlen(m_lpszBase);
00816    BOOL bFailed = FALSE;
00817
00818    LONG lResult;
00819    DWORD dwDisp;
00820    TCHAR szAppEvents[64];
00821    TCHAR szSchemesApps[64];
00822    TCHAR szCurrent[64];
00823    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_APPEVENTS, szAppEvents, ARRAYSIZE(szAppEvents));
00824    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_SCHEMESAPPS, szSchemesApps, ARRAYSIZE(szSchemesApps));
00825    LoadString(g_hInst, IDS_BMWS_CPSOUNDS_CURRENT, szCurrent, ARRAYSIZE(szCurrent));
00826
00827    CKey hKeyAppEvents;
00828
00829    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, szAppEvents, 0, NULL, REG_OPTION_NON_VOLATILE,
00830       KEY_READ, NULL, &hKeyAppEvents, &dwDisp);
00831    if(lResult == NOERROR)
00832    {
00833       CKey hKeyApps;
00834       lResult = RegCreateKeyEx(hKeyAppEvents, szSchemesApps, 0, NULL, REG_OPTION_NON_VOLATILE,
00835             KEY_READ, NULL, &hKeyApps, &dwDisp);
00836       if(lResult == NOERROR)
00837       {
00838          CKey hKeyEventsTitle;
00839          lResult = RegCreateKeyEx(hKeyApps, m_lpszBase, 0, NULL, REG_OPTION_NON_VOLATILE,
00840                KEY_READ, NULL, &hKeyEventsTitle, &dwDisp);
00841          if(lResult == NOERROR)
00842          {
00843             for(int i = 0; i < cSounds; i++)
00844             {
00845                CTSTR lpszIndiv(m_auidSounds[i]);
00846                CTSTR lpszCombo(TRUE, lstrlen(lpszIndiv) + iLenBase + 1);
00847
00848                lstrcpyn(lpszCombo, m_lpszBase, iLenBase+1);
00849                lstrcat(lpszCombo, lpszIndiv);
00850
00851                CKey hKeyInd;
00852                lResult = RegCreateKeyEx(hKeyEventsTitle, lpszCombo, 0, NULL,
00853                   REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKeyInd, &dwDisp);
00854                if(lResult == NOERROR)
00855                {
00856                   CKey hKeyCurrent;
00857                   lResult = RegCreateKeyEx(hKeyInd, szCurrent, 0, NULL, REG_OPTION_NON_VOLATILE,
00858                         KEY_READ, NULL, &hKeyCurrent, &dwDisp);
00859                   if(lResult == NOERROR)
00860                   {
00861                      SetRegStringValue(hKeyCurrent, (UINT)-1, m_alpszSoundFiles[i]);
00862                   }
00863                }
00864             }
00865
00866          }
00867       }
00868    }
00869 }

Friends And Related Function Documentation

friend class CCPSoundsDlg [friend]

Definition at line 33 of file bmws_cpsounds.h.

Referenced by FillPropPage().

Member Data Documentation

CTSTRArray m_alpszDisplays [protected]

Definition at line 49 of file bmws_cpsounds.h.

Referenced by CCPSounds(), and CCPSoundsDlg::CPSoundsProc().

CTSTRArray m_alpszSoundFiles [protected]

Definition at line 48 of file bmws_cpsounds.h.

Referenced by CCPSounds(), CCPSoundsDlg::CPSoundsProc(), Play(), and Save().

CUINTArray m_auidSounds [protected]

Definition at line 47 of file bmws_cpsounds.h.

Referenced by CCPSounds(), and Save().

CTSTR m_lpszBase [protected]

Definition at line 46 of file bmws_cpsounds.h.

Referenced by CCPSounds(), and Save().

CTSTR m_lpszDefPath [protected]

Definition at line 45 of file bmws_cpsounds.h.

Referenced by CCPSounds(), and CCPSoundsDlg::CPSoundsProc().

The documentation for this class was generated from the following files:
  • bmws_cpsounds.h
  • bmws_cpsounds.cpp
Generated on Wed May 8 12:39:33 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCPSounds Member List

This is the complete list of members for CCPSounds, including all inherited members.
CCPSounds(UINT uidBase, UINT uidDisplay, CUINTArray &auidSounds, CUINTArray &auidDisplays, CTSTR &lpszDefPath, CTSTRArray *palpszDefs=NULL, BOOL bRegister=TRUE) | CCPSounds |
CCPSoundsDlg class | CCPSounds | [friend]
CleanupPropPage(LPPROPSHEETPAGE lppsp) | CCPSounds |
FillPropPage(LPPROPSHEETPAGE lppsp) | CCPSounds |
m_alpszDisplays | CCPSounds | [protected]
m_alpszSoundFiles | CCPSounds | [protected]
m_auidSounds | CCPSounds | [protected]
m_lpszBase | CCPSounds | [protected]
m_lpszDefPath | CCPSounds | [protected]
Play(UINT uIndex) | CCPSounds |
Save() | CCPSounds |
Generated on Wed May 8 12:39:33 2002 for Solitaire Pack by doxygen 1.2.15


CCPSoundsDlg Class Reference

List of all members.

Public Methods

CCPSoundsDlg (CCPSounds *m_pCPSounds)
virtual | ~CCPSoundsDlg ()

Static Public Methods

INT_PTR CALLBACK | CPSoundsProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Methods

void | FillDropDown (HWND hwndDD)
void | AddFile (HWND hwndDD, LPTSTR lpszFileName, UINT uCount)
void | SetSound (UINT uIndex)
void | OnTreeIndex (int iIndex)
BOOL | IsCBValid (CTSTR &lpszPath)

Protected Attributes

CCPSounds * m_pCPSounds
CTSTRArray m_alpszTempFiles
CTSTRArray m_alpszDDFiles
CTSTR m_lpszPopupFile
CTSTR m_lpszCBTemp
CTSTR m_lpszCurFolder
int | m_iSelected
MCIDEVICEID | m_mciDevID
HBITMAP | m_hbmPlay
HBITMAP | m_hbmStop
BOOL | m_bReenable
HWND | m_hDlg
BOOL | m_bValidated
BOOL | m_bEditChanged

Friends

class | CCPSounds

Constructor & Destructor Documentation

CCPSoundsDlg ( CCPSounds * m_pCPSounds )

Definition at line 111 of file bmws_cpsounds.cpp.

References CTSTR::Assign(), g_hInstLC, IDB_BMWS_CPSOUNDS_PLAY, IDB_BMWS_CPSOUNDS_STOP, IDS_BMWS_CPSOUNDS_POPUPFILE, m_hbmPlay, m_hbmStop, m_iSelected, m_lpszPopupFile, and m_pCPSounds.

00112 {
00113    m_lpszPopupFile.Assign(IDS_BMWS_CPSOUNDS_POPUPFILE);
00114    m_pCPSounds = pCPSounds;
00115    m_hbmPlay = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_BMWS_CPSOUNDS_PLAY),
00116       IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
00117    m_hbmStop = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_BMWS_CPSOUNDS_STOP),
00118       IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
00119
00120    m_iSelected = -1;
00121 }

~CCPSoundsDlg ( ) [virtual]

Definition at line 129 of file bmws_cpsounds.cpp.

References m_hbmPlay, and m_hbmStop.

00130 {
00131    DeleteObject(m_hbmPlay);
00132    DeleteObject(m_hbmStop);
00133 }

Member Function Documentation

void AddFile | ( | HWND | hwndDD,
 |  | LPTSTR | lpszFileName,
 |  | UINT | uCount
 | ) | [protected]

Definition at line 490 of file bmws_cpsounds.cpp.

References CArray< CTSTR, CTSTR & >::Add(), m_alpszDDFiles, and m_lpszCurFolder.

Referenced by FillDropDown().

00491 {
00492    CTSTR lpszTotal(TRUE, lstrlen(m_lpszCurFolder) + lstrlen(lpszFileName) + 4);
00493    wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszFileName);
00494    m_alpszDDFiles.Add(lpszTotal);
00495    SHFILEINFO shfi;
00496    if(SHGetFileInfo(lpszTotal, 0, &shfi, sizeof(shfi), SHGFI_DISPLAYNAME))
00497    {
00498       int iLBIndex = SendMessage(hwndDD, CB_ADDSTRING, 0, (LPARAM)shfi.szDisplayName);
00499       SendMessage(hwndDD, CB_SETITEMDATA, iLBIndex, (LPARAM)uIndex);
00500    }
00501 }

INT_PTR CALLBACK CPSoundsProc | ( | HWND | hwndDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 151 of file bmws_cpsounds.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), CArray< CTSTR, CTSTR & >::Copy(), CHelpMgr::DialogCSHelp(), FillDropDown(), g_hInst, g_szAppTitle, CArray< CTSTR, CTSTR & >::GetSize(), IDC_BMWS_CPSOUNDS_BROWSE, IDC_BMWS_CPSOUNDS_DETAILS, IDC_BMWS_CPSOUNDS_FILENAME, IDC_BMWS_CPSOUNDS_PLAY, IDC_BMWS_CPSOUNDS_STOP, IDC_BMWS_CPSOUNDS_TREE, IDI_BMWS_CPSOUNDS_ICON, IDI_BMWS_CPSOUNDS_NULLICON, IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER, IDS_BMWS_CPSOUNDS_FILTER, IsCBValid(), CCPSounds::m_alpszDisplays, CCPSounds::m_alpszSoundFiles, m_alpszTempFiles, m_bEditChanged, m_bReenable, m_bValidated, m_hbmPlay, m_hbmStop, m_hDlg, m_iSelected, m_lpszCurFolder, CCPSounds::m_lpszDefPath, m_lpszPopupFile, m_mciDevID, m_pCPSounds, OnTreeIndex(), CCPSounds::Save(), SetSound(), and SingleOFN().

Referenced by CCPSounds::FillPropPage().

00153 {
00154    CCPSoundsDlg *pThis = (CCPSoundsDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00155
00156    switch(uMsg)
00157    {
00158       case WM_INITDIALOG:
00159       {
00160          pThis = (CCPSoundsDlg*)((LPPROPSHEETPAGE)lParam)->lParam;
00161          SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00162          pThis->m_hDlg = hwndDlg;
00163
00164          pThis->m_bReenable = TRUE;
00165          pThis->m_alpszTempFiles.Copy(pThis->m_pCPSounds->m_alpszSoundFiles);
00166 /*
00167          {
00168             CKey hKey;
00169             DWORD dwDisp;
00170             LONG lResult = RegCreateKeyEx(HKEY_LOCAL_MACHINE,
00171                CTSTR(IDS_BMWS_CPSOUNDS_REG_WIN), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ,
00172                NULL, &hKey, &dwDisp);
00173             if(lResult == NOERROR)
00174             {
00175                pThis-.
00176                //pThis->m_lpszCurFolder.Assign(GetRegStringValue(hKey,
00177                // IDS_BMWS_CPSOUNDS_REG_MEDIAPATH));
00178             }
00179          }*/
00180          pThis->m_lpszCurFolder.Assign(pThis->m_pCPSounds->m_lpszDefPath);
00181
00182          pThis->FillDropDown(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME));
00183
00184          SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY, BM_SETIMAGE, IMAGE_BITMAP,
00185             (LPARAM)pThis->m_hbmPlay);
00186          SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_STOP, BM_SETIMAGE, IMAGE_BITMAP,
00187             (LPARAM)pThis->m_hbmStop);
00188
00189          HIMAGELIST himl = ImageList_Create(16, 16, ILC_MASK, 2, 0);
00190
00191          if(himl)
00192          {
00193             HICON hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BMWS_CPSOUNDS_ICON),
00194                IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
00195             ImageList_AddIcon(himl, hIcon);
00196             DestroyIcon(hIcon);
00197             hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BMWS_CPSOUNDS_NULLICON),
00198                IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
00199             ImageList_AddIcon(himl, hIcon);
00200             DestroyIcon(hIcon);
00201             SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_SETIMAGELIST, TVSIL_NORMAL,
00202                (LPARAM)himl);
00203          }
00204
00205          TVITEM tvi;
00206          TVINSERTSTRUCT tvins;
00207
00208          tvins.hParent = NULL;
00209          tvins.hInsertAfter = TVI_LAST;
00210
00211          UINT cSounds = pThis->m_alpszTempFiles.GetSize();
00212
00213          for(UINT i = 0; i < cSounds; i++)
00214          {
00215             tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
00216             tvi.pszText = pThis->m_pCPSounds->m_alpszDisplays[i];
00217             tvi.cchTextMax = lstrlen(tvi.pszText);
00218             tvi.iImage = ((pThis->m_alpszTempFiles[i] && lstrlen(pThis->m_alpszTempFiles[i]) > 0)
00219                ? 0 : 1);
00220             tvi.iSelectedImage = tvi.iImage;
00221             tvi.lParam = i;
00222
00223             tvins.item = tvi;
00224
00225             SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_INSERTITEM, 0,
00226                (LPARAM)(LPTVINSERTSTRUCT) &tvins);
00227          }
00228          pThis->m_bEditChanged = FALSE;
00229          pThis->m_bValidated = FALSE;
00230
00231          EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00232       } return TRUE;
00233
00234       case MM_MCINOTIFY:
00235          if(wParam == MCI_NOTIFY_SUCCESSFUL)
00236          {
00237             mciSendCommand(lParam, MCI_CLOSE, MCI_WAIT, NULL);
00238             EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00239             if(pThis->m_bReenable && (GetFocus() == GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP)))
00240                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY));
00241             EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00242          }
00243          break;
00244
00245       case WM_COMMAND:
00246          switch(LOWORD(wParam))
00247          {
00248             case IDC_BMWS_CPSOUNDS_PLAY:
00249             {
00250                MCI_OPEN_PARMS mciOpenParms;
00251                MCI_PLAY_PARMS mciPlayParms;
00252                DWORD dwErr;
00253
00254                // Open the device by specifying the device and filename.
00255                // MCI will choose a device capable of playing the specified file.
00256                mciOpenParms.lpstrDeviceType = TEXT("waveaudio");
00257                mciOpenParms.lpstrElementName = pThis->m_alpszTempFiles[pThis->m_iSelected];
00258                if(dwErr = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,
00259                   (DWORD)(LPVOID)&mciOpenParms))
00260                {
00261                   TCHAR szErr[MAXERRORLENGTH];
00262                   if(mciGetErrorString(dwErr, szErr, MAXERRORLENGTH))
00263                      MessageBox(hwndDlg, szErr, g_szAppTitle, MB_OK | MB_ICONHAND);
00264                   return FALSE;
00265                }
00266
00267                // The device opened successfully; get the device ID.
00268                pThis->m_mciDevID = mciOpenParms.wDeviceID;
00269
00270                // Begin playback. The MM_MCINOTIFY message will be sent when
00271                // playback is complete. At this time, the window procedure closes
00272                // the device.
00273                mciPlayParms.dwCallback = (DWORD)hwndDlg;
00274                if(dwErr = mciSendCommand(pThis->m_mciDevID, MCI_PLAY, MCI_NOTIFY,
00275                   (DWORD)(LPVOID)&mciPlayParms))
00276                {
00277                   TCHAR szErr[MAXERRORLENGTH];
00278                   if(mciGetErrorString(dwErr, szErr, MAXERRORLENGTH))
00279                      MessageBox(hwndDlg, szErr, g_szAppTitle, MB_OK | MB_ICONHAND);
00280                   mciSendCommand(pThis->m_mciDevID, MCI_CLOSE, 0, NULL);
00281                   return FALSE;
00282                }
00283
00284                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00285                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), TRUE);
00286                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP));
00287             } break;
00288
00289             case IDC_BMWS_CPSOUNDS_STOP:
00290                mciSendCommand(pThis->m_mciDevID, MCI_STOP, 0, NULL);
00291                mciSendCommand(pThis->m_mciDevID, MCI_CLOSE, 0, NULL);
00292                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_STOP), FALSE);
00293                EnableWindow(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00294                SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_PLAY));
00295                break;
00296
00297             case IDC_BMWS_CPSOUNDS_BROWSE:
00298             {
00299                CTSTR lpszTempSound;
00300                CTSTR lpszTitleHolder(IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER);
00301                CTSTR lpszTitle(TRUE,
00302                   lstrlen(pThis->m_pCPSounds->m_alpszDisplays[pThis->m_iSelected]) +
00303                   lstrlen(lpszTitleHolder) + 1);
00304                wsprintf(lpszTitle, lpszTitleHolder,
00305                   pThis->m_pCPSounds->m_alpszDisplays[pThis->m_iSelected]);
00306                if(SingleOFN(lpszTempSound, IDS_BMWS_CPSOUNDS_FILTER, NULL, hwndDlg,
00307                   OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, lpszTitle, pThis->m_lpszCurFolder,
00308                   (UINT)-1) == 1)
00309                {
00310                   pThis->m_alpszTempFiles[pThis->m_iSelected].Assign(lpszTempSound);
00311                   CTSTR lpszNewPath(pThis->m_alpszTempFiles[pThis->m_iSelected]);
00312                   PathRemoveFileSpec(lpszNewPath);
00313                   if(lstrcmpi(lpszNewPath, pThis->m_lpszCurFolder) != 0)
00314                   {
00315                      pThis->m_lpszCurFolder.Assign(lpszNewPath);
00316                      pThis->FillDropDown(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME));
00317                   }
00318                   SHFILEINFO shfi;
00319                   if(SHGetFileInfo(pThis->m_alpszTempFiles[pThis->m_iSelected], 0, &shfi,
00320                      sizeof(shfi), SHGFI_DISPLAYNAME))
00321                   {
00322                      SetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, shfi.szDisplayName);
00323                      EnableWindow(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00324                      EnableWindow(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00325                      HTREEITEM hti = TreeView_GetSelection(GetDlgItem(pThis->m_hDlg,
00326                         IDC_BMWS_CPSOUNDS_TREE));
00327                      TVITEM tvi;
00328                      tvi.hItem = hti;
00329                      tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00330
00331                      tvi.iImage = 0;
00332                      tvi.iSelectedImage = tvi.iImage;
00333
00334                      TreeView_SetItem(GetDlgItem(pThis->m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00335                      ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00336                   }
00337                }
00338             } break;
00339
00340             case IDC_BMWS_CPSOUNDS_DETAILS:
00341             {
00342                SHELLEXECUTEINFO sei;
00343                ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
00344                sei.cbSize = sizeof(SHELLEXECUTEINFO);
00345                sei.hwnd = hwndDlg;
00346                sei.lpFile = pThis->m_alpszTempFiles[pThis->m_iSelected];
00347                sei.lpVerb = TEXT("properties");
00348                sei.fMask = SEE_MASK_INVOKEIDLIST;
00349                BOOL b = ShellExecuteEx(&sei);
00350             } break;
00351
00352             case IDC_BMWS_CPSOUNDS_FILENAME:
00353                switch(HIWORD(wParam))
00354                {
00355                   case CBN_SELCHANGE:
00356                      pThis->SetSound(SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME,
00357                         CB_GETCURSEL, 0, 0));
00358                      ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00359                      pThis->m_bEditChanged = FALSE;
00360                      break;
00361
00362                   case CBN_EDITCHANGE:
00363                      pThis->m_bValidated = FALSE;
00364                      pThis->m_bEditChanged = TRUE;
00365                      break;
00366
00367                   case CBN_KILLFOCUS:
00368                      if(!pThis->m_bValidated)
00369                      {
00370                         CTSTR lpszTempSound;
00371                         int iLen = GetWindowTextLength(GetDlgItem(hwndDlg,
00372                            IDC_BMWS_CPSOUNDS_FILENAME)) + 8;
00373                         lpszTempSound.Alloc(iLen);
00374                         GetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound,
00375                            iLen);
00376                         if(!pThis->IsCBValid(lpszTempSound))
00377                         {
00378                            SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_TREE));
00379                            pThis->OnTreeIndex(-1);
00380                         }
00381                      }
00382                      break;
00383                }
00384                break;
00385
00386          }
00387          break;
00388
00389       case WM_NOTIFY:
00390          switch(((LPNMHDR)lParam)->code)
00391          {
00392             case TVN_SELCHANGED:
00393                pThis->OnTreeIndex((int)((LPNMTREEVIEW)lParam)->itemNew.lParam);
00394                break;
00395
00396             case PSN_KILLACTIVE:
00397             {
00398                CTSTR lpszTempSound;
00399                int iLen = GetWindowTextLength(GetDlgItem(hwndDlg,
00400                   IDC_BMWS_CPSOUNDS_FILENAME)) + 8;
00401                lpszTempSound.Alloc(iLen);
00402                GetDlgItemText(hwndDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound,
00403                   iLen);
00404                if(!pThis->IsCBValid(lpszTempSound))
00405                {
00406                   SetFocus(GetDlgItem(hwndDlg, IDC_BMWS_CPSOUNDS_TREE));
00407                   pThis->OnTreeIndex(-1);
00408                   SetWindowLong(hwndDlg, DWL_MSGRESULT, TRUE);
00409                } else
00410                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00411             } break;
00412
00413             case PSN_APPLY:
00414                pThis->m_pCPSounds->m_alpszSoundFiles.Copy(pThis->m_alpszTempFiles);
00415                pThis->m_pCPSounds->Save();
00416                break;
00417          }
00418          return TRUE;
00419
00420       case WM_DESTROY:
00421          mciSendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, NULL);
00422          ImageList_Destroy((HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_BMWS_CPSOUNDS_TREE, TVM_GETIMAGELIST,
00423             TVSIL_NORMAL, 0));
00424          break;
00425
00426 #ifdef BMWS_CONTEXTHELP
00427       case WM_HELP:
00428       case WM_CONTEXTMENU:
00429          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, pThis->m_lpszPopupFile,
00430             pThis->s_adwPopupHelp);
00431          break;
00432 #endif
00433    }
00434
00435    return FALSE;
00436 }

void FillDropDown ( HWND hwndDD ) [protected]

Definition at line 450 of file bmws_cpsounds.cpp.

References AddFile(), IDS_BMWS_CPSOUNDS_NONE, IDS_BMWS_CPSOUNDS_WAVWILDCARD, m_alpszDDFiles, m_lpszCurFolder, CArray< CTSTR, CTSTR & >::RemoveAll(), and CArray< CTSTR, CTSTR & >::SetSize().

Referenced by CPSoundsProc().

00451 {
00452    m_alpszDDFiles.RemoveAll();
00453    m_alpszDDFiles.SetSize(1);
00454    SendMessage(hwndDD, CB_RESETCONTENT, 0, 0);
00455    SendMessage(hwndDD, CB_ADDSTRING, 0, (LPARAM)(LPTSTR)CTSTR(IDS_BMWS_CPSOUNDS_NONE));
00456    CTSTR lpszWavWildcard(IDS_BMWS_CPSOUNDS_WAVWILDCARD);
00457    CTSTR lpszTotal(TRUE, lstrlen(m_lpszCurFolder) + lstrlen(lpszWavWildcard) + 4);
00458    wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszWavWildcard);
00459    WIN32_FIND_DATA wfd;
00460    ZeroMemory(&wfd, sizeof(wfd));
00461    HANDLE hFind = FindFirstFile(lpszTotal, &wfd);
00462    if(hFind != INVALID_HANDLE_VALUE)
00463    {
00464       UINT uCount = 1;
00465       AddFile(hwndDD, wfd.cFileName, uCount);
00466       while(FindNextFile(hFind, &wfd))
00467       {
00468          uCount++;
00469          AddFile(hwndDD, wfd.cFileName, uCount);
00470       }
00471       FindClose(hFind);
00472    }
00473 }

BOOL IsCBValid ( CTSTR & lpszPath ) [protected]

Definition at line 632 of file bmws_cpsounds.cpp.

References g_szAppTitle, IDC_BMWS_CPSOUNDS_FILENAME, IDS_BMWS_CPSOUNDS_INVALIDFILE, IDS_BMWS_CPSOUNDS_WAVEXT, m_alpszTempFiles, m_bEditChanged, m_bValidated, m_hDlg, m_iSelected, m_lpszCurFolder, and CArray< CTSTR, CTSTR & >::SetAt().

Referenced by CPSoundsProc(), and OnTreeIndex().

00633 {
00634    m_bValidated = TRUE;
00635    if(SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, CB_GETCURSEL, 0, 0) == 0)
00636       return TRUE;
00637    CTSTR lpszTempSound(TRUE, lstrlen(lpszPath) + 8);
00638    lstrcpy(lpszTempSound, lpszPath);
00639    PathAddExtension(lpszTempSound, CTSTR(IDS_BMWS_CPSOUNDS_WAVEXT));
00640    CTSTR lpszTotal(TRUE, lstrlen(lpszTempSound) + lstrlen(m_lpszCurFolder) + 8);
00641    if(PathIsRelative(lpszTempSound))
00642    {
00643       wsprintf(lpszTotal, TEXT("%s\\%s"), m_lpszCurFolder, lpszTempSound);
00644    } else
00645    {
00646       lstrcpy(lpszTotal, lpszTempSound);
00647    }
00648    CTSTR lpszTotalC(TRUE, MAX_PATH);
00649    PathCanonicalize(lpszTotalC, lpszTotal);
00650    if(!PathFileExists(lpszTotalC))
00651    {
00652       MessageBox(m_hDlg, CTSTR(IDS_BMWS_CPSOUNDS_INVALIDFILE), g_szAppTitle, MB_OK |
00653          MB_ICONHAND);
00654       return FALSE;
00655    }
00656    if(m_bEditChanged)
00657    {
00658       ::SendMessage(GetParent(m_hDlg), PSM_CHANGED, (WPARAM)m_hDlg, 0);
00659       m_bEditChanged = FALSE;
00660    }
00661    m_alpszTempFiles.SetAt(m_iSelected, lpszTotalC);
00662    return TRUE;
00663 }

void OnTreeIndex ( int iIndex ) [protected]

Definition at line 576 of file bmws_cpsounds.cpp.

References IDC_BMWS_CPSOUNDS_DETAILS, IDC_BMWS_CPSOUNDS_FILENAME, IDC_BMWS_CPSOUNDS_PLAY, IsCBValid(), m_alpszTempFiles, m_bReenable, m_hDlg, m_iSelected, and m_lpszCurFolder.

Referenced by CPSoundsProc().

00577 {
00578    if(iIndex != -1)
00579    {
00580       int iLen = GetWindowTextLength(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME)) + 1;
00581       if(iLen > 1)
00582       {
00583          CTSTR lpszTempSound(TRUE, iLen);
00584          GetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszTempSound, iLen);
00585          IsCBValid(lpszTempSound);
00586       }
00587       m_iSelected = iIndex;
00588    }
00589    if(!m_alpszTempFiles[m_iSelected] || lstrlen(m_alpszTempFiles[m_iSelected]) == 0)
00590    {
00591       SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, CB_SETCURSEL, 0, 0);
00592       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), FALSE);
00593       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00594       m_bReenable = FALSE;
00595    } else
00596    {
00597       CTSTR lpszNewPath(m_alpszTempFiles[m_iSelected]);
00598       PathRemoveFileSpec(lpszNewPath);
00599       SHFILEINFO shfi;
00600       if(SHGetFileInfo(m_alpszTempFiles[m_iSelected], 0, &shfi, sizeof(shfi),
00601          SHGFI_DISPLAYNAME))
00602       {
00603          if(lstrcmpi(lpszNewPath, m_lpszCurFolder) == 0)
00604          {
00605             SetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, shfi.szDisplayName);
00606          } else
00607          {
00608             CTSTR lpszNewTotal(TRUE, MAX_PATH);
00609             wsprintf(lpszNewTotal, TEXT("%s\\%s"), lpszNewPath, shfi.szDisplayName);
00610             SetDlgItemText(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME, lpszNewTotal);
00611          }
00612       }
00613       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00614       EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00615       m_bReenable = TRUE;
00616    }
00617 }

void SetSound ( UINT uIndex ) [protected]

Definition at line 516 of file bmws_cpsounds.cpp.

References IDC_BMWS_CPSOUNDS_DETAILS, IDC_BMWS_CPSOUNDS_FILENAME, IDC_BMWS_CPSOUNDS_PLAY, IDC_BMWS_CPSOUNDS_TREE, m_alpszDDFiles, m_alpszTempFiles, m_hDlg, m_iSelected, and CArray< CTSTR, CTSTR & >::SetAt().

Referenced by CPSoundsProc().

00517 {
00518    if(uIndex == (UINT)-1)
00519       return;
00520    if(uIndex == 0)
00521    {
00522       if(m_alpszTempFiles[m_iSelected])
00523       {
00524          m_alpszTempFiles.SetAt(m_iSelected, CTSTR());
00525
00526          HTREEITEM hti = TreeView_GetSelection(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE));
00527          TVITEM tvi;
00528          tvi.hItem = hti;
00529          tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00530
00531          tvi.iImage = 1;
00532          tvi.iSelectedImage = tvi.iImage;
00533
00534          TreeView_SetItem(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00535
00536          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), FALSE);
00537          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), FALSE);
00538       }
00539    } else
00540    {
00541       UINT uDDIndex = (UINT)SendDlgItemMessage(m_hDlg, IDC_BMWS_CPSOUNDS_FILENAME,
00542          CB_GETITEMDATA, uIndex, 0);
00543       if(!m_alpszTempFiles[m_iSelected] || lstrlen(m_alpszTempFiles[m_iSelected]) == 0)
00544       {
00545          HTREEITEM hti = TreeView_GetSelection(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE));
00546          TVITEM tvi;
00547          tvi.hItem = hti;
00548          tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00549
00550          tvi.iImage = 0;
00551          tvi.iSelectedImage = tvi.iImage;
00552
00553          TreeView_SetItem(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_TREE), &tvi);
00554
00555          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_PLAY), TRUE);
00556          EnableWindow(GetDlgItem(m_hDlg, IDC_BMWS_CPSOUNDS_DETAILS), TRUE);
00557       }
00558       m_alpszTempFiles.SetAt(m_iSelected, m_alpszDDFiles[uDDIndex]);
00559    }
00560 }

Friends And Related Function Documentation

friend class CCPSounds [friend]

Definition at line 58 of file bmws_cpsounds.cpp.

Member Data Documentation

CTSTRArray m_alpszDDFiles [protected]

Definition at line 73 of file bmws_cpsounds.cpp.

Referenced by AddFile(), FillDropDown(), and SetSound().

CTSTRArray m_alpszTempFiles [protected]

Definition at line 72 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc(), IsCBValid(), OnTreeIndex(), and SetSound().

BOOL m_bEditChanged [protected]

Definition at line 85 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc(), and IsCBValid().

BOOL m_bReenable [protected]

Definition at line 82 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc(), and OnTreeIndex().

BOOL m_bValidated [protected]

Definition at line 84 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc(), and IsCBValid().

HBITMAP m_hbmPlay [protected]

Definition at line 80 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg(), CPSoundsProc(), and ~CCPSoundsDlg().

HBITMAP m_hbmStop [protected]

Definition at line 81 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg(), CPSoundsProc(), and ~CCPSoundsDlg().

HWND m_hDlg [protected]

Definition at line 83 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc(), IsCBValid(), OnTreeIndex(), and SetSound().

int m_iSelected [protected]

Definition at line 78 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg(), CPSoundsProc(), IsCBValid(), OnTreeIndex(), and SetSound().

CTSTR m_lpszCBTemp [protected]

Definition at line 76 of file bmws_cpsounds.cpp.

CTSTR m_lpszCurFolder [protected]

Definition at line 77 of file bmws_cpsounds.cpp.

Referenced by AddFile(), CPSoundsProc(), FillDropDown(), IsCBValid(), and OnTreeIndex().

CTSTR m_lpszPopupFile [protected]

Definition at line 75 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg(), and CPSoundsProc().

MCIDEVICEID m_mciDevID [protected]

Definition at line 79 of file bmws_cpsounds.cpp.

Referenced by CPSoundsProc().

CCPSounds* m_pCPSounds [protected]

Definition at line 71 of file bmws_cpsounds.cpp.

Referenced by CCPSoundsDlg(), and CPSoundsProc().

The documentation for this class was generated from the following file:
  • bmws_cpsounds.cpp
Generated on Wed May 8 12:39:34 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CCPSoundsDlg Member List

This is the complete list of members for CCPSoundsDlg, including all inherited members.
AddFile(HWND hwndDD, LPTSTR lpszFileName, UINT uCount) | CCPSoundsDlg | [protected]
CCPSounds class | CCPSoundsDlg | [friend]
CCPSoundsDlg(CCPSounds *m_pCPSounds) | CCPSoundsDlg |
CPSoundsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CCPSoundsDlg | [static]
FillDropDown(HWND hwndDD) | CCPSoundsDlg | [protected]
IsCBValid(CTSTR &lpszPath) | CCPSoundsDlg | [protected]
m_alpszDDFiles | CCPSoundsDlg | [protected]
m_alpszTempFiles | CCPSoundsDlg | [protected]
m_bEditChanged | CCPSoundsDlg | [protected]
m_bReenable | CCPSoundsDlg | [protected]
m_bValidated | CCPSoundsDlg | [protected]
m_hbmPlay | CCPSoundsDlg | [protected]
m_hbmStop | CCPSoundsDlg | [protected]
m_hDlg | CCPSoundsDlg | [protected]
m_iSelected | CCPSoundsDlg | [protected]
m_lpszCBTemp | CCPSoundsDlg | [protected]
m_lpszCurFolder | CCPSoundsDlg | [protected]
m_lpszPopupFile | CCPSoundsDlg | [protected]
m_mciDevID | CCPSoundsDlg | [protected]
m_pCPSounds | CCPSoundsDlg | [protected]
OnTreeIndex(int iIndex) | CCPSoundsDlg | [protected]
SetSound(UINT uIndex) | CCPSoundsDlg | [protected]
~CCPSoundsDlg() | CCPSoundsDlg | [virtual]
Generated on Wed May 8 12:39:34 2002 for Solitaire Pack by doxygen 1.2.15


CDeck Class Reference

#include <Deck.h>

Inheritance diagram for CDeck:

CPile CDispBase CEngineObj ICardPileSite IActionSite INDUnknownAndDispatch IEventHandlerSite List of all members.

Public Methods

CDeck ()
virtual | ~CDeck ()
void | InitDeck (IMsgProcessor *pMsgProcessor, IStatusBarMgr *pSBMgr, ICardSite *pCardSite)
void | ReclaimCards ()

Protected Attributes

CPtrArray< CCard *, CCard * > m_apDeckCards

Constructor & Destructor Documentation

CDeck ( )

Definition at line 26 of file Deck.cpp.

References m_apDeckCards, ODS, and CPtrArray< CCard *, CCard * >::SetRelease().

00026              : CPile(PILE_DECK)
00027 {
00028    // Signify that the contained pointers are COM interface pointers that
00029    // should be released, not deleted, when destroyed.
00030    m_apDeckCards.SetRelease(TRUE);
00031    ODS("CDeck constructor");
00032 }

~CDeck ( ) [virtual]

Definition at line 40 of file Deck.cpp.

References ODS.

00041 {
00042    ODS("CDeck destructor");
00043 }

Member Function Documentation

void InitDeck | ( | IMsgProcessor * | pMsgProcessor,
 |  | IStatusBarMgr * | pSBMgr,
 |  | ICardSite * | pCardSite
 | ) |

Definition at line 60 of file Deck.cpp.

References IMsgProcessor::EmptyMessageQueue(), ENSUREALLOC, CCard::InitCard(), CPile::m_abTransferred, CPile::m_apCards, m_apDeckCards, CEngineObj::m_pEngObjSite, CEngineObj::m_pHH, CEngineObj::m_spEl, ODS, IStatusBarMgr::SBUpdateTasks(), CPtrArray< CCard *, CCard * >::SetAt(), CCard::SetIndex(), CCard::SetPile(), CArray< BOOL, BOOL >::SetSize(), CArray< CCard *, CCard * >::SetSize(), CHTMLHelper::ShowElement(), and CPile::UpdateLayout().

Referenced by CEngine::AddDeck().

00061 {
00062    ODS("CDeck::InitDeck starting");
00063
00064    // Hide the deck pile element while creating the cards
00065    m_pHH->ShowElement(m_spEl, FALSE);
00066
00067    // Prepare arrays and progess bar
00068    m_apDeckCards.SetSize(52);
00069    m_apCards.SetSize(52);
00070    m_abTransferred.SetSize(52);
00071    pSBMgr->SBUpdateTasks(52, 0);
00072
00073    CHTMLElement2Ptr spEl2(m_spEl);
00074    for(int i = 0; i < 52; i++)
00075    {
00076       // Create and initialize cards
00077       CCard *pCard = new CCard(i+1);
00078       ENSUREALLOC(pCard);
00079       m_apDeckCards.SetAt(i, pCard);
00080       pCard->AddRef();
00081       m_apCards.SetAt(i, pCard);
00082       pCard->AddRef();
00083       pCard->InitCard(pCardSite, m_pEngObjSite, m_pHH);
00084       pCard->SetPile((ICardPileSite*)this, spEl2);
00085       pCard->SetIndex(i);
00086
00087       // Update status bar progress
00088       pSBMgr->SBUpdateTasks(0, 1);
00089
00090       // Let Windows process messages to keep program responsive
00091       pMsgProcessor->EmptyMessageQueue(FALSE);
00092    }
00093
00094    // Update pile layout and show pile element
00095    UpdateLayout();
00096    m_pHH->ShowElement(m_spEl, TRUE);
00097
00098    ODS("CDeck::InitDeck finished");
00099 }

void ReclaimCards ( )

Definition at line 113 of file Deck.cpp.

References CHECKHRCOM, CArray< CCard *, CCard * >::GetSize(), m_apDeckCards, CPile::PreReceiveCards(), and CPile::ReceiveCards().

00114 {
00115    // Move all cards from the piles they are currently in to this pile
00116    long lRealIndex = PreReceiveCards(-1, m_apDeckCards);
00117    ReceiveCards(lRealIndex, m_apDeckCards);
00118
00119    int cCards = m_apDeckCards.GetSize();
00120    for(int i = 0; i < cCards; i++)
00121    {
00122       // Set each card to be face down, undraggable
00123       CHECKHRCOM(m_apDeckCards[i]->put_CanDrag(VARIANT_FALSE));
00124       CHECKHRCOM(m_apDeckCards[i]->put_FaceUp(VARIANT_FALSE));
00125    }
00126 }

Member Data Documentation

CPtrArray<CCard*, CCard*> m_apDeckCards [protected]

Definition at line 42 of file Deck.h.

Referenced by CDeck(), InitDeck(), and ReclaimCards().

The documentation for this class was generated from the following files:
  • Deck.h
  • Deck.cpp
Generated on Wed May 8 12:39:34 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CDeck Member List

This is the complete list of members for CDeck, including all inherited members.
CDeck() | CDeck |
CDispBase() | CDispBase |
CEngineObj() | CEngineObj |
ClearCards() | CPile |
ClearTransferred() | CPile |
cNames | CDispBase |
CPile(long lType) | CPile |
DECLARE_IUNKNOWN_AND_IDISPATCH | CPile |
DoAction(CAction *pAction) | CPile | [virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngineObj | [virtual]
GetCardSpot(long lIndex) | CPile |
GetDispatch() const | CDispBase | [inline, protected]
GetNumCards() | CPile |
GetOuterUnknown() const | CDispBase | [inline, protected]
GetPileInterface(ISolpackPile **pp) | CPile | [virtual]
GetSizeWith(int cCards) | CPile | [protected]
GetType() | CEngineObj |
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitDeck(IMsgProcessor *pMsgProcessor, IStatusBarMgr *pSBMgr, ICardSite *pCardSite) | CDeck |
InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CEngineObj |
InitPile(IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CPile |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_abTransferred | CPile | [protected]
m_apCards | CPile | [protected]
m_apDeckCards | CDeck | [protected]
m_bShowNumCards | CPile | [protected]
m_dwEngObjType | CEngineObj | [protected]
m_hRgn | CPile | [protected]
m_lBaseType | CPile | [protected]
m_lHeight | CPile | [protected]
m_lpszTooltip | CPile | [protected]
m_lType | CPile |
m_lWidth | CPile | [protected]
m_lX | CPile |
m_lY | CPile |
m_pEngObjSite | CEngineObj | [protected]
m_pHH | CEngineObj | [protected]
m_pSite | CPile | [protected]
m_spEl | CEngineObj | [protected]
m_spImgElBase | CPile | [protected]
m_spStyle | CEngineObj | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
PileReleaseElCapture() | CPile | [inline, virtual]
PileSetElCapture() | CPile | [inline, virtual]
plHeight | CPile |
plWidth | CPile |
ppCard | CPile |
ppTInfo | CDispBase |
ppvObject | CPile |
PreReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
PtInPile(POINT pt) | CPile |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
ReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
ReclaimCards() | CDeck |
ReleaseElCapture() | CPile | [protected, virtual]
rgDispId | CDispBase |
RgnInPile(HRGN hRgn) | CPile |
rgszNames | CDispBase |
riid | CDispBase |
SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex) | CPile | [virtual]
SetElCapture() | CPile | [protected, virtual]
SetEventHandlers() | CEngineObj | [protected]
STDMETHOD(get_Type)(long *p) | CPile |
STDMETHOD(get_X)(long *p) | CPile |
STDMETHOD(put_X)(long v) | CPile |
STDMETHOD(get_Y)(long *p) | CPile |
STDMETHOD(put_Y)(long v) | CPile |
STDMETHOD(get_Width)(long *p) | CPile |
STDMETHOD(get_Height)(long *p) | CPile |
STDMETHOD(get_NumCards)(long *p) | CPile |
STDMETHOD(get_CommentTooltip)(BSTR *pbstrText) | CPile |
STDMETHOD(put_CommentTooltip)(BSTR bstrText) | CPile |
STDMETHOD(get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow) | CPile |
STDMETHOD(put_ShowNumCardsTooltip)(VARIANT_BOOL bShow) | CPile |
STDMETHOD(get_BaseType)(long *p) | CPile |
STDMETHOD(put_BaseType)(long v) | CPile |
STDMETHOD(Shuffle)() | CPile |
STDMETHOD(GetCard)(long lIndex | CPile |
STDMETHOD(WidthWith)(long lNumCards | CPile |
STDMETHOD(HeightWith)(long lNumCards | CPile |
STDMETHOD(NDQueryInterface)(REFIID riid | CPile |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
TooltipPrefChanged() | CPile |
TransferCards(CPtrArray< CCard *, CCard * > &apDest) | CPile |
TransferCards(long lIndex, long cCards, CPtrArray< CCard *, CCard * > &apDest) | CPile |
UndoAction(CAction *pAction) | CPile | [virtual]
UpdateBaseImg() | CPile | [protected]
UpdateDims() | CPile | [protected]
UpdateLayout(int iBegin=0, int iEnd=-1) | CPile |
UpdateTooltip() | CPile | [protected]
wFlags | CDispBase |
~CDeck() | CDeck | [virtual]
~CDispBase() | CDispBase | [virtual]
~CEngineObj() | CEngineObj | [virtual]
~CPile() | CPile | [virtual]
Generated on Wed May 8 12:39:34 2002 for Solitaire Pack by doxygen 1.2.15


CDispBase Class Reference

#include <bmws_dispbase.h>

Inheritance diagram for CDispBase:

INDUnknownAndDispatch CCard CEngine CGameBase CGameData CGameInfo CGameLib CPile CGameLaBelleLucie CGameSpider CDeck CFragment List of all members.

Public Methods

CDispBase ()
virtual | ~CDispBase ()
STDMETHOD (NDQueryInterface)(REFIID riid
STDMETHOD_ (ULONG, NDAddRef)()
STDMETHOD_ (ULONG, NDRelease)()
STDMETHOD (NDGetTypeInfoCount)(UINT *pctinfo)
STDMETHOD (NDGetTypeInfo)(UINT iTInfo
STDMETHOD (NDGetIDsOfNames)(REFIID riid
STDMETHOD (NDInvoke)(DISPID dispIdMember

Public Attributes

LPVOID * | ppvObject
LCID | lcid
LCID ITypeInfo ** | ppTInfo
LPOLESTR * | rgszNames
LPOLESTR UINT | cNames
LPOLESTR UINT LCID | lcid
LPOLESTR UINT LCID DISPID * | rgDispId
REFIID | riid
REFIID LCID | lcid
REFIID LCID WORD | wFlags
REFIID LCID WORD DISPPARAMS * | pDispParams
REFIID LCID WORD DISPPARAMS
VARIANT * 		pVarResult
REFIID LCID WORD DISPPARAMS
VARIANT EXCEPINFO * 		pExcepInfo
REFIID LCID WORD DISPPARAMS
VARIANT EXCEPINFO UINT * 		puArgErr

Protected Methods

LPUNKNOWN | GetOuterUnknown () const
LPDISPATCH | GetDispatch () const
virtual HRESULT | Init (LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp)

Private Attributes

DWORD | m_cRef
LPDISPATCH | m_pInvokeDispatch
LPTYPEINFO | m_pTypeInfo

Constructor & Destructor Documentation

CDispBase ( )

Definition at line 41 of file bmws_dispbase.cpp.

References g_cActiveComponents, m_cRef, and m_pTypeInfo.

00042 {
00043    m_cRef = 0;
00044    InterlockedIncrement(&g_cActiveComponents);
00045 #ifdef BMWS_TRACKMEMALLOC
00046    m_scTotalCreated++;
00047 #endif
00048    m_pTypeInfo = NULL;
00049 }

~CDispBase ( ) [virtual]

Definition at line 57 of file bmws_dispbase.cpp.

References g_cActiveComponents, m_pTypeInfo, and SAFERELEASE.

00058 {
00059    InterlockedDecrement(&g_cActiveComponents);
00060 #ifdef BMWS_TRACKMEMALLOC
00061    m_scTotalDeleted++;
00062 #endif
00063    SAFERELEASE(m_pTypeInfo);
00064 }

Member Function Documentation

LPDISPATCH GetDispatch ( ) const [inline, protected]

Definition at line 81 of file bmws_dispbase.h.

00082    {
00083       return (LPDISPATCH)((INDUnknownAndDispatch*)this);
00084    }

LPUNKNOWN GetOuterUnknown ( ) const [inline, protected]

Definition at line 76 of file bmws_dispbase.h.

00077    {
00078       return (LPUNKNOWN)((INDUnknownAndDispatch*)this);
00079    }

HRESULT Init | ( | LPTYPELIB | pTypeLib,
 |  | REFIID | riid,
 |  | LPDISPATCH | pDisp
 | ) | [protected, virtual]

Definition at line 196 of file bmws_dispbase.cpp.

References m_pInvokeDispatch, m_pTypeInfo, riid, and SAFERELEASE.

Referenced by CCard::InitCard(), CEngine::InitEngine(), CFragment::InitFragment(), CGameBase::InitGame(), CGameData::InitGameData(), CGameInfo::InitGameInfo(), CGameLib::InitGameLib(), and CPile::InitPile().

00197 {
00198    if(!pDisp || !pTypeLib)
00199       return E_INVALIDARG;
00200
00201    m_pInvokeDispatch = pDisp;
00202
00203    SAFERELEASE(m_pTypeInfo);
00204    return pTypeLib->GetTypeInfoOfGuid(riid, &m_pTypeInfo);
00205 }

STDMETHOD ( NDInvoke )

Implements INDUnknownAndDispatch.

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetIDsOfNames )

Implements INDUnknownAndDispatch.

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetTypeInfo )

Implements INDUnknownAndDispatch.

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetTypeInfoCount )

Implements INDUnknownAndDispatch.

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDQueryInterface )

Implements INDUnknownAndDispatch.

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD_ | ( | ULONG | ,
 |  | NDRelease |
 | ) |

Implements INDUnknownAndDispatch.

STDMETHOD_ | ( | ULONG | ,
 |  | NDAddRef |
 | ) |

Implements INDUnknownAndDispatch.

Member Data Documentation

LPOLESTR UINT cNames

Implements INDUnknownAndDispatch.

Definition at line 65 of file bmws_dispbase.h.

REFIID LCID lcid

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

LPOLESTR UINT LCID lcid

Implements INDUnknownAndDispatch.

Definition at line 65 of file bmws_dispbase.h.

LCID lcid

Implements INDUnknownAndDispatch.

Definition at line 64 of file bmws_dispbase.h.

DWORD m_cRef [private]

Definition at line 89 of file bmws_dispbase.h.

Referenced by CDispBase().

LPDISPATCH m_pInvokeDispatch [private]

Definition at line 90 of file bmws_dispbase.h.

Referenced by Init().

LPTYPEINFO m_pTypeInfo [private]

Definition at line 91 of file bmws_dispbase.h.

Referenced by CDispBase(), Init(), and ~CDispBase().

REFIID LCID WORD DISPPARAMS* pDispParams

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT EXCEPINFO* pExcepInfo

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

LCID ITypeInfo** ppTInfo

Definition at line 64 of file bmws_dispbase.h.

LPVOID* ppvObject

Reimplemented in CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

Definition at line 58 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT EXCEPINFO UINT* puArgErr

Definition at line 67 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT* pVarResult

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

LPOLESTR UINT LCID DISPID* rgDispId

Definition at line 65 of file bmws_dispbase.h.

LPOLESTR* rgszNames

Implements INDUnknownAndDispatch.

Definition at line 65 of file bmws_dispbase.h.

REFIID riid

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

Referenced by Init().

REFIID LCID WORD wFlags

Implements INDUnknownAndDispatch.

Definition at line 67 of file bmws_dispbase.h.

The documentation for this class was generated from the following files:
  • bmws_dispbase.h
  • bmws_dispbase.cpp
Generated on Wed May 8 12:39:35 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CDispBase Member List

This is the complete list of members for CDispBase, including all inherited members.
CDispBase() | CDispBase |
cNames | CDispBase |
GetDispatch() const | CDispBase | [inline, protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_cRef | CDispBase | [private]
m_pInvokeDispatch | CDispBase | [private]
m_pTypeInfo | CDispBase | [private]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
ppTInfo | CDispBase |
ppvObject | CDispBase |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
STDMETHOD(NDQueryInterface)(REFIID riid | CDispBase |
STDMETHOD(NDGetTypeInfoCount)(UINT *pctinfo) | CDispBase |
STDMETHOD(NDGetTypeInfo)(UINT iTInfo | CDispBase |
STDMETHOD(NDGetIDsOfNames)(REFIID riid | CDispBase |
STDMETHOD(NDInvoke)(DISPID dispIdMember | CDispBase |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
Generated on Wed May 8 12:39:35 2002 for Solitaire Pack by doxygen 1.2.15


CDlg Class Reference

#include <bmws_dlg.h>

Inheritance diagram for CDlg:

CAboutDlg CTechSupportDlg CUpdateDlg List of all members.

Public Methods

CDlg (UINT uidDlg)
virtual | ~CDlg ()
int | Run (HWND hWndParent)
virtual INT_PTR | DlgProc (UINT uMsg, WPARAM wParam, LPARAM lParam)=0

Static Public Methods

INT_PTR CALLBACK | BMWSDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Attributes

HWND | m_hwndDlg
UINT | m_uidDlg

Constructor & Destructor Documentation

CDlg ( UINT uidDlg )

Definition at line 32 of file bmws_dlg.cpp.

References m_hwndDlg, and m_uidDlg.

00033 {
00034    m_uidDlg = uidDlg;
00035    m_hwndDlg = NULL;
00036 }

virtual ~CDlg ( ) [inline, virtual]

Definition at line 27 of file bmws_dlg.h.

00027 {}

Member Function Documentation

INT_PTR CALLBACK BMWSDlgProc | ( | HWND | hwndDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 74 of file bmws_dlg.cpp.

References CHWND::CenterWindow(), DlgProc(), and m_hwndDlg.

Referenced by Run().

00075 {
00076    CDlg *pThis = (CDlg*)GetWindowLong(hwndDlg, GWL_USERDATA);
00077
00078    try   // Windows-called code
00079    {
00080       if(uMsg == WM_INITDIALOG)
00081       {
00082          pThis = (CDlg*)lParam;
00083          SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00084          pThis->m_hwndDlg = hwndDlg;
00085
00086          CHWND::CenterWindow(hwndDlg);
00087          pThis->DlgProc(uMsg, wParam, lParam);
00088          return TRUE;
00089       }
00090       if(pThis)
00091          return pThis->DlgProc(uMsg, wParam, lParam);
00092    }
00093    catch(CExcep *pE)
00094    {
00095       pE->Report();
00096       pE->Delete();
00097       EndDialog(hwndDlg, IDCANCEL);
00098    }
00099    return FALSE;
00100 }

virtual INT_PTR DlgProc | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Implemented in CTechSupportDlg, CUpdateDlg, and CAboutDlg.

Referenced by BMWSDlgProc().

int Run ( HWND hWndParent )

Definition at line 50 of file bmws_dlg.cpp.

References BMWSDlgProc(), g_hInstLC, m_uidDlg, and THROW.

Referenced by CMainWindow::OnCommand(), and CMainWindow::PresentUpdate().

00051 {
00052    int i = DialogBoxParam(g_hInstLC, MAKEINTRESOURCE(m_uidDlg), hWndParent,
00053       (DLGPROC)BMWSDlgProc, (LPARAM)this);
00054    if(i == -1)
00055       THROW(new CWinExcep(GetLastError()), CWinExcep*);
00056    return i;
00057 }

Member Data Documentation

HWND m_hwndDlg [protected]

Definition at line 35 of file bmws_dlg.h.

Referenced by BMWSDlgProc(), CDlg(), CUpdateDlg::DlgProc(), and CAboutDlg::DlgProc().

UINT m_uidDlg [protected]

Definition at line 36 of file bmws_dlg.h.

Referenced by CDlg(), and Run().

The documentation for this class was generated from the following files:
  • bmws_dlg.h
  • bmws_dlg.cpp
Generated on Wed May 8 12:39:35 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CDlg Member List

This is the complete list of members for CDlg, including all inherited members.
BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CDlg | [static]
CDlg(UINT uidDlg) | CDlg |
DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | CDlg | [pure virtual]
m_hwndDlg | CDlg | [protected]
m_uidDlg | CDlg | [protected]
Run(HWND hWndParent) | CDlg |
~CDlg() | CDlg | [inline, virtual]
Generated on Wed May 8 12:39:35 2002 for Solitaire Pack by doxygen 1.2.15


CEngine Class Reference

#include <Engine.h>

Inheritance diagram for CEngine:

IActionSite IUndoMgrOwner IEventHandlerSite IFragmentSite ICardSite IPileSite IGameCommandMgrSite IEngineObjSite CDispBase List of all members.

Public Methods

CEngine ()
virtual | ~CEngine ()
STDMETHOD (get_CardWidth)(long *p)
STDMETHOD (get_CardHeight)(long *p)
STDMETHOD (get_Score)(long *p)
STDMETHOD (put_Score)(long v)
STDMETHOD (get_WindowWidth)(long *p)
STDMETHOD (get_WindowHeight)(long *p)
STDMETHOD (get_SpacingX)(long *p)
STDMETHOD (get_SpacingY)(long *p)
STDMETHOD (get_Fragment)(ISolpackFragment **pp)
STDMETHOD (CreatePile)(long lType
STDMETHOD (CreateGameData)(ISolpackGameData **ppGameData)
STDMETHOD (AddGameCommand)(long lID
STDMETHOD (EnableGameCommand)(long lID
STDMETHOD (GameWon)()
STDMETHOD (NDQueryInterface)(REFIID riid
void | InitEngine (IMsgProcessor *pMsgProcessor, IEngineSite *pSite, IStatusBarMgr *pSBMgr, CLibMgr *pLibMgr, CHTMLHelper *pHH)
void | Uninit ()
void | PlayGame (int iLibIndex, int iGameIndex)
void | StopPlayGame ()
void | UpdateTooltips ()
void | RecalcLayout ()
void | DealGame ()
void | HandlePileClicked ()
void | HandleTryDrop ()
BOOL | TryCommand (UINT uMsg, WPARAM wParam, LPARAM lParam)
BOOL | MouseDown (CEngineObj *pObj, long lCurButton)
void | MouseMove ()
BOOL | MouseUp (BOOL bOverEl, long lButton)
void | CancelMouseEvent ()
CUndoMgr * EngGetUndoMgr ()
CUndoMgr * GetUndoMgr ()
void | HandleCommand (long lID)
BOOL | GetShowTooltips ()
BOOL | GetAnim ()
void | PlayCPSound (UINT uIndex)
CTSTR & GetFaceDownImg ()
void | CardFlipped ()
void | AnimStateChange (BOOL bAnim)
void | EventHandler (DWORD dwEventID, LPARAM lParam)
void | DoAction (CAction *pAction)
void | UndoAction (CAction *pAction)

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
ISolpackPile ** ppPile
BSTR | bstrText
BSTR BSTR | bstrHelpText
VARIANT_BOOL | bEnable
LPVOID * | ppvObject

Protected Methods

CDeck * AddDeck ()
void | CleanupGame ()
void | SetState (DWORD dwNewState)
void | SetMouseState (DWORD dwNewState)
void | CancelDrag (CPile *pPile)

Protected Attributes

IMsgProcessor * m_pMsgProcessor
IEngineSite * m_pSite
IStatusBarMgr * m_pSBMgr
CLibMgr * m_pLibMgr
CHTMLHelper * m_pHH
long | m_dwState
CTSTR m_lpszFaceDownImg
C3DShatter * m_pShatter
long | m_lScore
CSolpackGamePtr m_spGame
BOOL | m_bUsingMasterDeck
CPtrArray< CDeck *, CDeck * > m_apDecks
CPtrArray< CPile *, CPile * > m_apPiles
CFragment * m_pFragment
CGameCommandMgr m_gameCommandMgr
DWORD | m_dwMouseState
long | m_lButton
CPile * m_pPileSrc
CCard * m_pCardSrc
POINT | m_ptDrag
UINT | m_uDeactivateMsg
WPARAM | m_wDeactivateParam
LPARAM | m_lDeactivateParam
CUndoMgr m_undoMgr

Constructor & Destructor Documentation

CEngine ( )

Definition at line 129 of file Engine.cpp.

References ENG_UNINIT, m_apDecks, m_apPiles, m_bUsingMasterDeck, m_lButton, m_lDeactivateParam, m_pCardSrc, m_pFragment, m_pHH, m_pLibMgr, m_pMsgProcessor, m_pPileSrc, m_pSBMgr, m_pShatter, m_pSite, m_ptDrag, m_uDeactivateMsg, m_wDeactivateParam, MS_IDLE, ODS, SetMouseState(), CPtrArray< CDeck *, CDeck * >::SetRelease(), CPtrArray< CPile *, CPile * >::SetRelease(), CArray< CPile *, CPile * >::SetSize(), and SetState().

00130 {
00131    // Set initial values for member variables
00132    m_pMsgProcessor = NULL;
00133    m_pSite = NULL;
00134    m_pSBMgr = NULL;
00135    m_pLibMgr = NULL;
00136    m_pHH = NULL;
00137    m_pShatter = NULL;
00138    m_bUsingMasterDeck = FALSE;
00139    m_apPiles.SetSize(0, 8);
00140    m_pFragment = NULL;
00141    SetState(ENG_UNINIT);
00142    SetMouseState(MS_IDLE);
00143    m_lButton = 0;
00144    m_pPileSrc = NULL;
00145    m_pCardSrc = NULL;
00146    m_ptDrag.x = m_ptDrag.y = 0;
00147    m_uDeactivateMsg = 0;
00148    m_wDeactivateParam = 0;
00149    m_lDeactivateParam = 0;
00150
00151    // Signify that the contained pointers are COM interface pointers that
00152    // should be released, not deleted, when destroyed.
00153    m_apPiles.SetRelease(TRUE);
00154    m_apDecks.SetRelease(TRUE);
00155
00156    ODS("CEngine constructor");
00157 }

~CEngine ( ) [virtual]

Definition at line 165 of file Engine.cpp.

References ODS.

00166 {
00167    ODS("CEngine destructor");
00168 }

Member Function Documentation

CDeck * AddDeck ( ) [protected]

Definition at line 1497 of file Engine.cpp.

References CArray< CPile *, CPile * >::Add(), CArray< CDeck *, CDeck * >::Add(), ENSUREALLOC, CDeck::InitDeck(), CPile::InitPile(), m_apDecks, m_apPiles, m_pHH, m_pMsgProcessor, and m_pSBMgr.

Referenced by InitEngine().

01498 {
01499    // Create, initialize, and store the deck
01500    CDeck *pDeck = new CDeck();
01501    ENSUREALLOC(pDeck);
01502    m_apDecks.Add(pDeck);
01503    pDeck->AddRef();
01504    pDeck->InitPile((IPileSite*)this, (IEngineObjSite*)this, m_pHH);
01505    pDeck->InitDeck(m_pMsgProcessor, m_pSBMgr, (ICardSite*)this);
01506    m_apPiles.Add((CPile*)pDeck);
01507    pDeck->AddRef();
01508    return pDeck;
01509 }

void AnimStateChange ( BOOL bAnim ) [virtual]

Implements IFragmentSite.

Definition at line 1111 of file Engine.cpp.

References ENG_ANIM, and m_dwState.

01112 {
01113    if(bAnim)
01114       m_dwState |= ENG_ANIM;
01115    else
01116       m_dwState &= ~ENG_ANIM;
01117 }

void CancelDrag ( CPile * pPile ) [protected]

Definition at line 1630 of file Engine.cpp.

References CFragment::CancelAdditions(), CHECKHRCOM, m_pFragment, and m_spGame.

Referenced by CancelMouseEvent(), HandleTryDrop(), and MouseUp().

01631 {
01632    // Tell the game we've cancelled
01633    CHECKHRCOM(m_spGame->CancelMove());
01634
01635    // Move the fragment back
01636    m_pFragment->CancelAdditions();
01637 }

void CancelMouseEvent ( ) [virtual]

Implements IEngineObjSite.

Definition at line 1394 of file Engine.cpp.

References CancelDrag(), m_dwMouseState, m_pPileSrc, MS_DRAGGING, MS_IDLE, and SetMouseState().

Referenced by CMainWindow::MainWndProc().

01395 {
01396    if(m_dwMouseState == MS_IDLE)
01397       return;
01398
01399    // Cancel any drag
01400    if(m_dwMouseState == MS_DRAGGING)
01401       CancelDrag(m_pPileSrc);
01402
01403    SetMouseState(MS_IDLE);
01404 }

void CardFlipped ( ) [virtual]

Implements ICardSite.

Definition at line 1093 of file Engine.cpp.

References CPSOUNDS_FLIP, ENG_PILECLICKED, ENGSTATE, and PlayCPSound().

01094 {
01095    if(ENGSTATE == ENG_PILECLICKED)
01096       PlayCPSound(CPSOUNDS_FLIP);
01097 }

void CleanupGame ( ) [protected]

Definition at line 1522 of file Engine.cpp.

References CUndoMgr::Clear(), CPile::ClearCards(), CArray< CDeck *, CDeck * >::GetSize(), CArray< CPile *, CPile * >::GetSize(), m_apDecks, m_apPiles, m_pFragment, and m_undoMgr.

Referenced by DealGame(), and StopPlayGame().

01523 {
01524    // Clear all actions
01525    m_undoMgr.Clear(NULL);
01526
01527    // Empty all piles of their cards
01528    int i;
01529    int c = m_apPiles.GetSize();
01530    for(i = 0; i < c; i++)
01531       m_apPiles[i]->ClearCards();
01532
01533    m_pFragment->ClearCards();
01534
01535    // Move all cards back to their decks
01536    c = m_apDecks.GetSize();
01537    for(i = 0; i < c; i++)
01538       m_apDecks[i]->ReclaimCards();
01539 }

void DealGame ( )

Definition at line 824 of file Engine.cpp.

References CHECKHRCOM, CleanupGame(), ENG_DEAL, ENG_IDLE, CUndoMgr::Init(), m_dwState, m_spGame, m_undoMgr, and SetState().

Referenced by PlayGame(), and TryCommand().

00825 {
00826    if(m_dwState == ENG_IDLE)
00827    {
00828       // Clean up existing game, deal new game, and reset the undo manager
00829       SetState(ENG_DEAL);
00830       CleanupGame();
00831       CHECKHRCOM(m_spGame->Deal());
00832       m_undoMgr.Init();
00833       SetState(ENG_IDLE);
00834    }
00835 }

void DoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 1434 of file Engine.cpp.

References ACTION_DISABLECMD, ACTION_ENABLECMD, ACTION_SCORE, CGameCommandMgr::EnableGameCommand(), CAction::m_dwData, CAction::m_dwType, m_gameCommandMgr, m_lScore, m_pSite, and IEngineSite::SetScore().

01435 {
01436    switch(pAction->m_dwType)
01437    {
01438       // Updates the score
01439       case ACTION_SCORE:
01440       {
01441          m_lScore += (long)pAction->m_dwData;
01442          m_pSite->SetScore(m_lScore);
01443       } break;
01444
01445       // Enables or disables the command
01446       case ACTION_ENABLECMD:
01447       case ACTION_DISABLECMD:
01448          m_gameCommandMgr.EnableGameCommand((long)pAction->m_dwData,
01449             pAction->m_dwType == ACTION_ENABLECMD);
01450          break;
01451    }
01452 }

CUndoMgr* EngGetUndoMgr ( ) [inline, virtual]

Implements IEngineObjSite.

Definition at line 113 of file Engine.h.

References GetUndoMgr().

00113 { return GetUndoMgr(); }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 1132 of file Engine.cpp.

References CHECKHRCOM, ENG_ANIM, ENGEVENT_BODYCLICK, CHTMLHelper::GetEvent(), m_dwState, m_pFragment, m_pHH, and CFragment::SetCancelAnim().

01133 {
01134    try   // Windows-called code
01135    {
01136       // Cancel the event from bubbling
01137       CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
01138       CHECKHRCOM(spEventObj->put_cancelBubble(VARIANT_TRUE));
01139
01140       // We only handle one event here
01141       if(dwEventID == ENGEVENT_BODYCLICK)
01142       {
01143          // Cancel any animation when the user clicks the page
01144          if(m_dwState & ENG_ANIM)
01145             m_pFragment->SetCancelAnim(TRUE);
01146       }
01147    }
01148    catch(CExcep *pE)
01149    {
01150       pE->Report();
01151       pE->Delete();
01152    }
01153 }

BOOL GetAnim ( ) [virtual]

Implements IPileSite.

Definition at line 1041 of file Engine.cpp.

References IEngineSite::GetAnim(), and m_pSite.

01042 {
01043    return m_pSite->GetAnim();
01044 }

CTSTR & GetFaceDownImg ( ) [virtual]

Implements ICardSite.

Definition at line 1076 of file Engine.cpp.

References m_lpszFaceDownImg.

01077 {
01078    return m_lpszFaceDownImg;
01079 }

BOOL GetShowTooltips ( ) [virtual]

Implements IPileSite.

Definition at line 1025 of file Engine.cpp.

References IEngineSite::GetShowTooltips(), and m_pSite.

01026 {
01027    return m_pSite->GetShowTooltips();
01028 }

CUndoMgr * GetUndoMgr ( ) [virtual]

Implements IUndoMgrOwner.

Definition at line 1417 of file Engine.cpp.

References m_undoMgr.

Referenced by EngGetUndoMgr(), and CMainWindow::MainWndProc().

01418 {
01419    return &m_undoMgr;
01420 }

void HandleCommand ( long lID ) [virtual]

Implements IGameCommandMgrSite.

Definition at line 1005 of file Engine.cpp.

References CHECKHRCOM, ENG_HANDLECMD, ENG_IDLE, m_dwState, m_spGame, and SetState().

01006 {
01007    if(m_dwState != ENG_IDLE)
01008       return;
01009    SetState(ENG_HANDLECMD);
01010    CHECKHRCOM(m_spGame->HandleCommand(lID));
01011    SetState(ENG_IDLE);
01012 }

void HandlePileClicked ( )

Definition at line 848 of file Engine.cpp.

References _ASSERT, CHECKHRCOM, ENG_FLAGS, ENG_IDLE, m_dwState, m_pCardSrc, m_pPileSrc, m_spGame, and SetState().

Referenced by MouseUp().

00849 {
00850    // Call the game's PileClicked method
00851    _ASSERT(m_pPileSrc);
00852    CHECKHRCOM(m_spGame->PileClicked(m_pPileSrc, m_pCardSrc));
00853    SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
00854 }

void HandleTryDrop ( )

Definition at line 867 of file Engine.cpp.

References _ASSERT, CancelDrag(), CHECKHRCOM, CPSOUNDS_DROP, ENG_FLAGS, ENG_IDLE, CFragment::GetPileRgn(), CArray< CPile *, CPile * >::GetSize(), ISolpackFragment, ISolpackPile, m_apPiles, m_dwState, m_pFragment, m_pPileSrc, m_ptDrag, m_spGame, PlayCPSound(), SetState(), and CPile::UpdateLayout().

Referenced by MouseUp().

00868 {
00869    _ASSERT(m_pPileSrc);
00870
00871    // Assume the drop is invalid
00872    VARIANT_BOOL bValid = VARIANT_FALSE;
00873
00874    // First try to drop the fragment on the pile, if any, directly below the
00875    // mouse cursor
00876    int i;
00877    int cPiles = m_apPiles.GetSize();
00878    for(i = 0; i < cPiles && bValid != VARIANT_TRUE; i++)
00879    {
00880       if(m_apPiles[i] != m_pPileSrc)
00881       {
00882          if(m_apPiles[i]->PtInPile(m_ptDrag))
00883          {
00884             CHECKHRCOM(m_spGame->DropFragment((ISolpackFragment*)m_pFragment,
00885                (ISolpackPile*)m_apPiles[i], &bValid));
00886          }
00887       }
00888    }
00889
00890    // If we didn't drop successfully, then try the piles whose regions
00891    // intersect with the fragment's region
00892    if(bValid != VARIANT_TRUE)
00893    {
00894       // Get the bounding region of the fragment
00895       m_pFragment->UpdateLayout();
00896       HRGN hRgnFrag = m_pFragment->GetPileRgn();
00897
00898       for(int i = 0; i < cPiles && bValid != VARIANT_TRUE; i++)
00899       {
00900          if(m_apPiles[i] != m_pPileSrc)
00901          {
00902             if(m_apPiles[i]->RgnInPile(hRgnFrag))
00903             {
00904                CHECKHRCOM(m_spGame->DropFragment((ISolpackFragment*)m_pFragment,
00905                   (ISolpackPile*)m_apPiles[i], &bValid));
00906             }
00907          }
00908       }
00909    }
00910
00911    // Play sound on drop, or cancel drop if not dropped
00912    if(bValid == VARIANT_TRUE)
00913       PlayCPSound(CPSOUNDS_DROP);
00914    else
00915       CancelDrag(m_pPileSrc);
00916
00917    SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
00918 }

void InitEngine | ( | IMsgProcessor * | pMsgProcessor,
 |  | IEngineSite * | pSite,
 |  | IStatusBarMgr * | pSBMgr,
 |  | CLibMgr * | pLibMgr,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 597 of file Engine.cpp.

References _ASSERT, AddDeck(), CTSTR::Assign(), ENG_INACTIVE, ENSUREALLOC, g_pTypeLib, IDS_EL_DAVC, IDS_STATUS_INITDECK, IID_ISolpackApp, CGameCommandMgr::Init(), CDispBase::Init(), CFragment::InitFragment(), CPile::InitPile(), ISolpackApp, m_dwState, m_gameCommandMgr, m_lpszFaceDownImg, m_pFragment, m_pHH, m_pLibMgr, m_pMsgProcessor, m_pSBMgr, m_pShatter, m_pSite, ODS, IStatusBarMgr::SBSetText(), and SetState().

Referenced by CMainWindow::HTMLComplete().

00599 {
00600    ODS("CEngine::InitEngine starting");
00601    SetState(m_dwState);
00602
00603    // Set member variables' values
00604    _ASSERT(pSite);
00605    m_pMsgProcessor = pMsgProcessor;
00606    m_pSite = pSite;
00607    m_pSBMgr = pSBMgr;
00608    m_pLibMgr = pLibMgr;
00609    m_pHH = pHH;
00610
00611    // c54.gif is the card back image
00612    m_lpszFaceDownImg.Assign(TEXT("c54.gif"));
00613
00614    Init(g_pTypeLib, IID_ISolpackApp, (LPDISPATCH)((ISolpackApp*)this));
00615
00616    // Set up the DirectAnimation 3D shatter object
00617    m_pShatter = new C3DShatter(m_pHH, IDS_EL_DAVC);
00618    ENSUREALLOC(m_pShatter);
00619
00620    // Set up the game command manager
00621    m_gameCommandMgr.Init((IGameCommandMgrSite*)this, m_pHH);
00622
00623    // Create the initial deck
00624    m_pSBMgr->SBSetText(CTSTR(IDS_STATUS_INITDECK));
00625    AddDeck();
00626    m_pSBMgr->SBSetText(CTSTR());
00627
00628    // Create and initialize the fragment object
00629    m_pFragment = new CFragment();
00630    ENSUREALLOC(m_pFragment);
00631    m_pFragment->AddRef();
00632    m_pFragment->InitPile((IPileSite*)this, (IEngineObjSite*)this, m_pHH);
00633    m_pFragment->InitFragment(m_pMsgProcessor, (IFragmentSite*)this);
00634
00635    SetState(ENG_INACTIVE);
00636    ODS("CEngine::InitEngine finished");
00637 }

BOOL MouseDown | ( | CEngineObj * | pObj,
 |  | long | lCurButton
 | ) | [virtual]

Implements IEngineObjSite.

Definition at line 1168 of file Engine.cpp.

References CHECKHRCOM, ENG_IDLE, ENG_MOUSEDOWN, ENG_UNDO, ENGOBJ_PILE, ENGSTATE, CHTMLHelper::GetEvent(), CCard::GetPile(), CEngineObj::GetType(), m_dwMouseState, m_dwState, m_lButton, m_pCardSrc, m_pHH, m_pPileSrc, m_ptDrag, MS_CARD_LBD, MS_CARD_LBDNODRAG, MS_CARD_RBD, MS_DRAGGING, MS_IDLE, MS_PILE_LBD, MS_WAITALL, SetMouseState(), and SetState().

01169 {
01170    SetState(m_dwState | ENG_MOUSEDOWN);
01171
01172    // Figure out which button was just pressed down
01173    long lNewButton = lCurButton - m_lButton;
01174    m_lButton = lCurButton;
01175
01176    if((ENGSTATE != ENG_IDLE) || (m_dwState & ENG_UNDO))
01177    {
01178       SetMouseState(MS_WAITALL);
01179       return TRUE;
01180    }
01181
01182    // If the event came from a pile object
01183    if(pObj->GetType() == ENGOBJ_PILE)
01184    {
01185       if(m_dwMouseState != MS_IDLE)
01186       {
01187          // Clicking any other buttons while dragging cancels the drag
01188          if(m_dwMouseState != MS_DRAGGING)
01189             SetMouseState(MS_WAITALL);
01190          return FALSE;
01191       }
01192
01193       if(lNewButton != 1)  // Only lbutton down on pile does anything
01194       {
01195          SetMouseState(MS_WAITALL);
01196          return TRUE;
01197       }
01198
01199       m_pPileSrc = (CPile*)pObj;
01200       SetMouseState(MS_PILE_LBD);
01201       return TRUE;
01202    }
01203
01204    // Otherwise, the event came from a card
01205    // Set the new mouse state based on the old state and the button
01206    switch(m_dwMouseState)
01207    {
01208       case MS_IDLE:
01209          m_pCardSrc = (CCard*)pObj;
01210          m_pPileSrc = (CPile*)(m_pCardSrc->GetPile());
01211          if(lNewButton == 1)  // left button
01212          {
01213             // Store the coordinate
01214             CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01215             CHECKHRCOM(spEvent->get_clientX(&m_ptDrag.x));
01216             CHECKHRCOM(spEvent->get_clientY(&m_ptDrag.y));
01217             SetMouseState(MS_CARD_LBD);
01218          } else if(lNewButton == 2) // right button
01219          {
01220             SetMouseState(MS_CARD_RBD);
01221          } else   // some other button
01222          {
01223             SetMouseState(MS_WAITALL);
01224          }
01225          return TRUE;
01226          break;
01227       case MS_PILE_LBD:
01228       case MS_CARD_LBD:
01229       case MS_CARD_LBDNODRAG:
01230       case MS_CARD_RBD:
01231          // Clicking from any of these states cancels the action
01232          SetMouseState(MS_WAITALL);
01233          break;
01234    }
01235    return FALSE;
01236 }

void MouseMove ( ) [virtual]

Implements IEngineObjSite.

Definition at line 1249 of file Engine.cpp.

References _ASSERT, CHECKHRCOM, CHTMLHelper::GetEvent(), ISolpackFragment, CCard::m_bCanDrag, m_pCardSrc, m_pFragment, m_pHH, m_pPileSrc, m_ptDrag, m_spGame, CFragment::MoveBy(), MS_CARD_LBD, MS_CARD_LBDNODRAG, MS_DRAGGING, ODS, and SetMouseState().

01250 {
01251    switch(m_dwMouseState)
01252    {
01253       case MS_CARD_LBD:
01254       {
01255          _ASSERT(m_pCardSrc);
01256          ODS("Trying to start a drag");
01257          if(m_pCardSrc->m_bCanDrag)
01258          {
01259             // Add cards to the fragment
01260             CHECKHRCOM(m_spGame->SetupFragment(m_pPileSrc, m_pCardSrc,
01261                (ISolpackFragment*)m_pFragment));
01262             SetMouseState(MS_DRAGGING);
01263
01264             // Store the coordinate
01265             CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01266             POINT pt;
01267             CHECKHRCOM(spEvent->get_clientX(&pt.x));
01268             CHECKHRCOM(spEvent->get_clientY(&pt.y));
01269             m_pFragment->MoveBy(pt.x - m_ptDrag.x, pt.y - m_ptDrag.y);
01270             m_ptDrag.x = pt.x;
01271             m_ptDrag.y = pt.y;
01272          } else
01273          {
01274             // Card can't be dragged
01275             SetMouseState(MS_CARD_LBDNODRAG);
01276          }
01277       } break;
01278
01279       case MS_DRAGGING:
01280          // Update the position of the fragment and store the new coordinate
01281          POINT pt;
01282          CHTMLEventObjPtr spEvent = m_pHH->GetEvent();
01283          CHECKHRCOM(spEvent->get_clientX(&pt.x));
01284          CHECKHRCOM(spEvent->get_clientY(&pt.y));
01285          m_pFragment->MoveBy(pt.x - m_ptDrag.x, pt.y - m_ptDrag.y);
01286          m_ptDrag.x = pt.x;
01287          m_ptDrag.y = pt.y;
01288          break;
01289    }
01290    return;
01291 }

BOOL MouseUp | ( | BOOL | bOverEl,
 |  | long | lButton
 | ) | [virtual]

Implements IEngineObjSite.

Definition at line 1308 of file Engine.cpp.

References _ASSERT, CancelDrag(), CHECKHRCOM, ENG_ANIM, ENG_DROPFRAG, ENG_FLAGS, ENG_IDLE, ENG_PILECLICKED, HandlePileClicked(), HandleTryDrop(), ISolpackCard, m_dwMouseState, m_dwState, m_lButton, m_pCardSrc, m_pFragment, m_pPileSrc, m_spGame, MS_CARD_AUTOPLAY, MS_CARD_LBD, MS_CARD_LBDNODRAG, MS_CARD_RBD, MS_DRAGGING, MS_IDLE, MS_PILE_CLICKED, MS_PILE_LBD, MS_TRYDROP, MS_WAITALL, CFragment::SetCancelAnim(), SetMouseState(), and SetState().

01309 {
01310    m_lButton &= ~lButton;
01311
01312    // Cancel any animation
01313    if(m_dwState & ENG_ANIM)
01314       m_pFragment->SetCancelAnim(TRUE);
01315
01316    if(m_dwMouseState == MS_IDLE)
01317       return FALSE;
01318
01319    // Handle left button up
01320    if(lButton == 1)
01321    {
01322       switch(m_dwMouseState)
01323       {
01324          case MS_PILE_LBD:
01325          case MS_CARD_LBD:
01326          case MS_CARD_LBDNODRAG:
01327             if(bOverEl)
01328             {
01329                // Pile was clicked
01330                SetMouseState(MS_PILE_CLICKED);
01331                SetState((m_dwState & ENG_FLAGS) | ENG_PILECLICKED);
01332                HandlePileClicked();
01333             }
01334             SetMouseState(MS_IDLE);
01335             break;
01336          case MS_DRAGGING:
01337             // Drag has ended
01338             SetMouseState(MS_TRYDROP);
01339             SetState((m_dwState & ENG_FLAGS) | ENG_DROPFRAG);
01340             HandleTryDrop();
01341             SetMouseState(MS_WAITALL);
01342             break;
01343       }
01344    } else
01345    {
01346       if(m_dwMouseState == MS_DRAGGING)
01347       {
01348          // Drag was cancelled by another click
01349          SetMouseState(MS_TRYDROP);
01350          CancelDrag(m_pPileSrc);
01351          SetMouseState(MS_WAITALL);
01352       }
01353       if(lButton == 2)
01354       {
01355          if(m_dwMouseState == MS_CARD_RBD)
01356          {
01357             if(bOverEl)
01358             {
01359                // Right button was clicked; auto play card
01360                _ASSERT(m_pCardSrc);
01361                SetMouseState(MS_CARD_AUTOPLAY);
01362                SetState((m_dwState & ENG_FLAGS) | ENG_PILECLICKED);
01363                CHECKHRCOM(m_spGame->AutoPlayCard((ISolpackCard*)m_pCardSrc));
01364                SetState((m_dwState & ENG_FLAGS) | ENG_IDLE);
01365             }
01366             SetMouseState(MS_IDLE);
01367          }
01368       }
01369    }
01370
01371    if(m_dwMouseState == MS_WAITALL)
01372    {
01373       // If we were waiting for all buttons to be released, and they have
01374       // been, back to idle state
01375       if(m_lButton == 0)
01376          SetMouseState(MS_IDLE);
01377       else
01378          return FALSE;
01379    }
01380    return TRUE;
01381 }

void PlayCPSound ( UINT uIndex ) [virtual]

Implements IPileSite.

Definition at line 1058 of file Engine.cpp.

References ENG_GAMEWON, m_dwState, m_pSite, and IEngineSite::PlayCPSound().

Referenced by CardFlipped(), and HandleTryDrop().

01059 {
01060    // If we've already won, don't play any sound
01061    if(m_dwState != ENG_GAMEWON)
01062       m_pSite->PlayCPSound(uIndex);
01063 }

void PlayGame | ( | int | iLibIndex,
 |  | int | iGameIndex
 | ) |

Definition at line 683 of file Engine.cpp.

References _ASSERT, CBSTR::Addr(), CPtr< ISolpackGame,&IID_ISolpackGame >::Assign(), CHECKHRCOM, DealGame(), ENG_IDLE, ENG_STARTGAME, ENGEVENT_BODYCLICK, ENSUREALLOC, CLibMgr::GetGame(), CHTMLHelper::GetNamedEl(), IDS_EL_BODY, IDS_EL_ENGINE, IDS_STATUS_INITGAME, ISolpackApp, m_lScore, m_pHH, m_pLibMgr, m_pSBMgr, m_pSite, m_spGame, ODS, IStatusBarMgr::SBSetText(), IEngineSite::SetScore(), SetState(), and CHTMLHelper::ShowElementEx().

Referenced by CMainWindow::GameSelected().

00684 {
00685    _ASSERT(m_pHH);
00686    ODS("CEngine::PlayGame started");
00687    SetState(ENG_STARTGAME);
00688
00689    // Retrieve the game, game info, and title
00690    m_spGame.Assign(TRUE, m_pLibMgr->GetGame(iLibIndex, iGameIndex));
00691    CSolpackGameInfoPtr spInfo;
00692    CHECKHRCOM(m_spGame->get_Info(&spInfo));
00693    CBSTR bstr;
00694    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00695
00696    // Set the status bar text
00697    m_pSBMgr->SBSetText(CTSTR().Format(CTSTR(IDS_STATUS_INITGAME), CTSTR(bstr)));
00698    m_lScore = 0;
00699
00700    // Show the engine UI
00701    m_pHH->ShowElementEx(IDS_EL_ENGINE, TRUE);
00702
00703    // Create event handler for clicking the body
00704    CEventHandler *pHandler = NULL;
00705    CVariant v;
00706    CHTMLElementPtr spBody(TRUE, m_pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00707
00708    // Body mouse up handler
00709    pHandler = new CEventHandler((IEventHandlerSite*)this, ENGEVENT_BODYCLICK, 0);
00710    ENSUREALLOC(pHandler);
00711    v.vt = VT_DISPATCH;
00712    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00713    CHECKHRCOM(spBody->put_onmouseup(v));
00714
00715    // Initialize the game
00716    CHECKHRCOM(m_spGame->Initialize((ISolpackApp*)this));
00717    m_pSite->SetScore(m_lScore);
00718
00719    SetState(ENG_IDLE);
00720
00721    // Deal the initial game
00722    DealGame();
00723
00724    ODS("CEngine::PlayGame finished");
00725 }

void RecalcLayout ( )

Definition at line 802 of file Engine.cpp.

References m_spGame, m_undoMgr, and CUndoMgr::SetCanRecord().

Referenced by CMainWindow::CheckRecalcNeeded().

00803 {
00804    if(m_spGame)
00805    {
00806       // While the game is re-laying itself out, don't record actions
00807       BOOL bOld = m_undoMgr.SetCanRecord(FALSE);
00808       m_spGame->RecalcLayout();
00809       m_undoMgr.SetCanRecord(bOld);
00810    }
00811 }

void SetMouseState ( DWORD dwNewState ) [protected]

Definition at line 1597 of file Engine.cpp.

References ENG_MOUSEDOWN, m_dwMouseState, m_dwState, m_lButton, m_pCardSrc, m_pPileSrc, MS_IDLE, ODS2, and SetState().

Referenced by CancelMouseEvent(), CEngine(), MouseDown(), MouseMove(), and MouseUp().

01598 {
01599    // Print state change message
01600 #ifdef _DEBUG
01601    ODS2(TEXT("MS switch to: "));
01602    ODS2(szMSNames[dwNewState]);
01603    ODS2(TEXT("\n"));
01604 #endif
01605
01606    m_dwMouseState = dwNewState;
01607
01608    // Clear any storing of drag source piles and cards if we just went idle
01609    if(m_dwMouseState == MS_IDLE)
01610    {
01611       m_pPileSrc = NULL;
01612       m_pCardSrc = NULL;
01613       m_lButton = 0;
01614       SetState(m_dwState & ~ENG_MOUSEDOWN);
01615    }
01616 }

void SetState ( DWORD dwNewState ) [protected]

Definition at line 1553 of file Engine.cpp.

References ENG_ANIM, ENG_IDLE, ENG_MOUSEDOWN, ENG_UNDO, m_dwState, m_lDeactivateParam, m_pFragment, m_pSite, m_uDeactivateMsg, m_undoMgr, m_wDeactivateParam, ODS2, IEngineSite::PostMsg(), CUndoMgr::PushNewTurn(), and CFragment::SetCancelAnim().

Referenced by CEngine(), DealGame(), HandleCommand(), HandlePileClicked(), HandleTryDrop(), InitEngine(), MouseDown(), MouseUp(), PlayGame(), SetMouseState(), StopPlayGame(), TryCommand(), and Uninit().

01554 {
01555    // Print state change message
01556 #ifdef _DEBUG
01557    ODS2(TEXT("EngState switch to: "));
01558    ODS2(szEngSNames[dwNewState & ~(ENG_UNDO | ENG_ANIM | ENG_MOUSEDOWN)]);
01559    if(dwNewState & ENG_UNDO)
01560       ODS2(TEXT(" & ENG_UNDO"));
01561    if(dwNewState & ENG_ANIM)
01562       ODS2(TEXT(" & ENG_ANIM"));
01563    if(dwNewState & ENG_MOUSEDOWN)
01564       ODS2(TEXT(" & ENG_MOUSEDOWN"));
01565    ODS2(TEXT("\n"));
01566 #endif
01567
01568    // If we just went idle, push a new turn and process any message that we
01569    // received while busy
01570    m_dwState = dwNewState;
01571    if(m_dwState == ENG_IDLE)
01572    {
01573       m_undoMgr.PushNewTurn();
01574       m_pFragment->SetCancelAnim(FALSE);
01575       if(m_uDeactivateMsg > 0)
01576       {
01577          m_pSite->PostMsg(m_uDeactivateMsg, m_wDeactivateParam, m_lDeactivateParam);
01578          m_uDeactivateMsg = 0;
01579          m_wDeactivateParam = 0;
01580          m_lDeactivateParam = 0;
01581       }
01582    }
01583 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( GameWon )

STDMETHOD ( EnableGameCommand )

STDMETHOD ( AddGameCommand )

STDMETHOD ( CreateGameData )

STDMETHOD ( CreatePile )

STDMETHOD ( get_Fragment )

STDMETHOD ( get_SpacingY )

STDMETHOD ( get_SpacingX )

STDMETHOD ( get_WindowHeight )

STDMETHOD ( get_WindowWidth )

STDMETHOD ( put_Score )

STDMETHOD ( get_Score )

STDMETHOD ( get_CardHeight )

STDMETHOD ( get_CardWidth )

void StopPlayGame ( )

Definition at line 739 of file Engine.cpp.

References CHECKHRCOM, CleanupGame(), CGameCommandMgr::Clear(), CUndoMgr::Clear(), ENG_STOPGAME, CHTMLHelper::GetNamedEl(), IDS_EL_BODY, IDS_EL_ENGINE, m_apDecks, m_apPiles, m_bUsingMasterDeck, m_dwState, m_gameCommandMgr, m_pHH, m_spGame, m_undoMgr, CPtr< ISolpackGame,&IID_ISolpackGame >::Release(), CArray< CDeck *, CDeck * >::SetSize(), CArray< CPile *, CPile * >::SetSize(), SetState(), and CHTMLHelper::ShowElementEx().

Referenced by CMainWindow::OnCommand(), and Uninit().

00740 {
00741    if(!m_pHH)
00742       return;
00743
00744    DWORD dwOldState = m_dwState;
00745    SetState(ENG_STOPGAME);
00746
00747    // Release the body clicked event handler
00748    CVariant v;
00749    v.vt = VT_NULL;
00750    CHTMLElementPtr spBody(TRUE, m_pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00751    spBody->put_onmouseup(v);
00752
00753    // Hide the engine UI
00754    m_pHH->ShowElementEx(IDS_EL_ENGINE, FALSE);
00755
00756    // Clean up the game
00757    m_undoMgr.Clear(NULL);
00758    if(m_spGame)
00759       CHECKHRCOM(m_spGame->Uninitialize());
00760    CleanupGame();
00761
00762    // Release all objects that the game created
00763    m_bUsingMasterDeck = FALSE;
00764    m_apPiles.SetSize(1);
00765    m_apDecks.SetSize(1);
00766    m_gameCommandMgr.Clear();
00767    m_spGame.Release();
00768    SetState(dwOldState);
00769 }

BOOL TryCommand | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) |

Definition at line 937 of file Engine.cpp.

References CUndoMgr::CanRedo(), CUndoMgr::CanUndo(), CHECKHRCOM, DealGame(), C3DShatter::EndAnimation(), ENG_AUTOPLAY, ENG_IDLE, ENG_UNDO, IDM_GAME_AUTOPLAY, IDM_GAME_DEAL, IDM_GAME_REDO, IDM_GAME_UNDO, m_dwState, m_lDeactivateParam, m_pFragment, m_pShatter, m_spGame, m_uDeactivateMsg, m_undoMgr, m_wDeactivateParam, CUndoMgr::Redo(), CFragment::SetCancelAnim(), SetState(), and CUndoMgr::Undo().

Referenced by CMainWindow::MainWndProc(), and CMainWindow::OnCommand().

00938 {
00939    if(m_pShatter)
00940       m_pShatter->EndAnimation();
00941
00942    // If the engine is busy doing something, such as animating, cancel
00943    // animation and store the message to be processed when the engine becomes
00944    // idle
00945    if(m_dwState != ENG_IDLE)
00946    {
00947       if(m_pFragment)
00948          m_pFragment->SetCancelAnim(TRUE);
00949       m_uDeactivateMsg = uMsg;
00950       m_wDeactivateParam = wParam;
00951       m_lDeactivateParam = lParam;
00952       return FALSE;
00953    }
00954
00955    switch(LOWORD(wParam))
00956    {
00957       case IDM_GAME_DEAL:
00958          // Deal a new game
00959          DealGame();
00960          break;
00961
00962       case IDM_GAME_AUTOPLAY:
00963          // Autoplay the current game
00964          SetState(ENG_AUTOPLAY);
00965          CHECKHRCOM(m_spGame->AutoPlay());
00966          SetState(ENG_IDLE);
00967          break;
00968
00969       case IDM_GAME_UNDO:
00970          // Undo, if possible
00971          if(!(m_dwState & ENG_UNDO) && m_undoMgr.CanUndo())
00972          {
00973             SetState(m_dwState | ENG_UNDO);
00974             m_undoMgr.Undo();
00975             SetState(m_dwState & ~ENG_UNDO);
00976          }
00977          break;
00978
00979       case IDM_GAME_REDO:
00980          // Redo, if possible
00981          if(!(m_dwState & ENG_UNDO) && m_undoMgr.CanRedo())
00982          {
00983             SetState(m_dwState | ENG_UNDO);
00984             m_undoMgr.Redo();
00985             SetState(m_dwState & ~ENG_UNDO);
00986          }
00987          break;
00988    }
00989
00990    return TRUE;
00991 }

void UndoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 1466 of file Engine.cpp.

References ACTION_DISABLECMD, ACTION_ENABLECMD, ACTION_SCORE, CGameCommandMgr::EnableGameCommand(), CAction::m_dwData, CAction::m_dwType, m_gameCommandMgr, m_lScore, m_pSite, and IEngineSite::SetScore().

01467 {
01468    switch(pAction->m_dwType)
01469    {
01470       // Updates the score
01471       case ACTION_SCORE:
01472       {
01473          m_lScore -= (long)pAction->m_dwData;
01474          m_pSite->SetScore(m_lScore);
01475       } break;
01476
01477       // Enables or disables the command
01478       case ACTION_ENABLECMD:
01479       case ACTION_DISABLECMD:
01480          m_gameCommandMgr.EnableGameCommand((long)pAction->m_dwData,
01481             pAction->m_dwType == ACTION_DISABLECMD);
01482          break;
01483    }
01484 }

void Uninit ( )

Definition at line 650 of file Engine.cpp.

References C3DShatter::EndAnimation(), ENG_UNINIT, m_gameCommandMgr, m_pFragment, m_pHH, m_pShatter, SAFEDELETE, SAFERELEASE, SetState(), StopPlayGame(), and CGameCommandMgr::Uninit().

Referenced by CMainWindow::OnDestroy().

00651 {
00652    SetState(ENG_UNINIT);
00653
00654    // Release the 3D shatter object
00655    if(m_pShatter)
00656       m_pShatter->EndAnimation();
00657    SAFEDELETE(m_pShatter);
00658
00659    // Stop any game that may be playing
00660    StopPlayGame();
00661
00662    // Free the game command manager and fragment
00663    m_gameCommandMgr.Uninit();
00664    SAFERELEASE(m_pFragment);
00665
00666    m_pHH = NULL;
00667 }

void UpdateTooltips ( )

Definition at line 782 of file Engine.cpp.

References CArray< CPile *, CPile * >::GetSize(), and m_apPiles.

Referenced by CMainWindow::OptionTooltips().

00783 {
00784    // Updates the tooltip settings for each created pile
00785    int cPiles = m_apPiles.GetSize();
00786    for(int i = 0; i < cPiles; i++)
00787       m_apPiles[i]->TooltipPrefChanged();
00788 }

Member Data Documentation

VARIANT_BOOL bEnable

Definition at line 90 of file Engine.h.

BSTR BSTR bstrHelpText

Definition at line 89 of file Engine.h.

BSTR bstrText

Definition at line 89 of file Engine.h.

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 75 of file Engine.h.

CPtrArray<CDeck*, CDeck*> m_apDecks [protected]

Definition at line 160 of file Engine.h.

Referenced by AddDeck(), CEngine(), CleanupGame(), and StopPlayGame().

CPtrArray<CPile*, CPile*> m_apPiles [protected]

Definition at line 161 of file Engine.h.

Referenced by AddDeck(), CEngine(), CleanupGame(), HandleTryDrop(), StopPlayGame(), and UpdateTooltips().

BOOL m_bUsingMasterDeck [protected]

Definition at line 159 of file Engine.h.

Referenced by CEngine(), and StopPlayGame().

DWORD m_dwMouseState [protected]

Definition at line 167 of file Engine.h.

Referenced by CancelMouseEvent(), MouseDown(), MouseUp(), and SetMouseState().

long m_dwState [protected]

Definition at line 152 of file Engine.h.

Referenced by AnimStateChange(), DealGame(), EventHandler(), HandleCommand(), HandlePileClicked(), HandleTryDrop(), InitEngine(), MouseDown(), MouseUp(), PlayCPSound(), SetMouseState(), SetState(), StopPlayGame(), and TryCommand().

CGameCommandMgr m_gameCommandMgr [protected]

Definition at line 164 of file Engine.h.

Referenced by DoAction(), InitEngine(), StopPlayGame(), UndoAction(), and Uninit().

long m_lButton [protected]

Definition at line 168 of file Engine.h.

Referenced by CEngine(), MouseDown(), MouseUp(), and SetMouseState().

LPARAM m_lDeactivateParam [protected]

Definition at line 175 of file Engine.h.

Referenced by CEngine(), SetState(), and TryCommand().

CTSTR m_lpszFaceDownImg [protected]

Definition at line 154 of file Engine.h.

Referenced by GetFaceDownImg(), and InitEngine().

long m_lScore [protected]

Definition at line 156 of file Engine.h.

Referenced by DoAction(), PlayGame(), and UndoAction().

CCard* m_pCardSrc [protected]

Definition at line 170 of file Engine.h.

Referenced by CEngine(), HandlePileClicked(), MouseDown(), MouseMove(), MouseUp(), and SetMouseState().

CFragment* m_pFragment [protected]

Definition at line 162 of file Engine.h.

Referenced by CancelDrag(), CEngine(), CleanupGame(), EventHandler(), HandleTryDrop(), InitEngine(), MouseMove(), MouseUp(), SetState(), TryCommand(), and Uninit().

CHTMLHelper* m_pHH [protected]

Definition at line 151 of file Engine.h.

Referenced by AddDeck(), CEngine(), EventHandler(), InitEngine(), MouseDown(), MouseMove(), PlayGame(), StopPlayGame(), and Uninit().

CLibMgr* m_pLibMgr [protected]

Definition at line 150 of file Engine.h.

Referenced by CEngine(), InitEngine(), and PlayGame().

IMsgProcessor* m_pMsgProcessor [protected]

Definition at line 147 of file Engine.h.

Referenced by AddDeck(), CEngine(), and InitEngine().

CPile* m_pPileSrc [protected]

Definition at line 169 of file Engine.h.

Referenced by CancelMouseEvent(), CEngine(), HandlePileClicked(), HandleTryDrop(), MouseDown(), MouseMove(), MouseUp(), and SetMouseState().

IStatusBarMgr* m_pSBMgr [protected]

Definition at line 149 of file Engine.h.

Referenced by AddDeck(), CEngine(), InitEngine(), and PlayGame().

C3DShatter* m_pShatter [protected]

Definition at line 155 of file Engine.h.

Referenced by CEngine(), InitEngine(), TryCommand(), and Uninit().

IEngineSite* m_pSite [protected]

Definition at line 148 of file Engine.h.

Referenced by CEngine(), DoAction(), GetAnim(), GetShowTooltips(), InitEngine(), PlayCPSound(), PlayGame(), SetState(), and UndoAction().

POINT m_ptDrag [protected]

Definition at line 171 of file Engine.h.

Referenced by CEngine(), HandleTryDrop(), MouseDown(), and MouseMove().

CSolpackGamePtr m_spGame [protected]

Definition at line 157 of file Engine.h.

Referenced by CancelDrag(), DealGame(), HandleCommand(), HandlePileClicked(), HandleTryDrop(), MouseMove(), MouseUp(), PlayGame(), RecalcLayout(), StopPlayGame(), and TryCommand().

UINT m_uDeactivateMsg [protected]

Definition at line 173 of file Engine.h.

Referenced by CEngine(), SetState(), and TryCommand().

CUndoMgr m_undoMgr [protected]

Definition at line 177 of file Engine.h.

Referenced by CleanupGame(), DealGame(), GetUndoMgr(), RecalcLayout(), SetState(), StopPlayGame(), and TryCommand().

WPARAM m_wDeactivateParam [protected]

Definition at line 174 of file Engine.h.

Referenced by CEngine(), SetState(), and TryCommand().

ISolpackPile** ppPile

Definition at line 87 of file Engine.h.

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 94 of file Engine.h.

The documentation for this class was generated from the following files:
  • Engine.h
  • Engine.cpp
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CEngine Member List

This is the complete list of members for CEngine, including all inherited members.
AddDeck() | CEngine | [protected]
AnimStateChange(BOOL bAnim) | CEngine | [virtual]
bEnable | CEngine |
bstrHelpText | CEngine |
bstrText | CEngine |
CancelDrag(CPile *pPile) | CEngine | [protected]
CancelMouseEvent() | CEngine | [virtual]
CardFlipped() | CEngine | [virtual]
CDispBase() | CDispBase |
CEngine() | CEngine |
CleanupGame() | CEngine | [protected]
cNames | CDispBase |
DealGame() | CEngine |
DECLARE_IUNKNOWN_AND_IDISPATCH | CEngine |
DoAction(CAction *pAction) | CEngine | [virtual]
EngGetUndoMgr() | CEngine | [inline, virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngine | [virtual]
GetAnim() | CEngine | [virtual]
GetDispatch() const | CDispBase | [inline, protected]
GetFaceDownImg() | CEngine | [virtual]
GetOuterUnknown() const | CDispBase | [inline, protected]
GetShowTooltips() | CEngine | [virtual]
GetUndoMgr() | CEngine | [virtual]
HandleCommand(long lID) | CEngine | [virtual]
HandlePileClicked() | CEngine |
HandleTryDrop() | CEngine |
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitEngine(IMsgProcessor *pMsgProcessor, IEngineSite *pSite, IStatusBarMgr *pSBMgr, CLibMgr *pLibMgr, CHTMLHelper *pHH) | CEngine |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_apDecks | CEngine | [protected]
m_apPiles | CEngine | [protected]
m_bUsingMasterDeck | CEngine | [protected]
m_dwMouseState | CEngine | [protected]
m_dwState | CEngine | [protected]
m_gameCommandMgr | CEngine | [protected]
m_lButton | CEngine | [protected]
m_lDeactivateParam | CEngine | [protected]
m_lpszFaceDownImg | CEngine | [protected]
m_lScore | CEngine | [protected]
m_pCardSrc | CEngine | [protected]
m_pFragment | CEngine | [protected]
m_pHH | CEngine | [protected]
m_pLibMgr | CEngine | [protected]
m_pMsgProcessor | CEngine | [protected]
m_pPileSrc | CEngine | [protected]
m_pSBMgr | CEngine | [protected]
m_pShatter | CEngine | [protected]
m_pSite | CEngine | [protected]
m_ptDrag | CEngine | [protected]
m_spGame | CEngine | [protected]
m_uDeactivateMsg | CEngine | [protected]
m_undoMgr | CEngine | [protected]
m_wDeactivateParam | CEngine | [protected]
MouseDown(CEngineObj *pObj, long lCurButton) | CEngine | [virtual]
MouseMove() | CEngine | [virtual]
MouseUp(BOOL bOverEl, long lButton) | CEngine | [virtual]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
PlayCPSound(UINT uIndex) | CEngine | [virtual]
PlayGame(int iLibIndex, int iGameIndex) | CEngine |
ppPile | CEngine |
ppTInfo | CDispBase |
ppvObject | CEngine |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
RecalcLayout() | CEngine |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
SetMouseState(DWORD dwNewState) | CEngine | [protected]
SetState(DWORD dwNewState) | CEngine | [protected]
STDMETHOD(get_CardWidth)(long *p) | CEngine |
STDMETHOD(get_CardHeight)(long *p) | CEngine |
STDMETHOD(get_Score)(long *p) | CEngine |
STDMETHOD(put_Score)(long v) | CEngine |
STDMETHOD(get_WindowWidth)(long *p) | CEngine |
STDMETHOD(get_WindowHeight)(long *p) | CEngine |
STDMETHOD(get_SpacingX)(long *p) | CEngine |
STDMETHOD(get_SpacingY)(long *p) | CEngine |
STDMETHOD(get_Fragment)(ISolpackFragment **pp) | CEngine |
STDMETHOD(CreatePile)(long lType | CEngine |
STDMETHOD(CreateGameData)(ISolpackGameData **ppGameData) | CEngine |
STDMETHOD(AddGameCommand)(long lID | CEngine |
STDMETHOD(EnableGameCommand)(long lID | CEngine |
STDMETHOD(GameWon)() | CEngine |
STDMETHOD(NDQueryInterface)(REFIID riid | CEngine |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
StopPlayGame() | CEngine |
TryCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) | CEngine |
UndoAction(CAction *pAction) | CEngine | [virtual]
Uninit() | CEngine |
UpdateTooltips() | CEngine |
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CEngine() | CEngine | [virtual]
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


CEngineObj Class Reference

#include <EngineObj.h>

Inheritance diagram for CEngineObj:

IEventHandlerSite CCard CPile CDeck CFragment List of all members.

Public Methods

CEngineObj ()
virtual | ~CEngineObj ()
void | InitEngineObj (IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
DWORD | GetType ()
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Methods

void | SetEventHandlers ()
virtual void | SetElCapture ()=0
virtual void | ReleaseElCapture ()=0

Protected Attributes

IEngineObjSite * m_pEngObjSite
CHTMLHelper * m_pHH
CHTMLElementPtr m_spEl
CHTMLStylePtr m_spStyle
DWORD | m_dwEngObjType

Constructor & Destructor Documentation

CEngineObj ( )

Definition at line 36 of file EngineObj.cpp.

References m_pEngObjSite, and m_pHH.

00037 {
00038    // Set initial values for member variables
00039    m_pEngObjSite = NULL;
00040    m_pHH = NULL;
00041 }

~CEngineObj ( ) [virtual]

Definition at line 49 of file EngineObj.cpp.

References CHTMLElement2Ptr, and m_spEl.

00050 {
00051    if(m_spEl)
00052    {
00053       // Release all event handlers
00054       CVariant v;
00055       v.vt = VT_NULL;
00056
00057       m_spEl->put_onmousedown(v);
00058       m_spEl->put_onmouseup(v);
00059       m_spEl->put_onmousemove(v);
00060       CHTMLElement2Ptr(m_spEl)->put_onlosecapture(v);
00061    }
00062 }

Member Function Documentation

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 113 of file EngineObj.cpp.

References IEngineObjSite::CancelMouseEvent(), CHECKHRCOM, EOEVENT_LOSECAPTURE, EOEVENT_MOUSEDOWN, EOEVENT_MOUSEMOVE, EOEVENT_MOUSEUP, CHTMLHelper::GetEvent(), m_pEngObjSite, m_pHH, m_spEl, IEngineObjSite::MouseDown(), IEngineObjSite::MouseMove(), IEngineObjSite::MouseUp(), ReleaseElCapture(), and SetElCapture().

00114 {
00115    try   // Windows-called code
00116    {
00117       // Cancel the event from bubbling
00118       CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
00119       CHECKHRCOM(spEventObj->put_cancelBubble(VARIANT_TRUE));
00120
00121       long lButton;
00122       CHECKHRCOM(spEventObj->get_button(&lButton));
00123
00124       switch(dwEventID)
00125       {
00126          case EOEVENT_MOUSEDOWN:
00127             // Tell the engine a mouse button was pressed
00128             if(m_pEngObjSite->MouseDown(this, lButton))
00129                SetElCapture();
00130             break;
00131
00132          case EOEVENT_MOUSEUP:
00133          {
00134             // Determine whether the mouse was released over this object's
00135             // element or one of its children
00136             CHTMLElementPtr spEl;
00137             CHECKHRCOM(spEventObj->get_srcElement(&spEl));
00138             VARIANT_BOOL vbContains;
00139             CHECKHRCOM(m_spEl->contains(spEl, &vbContains));
00140
00141             // Tell the engine a mouse button was released
00142             if(m_pEngObjSite->MouseUp(vbContains == VARIANT_TRUE, lButton))
00143                ReleaseElCapture();
00144          } break;
00145
00146          case EOEVENT_MOUSEMOVE:
00147             // Tell the engine the mouse was moved
00148             m_pEngObjSite->MouseMove();
00149             break;
00150
00151          case EOEVENT_LOSECAPTURE:
00152             // Tell the engine that we've lost focus for some reason
00153             m_pEngObjSite->CancelMouseEvent();
00154             break;
00155       }
00156    }
00157    catch(CExcep *pE)
00158    {
00159       pE->Report();
00160       pE->Delete();
00161    }
00162 }

DWORD GetType ( )

Definition at line 95 of file EngineObj.cpp.

References m_dwEngObjType.

Referenced by CEngine::MouseDown().

00096 {
00097    return m_dwEngObjType;
00098 }

void InitEngineObj | ( | IEngineObjSite * | pEngObjSite,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 77 of file EngineObj.cpp.

References m_pEngObjSite, and m_pHH.

Referenced by CCard::InitCard(), and CPile::InitPile().

00078 {
00079    // Set member variables' values
00080    m_pEngObjSite = pEngObjSite;
00081    m_pHH = pHH;
00082 }

virtual void ReleaseElCapture ( ) [protected, pure virtual]

Implemented in CCard, and CPile.

Referenced by EventHandler().

virtual void SetElCapture ( ) [protected, pure virtual]

Implemented in CCard, and CPile.

Referenced by EventHandler().

void SetEventHandlers ( ) [protected]

Definition at line 175 of file EngineObj.cpp.

References _ASSERT, CHECKHRCOM, CHTMLElement2Ptr, ENSUREALLOC, EOEVENT_LOSECAPTURE, EOEVENT_MOUSEDOWN, EOEVENT_MOUSEMOVE, EOEVENT_MOUSEUP, and m_spEl.

Referenced by CCard::InitCard(), and CPile::InitPile().

00176 {
00177    _ASSERT(m_spEl);
00178
00179    // Create event handlers for the element
00180    CEventHandler *pHandler = NULL;
00181    CVariant v;
00182
00183    // Mouse button down handler
00184    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEDOWN, 0);
00185    ENSUREALLOC(pHandler);
00186    v.vt = VT_DISPATCH;
00187    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00188    CHECKHRCOM(m_spEl->put_onmousedown(v));
00189    VariantClear(&v);
00190
00191    // Mouse button up handler
00192    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEUP, 0);
00193    ENSUREALLOC(pHandler);
00194    v.vt = VT_DISPATCH;
00195    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00196    CHECKHRCOM(m_spEl->put_onmouseup(v));
00197    VariantClear(&v);
00198
00199    // Mouse move handler
00200    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_MOUSEMOVE, 0);
00201    ENSUREALLOC(pHandler);
00202    v.vt = VT_DISPATCH;
00203    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00204    CHECKHRCOM(m_spEl->put_onmousemove(v));
00205    VariantClear(&v);
00206
00207    // Lose focus handler
00208    pHandler = new CEventHandler((IEventHandlerSite*)this, EOEVENT_LOSECAPTURE, 0);
00209    ENSUREALLOC(pHandler);
00210    v.vt = VT_DISPATCH;
00211    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00212    CHECKHRCOM(CHTMLElement2Ptr(m_spEl)->put_onlosecapture(v));
00213    VariantClear(&v);
00214 }

Member Data Documentation

DWORD m_dwEngObjType [protected]

Definition at line 86 of file EngineObj.h.

Referenced by CCard::CCard(), CPile::CPile(), and GetType().

IEngineObjSite* m_pEngObjSite [protected]

Definition at line 80 of file EngineObj.h.

Referenced by CEngineObj(), EventHandler(), CDeck::InitDeck(), and InitEngineObj().

CHTMLHelper* m_pHH [protected]

Definition at line 81 of file EngineObj.h.

Referenced by CEngineObj(), EventHandler(), CDeck::InitDeck(), InitEngineObj(), CFragment::InitFragment(), CPile::InitPile(), CPile::ReceiveCards(), CPile::SetCardIndex(), and CCard::SetPile().

CHTMLElementPtr m_spEl [protected]

Definition at line 83 of file EngineObj.h.

Referenced by CPile::DoAction(), CFragment::DoAction(), EventHandler(), CCard::GetElement(), CCard::InitCard(), CDeck::InitDeck(), CFragment::InitFragment(), CPile::InitPile(), CFragment::PileToFrag(), CPile::ReceiveCards(), CPile::ReleaseElCapture(), CPile::SetCardIndex(), CPile::SetElCapture(), SetEventHandlers(), CCard::SetPile(), CPile::UndoAction(), CPile::UpdateTooltip(), ~CEngineObj(), and CPile::~CPile().

CHTMLStylePtr m_spStyle [protected]

Definition at line 84 of file EngineObj.h.

Referenced by CFragment::CancelAdditions(), CPile::DoAction(), CFragment::FragToPile(), CCard::InitCard(), CFragment::InitFragment(), CPile::InitPile(), CFragment::MoveBy(), CFragment::PileToFrag(), CCard::SetPosition(), CPile::UndoAction(), CPile::UpdateDims(), and CCard::UpdateImg().

The documentation for this class was generated from the following files:
  • EngineObj.h
  • EngineObj.cpp
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CEngineObj Member List

This is the complete list of members for CEngineObj, including all inherited members.
CEngineObj() | CEngineObj |
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngineObj | [virtual]
GetType() | CEngineObj |
InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CEngineObj |
m_dwEngObjType | CEngineObj | [protected]
m_pEngObjSite | CEngineObj | [protected]
m_pHH | CEngineObj | [protected]
m_spEl | CEngineObj | [protected]
m_spStyle | CEngineObj | [protected]
ReleaseElCapture()=0 | CEngineObj | [protected, pure virtual]
SetElCapture()=0 | CEngineObj | [protected, pure virtual]
SetEventHandlers() | CEngineObj | [protected]
~CEngineObj() | CEngineObj | [virtual]
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


CEventHandler Class Reference

#include <bmws_eventhandler.h>

List of all members.

Public Methods

CEventHandler (IEventHandlerSite *pSite, DWORD dwEventID, LPARAM lParam)
STDMETHOD (QueryInterface)(REFIID riid
STDMETHOD_ (ULONG, AddRef)()
STDMETHOD_ (ULONG, Release)()
STDMETHOD (GetIDsOfNames)(REFIID riid
STDMETHOD (GetTypeInfo)(unsigned int itinfo
STDMETHOD (GetTypeInfoCount)(unsigned int FAR *pctinfo)
STDMETHOD (Invoke)(DISPID dispid

Public Attributes

LPVOID * | ppvObject
OLECHAR FAR *FAR * | rgszNames
OLECHAR FAR *FAR unsigned int | cNames
OLECHAR FAR *FAR unsigned
int LCID 		lcid
OLECHAR FAR *FAR unsigned
int LCID DISPID FAR * 		rgdispid
LCID | lcid
LCID ITypeInfo FAR *FAR * | pptinfo
REFIID | riid
REFIID LCID | lcid
REFIID LCID WORD | wFlags
REFIID LCID WORD DISPPARAMS
FAR * 		pdispparams
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR * 		pvarResult
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR * 		pexecinfo
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR unsigned int FAR * 		puArgErr

Protected Attributes

IEventHandlerSite * m_pSite
DWORD | m_dwRefCount
DWORD | m_dwEventID
LPARAM | m_lParam

Constructor & Destructor Documentation

CEventHandler | ( | IEventHandlerSite * | pSite,
 |  | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) |

Definition at line 36 of file bmws_eventhandler.cpp.

References m_dwEventID, m_dwRefCount, m_lParam, and m_pSite.

00037 {
00038    m_pSite = pSite;
00039    m_dwEventID = dwEventID;
00040    m_lParam = lParam;
00041    m_dwRefCount = 0;
00042 #ifdef BMWS_TRACKMEMALLOC
00043    m_scTotalCreated++;
00044 #endif
00045 }

Member Function Documentation

STDMETHOD ( Invoke )

STDMETHOD ( GetTypeInfoCount )

STDMETHOD ( GetTypeInfo )

STDMETHOD ( GetIDsOfNames )

STDMETHOD ( QueryInterface )

STDMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |

STDMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |

Member Data Documentation

OLECHAR FAR* FAR unsigned int cNames

Definition at line 67 of file bmws_eventhandler.h.

REFIID LCID lcid

Definition at line 71 of file bmws_eventhandler.h.

LCID lcid

Definition at line 69 of file bmws_eventhandler.h.

OLECHAR FAR* FAR unsigned int LCID lcid

Definition at line 67 of file bmws_eventhandler.h.

DWORD m_dwEventID [protected]

Definition at line 83 of file bmws_eventhandler.h.

Referenced by CEventHandler().

DWORD m_dwRefCount [protected]

Definition at line 82 of file bmws_eventhandler.h.

Referenced by CEventHandler().

LPARAM m_lParam [protected]

Definition at line 84 of file bmws_eventhandler.h.

Referenced by CEventHandler().

IEventHandlerSite* m_pSite [protected]

Definition at line 81 of file bmws_eventhandler.h.

Referenced by CEventHandler().

REFIID LCID WORD DISPPARAMS FAR* pdispparams

Definition at line 71 of file bmws_eventhandler.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR* pexecinfo

Definition at line 71 of file bmws_eventhandler.h.

LCID ITypeInfo FAR* FAR* pptinfo

Definition at line 69 of file bmws_eventhandler.h.

LPVOID* ppvObject

Definition at line 62 of file bmws_eventhandler.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR unsigned int FAR* puArgErr

Definition at line 71 of file bmws_eventhandler.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR* pvarResult

Definition at line 71 of file bmws_eventhandler.h.

OLECHAR FAR* FAR unsigned int LCID DISPID FAR* rgdispid

Definition at line 67 of file bmws_eventhandler.h.

OLECHAR FAR* FAR* rgszNames

Definition at line 67 of file bmws_eventhandler.h.

REFIID riid

Definition at line 71 of file bmws_eventhandler.h.

REFIID LCID WORD wFlags

Definition at line 71 of file bmws_eventhandler.h.

The documentation for this class was generated from the following files:
  • bmws_eventhandler.h
  • bmws_eventhandler.cpp
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CEventHandler Member List

This is the complete list of members for CEventHandler, including all inherited members.
CEventHandler(IEventHandlerSite *pSite, DWORD dwEventID, LPARAM lParam) | CEventHandler |
cNames | CEventHandler |
lcid | CEventHandler |
lcid | CEventHandler |
lcid | CEventHandler |
m_dwEventID | CEventHandler | [protected]
m_dwRefCount | CEventHandler | [protected]
m_lParam | CEventHandler | [protected]
m_pSite | CEventHandler | [protected]
pdispparams | CEventHandler |
pexecinfo | CEventHandler |
pptinfo | CEventHandler |
ppvObject | CEventHandler |
puArgErr | CEventHandler |
pvarResult | CEventHandler |
rgdispid | CEventHandler |
rgszNames | CEventHandler |
riid | CEventHandler |
STDMETHOD(QueryInterface)(REFIID riid | CEventHandler |
STDMETHOD(GetIDsOfNames)(REFIID riid | CEventHandler |
STDMETHOD(GetTypeInfo)(unsigned int itinfo | CEventHandler |
STDMETHOD(GetTypeInfoCount)(unsigned int FAR *pctinfo) | CEventHandler |
STDMETHOD(Invoke)(DISPID dispid | CEventHandler |
STDMETHOD_(ULONG, AddRef)() | CEventHandler |
STDMETHOD_(ULONG, Release)() | CEventHandler |
wFlags | CEventHandler |
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


CEventSink Class Reference

#include <bmws_eventsink.h>

List of all members.

Public Methods

CEventSink (IEventSinkSite *pSite, LPARAM lParam, IUnknown *pUnkSource, REFIID riid)
STDMETHOD (QueryInterface)(REFIID riid
STDMETHOD_ (ULONG, AddRef)()
STDMETHOD_ (ULONG, Release)()
STDMETHOD (GetTypeInfoCount)(unsigned int FAR *pctinfo)
STDMETHOD (GetTypeInfo)(unsigned int iTInfo
STDMETHOD (GetIDsOfNames)(REFIID riid
STDMETHOD (Invoke)(DISPID dispIdMember
void | Disconnect ()

Public Attributes

LPVOID * | ppvObject
LCID | lcid
LCID ITypeInfo FAR *FAR * | ppTInfo
OLECHAR FAR *FAR * | rgszNames
OLECHAR FAR *FAR unsigned int | cNames
OLECHAR FAR *FAR unsigned
int LCID 		lcid
OLECHAR FAR *FAR unsigned
int LCID DISPID FAR * 		rgDispId
REFIID | riid
REFIID LCID | lcid
REFIID LCID WORD | wFlags
REFIID LCID WORD DISPPARAMS
FAR * 		pDispParams
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR * 		pVarResult
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR * 		pExcepInfo
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR unsigned int FAR * 		puArgErr

Protected Methods

IConnectionPoint * | GetConnectionPoint ()

Protected Attributes

IEventSinkSite * m_pSite
DWORD | m_dwRefCount
LPARAM | m_lParam
DWORD | m_dwCookie
BOOL | m_bConnected
CUnknownPtr m_spUnkSource
IID * m_piid

Constructor & Destructor Documentation

CEventSink | ( | IEventSinkSite * | pSite,
 |  | LPARAM | lParam,
 |  | IUnknown * | pUnkSource,
 |  | REFIID | riid
 | ) |

Definition at line 37 of file bmws_eventsink.cpp.

References CPtr< IUnknown,&IID_IUnknown >::Assign(), GetConnectionPoint(), m_bConnected, m_dwCookie, m_dwRefCount, m_lParam, m_piid, m_pSite, m_spUnkSource, riid, and SAFERELEASE.

00038 {
00039    m_dwCookie = 0;
00040    m_dwRefCount = 0;
00041    m_lParam = lParam;
00042    m_pSite = pSite;
00043    m_bConnected = FALSE;
00044    m_spUnkSource.Assign(pUnkSource);
00045    m_piid = (IID*)&riid;
00046
00047    IConnectionPoint *pcp = GetConnectionPoint();
00048    if(pcp)
00049    {
00050       m_bConnected = SUCCEEDED(pcp->Advise((IDispatch*)this, &m_dwCookie));
00051       SAFERELEASE(pcp);
00052    }
00053
00054 #ifdef BMWS_TRACKMEMALLOC
00055    m_scTotalCreated++;
00056 #endif
00057 }

Member Function Documentation

void Disconnect ( )

Definition at line 156 of file bmws_eventsink.cpp.

References GetConnectionPoint(), m_bConnected, m_dwCookie, and SAFERELEASE.

Referenced by CBrowserContainer::Uninit(), and C3DShatter::~C3DShatter().

00157 {
00158    IConnectionPoint *pcp = GetConnectionPoint();
00159    AddRef();
00160    if(pcp)
00161    {
00162       pcp->Unadvise(m_dwCookie);
00163       SAFERELEASE(pcp);
00164       m_bConnected = FALSE;
00165    }
00166    Release();
00167 }

IConnectionPoint * GetConnectionPoint ( ) [protected]

Definition at line 181 of file bmws_eventsink.cpp.

References m_piid, m_spUnkSource, and SAFERELEASE.

Referenced by CEventSink(), and Disconnect().

00182 {
00183    if(!m_spUnkSource)
00184       return NULL;
00185
00186    IConnectionPointContainer *pcpc;
00187    IConnectionPoint *pcp = NULL;
00188
00189    if(SUCCEEDED(m_spUnkSource->QueryInterface(IID_IConnectionPointContainer, (LPVOID*)&pcpc)))
00190    {
00191       pcpc->FindConnectionPoint(*m_piid, &pcp);
00192       SAFERELEASE(pcpc);
00193    }
00194
00195    return pcp;
00196 }

STDMETHOD ( Invoke )

STDMETHOD ( GetIDsOfNames )

STDMETHOD ( GetTypeInfo )

STDMETHOD ( GetTypeInfoCount )

STDMETHOD ( QueryInterface )

STDMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |

STDMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |

Member Data Documentation

OLECHAR FAR* FAR unsigned int cNames

Definition at line 70 of file bmws_eventsink.h.

REFIID LCID lcid

Definition at line 72 of file bmws_eventsink.h.

OLECHAR FAR* FAR unsigned int LCID lcid

Definition at line 70 of file bmws_eventsink.h.

LCID lcid

Definition at line 69 of file bmws_eventsink.h.

BOOL m_bConnected [protected]

Definition at line 90 of file bmws_eventsink.h.

Referenced by CEventSink(), and Disconnect().

DWORD m_dwCookie [protected]

Definition at line 89 of file bmws_eventsink.h.

Referenced by CEventSink(), and Disconnect().

DWORD m_dwRefCount [protected]

Definition at line 87 of file bmws_eventsink.h.

Referenced by CEventSink().

LPARAM m_lParam [protected]

Definition at line 88 of file bmws_eventsink.h.

Referenced by CEventSink().

IID* m_piid [protected]

Definition at line 92 of file bmws_eventsink.h.

Referenced by CEventSink(), and GetConnectionPoint().

IEventSinkSite* m_pSite [protected]

Definition at line 86 of file bmws_eventsink.h.

Referenced by CEventSink().

CUnknownPtr m_spUnkSource [protected]

Definition at line 91 of file bmws_eventsink.h.

Referenced by CEventSink(), and GetConnectionPoint().

REFIID LCID WORD DISPPARAMS FAR* pDispParams

Definition at line 72 of file bmws_eventsink.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR* pExcepInfo

Definition at line 72 of file bmws_eventsink.h.

LCID ITypeInfo FAR* FAR* ppTInfo

Definition at line 69 of file bmws_eventsink.h.

LPVOID* ppvObject

Definition at line 63 of file bmws_eventsink.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR unsigned int FAR* puArgErr

Definition at line 72 of file bmws_eventsink.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR* pVarResult

Definition at line 72 of file bmws_eventsink.h.

OLECHAR FAR* FAR unsigned int LCID DISPID FAR* rgDispId

Definition at line 70 of file bmws_eventsink.h.

OLECHAR FAR* FAR* rgszNames

Definition at line 70 of file bmws_eventsink.h.

REFIID riid

Definition at line 72 of file bmws_eventsink.h.

Referenced by CEventSink().

REFIID LCID WORD wFlags

Definition at line 72 of file bmws_eventsink.h.

The documentation for this class was generated from the following files:
  • bmws_eventsink.h
  • bmws_eventsink.cpp
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CEventSink Member List

This is the complete list of members for CEventSink, including all inherited members.
CEventSink(IEventSinkSite *pSite, LPARAM lParam, IUnknown *pUnkSource, REFIID riid) | CEventSink |
cNames | CEventSink |
Disconnect() | CEventSink |
GetConnectionPoint() | CEventSink | [protected]
lcid | CEventSink |
lcid | CEventSink |
lcid | CEventSink |
m_bConnected | CEventSink | [protected]
m_dwCookie | CEventSink | [protected]
m_dwRefCount | CEventSink | [protected]
m_lParam | CEventSink | [protected]
m_piid | CEventSink | [protected]
m_pSite | CEventSink | [protected]
m_spUnkSource | CEventSink | [protected]
pDispParams | CEventSink |
pExcepInfo | CEventSink |
ppTInfo | CEventSink |
ppvObject | CEventSink |
puArgErr | CEventSink |
pVarResult | CEventSink |
rgDispId | CEventSink |
rgszNames | CEventSink |
riid | CEventSink |
STDMETHOD(QueryInterface)(REFIID riid | CEventSink |
STDMETHOD(GetTypeInfoCount)(unsigned int FAR *pctinfo) | CEventSink |
STDMETHOD(GetTypeInfo)(unsigned int iTInfo | CEventSink |
STDMETHOD(GetIDsOfNames)(REFIID riid | CEventSink |
STDMETHOD(Invoke)(DISPID dispIdMember | CEventSink |
STDMETHOD_(ULONG, AddRef)() | CEventSink |
STDMETHOD_(ULONG, Release)() | CEventSink |
wFlags | CEventSink |
Generated on Wed May 8 12:39:37 2002 for Solitaire Pack by doxygen 1.2.15


CExcep Class Reference

#include <bmws_error.h>

Inheritance diagram for CExcep:

CCOMExcep CExcepEx COOMExcep CQuitExcep CWinExcep CXMLExcep List of all members.

Public Methods

CExcep (int code, BOOL bDelete=TRUE)
virtual void | Report ()
void | Delete ()

Public Attributes

int | m_code
BOOL | m_bDelete

Constructor & Destructor Documentation

CExcep | ( | int | code,
 |  | BOOL | bDelete = TRUE
 | ) | [inline]

Definition at line 114 of file bmws_error.h.

References m_bDelete, and m_code.

00115    {
00116       m_code = code;
00117       m_bDelete = bDelete;
00118    }

Member Function Documentation

void Delete ( ) [inline]

Definition at line 161 of file bmws_error.h.

Referenced by HHInternalExcep().

00162    {
00163       if(m_bDelete)
00164          delete this;
00165    }

virtual void Report ( ) [inline, virtual]

Reimplemented in CExcepEx, COOMExcep, CCOMExcep, and CQuitExcep.

Definition at line 134 of file bmws_error.h.

References ERROR_ERRORINS_INT, g_hWnd, HandleError(), IDS_BMWS_ERROR_INTERNAL, IDS_BMWS_REMEDY_CONTACTBMWS, and m_code.

00139    {
00140 #ifdef _DEBUG
00141       HandleError(g_hWnd, IDS_BMWS_ERROR_INTERNAL,
00142          IDS_BMWS_REMEDY_CONTACTBMWS, m_code, 0, ERROR_ERRORINS_INT |
00143          (bFirst? ERROR_FIRSTCHANCE : 0));
00144 #else
00145       HandleError(g_hWnd, IDS_BMWS_ERROR_INTERNAL,
00146          IDS_BMWS_REMEDY_CONTACTBMWS, m_code, 0, ERROR_ERRORINS_INT);
00147 #endif
00148    }

Member Data Documentation

BOOL m_bDelete

Definition at line 169 of file bmws_error.h.

Referenced by CExcep().

int m_code

Definition at line 168 of file bmws_error.h.

Referenced by CExcep(), CCOMExcep::Report(), COOMExcep::Report(), and Report().

The documentation for this class was generated from the following file:
  • bmws_error.h
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CExcep Member List

This is the complete list of members for CExcep, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
Report() | CExcep | [inline, virtual]
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


CExcepEx Class Reference

#include <bmws_error.h>

Inheritance diagram for CExcepEx:

CExcep CWinExcep CXMLExcep List of all members.

Public Methods

CExcepEx ()
CExcepEx (UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0)
virtual void | Report ()

Public Attributes

UINT | m_uidError
UINT | m_uidRemedy
UINT_PTR | m_uidErrorIns
UINT_PTR | m_uidRemedyIns
DWORD | m_dwFlags

Constructor & Destructor Documentation

CExcepEx ( ) [inline]

Definition at line 188 of file bmws_error.h.

00188               : CExcep(0)
00189    {
00190    }

CExcepEx | ( | UINT | uidError,
 |  | UINT | uidRemedy,
 |  | UINT_PTR | uidErrorIns = 0,
 |  | UINT_PTR | uidRemedyIns = 0,
 |  | DWORD | dwFlags = 0
 | ) | [inline]

Definition at line 211 of file bmws_error.h.

References ERROR_ERRORINS_LPTSTR, ERROR_REMEDYINS_LPTSTR, m_dwFlags, m_uidError, m_uidErrorIns, m_uidRemedy, m_uidRemedyIns, and SetErrorInserts().

00212                          : CExcep(uidError)
00213    {
00214       m_uidError = uidError;
00215       m_uidRemedy = uidRemedy;
00216       m_uidErrorIns = uidErrorIns;
00217       m_uidRemedyIns = uidRemedyIns;
00218       m_dwFlags = dwFlags;
00219       if(m_dwFlags & ERROR_ERRORINS_LPTSTR)
00220          SetErrorInserts((LPTSTR)uidErrorIns, NULL);
00221       if(m_dwFlags & ERROR_REMEDYINS_LPTSTR)
00222          SetErrorInserts((LPTSTR)uidRemedyIns, NULL);
00223    }

Member Function Documentation

virtual void Report ( ) [inline, virtual]

Reimplemented from CExcep.

Definition at line 226 of file bmws_error.h.

References g_hWnd, HandleError(), m_dwFlags, m_uidError, m_uidErrorIns, m_uidRemedy, and m_uidRemedyIns.

00231    {
00232 #ifdef _DEBUG
00233       HandleError(g_hWnd, m_uidError, m_uidRemedy, m_uidErrorIns, m_uidRemedyIns, m_dwFlags |
00234          (bFirst ? ERROR_FIRSTCHANCE : 0));
00235 #else
00236       HandleError(g_hWnd, m_uidError, m_uidRemedy, m_uidErrorIns, m_uidRemedyIns, m_dwFlags);
00237 #endif
00238    }

Member Data Documentation

DWORD m_dwFlags

Definition at line 245 of file bmws_error.h.

Referenced by CExcepEx(), CWinExcep::CWinExcep(), and Report().

UINT m_uidError

Definition at line 241 of file bmws_error.h.

Referenced by CExcepEx(), CWinExcep::CWinExcep(), and Report().

UINT_PTR m_uidErrorIns

Definition at line 243 of file bmws_error.h.

Referenced by CExcepEx(), CWinExcep::CWinExcep(), and Report().

UINT m_uidRemedy

Definition at line 242 of file bmws_error.h.

Referenced by CExcepEx(), CWinExcep::CWinExcep(), and Report().

UINT_PTR m_uidRemedyIns

Definition at line 244 of file bmws_error.h.

Referenced by CExcepEx(), CWinExcep::CWinExcep(), and Report().

The documentation for this class was generated from the following file:
  • bmws_error.h
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CExcepEx Member List

This is the complete list of members for CExcepEx, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
CExcepEx() | CExcepEx | [inline]
CExcepEx(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0) | CExcepEx | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
m_dwFlags | CExcepEx |
m_uidError | CExcepEx |
m_uidErrorIns | CExcepEx |
m_uidRemedy | CExcepEx |
m_uidRemedyIns | CExcepEx |
Report() | CExcepEx | [inline, virtual]
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


CFactory Class Reference

#include <bmws_comserver.h>

List of all members.

Public Methods

CFactory (const LPFACTORYDATA pFactoryData)
STDMETHOD (QueryInterface)(REFIID riid
STDMETHOD_ (DWORD, AddRef)()
STDMETHOD_ (DWORD, Release)()
STDMETHOD (CreateInstance)(LPUNKNOWN pUnkOuter
STDMETHOD (LockServer)(BOOL fLock)

Static Public Methods

HRESULT | CanUnloadNow ()
HRESULT | GetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
HRESULT | RegisterAll ()
HRESULT | UnregisterAll ()
BOOL | IsLocked ()

Public Attributes

LPVOID * | ppvObject
REFIID | riid
REFIID LPVOID * | ppvObject

Protected Attributes

long | m_cRef
const LPFACTORYDATA | m_pFactoryData

Static Protected Attributes

LONG | s_cServerLocks = 0

Constructor & Destructor Documentation

CFactory ( const LPFACTORYDATA pFactoryData )

Definition at line 275 of file bmws_comserver.cpp.

References m_cRef.

Referenced by GetClassObject().

00275                                                    :
00276    m_pFactoryData(pFactoryData)
00277 {
00278    m_cRef = 1;
00279 }

Member Function Documentation

HRESULT CanUnloadNow ( ) [static]

Definition at line 413 of file bmws_comserver.cpp.

References g_cActiveComponents, and IsLocked().

Referenced by DllCanUnloadNow().

00414 {
00415    return (g_cActiveComponents || IsLocked()) ? S_FALSE : S_OK;
00416 }

HRESULT GetClassObject | ( | REFCLSID | rclsid,
 |  | REFIID | riid,
 |  | LPVOID * | ppv
 | ) | [static]

Definition at line 382 of file bmws_comserver.cpp.

References CFactory(), g_cFactoryDataEntries, CFactoryData::m_pCLSID, and riid.

Referenced by DllGetClassObject().

00383 {
00384    if(!IsEqualIID(riid, IID_IUnknown) && !IsEqualIID(riid, IID_IClassFactory))
00385       return E_NOINTERFACE;
00386
00387    for(int i = 0; i < g_cFactoryDataEntries; i++)
00388    {
00389       const LPFACTORYDATA pData = &g_aFactoryData[i];
00390       if(IsEqualCLSID(*pData->m_pCLSID, rclsid))
00391       {
00392          *ppv = (LPUNKNOWN) new CFactory(pData);
00393          if(*ppv == NULL)
00394             return E_OUTOFMEMORY;
00395          return S_OK;
00396       }
00397    }
00398
00399    return CLASS_E_CLASSNOTAVAILABLE;
00400 }

BOOL IsLocked ( ) [inline, static]

Definition at line 84 of file bmws_comserver.h.

References s_cServerLocks.

Referenced by CanUnloadNow().

00085    {
00086       return s_cServerLocks > 0;
00087    }

HRESULT RegisterAll ( ) [static]

Definition at line 429 of file bmws_comserver.cpp.

References g_cFactoryDataEntries, g_hInst, and RegisterComponent().

Referenced by DllRegisterServer().

00430 {
00431    for(int i = 0; i < g_cFactoryDataEntries; i++)
00432    {
00433       RegisterComponent(g_hInst, *(g_aFactoryData[i].m_pCLSID), g_aFactoryData[i].uidStrBase,
00434          *(g_aFactoryData[i].m_pLIBID), g_aFactoryData[i].uidDescHolder,
00435          g_aFactoryData[i].uidProgIDHolder, g_aFactoryData[i].uidProgIDVIHolder,
00436          g_aFactoryData[i].uidDescRoot, g_aFactoryData[i].uidProgIDRoot);
00437    }
00438    return S_OK;
00439 }

STDMETHOD ( LockServer )

STDMETHOD ( CreateInstance )

STDMETHOD ( QueryInterface )

STDMETHOD_ | ( | DWORD | ,
 |  | Release |
 | ) |

STDMETHOD_ | ( | DWORD | ,
 |  | AddRef |
 | ) |

HRESULT UnregisterAll ( ) [static]

Definition at line 452 of file bmws_comserver.cpp.

References g_cFactoryDataEntries, and UnregisterComponent().

Referenced by DllUnregisterServer().

00453 {
00454    for(int i = 0; i < g_cFactoryDataEntries; i++)
00455    {
00456       UnregisterComponent(*(g_aFactoryData[i].m_pCLSID), g_aFactoryData[i].uidStrBase,
00457          g_aFactoryData[i].uidProgIDHolder, g_aFactoryData[i].uidProgIDVIHolder,
00458          g_aFactoryData[i].uidProgIDRoot);
00459    }
00460    return S_OK;
00461 }

Member Data Documentation

long m_cRef [protected]

Definition at line 91 of file bmws_comserver.h.

Referenced by CFactory().

const LPFACTORYDATA m_pFactoryData [protected]

Definition at line 92 of file bmws_comserver.h.

REFIID LPVOID* ppvObject

Definition at line 65 of file bmws_comserver.h.

LPVOID* ppvObject

Definition at line 60 of file bmws_comserver.h.

REFIID riid

Definition at line 65 of file bmws_comserver.h.

Referenced by GetClassObject().

LONG s_cServerLocks = 0 [static, protected]

Definition at line 29 of file bmws_comserver.cpp.

Referenced by IsLocked().

The documentation for this class was generated from the following files:
  • bmws_comserver.h
  • bmws_comserver.cpp
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFactory Member List

This is the complete list of members for CFactory, including all inherited members.
CanUnloadNow() | CFactory | [static]
CFactory(const LPFACTORYDATA pFactoryData) | CFactory |
GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) | CFactory | [static]
IsLocked() | CFactory | [inline, static]
m_cRef | CFactory | [protected]
m_pFactoryData | CFactory | [protected]
ppvObject | CFactory |
ppvObject | CFactory |
RegisterAll() | CFactory | [static]
riid | CFactory |
s_cServerLocks | CFactory | [protected, static]
STDMETHOD(QueryInterface)(REFIID riid | CFactory |
STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter | CFactory |
STDMETHOD(LockServer)(BOOL fLock) | CFactory |
STDMETHOD_(DWORD, AddRef)() | CFactory |
STDMETHOD_(DWORD, Release)() | CFactory |
UnregisterAll() | CFactory | [static]
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


CFactoryData Class Reference

#include <bmws_comserver.h>

List of all members.

Public Attributes

const CLSID * | m_pCLSID
FPCREATEINSTANCE CreateInstance
UINT | uidStrBase
const GUID * | m_pLIBID
UINT | uidDescHolder
UINT | uidProgIDHolder
UINT | uidProgIDVIHolder
UINT | uidDescRoot
UINT | uidProgIDRoot
WORD | m_wTypeLibVerMajor
WORD | m_wTypeLibVerMinor

Member Data Documentation

FPCREATEINSTANCE CreateInstance

Definition at line 33 of file bmws_comserver.h.

const CLSID* m_pCLSID

Definition at line 32 of file bmws_comserver.h.

Referenced by CFactory::GetClassObject().

const GUID* m_pLIBID

Definition at line 35 of file bmws_comserver.h.

WORD m_wTypeLibVerMajor

Definition at line 41 of file bmws_comserver.h.

WORD m_wTypeLibVerMinor

Definition at line 42 of file bmws_comserver.h.

UINT uidDescHolder

Definition at line 36 of file bmws_comserver.h.

UINT uidDescRoot

Definition at line 39 of file bmws_comserver.h.

UINT uidProgIDHolder

Definition at line 37 of file bmws_comserver.h.

UINT uidProgIDRoot

Definition at line 40 of file bmws_comserver.h.

UINT uidProgIDVIHolder

Definition at line 38 of file bmws_comserver.h.

UINT uidStrBase

Definition at line 34 of file bmws_comserver.h.

The documentation for this class was generated from the following file:
  • bmws_comserver.h
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFactoryData Member List

This is the complete list of members for CFactoryData, including all inherited members.
CreateInstance | CFactoryData
m_pCLSID | CFactoryData
m_pLIBID | CFactoryData
m_wTypeLibVerMajor | CFactoryData
m_wTypeLibVerMinor | CFactoryData
uidDescHolder | CFactoryData
uidDescRoot | CFactoryData
uidProgIDHolder | CFactoryData
uidProgIDRoot | CFactoryData
uidProgIDVIHolder | CFactoryData
uidStrBase | CFactoryData
Generated on Wed May 8 12:39:38 2002 for Solitaire Pack by doxygen 1.2.15


CFragment Class Reference

#include <Fragment.h>

Inheritance diagram for CFragment:

CPile CDispBase CEngineObj ICardPileSite IActionSite INDUnknownAndDispatch IEventHandlerSite List of all members.

Public Methods

CFragment ()
virtual | ~CFragment ()
STDMETHOD (AddToFragment)(IDispatch *pObj)
STDMETHOD (MoveToPile)(ISolpackPile *pDest
STDMETHOD (get_Type)(long *p)
STDMETHOD (get_X)(long *p)
STDMETHOD (put_X)(long v)
STDMETHOD (get_Y)(long *p)
STDMETHOD (put_Y)(long v)
STDMETHOD (get_Width)(long *p)
STDMETHOD (get_Height)(long *p)
STDMETHOD (get_NumCards)(long *p)
STDMETHOD (get_CommentTooltip)(BSTR *pbstrText)
STDMETHOD (put_CommentTooltip)(BSTR bstrText)
STDMETHOD (get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow)
STDMETHOD (put_ShowNumCardsTooltip)(VARIANT_BOOL bShow)
STDMETHOD (get_BaseType)(long *p)
STDMETHOD (put_BaseType)(long v)
STDMETHOD (Shuffle)()
STDMETHOD (GetCard)(long lIndex
void | DoAction (CAction *pAction)
void | UndoAction (CAction *pAction)
void | InitFragment (IMsgProcessor *pMsgProcessor, IFragmentSite *pSite)
void | SetCancelAnim (BOOL bCancelAnim)
void | MoveBy (long dx, long dy)
HRGN | GetPileRgn ()
void | CancelAdditions ()
void | FragToPile (CFragmentAction *pAction)
void | PileToFrag (CFragmentAction *pAction)

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
long | lIndex
long VARIANT_BOOL | bAnimate
long VARIANT_BOOL VARIANT_BOOL | bToggleFace

Protected Methods

void | TryAddPile (CPile *pPile)
void | Animate (CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices)

Protected Attributes

IFragmentSite * m_pFragSite
IMsgProcessor * m_pMsgProcessor
BOOL | m_bCancelAnim
CPtrArray< CPile *, CPile * > m_apSources
CFragmentAction * m_pCurAction

Constructor & Destructor Documentation

CFragment ( )

Definition at line 77 of file Fragment.cpp.

References m_apSources, m_bCancelAnim, m_pCurAction, CPile::m_pSite, ODS, and CPtrArray< CPile *, CPile * >::SetRelease().

00077                      : CPile(PILE_FRAGMENT)
00078 {
00079    // Set initial values for member variables
00080    m_pSite = NULL;
00081    m_bCancelAnim = FALSE;
00082    m_pCurAction = NULL;
00083
00084    // Signify that the contained pointers are COM interface pointers that
00085    // should be released, not deleted, when destroyed.
00086    m_apSources.SetRelease(TRUE);
00087    ODS("CFragment constructor");
00088 }

~CFragment ( ) [virtual]

Definition at line 96 of file Fragment.cpp.

References m_pCurAction, ODS, and SAFEDELETE.

00097 {
00098    SAFEDELETE(m_pCurAction);
00099    ODS("CFragment destructor");
00100 }

Member Function Documentation

void Animate | ( | CArray< CPile *, CPile * > & | apDests,
 |  | CArray< long, long > & | alIndices
 | ) | [protected]

Definition at line 659 of file Fragment.cpp.

References IFragmentSite::AnimStateChange(), IMsgProcessor::EmptyMessageQueue(), CArray< CCard *, CCard * >::GetSize(), CPile::m_apCards, m_bCancelAnim, CPile::m_lX, CPile::m_lY, m_pFragSite, m_pMsgProcessor, CArray::SetSize(), and STEPDISTANCE.

Referenced by FragToPile(), and PileToFrag().

00660 {
00661    // If there are no cards being animated, return
00662    int cCards = m_apCards.GetSize();
00663    if(cCards == 0)
00664       return;
00665
00666    // Tell the engine we are starting an animation
00667    m_pFragSite->AnimStateChange(TRUE);
00668
00669    // Create and size arrays used to hold calculated values for each card
00670    int i;
00671    CArray<SIZE, SIZE&> aAbsDeltaCard;
00672    CArray<DPAIR, DPAIR&> aStepDeltaCard;
00673    CArray<DPAIR, DPAIR&> aptCardCur;
00674    CArray<POINT, POINT&> aptCardDest;
00675    CArray<POINT, POINT&> aptCardSrc;
00676    CArray<int, int> acSteps;
00677    aAbsDeltaCard.SetSize(cCards);
00678    aptCardCur.SetSize(cCards);
00679    aStepDeltaCard.SetSize(cCards);
00680    aptCardDest.SetSize(cCards);
00681    aptCardSrc.SetSize(cCards);
00682    acSteps.SetSize(cCards);
00683    int cMaxSteps = 0;
00684
00685    // Calculate the delta X and Y that each card must travel
00686    for(i = 0; i < cCards; i++)
00687    {
00688       // delta = (pile dest coord + card dest offset) - (this frag coord + cur card offset)
00689       aptCardDest[i] = apDests[i]->GetCardSpot(/*i +*/ apIndices[i]);
00690       aptCardSrc[i] = m_apCards[i]->GetPosition();
00691       aAbsDeltaCard[i].cx = (apDests[i]->m_lX + aptCardDest[i].x) - (m_lX + aptCardSrc[i].x);
00692       aAbsDeltaCard[i].cy = (apDests[i]->m_lY + aptCardDest[i].y) - (m_lY + aptCardSrc[i].y);
00693       acSteps[i] = (int)ceil(fabs(sqrt(pow(aAbsDeltaCard[i].cx, 2) +
00694          pow(aAbsDeltaCard[i].cy, 2))) / STEPDISTANCE);
00695       if(acSteps[i] > cMaxSteps)
00696          cMaxSteps = acSteps[i];
00697       aptCardCur[i].x = aptCardSrc[i].x;
00698       aptCardCur[i].y = aptCardSrc[i].y;
00699    }
00700
00701    // Calculate the card steps
00702    for(i = 0; i < cCards; i++)
00703    {
00704       aStepDeltaCard[i].x = (double)(aAbsDeltaCard[i].cx) / acSteps[i];
00705       aStepDeltaCard[i].y = (double)(aAbsDeltaCard[i].cy) / acSteps[i];
00706    }
00707
00708    // Perform each step of the animation
00709    for(int j = 0; j < cMaxSteps-1 && !m_bCancelAnim; j++)
00710    {
00711       // Animate each individual card
00712       for(i = 0; i < cCards; i++)
00713       {
00714          if(j == acSteps[i])
00715          {
00716             // On the last step, move card to its final position to avoid
00717             // the card being a few pixels off due to rounding errors
00718             m_apCards[i]->SetPosition((apDests[i]->m_lX) + aptCardDest[i].x,
00719                (apDests[i]->m_lY) + aptCardDest[i].y);
00720          } else if(j < acSteps[i])
00721          {
00722             // Adjust the card's position
00723             aptCardCur[i].x += aStepDeltaCard[i].x;
00724             aptCardCur[i].y += aStepDeltaCard[i].y;
00725             m_apCards[i]->SetPosition((long)aptCardCur[i].x, (long)aptCardCur[i].y);
00726          }
00727       }
00728
00729       // Process messages so that the animation can actually be seen
00730       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00731    }
00732
00733    // Tell the engine we're done animating
00734    m_pFragSite->AnimStateChange(FALSE);
00735 }

void CancelAdditions ( )

Definition at line 419 of file Fragment.cpp.

References CHECKHRCOM, CPile::m_lX, CPile::m_lY, m_pCurAction, CEngineObj::m_spStyle, PileToFrag(), SAFEDELETE, and CPile::UpdateLayout().

Referenced by CEngine::CancelDrag().

00420 {
00421    // If we haven't added any additions, just return
00422    if(!m_pCurAction)
00423       return;
00424
00425    // Move all cards from the fragment back to their source pile
00426    PileToFrag(m_pCurAction);
00427    SAFEDELETE(m_pCurAction);
00428
00429    // Reset fragment position
00430    m_lX = 0;
00431    m_lY = 0;
00432    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00433    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00434    UpdateLayout();
00435 }

void DoAction ( CAction * pAction ) [virtual]

Reimplemented from CPile.

Definition at line 268 of file Fragment.cpp.

References ACTION_FRAGMENT, CPile::DoAction(), FragToPile(), CArray< CFragmentAdd *, CFragmentAdd * >::GetSize(), CFragmentAction::m_apAdditions, CPile::m_apCards, CFragmentAction::m_bMovedOnce, CAction::m_dwType, CPile::m_lX, CPile::m_lY, CEngineObj::m_spEl, TryAddPile(), and CPile::UpdateLayout().

00269 {
00270    if(pAction->m_dwType == ACTION_FRAGMENT)
00271    {
00272       CFragmentAction *pFAction = (CFragmentAction*)pAction;
00273       if(pFAction->m_bMovedOnce)
00274       {
00275          // If we haven't moved this pile yet (that is, if this is NOT a redo
00276          // operation), perform first-time movement setup
00277          CHTMLElement2Ptr spEl2(m_spEl);
00278          int cAdditions = pFAction->m_apAdditions.GetSize();
00279          for(int i = 0; i < cAdditions; i++)
00280          {
00281             // Actually add each pile/cards to the fragment
00282             pFAction->m_apAdditions[i]->Setup(m_apCards, m_lX, m_lY, (ICardPileSite*)this,
00283                spEl2);
00284             TryAddPile(pFAction->m_apAdditions[i]->m_pPileSrc);
00285          }
00286          UpdateLayout();
00287       }
00288
00289       // Move the fragment to the specified target pile
00290       FragToPile((CFragmentAction*)pAction);
00291    } else
00292       CPile::DoAction(pAction);  // The Pile class handles any other actions
00293 }

void FragToPile ( CFragmentAction * pAction )

Definition at line 449 of file Fragment.cpp.

References _ASSERT, Animate(), CHECKHRCOM, IMsgProcessor::EmptyMessageQueue(), IPileSite::GetAnim(), CPile::GetNumCards(), CArray< CPile *, CPile * >::GetSize(), CArray< CCard *, CCard * >::GetSize(), CArray< CFragmentAdd *, CFragmentAdd * >::GetSize(), CFragmentAction::m_apAdditions, CPile::m_apCards, m_apSources, CFragmentAction::m_bAnimate, m_bCancelAnim, CFragmentAction::m_bMovedOnce, CFragmentAction::m_bToggleFace, CFragmentAction::m_lIndex, CPile::m_lX, CPile::m_lY, m_pMsgProcessor, CFragmentAction::m_pPileDest, CPile::m_pSite, CEngineObj::m_spStyle, CPile::PreReceiveCards(), CPile::ReceiveCards(), CArray::SetAt(), CArray< CPile *, CPile * >::SetSize(), CArray< CCard *, CCard * >::SetSize(), CArray::SetSize(), and CPile::UpdateLayout().

Referenced by DoAction().

00450 {
00451    _ASSERT(pAction);
00452    _ASSERT(pAction->m_pPileDest);
00453
00454    pAction->m_bMovedOnce = TRUE;
00455
00456    int cAdditions = pAction->m_apAdditions.GetSize();
00457
00458    // Have all the source piles remove the cards that were transferred
00459    int i;
00460    for(i = 0; i < cAdditions; i++)
00461       pAction->m_apAdditions[i]->ClearSrc();
00462
00463    int cCards = m_apCards.GetSize();
00464    if(cCards == 0)
00465       return;
00466
00467    // Prepare the destination pile to receive the cards
00468    if(pAction->m_lIndex > pAction->m_pPileDest->GetNumCards())
00469       pAction->m_lIndex = -1;
00470    pAction->m_lIndex = pAction->m_pPileDest->PreReceiveCards(pAction->m_lIndex, m_apCards);
00471
00472    // Check whether to animate cards
00473    BOOL bEmptyQueue = TRUE;
00474    if(pAction->m_bAnimate && m_pSite->GetAnim())
00475    {
00476       // All cards go to the same destination pile in this case
00477       // Set their indices according to the destination index
00478       CArray<CPile*, CPile*> apDests;
00479       CArray<long, long> alIndices;
00480       apDests.SetSize(cCards);
00481       alIndices.SetSize(cCards);
00482       for(i = 0; i < cCards; i++)
00483       {
00484          apDests.SetAt(i, pAction->m_pPileDest);
00485          long l = pAction->m_lIndex + i;
00486          alIndices.SetAt(i, l);
00487       }
00488
00489       // Perform the animation
00490       Animate(apDests, alIndices);
00491       bEmptyQueue = !m_bCancelAnim;
00492    }
00493
00494    // Actually transfer the cards to the target pile
00495    pAction->m_pPileDest->ReceiveCards(pAction->m_lIndex, m_apCards);
00496    if(bEmptyQueue)
00497       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00498
00499    // Toggle the cards' FaceUp property, if desired
00500    if(pAction->m_bToggleFace)
00501       for(i = 0; i < cCards; i++)
00502          m_apCards[i]->ToggleFace();
00503
00504    // Update the layout of the piles from which cards came
00505    int cPiles = m_apSources.GetSize();
00506    for(i = 0; i < cPiles; i++)
00507       m_apSources[i]->UpdateLayout();
00508
00509    m_apCards.SetSize(0);
00510
00511    // Reposition the fragment
00512    m_lX = 0;
00513    m_lY = 0;
00514    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00515    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00516    UpdateLayout();
00517
00518    m_apSources.SetSize(0);
00519 }

HRGN GetPileRgn ( )

Definition at line 403 of file Fragment.cpp.

References CPile::m_hRgn.

Referenced by CEngine::HandleTryDrop().

00404 {
00405    return m_hRgn;
00406 }

void InitFragment | ( | IMsgProcessor * | pMsgProcessor,
 |  | IFragmentSite * | pSite
 | ) |

Definition at line 330 of file Fragment.cpp.

References _ASSERT, CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, g_pTypeLib, CHTMLHelper::GetNamedEl(), IDS_EL_FRAGMENT, IID_ISolpackFragment, CDispBase::Init(), ISolpackFragment, m_pFragSite, CEngineObj::m_pHH, m_pMsgProcessor, CEngineObj::m_spEl, CEngineObj::m_spStyle, and ODS.

Referenced by CEngine::InitEngine().

00331 {
00332    _ASSERT(m_pHH);
00333    _ASSERT(pSite);
00334    m_pFragSite = pSite;
00335    m_pMsgProcessor = pMsgProcessor;
00336    ODS("CFragment::InitFragment");
00337
00338    Init(g_pTypeLib, IID_ISolpackFragment, (LPDISPATCH)((ISolpackFragment*)this));
00339
00340    // Initialize the fragment HTML element
00341    m_spEl.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_FRAGMENT, IID_IHTMLElement));
00342    CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00343    CHECKHRCOM(m_spStyle->put_pixelLeft(0));
00344    CHECKHRCOM(m_spStyle->put_pixelTop(0));
00345 }

void MoveBy | ( | long | dx,
 |  | long | dy
 | ) |

Definition at line 377 of file Fragment.cpp.

References CHECKHRCOM, CPile::m_lX, CPile::m_lY, and CEngineObj::m_spStyle.

Referenced by CEngine::MouseMove().

00378 {
00379    // Only update the HTML element's position if the coordinate changed
00380    if(dx != 0)
00381    {
00382       m_lX += dx;
00383       CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00384    }
00385    if(dy != 0)
00386    {
00387       m_lY += dy;
00388       CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00389    }
00390 }

void PileToFrag ( CFragmentAction * pAction )

Definition at line 535 of file Fragment.cpp.

References Animate(), CHECKHRCOM, CPile::ClearTransferred(), IMsgProcessor::EmptyMessageQueue(), IPileSite::GetAnim(), CArray< CFragmentAdd *, CFragmentAdd * >::GetSize(), CPile::m_abTransferred, CFragmentAction::m_apAdditions, CPile::m_apCards, m_apSources, CFragmentAction::m_bAnimate, m_bCancelAnim, CFragmentAction::m_bToggleFace, CFragmentAction::m_cCards, CFragmentAction::m_lIndex, CPile::m_lX, CPile::m_lY, m_pMsgProcessor, CFragmentAction::m_pPileDest, CPile::m_pSite, CEngineObj::m_spEl, CEngineObj::m_spStyle, CArray< CPile *, CPile * >::SetSize(), CArray< BOOL, BOOL >::SetSize(), CArray< CCard *, CCard * >::SetSize(), CArray::SetSize(), CPile::TransferCards(), and CPile::UpdateLayout().

Referenced by CancelAdditions(), and UndoAction().

00536 {
00537    // If there are no cards to be moved, return
00538    int cCards = pAction->m_cCards;
00539    if(cCards == 0)
00540       return;
00541
00542    int cAdditions = pAction->m_apAdditions.GetSize();
00543
00544    int i;
00545    CPile *pSrc = pAction->m_pPileDest;
00546    if(pSrc)
00547    {
00548       // Note: pSrc would be null if this method is called from
00549       // CancelAdditions (that is, drag is cancelled before being dropped)
00550
00551       // Move the cards from their target pile back into the fragment
00552       pSrc->TransferCards(pAction->m_lIndex, cCards, m_apCards);
00553       pSrc->ClearTransferred();
00554       pSrc->UpdateLayout();
00555
00556       // Toggle the cards' FaceUp property, if desired
00557       if(pAction->m_bToggleFace)
00558          for(i = 0; i < cCards; i++)
00559             m_apCards[i]->ToggleFace();
00560
00561       // Add all the cards to the fragment pile
00562       CHTMLElement2Ptr spEl2(m_spEl);
00563       for(i = 0; i < cCards; i++)
00564       {
00565          m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00566          POINT pt = m_apCards[i]->GetPosition();
00567          m_apCards[i]->SetIndex(i);
00568          m_apCards[i]->SetPosition(pt.x + pSrc->m_lX - m_lX, pt.y + pSrc->m_lY - m_lY);
00569       }
00570    }
00571
00572    UpdateLayout();
00573
00574    // Have source piles remove cards that were transferred
00575    for(i = cAdditions - 1; i >= 0; i--)
00576       pAction->m_apAdditions[i]->m_pPileSrc->ClearTransferred();
00577
00578    // Prepare source piles to receive cards
00579    for(i = 0; i < cAdditions; i++)
00580       pAction->m_apAdditions[i]->DoPreReceive(m_apCards);
00581
00582    // Check whether to animate cards
00583    BOOL bEmptyQueue = !m_bCancelAnim;
00584    if(pAction->m_bAnimate && m_pSite->GetAnim())
00585    {
00586       // Here, destination piles are the pile from which the card first came
00587       // Index is that which it originally had
00588       CArray<CPile*, CPile*> apDests;
00589       CArray<long, long> alIndices;
00590       apDests.SetSize(cCards);
00591       alIndices.SetSize(cCards);
00592       long lIndexCur = 0;
00593       for(i = 0; i < cAdditions; i++)
00594          pAction->m_apAdditions[i]->SetDestAndIndex(apDests, alIndices, lIndexCur);
00595
00596       // Perform the animation
00597       Animate(apDests, alIndices);
00598       bEmptyQueue = !m_bCancelAnim;
00599    }
00600
00601    if(bEmptyQueue)
00602       m_pMsgProcessor->EmptyMessageQueue(FALSE);
00603
00604    // Actually transfer the cards back to their original pile
00605    for(i = cAdditions - 1; i >= 0; i--)
00606       pAction->m_apAdditions[i]->DoReceive(m_apCards);
00607
00608    m_apCards.SetSize(0);
00609    m_abTransferred.SetSize(0);
00610    m_apSources.SetSize(0);
00611
00612    // Reposition the fragment
00613    m_lX = 0;
00614    m_lY = 0;
00615    CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00616    CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00617    UpdateLayout();
00618 }

void SetCancelAnim ( BOOL bCancelAnim )

Definition at line 359 of file Fragment.cpp.

References m_bCancelAnim.

Referenced by CEngine::EventHandler(), CEngine::MouseUp(), CEngine::SetState(), and CEngine::TryCommand().

00360 {
00361    m_bCancelAnim = bCancelAnim;
00362 }

STDMETHOD ( GetCard )

Reimplemented from CPile.

STDMETHOD ( Shuffle ) [inline]

Reimplemented from CPile.

Definition at line 123 of file Fragment.h.

00124       { return E_NOTIMPL; }

STDMETHOD ( put_BaseType ) [inline]

Reimplemented from CPile.

Definition at line 121 of file Fragment.h.

00122       { return E_NOTIMPL; }

STDMETHOD ( get_BaseType ) [inline]

Reimplemented from CPile.

Definition at line 119 of file Fragment.h.

00120       { return E_NOTIMPL; }

STDMETHOD ( put_ShowNumCardsTooltip ) [inline]

Reimplemented from CPile.

Definition at line 117 of file Fragment.h.

00118       { return E_NOTIMPL; }

STDMETHOD ( get_ShowNumCardsTooltip ) [inline]

Reimplemented from CPile.

Definition at line 115 of file Fragment.h.

00116       { return E_NOTIMPL; }

STDMETHOD ( put_CommentTooltip ) [inline]

Reimplemented from CPile.

Definition at line 113 of file Fragment.h.

00114       { return E_NOTIMPL; }

STDMETHOD ( get_CommentTooltip ) [inline]

Reimplemented from CPile.

Definition at line 111 of file Fragment.h.

00112       { return E_NOTIMPL; }

STDMETHOD ( get_NumCards ) [inline]

Reimplemented from CPile.

Definition at line 109 of file Fragment.h.

00110       { return CPile::get_NumCards(p); }

STDMETHOD ( get_Height ) [inline]

Reimplemented from CPile.

Definition at line 107 of file Fragment.h.

00108       { return CPile::get_Height(p); }

STDMETHOD ( get_Width ) [inline]

Reimplemented from CPile.

Definition at line 105 of file Fragment.h.

00106       { return CPile::get_Width(p); }

STDMETHOD ( put_Y ) [inline]

Reimplemented from CPile.

Definition at line 103 of file Fragment.h.

00104       { return CPile::put_Y(v); }

STDMETHOD ( get_Y ) [inline]

Reimplemented from CPile.

Definition at line 101 of file Fragment.h.

00102       { return CPile::get_Y(p); }

STDMETHOD ( put_X ) [inline]

Reimplemented from CPile.

Definition at line 99 of file Fragment.h.

00100       { return CPile::put_X(v); }

STDMETHOD ( get_X ) [inline]

Reimplemented from CPile.

Definition at line 97 of file Fragment.h.

00098       { return CPile::get_X(p); }

STDMETHOD ( get_Type ) [inline]

Reimplemented from CPile.

Definition at line 95 of file Fragment.h.

00096       { return CPile::get_Type(p); }

STDMETHOD ( MoveToPile )

STDMETHOD ( AddToFragment )

void TryAddPile ( CPile * pPile ) [protected]

Definition at line 632 of file Fragment.cpp.

References CArray< CPile *, CPile * >::Add(), CArray< CPile *, CPile * >::GetSize(), and m_apSources.

Referenced by DoAction().

00633 {
00634    // If the pile is already in the array of source piles, return
00635    int cPiles = m_apSources.GetSize();
00636    for(int i = 0; i < cPiles; i++)
00637       if(m_apSources[i] == pPile)
00638          return;
00639
00640    // Pile is not in the array; add it
00641    m_apSources.Add(pPile);
00642    pPile->AddRef();
00643 }

void UndoAction ( CAction * pAction ) [virtual]

Reimplemented from CPile.

Definition at line 307 of file Fragment.cpp.

References ACTION_FRAGMENT, CAction::m_dwType, PileToFrag(), and CPile::UndoAction().

00308 {
00309    if(pAction->m_dwType == ACTION_FRAGMENT)
00310       // Move the cards from the target pile back into the fragment, and then
00311       // back to their source pile(s)
00312       PileToFrag((CFragmentAction*)pAction);
00313    else
00314       CPile::UndoAction(pAction);
00315 }

Member Data Documentation

long VARIANT_BOOL bAnimate

Definition at line 91 of file Fragment.h.

long VARIANT_BOOL VARIANT_BOOL bToggleFace

Definition at line 91 of file Fragment.h.

DECLARE_IUNKNOWN_AND_IDISPATCH

Reimplemented from CPile.

Definition at line 87 of file Fragment.h.

long lIndex

Definition at line 91 of file Fragment.h.

CPtrArray<CPile*, CPile*> m_apSources [protected]

Definition at line 154 of file Fragment.h.

Referenced by CFragment(), FragToPile(), PileToFrag(), and TryAddPile().

BOOL m_bCancelAnim [protected]

Definition at line 153 of file Fragment.h.

Referenced by Animate(), CFragment(), FragToPile(), PileToFrag(), and SetCancelAnim().

CFragmentAction* m_pCurAction [protected]

Definition at line 155 of file Fragment.h.

Referenced by CancelAdditions(), CFragment(), and ~CFragment().

IFragmentSite* m_pFragSite [protected]

Definition at line 151 of file Fragment.h.

Referenced by Animate(), and InitFragment().

IMsgProcessor* m_pMsgProcessor [protected]

Definition at line 152 of file Fragment.h.

Referenced by Animate(), FragToPile(), InitFragment(), and PileToFrag().

The documentation for this class was generated from the following files:
  • Fragment.h
  • Fragment.cpp
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFragment Member List

This is the complete list of members for CFragment, including all inherited members.
Animate(CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices) | CFragment | [protected]
bAnimate | CFragment |
bToggleFace | CFragment |
CancelAdditions() | CFragment |
CDispBase() | CDispBase |
CEngineObj() | CEngineObj |
CFragment() | CFragment |
ClearCards() | CPile |
ClearTransferred() | CPile |
cNames | CDispBase |
CPile(long lType) | CPile |
DECLARE_IUNKNOWN_AND_IDISPATCH | CFragment |
DoAction(CAction *pAction) | CFragment | [virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngineObj | [virtual]
FragToPile(CFragmentAction *pAction) | CFragment |
GetCardSpot(long lIndex) | CPile |
GetDispatch() const | CDispBase | [inline, protected]
GetNumCards() | CPile |
GetOuterUnknown() const | CDispBase | [inline, protected]
GetPileInterface(ISolpackPile **pp) | CPile | [virtual]
GetPileRgn() | CFragment |
GetSizeWith(int cCards) | CPile | [protected]
GetType() | CEngineObj |
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CEngineObj |
InitFragment(IMsgProcessor *pMsgProcessor, IFragmentSite *pSite) | CFragment |
InitPile(IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CPile |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
lIndex | CFragment |
m_abTransferred | CPile | [protected]
m_apCards | CPile | [protected]
m_apSources | CFragment | [protected]
m_bCancelAnim | CFragment | [protected]
m_bShowNumCards | CPile | [protected]
m_dwEngObjType | CEngineObj | [protected]
m_hRgn | CPile | [protected]
m_lBaseType | CPile | [protected]
m_lHeight | CPile | [protected]
m_lpszTooltip | CPile | [protected]
m_lType | CPile |
m_lWidth | CPile | [protected]
m_lX | CPile |
m_lY | CPile |
m_pCurAction | CFragment | [protected]
m_pEngObjSite | CEngineObj | [protected]
m_pFragSite | CFragment | [protected]
m_pHH | CEngineObj | [protected]
m_pMsgProcessor | CFragment | [protected]
m_pSite | CPile | [protected]
m_spEl | CEngineObj | [protected]
m_spImgElBase | CPile | [protected]
m_spStyle | CEngineObj | [protected]
MoveBy(long dx, long dy) | CFragment |
pDispParams | CDispBase |
pExcepInfo | CDispBase |
PileReleaseElCapture() | CPile | [inline, virtual]
PileSetElCapture() | CPile | [inline, virtual]
PileToFrag(CFragmentAction *pAction) | CFragment |
plHeight | CPile |
plWidth | CPile |
ppCard | CPile |
ppTInfo | CDispBase |
ppvObject | CPile |
PreReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
PtInPile(POINT pt) | CPile |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
ReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
ReleaseElCapture() | CPile | [protected, virtual]
rgDispId | CDispBase |
RgnInPile(HRGN hRgn) | CPile |
rgszNames | CDispBase |
riid | CDispBase |
SetCancelAnim(BOOL bCancelAnim) | CFragment |
SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex) | CPile | [virtual]
SetElCapture() | CPile | [protected, virtual]
SetEventHandlers() | CEngineObj | [protected]
STDMETHOD(AddToFragment)(IDispatch *pObj) | CFragment |
STDMETHOD(MoveToPile)(ISolpackPile *pDest | CFragment |
STDMETHOD(get_Type)(long *p) | CFragment | [inline]
STDMETHOD(get_X)(long *p) | CFragment | [inline]
STDMETHOD(put_X)(long v) | CFragment | [inline]
STDMETHOD(get_Y)(long *p) | CFragment | [inline]
STDMETHOD(put_Y)(long v) | CFragment | [inline]
STDMETHOD(get_Width)(long *p) | CFragment | [inline]
STDMETHOD(get_Height)(long *p) | CFragment | [inline]
STDMETHOD(get_NumCards)(long *p) | CFragment | [inline]
STDMETHOD(get_CommentTooltip)(BSTR *pbstrText) | CFragment | [inline]
STDMETHOD(put_CommentTooltip)(BSTR bstrText) | CFragment | [inline]
STDMETHOD(get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow) | CFragment | [inline]
STDMETHOD(put_ShowNumCardsTooltip)(VARIANT_BOOL bShow) | CFragment | [inline]
STDMETHOD(get_BaseType)(long *p) | CFragment | [inline]
STDMETHOD(put_BaseType)(long v) | CFragment | [inline]
STDMETHOD(Shuffle)() | CFragment | [inline]
STDMETHOD(GetCard)(long lIndex | CFragment |
CPile::STDMETHOD(WidthWith)(long lNumCards | CPile |
CPile::STDMETHOD(HeightWith)(long lNumCards | CPile |
CPile::STDMETHOD(NDQueryInterface)(REFIID riid | CPile |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
TooltipPrefChanged() | CPile |
TransferCards(CPtrArray< CCard *, CCard * > &apDest) | CPile |
TransferCards(long lIndex, long cCards, CPtrArray< CCard *, CCard * > &apDest) | CPile |
TryAddPile(CPile *pPile) | CFragment | [protected]
UndoAction(CAction *pAction) | CFragment | [virtual]
UpdateBaseImg() | CPile | [protected]
UpdateDims() | CPile | [protected]
UpdateLayout(int iBegin=0, int iEnd=-1) | CPile |
UpdateTooltip() | CPile | [protected]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CEngineObj() | CEngineObj | [virtual]
~CFragment() | CFragment | [virtual]
~CPile() | CPile | [virtual]
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


CFragmentAction Class Reference

#include <Fragment.h>

Inheritance diagram for CFragmentAction:

CAction List of all members.

Public Methods

CFragmentAction (IActionSite *pSite)
virtual | ~CFragmentAction ()
void | AddPile (CPile *pPile)
void | AddCard (CPile *pCard)

Protected Attributes

CPtrArray< CFragmentAdd *,
CFragmentAdd * > 		m_apAdditions
CPile * m_pPileDest
long | m_lIndex
BOOL | m_bAnimate
BOOL | m_bToggleFace
long | m_cCards
BOOL | m_bMovedOnce

Friends

class | CFragment

Constructor & Destructor Documentation

CFragmentAction ( IActionSite * pSite )

Definition at line 57 of file Fragment.cpp.

References ACTION_FRAGMENT, m_apAdditions, m_bAnimate, m_bMovedOnce, m_bToggleFace, m_cCards, m_lIndex, m_pPileDest, and CArray< CFragmentAdd *, CFragmentAdd * >::SetSize().

00057                                                    : CAction(pSite, ACTION_FRAGMENT, 0)
00058 {
00059    // Set initial values for member variables
00060    m_pPileDest = FALSE;
00061    m_bAnimate = TRUE;
00062    m_bToggleFace = FALSE;
00063    m_lIndex = -1;
00064    m_cCards = 0;
00065    m_apAdditions.SetSize(0, 8);
00066    m_bMovedOnce = FALSE;
00067 }

virtual ~CFragmentAction ( ) [inline, virtual]

Definition at line 54 of file Fragment.h.

00054 {}

Member Function Documentation

void AddCard ( CPile * pCard )

void AddPile ( CPile * pPile )

Friends And Related Function Documentation

friend class CFragment [friend]

Definition at line 59 of file Fragment.h.

Member Data Documentation

CPtrArray<CFragmentAdd*, CFragmentAdd*> m_apAdditions [protected]

Definition at line 62 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::DoAction(), CFragment::FragToPile(), and CFragment::PileToFrag().

BOOL m_bAnimate [protected]

Definition at line 66 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::FragToPile(), and CFragment::PileToFrag().

BOOL m_bMovedOnce [protected]

Definition at line 69 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::DoAction(), and CFragment::FragToPile().

BOOL m_bToggleFace [protected]

Definition at line 67 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::FragToPile(), and CFragment::PileToFrag().

long m_cCards [protected]

Definition at line 68 of file Fragment.h.

Referenced by CFragmentAction(), and CFragment::PileToFrag().

long m_lIndex [protected]

Definition at line 65 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::FragToPile(), and CFragment::PileToFrag().

CPile* m_pPileDest [protected]

Definition at line 64 of file Fragment.h.

Referenced by CFragmentAction(), CFragment::FragToPile(), and CFragment::PileToFrag().

The documentation for this class was generated from the following files:
  • Fragment.h
  • Fragment.cpp
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFragmentAction Member List

This is the complete list of members for CFragmentAction, including all inherited members.
AddCard(CPile *pCard) | CFragmentAction |
AddPile(CPile *pPile) | CFragmentAction |
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
CFragment class | CFragmentAction | [friend]
CFragmentAction(IActionSite *pSite) | CFragmentAction |
m_apAdditions | CFragmentAction | [protected]
m_bAnimate | CFragmentAction | [protected]
m_bMovedOnce | CFragmentAction | [protected]
m_bToggleFace | CFragmentAction | [protected]
m_cCards | CFragmentAction | [protected]
m_dwData | CAction |
m_dwType | CAction |
m_lIndex | CFragmentAction | [protected]
m_pNext | CAction |
m_pPileDest | CFragmentAction | [protected]
m_pPrev | CAction |
m_pSite | CAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
~CFragmentAction() | CFragmentAction | [inline, virtual]
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


CFragmentAdd Class Reference

#include <FragmentAdd.h>

Inheritance diagram for CFragmentAdd:

CFragmentAddCard CFragmentAddPile List of all members.

Public Methods

virtual void | DoPreReceive (CPtrArray< CCard *, CCard * > &apCards)=0
virtual void | DoReceive (CPtrArray< CCard *, CCard * > &apCards)=0
virtual void | ClearSrc ()=0
virtual void | SetDestAndIndex (CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex)=0
virtual void | Setup (CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2)=0

Public Attributes

CPile * m_pPileSrc
long | m_lIndexDest

Member Function Documentation

virtual void ClearSrc ( ) [pure virtual]

Implemented in CFragmentAddPile, and CFragmentAddCard.

virtual void DoPreReceive ( CPtrArray< CCard *, CCard * > & apCards ) [pure virtual]

Implemented in CFragmentAddPile, and CFragmentAddCard.

virtual void DoReceive ( CPtrArray< CCard *, CCard * > & apCards ) [pure virtual]

Implemented in CFragmentAddPile, and CFragmentAddCard.

virtual void SetDestAndIndex | ( | CArray< CPile *, CPile * > & | apDests,
 |  | CArray< long, long > & | alIndices,
 |  | long & | lIndex
 | ) | [pure virtual]

Implemented in CFragmentAddPile, and CFragmentAddCard.

virtual void Setup | ( | CPtrArray< CCard *, CCard * > & | apCards,
 |  | long | lFragX,
 |  | long | lFragY,
 |  | ICardPileSite * | pSite,
 |  | CHTMLElement2Ptr & | spEl2
 | ) | [pure virtual]

Implemented in CFragmentAddPile, and CFragmentAddCard.

Member Data Documentation

long m_lIndexDest

Definition at line 42 of file FragmentAdd.h.

Referenced by CFragmentAddCard::DoPreReceive(), CFragmentAddPile::DoPreReceive(), CFragmentAddCard::DoReceive(), CFragmentAddPile::DoReceive(), and CFragmentAddCard::Setup().

CPile* m_pPileSrc

Definition at line 41 of file FragmentAdd.h.

Referenced by CFragmentAddCard::ClearSrc(), CFragmentAddPile::ClearSrc(), CFragmentAddCard::DoPreReceive(), CFragmentAddPile::DoPreReceive(), CFragmentAddCard::DoReceive(), CFragmentAddPile::DoReceive(), CFragmentAddCard::SetDestAndIndex(), CFragmentAddPile::SetDestAndIndex(), CFragmentAddCard::Setup(), and CFragmentAddPile::Setup().

The documentation for this class was generated from the following file:
  • FragmentAdd.h
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFragmentAdd Member List

This is the complete list of members for CFragmentAdd, including all inherited members.
ClearSrc()=0 | CFragmentAdd | [pure virtual]
DoPreReceive(CPtrArray< CCard *, CCard * > &apCards)=0 | CFragmentAdd | [pure virtual]
DoReceive(CPtrArray< CCard *, CCard * > &apCards)=0 | CFragmentAdd | [pure virtual]
m_lIndexDest | CFragmentAdd |
m_pPileSrc | CFragmentAdd |
SetDestAndIndex(CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex)=0 | CFragmentAdd | [pure virtual]
Setup(CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2)=0 | CFragmentAdd | [pure virtual]
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


CFragmentAddCard Class Reference

#include <FragmentAdd.h>

Inheritance diagram for CFragmentAddCard:

CFragmentAdd List of all members.

Public Methods

void | DoPreReceive (CPtrArray< CCard *, CCard * > &apCards)
void | DoReceive (CPtrArray< CCard *, CCard * > &apCards)
void | ClearSrc ()
void | SetDestAndIndex (CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex)
void | Setup (CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2)

Public Attributes

CCard * m_pCardSrc
long | m_lIndexSrc

Member Function Documentation

void ClearSrc ( ) [virtual]

Implements CFragmentAdd.

Definition at line 172 of file FragmentAdd.cpp.

References CPile::ClearTransferred(), and CFragmentAdd::m_pPileSrc.

00173 {
00174    m_pPileSrc->ClearTransferred();
00175 }

void DoPreReceive ( CPtrArray< CCard *, CCard * > & apCards ) [virtual]

Implements CFragmentAdd.

Definition at line 139 of file FragmentAdd.cpp.

References CFragmentAdd::m_lIndexDest, m_lIndexSrc, CFragmentAdd::m_pPileSrc, and CPile::PreReceiveCards().

00140 {
00141    m_pPileSrc->PreReceiveCards(m_lIndexSrc, apCards, m_lIndexDest, 1);
00142 }

void DoReceive ( CPtrArray< CCard *, CCard * > & apCards ) [virtual]

Implements CFragmentAdd.

Definition at line 156 of file FragmentAdd.cpp.

References CFragmentAdd::m_lIndexDest, m_lIndexSrc, CFragmentAdd::m_pPileSrc, and CPile::ReceiveCards().

00157 {
00158    m_pPileSrc->ReceiveCards(m_lIndexSrc, apCards, m_lIndexDest, 1);
00159 }

void SetDestAndIndex | ( | CArray< CPile *, CPile * > & | apDests,
 |  | CArray< long, long > & | alIndices,
 |  | long & | lIndex
 | ) | [virtual]

Implements CFragmentAdd.

Definition at line 192 of file FragmentAdd.cpp.

References m_lIndexSrc, CFragmentAdd::m_pPileSrc, and CArray::SetAt().

00194 {
00195    apDests.SetAt(lIndex, m_pPileSrc);
00196    alIndices.SetAt(lIndex, m_lIndexSrc);
00197    lIndex++;
00198 }

void Setup | ( | CPtrArray< CCard *, CCard * > & | apCards,
 |  | long | lFragX,
 |  | long | lFragY,
 |  | ICardPileSite * | pSite,
 |  | CHTMLElement2Ptr & | spEl2
 | ) | [virtual]

Implements CFragmentAdd.

Definition at line 217 of file FragmentAdd.cpp.

References CCard::GetPosition(), CArray< TP, TPA >::GetSize(), CFragmentAdd::m_lIndexDest, m_lIndexSrc, CPile::m_lX, CPile::m_lY, m_pCardSrc, CFragmentAdd::m_pPileSrc, CCard::SetIndex(), CCard::SetPile(), CCard::SetPosition(), and CPile::TransferCards().

00219 {
00220    // Transfer the card to the fragment
00221    int cCardsOld = apCards.GetSize();
00222    m_pPileSrc->TransferCards(m_lIndexSrc, 1, apCards);
00223    m_lIndexDest = cCardsOld;
00224
00225    // Set up the card in the fragment
00226    m_pCardSrc->SetPile(pSite, spEl2);
00227    m_pCardSrc->SetIndex(cCardsOld);
00228    POINT pt = m_pCardSrc->GetPosition();
00229    m_pCardSrc->SetPosition(pt.x + m_pPileSrc->m_lX - lFragX, pt.y + m_pPileSrc->m_lY - lFragY);
00230 }

Member Data Documentation

long m_lIndexSrc

Definition at line 85 of file FragmentAdd.h.

Referenced by DoPreReceive(), DoReceive(), SetDestAndIndex(), and Setup().

CCard* m_pCardSrc

Definition at line 84 of file FragmentAdd.h.

Referenced by Setup().

The documentation for this class was generated from the following files:
  • FragmentAdd.h
  • FragmentAdd.cpp
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFragmentAddCard Member List

This is the complete list of members for CFragmentAddCard, including all inherited members.
ClearSrc() | CFragmentAddCard | [virtual]
DoPreReceive(CPtrArray< CCard *, CCard * > &apCards) | CFragmentAddCard | [virtual]
DoReceive(CPtrArray< CCard *, CCard * > &apCards) | CFragmentAddCard | [virtual]
m_lIndexDest | CFragmentAdd |
m_lIndexSrc | CFragmentAddCard |
m_pCardSrc | CFragmentAddCard |
m_pPileSrc | CFragmentAdd |
SetDestAndIndex(CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex) | CFragmentAddCard | [virtual]
Setup(CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2) | CFragmentAddCard | [virtual]
Generated on Wed May 8 12:39:39 2002 for Solitaire Pack by doxygen 1.2.15


CFragmentAddPile Class Reference

#include <FragmentAdd.h>

Inheritance diagram for CFragmentAddPile:

CFragmentAdd List of all members.

Public Methods

void | DoPreReceive (CPtrArray< CCard *, CCard * > &apCards)
void | DoReceive (CPtrArray< CCard *, CCard * > &apCards)
void | ClearSrc ()
void | SetDestAndIndex (CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex)
void | Setup (CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2)

Public Attributes

long | m_cCards

Member Function Documentation

void ClearSrc ( ) [virtual]

Implements CFragmentAdd.

Definition at line 60 of file FragmentAdd.cpp.

References CPile::ClearCards(), and CFragmentAdd::m_pPileSrc.

00061 {
00062    m_pPileSrc->ClearCards();
00063 }

void DoPreReceive ( CPtrArray< CCard *, CCard * > & apCards ) [virtual]

Implements CFragmentAdd.

Definition at line 27 of file FragmentAdd.cpp.

References m_cCards, CFragmentAdd::m_lIndexDest, CFragmentAdd::m_pPileSrc, and CPile::PreReceiveCards().

00028 {
00029    m_pPileSrc->PreReceiveCards(0, apCards, m_lIndexDest, m_cCards);
00030 }

void DoReceive ( CPtrArray< CCard *, CCard * > & apCards ) [virtual]

Implements CFragmentAdd.

Definition at line 44 of file FragmentAdd.cpp.

References m_cCards, CFragmentAdd::m_lIndexDest, CFragmentAdd::m_pPileSrc, and CPile::ReceiveCards().

00045 {
00046    m_pPileSrc->ReceiveCards(0, apCards, m_lIndexDest, m_cCards);
00047 }

void SetDestAndIndex | ( | CArray< CPile *, CPile * > & | apDests,
 |  | CArray< long, long > & | alIndices,
 |  | long & | lIndex
 | ) | [virtual]

Implements CFragmentAdd.

Definition at line 80 of file FragmentAdd.cpp.

References m_cCards, CFragmentAdd::m_pPileSrc, and CArray::SetAt().

00082 {
00083    for(int j = 0; j < m_cCards; j++)
00084    {
00085       apDests.SetAt(lIndex, m_pPileSrc);
00086       alIndices.SetAt(lIndex, j);
00087       lIndex++;
00088    }
00089 }

void Setup | ( | CPtrArray< CCard *, CCard * > & | apCards,
 |  | long | lFragX,
 |  | long | lFragY,
 |  | ICardPileSite * | pSite,
 |  | CHTMLElement2Ptr & | spEl2
 | ) | [virtual]

Implements CFragmentAdd.

Definition at line 108 of file FragmentAdd.cpp.

References CArray< TP, TPA >::GetSize(), CPile::m_lX, CPile::m_lY, CFragmentAdd::m_pPileSrc, and CPile::TransferCards().

00110 {
00111    // Transfer cards to the fragment
00112    int cCardsOld = apCards.GetSize();
00113    m_pPileSrc->TransferCards(apCards);
00114    int cCardsNew = apCards.GetSize();
00115
00116    // Set up each card in the fragment
00117    for(int j = cCardsOld; j < cCardsNew; j++)
00118    {
00119       apCards[j]->SetPile(pSite, spEl2);
00120       apCards[j]->SetIndex(j);
00121       POINT pt = apCards[j]->GetPosition();
00122       apCards[j]->SetPosition(pt.x + m_pPileSrc->m_lX - lFragX,
00123          pt.y + m_pPileSrc->m_lY - lFragY);
00124    }
00125 }

Member Data Documentation

long m_cCards

Definition at line 63 of file FragmentAdd.h.

Referenced by DoPreReceive(), DoReceive(), and SetDestAndIndex().

The documentation for this class was generated from the following files:
  • FragmentAdd.h
  • FragmentAdd.cpp
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CFragmentAddPile Member List

This is the complete list of members for CFragmentAddPile, including all inherited members.
ClearSrc() | CFragmentAddPile | [virtual]
DoPreReceive(CPtrArray< CCard *, CCard * > &apCards) | CFragmentAddPile | [virtual]
DoReceive(CPtrArray< CCard *, CCard * > &apCards) | CFragmentAddPile | [virtual]
m_cCards | CFragmentAddPile |
m_lIndexDest | CFragmentAdd |
m_pPileSrc | CFragmentAdd |
SetDestAndIndex(CArray< CPile *, CPile * > &apDests, CArray< long, long > &alIndices, long &lIndex) | CFragmentAddPile | [virtual]
Setup(CPtrArray< CCard *, CCard * > &apCards, long lFragX, long lFragY, ICardPileSite *pSite, CHTMLElement2Ptr &spEl2) | CFragmentAddPile | [virtual]
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


CGameBase Class Reference

#include <GameBase.h>

Inheritance diagram for CGameBase:

CDispBase INDUnknownAndDispatch CGameLaBelleLucie CGameSpider List of all members.

Public Methods

CGameBase (UINT uGameID, CGameInfo *pInfo)
virtual | ~CGameBase ()
STDMETHOD (get_Info)(ISolpackGameInfo **ppInfo)
STDMETHOD (Initialize)(ISolpackApp *pApp)
STDMETHOD (Uninitialize)()
STDMETHOD (Deal)()
STDMETHOD (AutoPlay)()
STDMETHOD (AutoPlayCard)(ISolpackCard *pCard)
STDMETHOD (HandleCommand)(long lID)
STDMETHOD (PileClicked)(ISolpackPile *pPile
STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc
STDMETHOD (DropFragment)(ISolpackFragment *pFrag
STDMETHOD (CancelMove)()
STDMETHOD (RecalcLayout)()
STDMETHOD (NDQueryInterface)(REFIID riid
virtual void | InitGame ()

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
ISolpackCard * pCard
ISolpackCard * pCardSrc
ISolpackCard ISolpackFragment * pFrag
ISolpackPile * pPileDest
ISolpackPile VARIANT_BOOL * | pbValid
LPVOID * | ppvObject

Protected Methods

void | CreateDeck (ISolpackPile **ppPile)
void | GetMetrics ()
virtual void | UpdateLayout ()
BOOL | ObjectsEqual (IUnknown *pUnk1, IUnknown *pUnk2)
void | IncrScore (long lIncr)
CSolpackCardPtr | GetCardFromData (ISolpackGameData *pGameData)
void | PutCardInData (ISolpackGameData *pGameData, ISolpackCard *pCard)
long | GetLongFromData (ISolpackGameData *pGameData)
void | PutLongInData (ISolpackGameData *pGameData, long l)

Protected Attributes

CSolpackAppPtr m_spApp
CSolpackPilePtr m_spDeck
CSolpackPilePtr m_spDragSrc
BOOL | m_bPlaying
UINT | m_uGameID
CGameInfo * m_pGameInfo
long | m_lCardWidth
long | m_lCardHeight
long | m_lWindowWidth
long | m_lWindowHeight
long | m_lSpacingX
long | m_lSpacingY

Constructor & Destructor Documentation

CGameBase | ( | UINT | uGameID,
 |  | CGameInfo * | pInfo
 | ) |

Definition at line 35 of file GameBase.cpp.

References m_bPlaying, m_lCardHeight, m_lCardWidth, m_lSpacingX, m_lSpacingY, m_lWindowHeight, m_lWindowWidth, m_pGameInfo, m_uGameID, and ODS.

00036 {
00037    // Set initial values for member variables
00038    m_uGameID = uGameID;
00039    m_pGameInfo = pInfo;
00040    m_pGameInfo->AddRef();
00041    m_bPlaying = FALSE;
00042    m_lCardWidth = 0;
00043    m_lCardHeight = 0;
00044    m_lWindowWidth = 0;
00045    m_lWindowHeight = 0;
00046    m_lSpacingX = 0;
00047    m_lSpacingY = 0;
00048    ODS("CGameBase constructor");
00049 }

~CGameBase ( ) [virtual]

Definition at line 57 of file GameBase.cpp.

References m_pGameInfo, ODS, and SAFERELEASE.

00058 {
00059    SAFERELEASE(m_pGameInfo);
00060    ODS("CGameBase destructor");
00061 }

Member Function Documentation

void CreateDeck ( ISolpackPile ** ppPile ) [protected]

Definition at line 414 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, ISolpackPile, m_lCardHeight, m_lCardWidth, and m_spApp.

00415 {
00416    _ASSERT(m_spApp);
00417    CHECKHRCOM(m_spApp->CreatePile(PILE_DECK, ppPile));
00418    CHECKHRCOM((*ppPile)->put_X(-m_lCardWidth-5));
00419    CHECKHRCOM((*ppPile)->put_Y(-m_lCardHeight-5));
00420 }

CSolpackCardPtr GetCardFromData ( ISolpackGameData * pGameData ) [protected]

Definition at line 503 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, IID_ISolpackCard, and ISolpackGameData.

Referenced by CGameSpider::DealCard(), and CGameLaBelleLucie::IsCardPlayable().

00504 {
00505    _ASSERT(pGameData);
00506
00507    CVariant v;
00508    CHECKHRCOM(pGameData->get_Data(&v));
00509
00510    if(v.vt != VT_DISPATCH)
00511       return NULL;
00512
00513    CSolpackCardPtr spCard;
00514    CHECKHRCOM(v.pdispVal->QueryInterface(IID_ISolpackCard, (LPVOID*)&spCard));
00515    return spCard;
00516 }

long GetLongFromData ( ISolpackGameData * pGameData ) [protected]

Definition at line 557 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, and ISolpackGameData.

Referenced by CGameSpider::CheckPile(), and CGameLaBelleLucie::DealRound().

00558 {
00559    _ASSERT(pGameData);
00560
00561    CVariant v;
00562    CHECKHRCOM(pGameData->get_Data(&v));
00563    return v.lVal;
00564 }

void GetMetrics ( ) [protected]

Definition at line 433 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, m_lCardHeight, m_lCardWidth, m_lSpacingX, m_lSpacingY, m_lWindowHeight, m_lWindowWidth, and m_spApp.

00434 {
00435    _ASSERT(m_spApp);
00436    CHECKHRCOM(m_spApp->get_CardWidth(&m_lCardWidth));
00437    CHECKHRCOM(m_spApp->get_CardHeight(&m_lCardHeight));
00438    CHECKHRCOM(m_spApp->get_WindowWidth(&m_lWindowWidth));
00439    CHECKHRCOM(m_spApp->get_WindowHeight(&m_lWindowHeight));
00440    CHECKHRCOM(m_spApp->get_SpacingX(&m_lSpacingX));
00441    CHECKHRCOM(m_spApp->get_SpacingY(&m_lSpacingY));
00442 }

void IncrScore ( long lIncr ) [protected]

Definition at line 482 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, and m_spApp.

Referenced by CGameSpider::DealCard(), and CGameLaBelleLucie::ScoreCard().

00483 {
00484    _ASSERT(m_spApp);
00485    long lScore;
00486    CHECKHRCOM(m_spApp->get_Score(&lScore));
00487    lScore += lIncr;
00488    CHECKHRCOM(m_spApp->put_Score(lScore));
00489 }

void InitGame ( ) [virtual]

Definition at line 397 of file GameBase.cpp.

References g_pTypeLib, IID_ISolpackGame, CDispBase::Init(), and ISolpackGame.

00398 {
00399    Init(g_pTypeLib, IID_ISolpackGame, (LPDISPATCH)((ISolpackGame*)this));
00400 }

BOOL ObjectsEqual | ( | IUnknown * | pUnk1,
 |  | IUnknown * | pUnk2
 | ) | [protected]

Definition at line 460 of file GameBase.cpp.

00461 {
00462    if(!pUnk1 || !pUnk2)
00463       return FALSE;
00464
00465    CUnknownPtr spUnk1(pUnk1);
00466    CUnknownPtr spUnk2(pUnk2);
00467    return (((IUnknown*)spUnk1) == ((IUnknown*)spUnk2));
00468 }

void PutCardInData | ( | ISolpackGameData * | pGameData,
 |  | ISolpackCard * | pCard
 | ) | [protected]

Definition at line 531 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, ISolpackCard, ISolpackGameData, and pCard.

Referenced by CGameSpider::AdjustAfterSuccess(), CGameLaBelleLucie::AdjustSrcPile(), CGameSpider::DealCard(), and CGameLaBelleLucie::DealRound().

00532 {
00533    _ASSERT(pGameData);
00534
00535    HRESULT hr = E_FAIL;
00536    CVariant v;
00537    if(pCard)
00538    {
00539       v.vt = VT_DISPATCH;
00540       CHECKHRCOM(pCard->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
00541    }
00542    CHECKHRCOM(pGameData->put_Data(v));
00543 }

void PutLongInData | ( | ISolpackGameData * | pGameData,
 |  | long | l
 | ) | [protected]

Definition at line 579 of file GameBase.cpp.

References _ASSERT, CHECKHRCOM, and ISolpackGameData.

Referenced by CGameSpider::CheckPile(), and CGameLaBelleLucie::DealRound().

00580 {
00581    _ASSERT(pGameData);
00582
00583    CVariant v;
00584    v.vt = VT_I4;
00585    v.lVal = l;
00586    CHECKHRCOM(pGameData->put_Data(v));
00587 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( RecalcLayout )

STDMETHOD ( CancelMove )

STDMETHOD ( DropFragment )

Reimplemented in CGameLaBelleLucie, CGameLaBelleLucie, CGameSpider, and CGameSpider.

STDMETHOD ( SetupFragment )

Reimplemented in CGameLaBelleLucie, and CGameSpider.

STDMETHOD ( PileClicked )

Reimplemented in CGameSpider.

STDMETHOD ( HandleCommand )

Reimplemented in CGameLaBelleLucie.

STDMETHOD ( AutoPlayCard )

Reimplemented in CGameLaBelleLucie, and CGameLaBelleLucie.

STDMETHOD ( AutoPlay )

Reimplemented in CGameLaBelleLucie, and CGameLaBelleLucie.

STDMETHOD ( Deal )

Reimplemented in CGameLaBelleLucie, CGameLaBelleLucie, CGameSpider, and CGameSpider.

STDMETHOD ( Uninitialize )

Reimplemented in CGameLaBelleLucie, and CGameSpider.

STDMETHOD ( Initialize )

Reimplemented in CGameLaBelleLucie, and CGameSpider.

STDMETHOD ( get_Info )

virtual void UpdateLayout ( ) [inline, protected, virtual]

Reimplemented in CGameLaBelleLucie, and CGameSpider.

Definition at line 71 of file GameBase.h.

00071 {}

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 45 of file GameBase.h.

BOOL m_bPlaying [protected]

Definition at line 83 of file GameBase.h.

Referenced by CGameBase().

long m_lCardHeight [protected]

Definition at line 90 of file GameBase.h.

Referenced by CGameBase(), CreateDeck(), GetMetrics(), CGameSpider::UpdateLayout(), and CGameLaBelleLucie::UpdateLayout().

long m_lCardWidth [protected]

Definition at line 89 of file GameBase.h.

Referenced by CGameBase(), CreateDeck(), GetMetrics(), CGameSpider::UpdateLayout(), and CGameLaBelleLucie::UpdatePilePositions().

long m_lSpacingX [protected]

Definition at line 93 of file GameBase.h.

Referenced by CGameBase(), GetMetrics(), CGameSpider::UpdateLayout(), and CGameLaBelleLucie::UpdatePilePositions().

long m_lSpacingY [protected]

Definition at line 94 of file GameBase.h.

Referenced by CGameBase(), GetMetrics(), CGameSpider::UpdateLayout(), and CGameLaBelleLucie::UpdateLayout().

long m_lWindowHeight [protected]

Definition at line 92 of file GameBase.h.

Referenced by CGameBase(), and GetMetrics().

long m_lWindowWidth [protected]

Definition at line 91 of file GameBase.h.

Referenced by CGameBase(), GetMetrics(), CGameSpider::UpdateLayout(), and CGameLaBelleLucie::UpdatePilePositions().

CGameInfo* m_pGameInfo [protected]

Definition at line 86 of file GameBase.h.

Referenced by CGameBase(), and ~CGameBase().

CSolpackAppPtr m_spApp [protected]

Definition at line 80 of file GameBase.h.

Referenced by CGameSpider::CheckPile(), CreateDeck(), CGameLaBelleLucie::DealRound(), GetMetrics(), IncrScore(), CGameLaBelleLucie::InternalAutoPlayCard(), and CGameLaBelleLucie::ScoreCard().

CSolpackPilePtr m_spDeck [protected]

Definition at line 81 of file GameBase.h.

Referenced by CGameLaBelleLucie::DealRound().

CSolpackPilePtr m_spDragSrc [protected]

Definition at line 82 of file GameBase.h.

UINT m_uGameID [protected]

Definition at line 85 of file GameBase.h.

Referenced by CGameBase().

ISolpackPile VARIANT_BOOL* pbValid

Reimplemented in CGameLaBelleLucie, and CGameSpider.

Definition at line 58 of file GameBase.h.

ISolpackCard* pCard

Reimplemented in CGameSpider.

Definition at line 55 of file GameBase.h.

Referenced by CGameLaBelleLucie::InternalAutoPlayCard(), PutCardInData(), and CGameLaBelleLucie::ScoreCard().

ISolpackCard* pCardSrc

Reimplemented in CGameLaBelleLucie, and CGameSpider.

Definition at line 56 of file GameBase.h.

ISolpackCard ISolpackFragment* pFrag

Reimplemented in CGameLaBelleLucie, and CGameSpider.

Definition at line 56 of file GameBase.h.

ISolpackPile* pPileDest

Reimplemented in CGameLaBelleLucie, and CGameSpider.

Definition at line 58 of file GameBase.h.

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 64 of file GameBase.h.

The documentation for this class was generated from the following files:
  • GameBase.h
  • GameBase.cpp
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameBase Member List

This is the complete list of members for CGameBase, including all inherited members.
CDispBase() | CDispBase |
CGameBase(UINT uGameID, CGameInfo *pInfo) | CGameBase |
cNames | CDispBase |
CreateDeck(ISolpackPile **ppPile) | CGameBase | [protected]
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameBase |
GetCardFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetDispatch() const | CDispBase | [inline, protected]
GetLongFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetMetrics() | CGameBase | [protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
IncrScore(long lIncr) | CGameBase | [protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGame() | CGameBase | [virtual]
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_bPlaying | CGameBase | [protected]
m_lCardHeight | CGameBase | [protected]
m_lCardWidth | CGameBase | [protected]
m_lSpacingX | CGameBase | [protected]
m_lSpacingY | CGameBase | [protected]
m_lWindowHeight | CGameBase | [protected]
m_lWindowWidth | CGameBase | [protected]
m_pGameInfo | CGameBase | [protected]
m_spApp | CGameBase | [protected]
m_spDeck | CGameBase | [protected]
m_spDragSrc | CGameBase | [protected]
m_uGameID | CGameBase | [protected]
ObjectsEqual(IUnknown *pUnk1, IUnknown *pUnk2) | CGameBase | [protected]
pbValid | CGameBase |
pCard | CGameBase |
pCardSrc | CGameBase |
pDispParams | CDispBase |
pExcepInfo | CDispBase |
pFrag | CGameBase |
pPileDest | CGameBase |
ppTInfo | CDispBase |
ppvObject | CGameBase |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PutCardInData(ISolpackGameData *pGameData, ISolpackCard *pCard) | CGameBase | [protected]
PutLongInData(ISolpackGameData *pGameData, long l) | CGameBase | [protected]
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
STDMETHOD(get_Info)(ISolpackGameInfo **ppInfo) | CGameBase |
STDMETHOD(Initialize)(ISolpackApp *pApp) | CGameBase |
STDMETHOD(Uninitialize)() | CGameBase |
STDMETHOD(Deal)() | CGameBase |
STDMETHOD(AutoPlay)() | CGameBase |
STDMETHOD(AutoPlayCard)(ISolpackCard *pCard) | CGameBase |
STDMETHOD(HandleCommand)(long lID) | CGameBase |
STDMETHOD(PileClicked)(ISolpackPile *pPile | CGameBase |
STDMETHOD(SetupFragment)(ISolpackPile *pPileSrc | CGameBase |
STDMETHOD(DropFragment)(ISolpackFragment *pFrag | CGameBase |
STDMETHOD(CancelMove)() | CGameBase |
STDMETHOD(RecalcLayout)() | CGameBase |
STDMETHOD(NDQueryInterface)(REFIID riid | CGameBase |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
UpdateLayout() | CGameBase | [inline, protected, virtual]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameBase() | CGameBase | [virtual]
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


CGameCommand Class Reference

#include <GameCommandMgr.h>

List of all members.

Public Methods

CGameCommand ()
virtual | ~CGameCommand ()
void | Init (IEventHandlerSite *pSite, CHTMLHelper *pHH, long lIndex, BSTR bstrText, BSTR bstrHelpText)
void | Enable (IEventHandlerSite *pSite, BOOL bEnable, CHTMLHelper *pHH, long lIndex)

Public Attributes

long | m_lID

Protected Methods

void | ReleaseLink ()

Protected Attributes

BOOL | m_bEnabled
CHTMLElementPtr m_spCell
CHTMLElementPtr m_spEl
CBSTR m_bstrText
CBSTR m_bstrHelpText

Constructor & Destructor Documentation

CGameCommand ( )

Definition at line 26 of file GameCommandMgr.cpp.

References m_bEnabled, and m_lID.

00027 {
00028    // Set initial values for member variables
00029    m_lID = 0;
00030    m_bEnabled = FALSE;
00031 }

~CGameCommand ( ) [virtual]

Definition at line 39 of file GameCommandMgr.cpp.

References ReleaseLink().

00040 {
00041    // Clean up link
00042    if(m_bEnabled)
00043       ReleaseLink();
00044 }

Member Function Documentation

void Enable | ( | IEventHandlerSite * | pSite,
 |  | BOOL | bEnable,
 |  | CHTMLHelper * | pHH,
 |  | long | lIndex
 | ) |

Definition at line 98 of file GameCommandMgr.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CHTMLHelper::CreateElement(), ENSUREALLOC, IDS_TAG_A, m_bEnabled, m_bstrHelpText, m_bstrText, m_spCell, m_spEl, ReleaseLink(), and CHTMLHelper::SetElTextWithEl().

Referenced by Init().

00099 {
00100    if(bEnable == m_bEnabled)
00101       return;
00102
00103    // If we're disabling the link, release it
00104    if(m_bEnabled)
00105       ReleaseLink();
00106
00107    // Empty the contents of the command cell element
00108    pHH->SetElTextWithEl(m_spCell, CBSTR());
00109    m_bEnabled = bEnable;
00110
00111    if(m_bEnabled)
00112    {
00113       // Create the link element
00114       m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_A, IID_IHTMLElement));
00115       CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA(m_spEl);
00116       CHECKHRCOM(spA->put_href(CBSTR(TEXT(""))));
00117       CHECKHRCOM(m_spEl->put_innerHTML(m_bstrText));
00118       CHECKHRCOM(m_spEl->put_title(m_bstrHelpText));
00119
00120       // Add the link element to the HTML table cell
00121       CHTMLElement2Ptr spCell2(m_spCell);
00122       CHECKHRCOM(spCell2->insertAdjacentElement(CBSTR(TEXT("beforeEnd")), m_spEl, NULL));
00123
00124       // Create event handlers for the link
00125       CEventHandler *pHandler = NULL;
00126       CVariant v;
00127
00128       // Mouse clicked handler
00129       pHandler = new CEventHandler(pSite, 0, lIndex);
00130       ENSUREALLOC(pHandler);
00131       v.vt = VT_DISPATCH;
00132       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00133       CHECKHRCOM(m_spEl->put_onclick(v));
00134    } else
00135    {
00136       // Set the text of the disabled command
00137       pHH->SetElTextWithEl(m_spCell, m_bstrText);
00138    }
00139 }

void Init | ( | IEventHandlerSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | long | lIndex,
 |  | BSTR | bstrText,
 |  | BSTR | bstrHelpText
 | ) |

Definition at line 63 of file GameCommandMgr.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, Enable(), CHTMLHelper::GetNamedEl(), IDS_EL_COMMANDROW, m_bstrHelpText, m_bstrText, and m_spCell.

Referenced by CGameCommandMgr::AddGameCommand().

00065 {
00066    // Set member variables
00067    m_bstrText = bstrText;
00068    m_bstrHelpText = bstrHelpText;
00069
00070    // Add the table cell for the command
00071    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(TRUE, pHH->GetNamedEl(IDS_EL_COMMANDROW,
00072       IID_IHTMLTableRow));
00073    CDispatchPtr spDispCell;
00074    CHECKHRCOM(spRow->insertCell(-1, &spDispCell));
00075
00076    m_spCell.Assign(spDispCell);
00077
00078    // Create the link
00079    Enable(pSite, TRUE, pHH, lIndex);
00080 }

void ReleaseLink ( ) [protected]

Definition at line 154 of file GameCommandMgr.cpp.

References m_spEl, and CPtr< IHTMLElement,&IID_IHTMLElement >::Release().

Referenced by Enable(), and ~CGameCommand().

00155 {
00156    if(m_spEl)
00157    {
00158       // Free the mouse clicked event handler
00159       CVariant v;
00160       v.vt = VT_NULL;
00161       m_spEl->put_onclick(v);
00162       m_spEl.Release();
00163    }
00164 }

Member Data Documentation

BOOL m_bEnabled [protected]

Definition at line 46 of file GameCommandMgr.h.

Referenced by CGameCommand(), and Enable().

CBSTR m_bstrHelpText [protected]

Definition at line 50 of file GameCommandMgr.h.

Referenced by Enable(), and Init().

CBSTR m_bstrText [protected]

Definition at line 49 of file GameCommandMgr.h.

Referenced by Enable(), and Init().

long m_lID

Definition at line 41 of file GameCommandMgr.h.

Referenced by CGameCommandMgr::AddGameCommand(), and CGameCommand().

CHTMLElementPtr m_spCell [protected]

Definition at line 47 of file GameCommandMgr.h.

Referenced by Enable(), and Init().

CHTMLElementPtr m_spEl [protected]

Definition at line 48 of file GameCommandMgr.h.

Referenced by Enable(), and ReleaseLink().

The documentation for this class was generated from the following files:
  • GameCommandMgr.h
  • GameCommandMgr.cpp
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameCommand Member List

This is the complete list of members for CGameCommand, including all inherited members.
CGameCommand() | CGameCommand |
Enable(IEventHandlerSite *pSite, BOOL bEnable, CHTMLHelper *pHH, long lIndex) | CGameCommand |
Init(IEventHandlerSite *pSite, CHTMLHelper *pHH, long lIndex, BSTR bstrText, BSTR bstrHelpText) | CGameCommand |
m_bEnabled | CGameCommand | [protected]
m_bstrHelpText | CGameCommand | [protected]
m_bstrText | CGameCommand | [protected]
m_lID | CGameCommand |
m_spCell | CGameCommand | [protected]
m_spEl | CGameCommand | [protected]
ReleaseLink() | CGameCommand | [protected]
~CGameCommand() | CGameCommand | [virtual]
Generated on Wed May 8 12:39:40 2002 for Solitaire Pack by doxygen 1.2.15


CGameCommandMgr Class Reference

#include <GameCommandMgr.h>

Inheritance diagram for CGameCommandMgr:

IEventHandlerSite List of all members.

Public Methods

CGameCommandMgr ()
virtual | ~CGameCommandMgr ()
void | Init (IGameCommandMgrSite *pSite, CHTMLHelper *pHH)
void | Uninit ()
void | Clear ()
HRESULT | AddGameCommand (long lID, BSTR bstrText, BSTR bstrHelpText)
void | EnableGameCommand (long lID, BOOL bEnable)
int | GetCommandIndex (long lID)
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

IGameCommandMgrSite * m_pSite
CHTMLHelper * m_pHH
CPtrArray< CGameCommand *,
CGameCommand * > 		m_apCommands

Constructor & Destructor Documentation

CGameCommandMgr ( )

Definition at line 174 of file GameCommandMgr.cpp.

References m_pHH, and m_pSite.

00175 {
00176    // Set initial values for member variables
00177    m_pSite = NULL;
00178    m_pHH = NULL;
00179 }

~CGameCommandMgr ( ) [virtual]

Definition at line 187 of file GameCommandMgr.cpp.

00188 {
00189 }

Member Function Documentation

HRESULT AddGameCommand | ( | long | lID,
 |  | BSTR | bstrText,
 |  | BSTR | bstrHelpText
 | ) |

Definition at line 280 of file GameCommandMgr.cpp.

References CArray< CGameCommand *, CGameCommand * >::Add(), CHECKHRCOM, ENSUREALLOC, GetCommandIndex(), CHTMLHelper::GetNamedEl(), CArray< CGameCommand *, CGameCommand * >::GetSize(), IDS_EL_COMMANDBARHOLDER, CGameCommand::Init(), m_apCommands, CGameCommand::m_lID, and m_pHH.

00281 {
00282    // lID must be unique, and bstrText must not be NULL
00283    if(!bstrText || (GetCommandIndex(lID) != -1))
00284       return E_INVALIDARG;
00285
00286    // Create and initialize the game command object
00287    CGameCommand *pCmd = new CGameCommand();
00288    ENSUREALLOC(pCmd);
00289    m_apCommands.Add(pCmd);
00290    pCmd->m_lID = lID;
00291    pCmd->Init((IEventHandlerSite*)this, m_pHH, m_apCommands.GetSize()-1, bstrText, bstrHelpText);
00292
00293    // If this is the first command, make the command bar visibles
00294    if(m_apCommands.GetSize() == 1)
00295    {
00296       CPtr<IHTMLTableRow2, &IID_IHTMLTableRow2> spRow2(TRUE,
00297          m_pHH->GetNamedEl(IDS_EL_COMMANDBARHOLDER, IID_IHTMLTableRow2));
00298       CVariant v;
00299       v.vt = VT_BSTR;
00300       v.bstrVal = CBSTR(TEXT("20px")).Detach();
00301       CHECKHRCOM(spRow2->put_height(v));
00302    }
00303
00304    return S_OK;
00305 }

void Clear ( )

Definition at line 240 of file GameCommandMgr.cpp.

References CHECKHRCOM, CHTMLHelper::GetNamedEl(), CArray< CGameCommand *, CGameCommand * >::GetSize(), IDS_EL_COMMANDBARHOLDER, IDS_EL_COMMANDROW, m_apCommands, m_pHH, and CArray< CGameCommand *, CGameCommand * >::SetSize().

Referenced by CEngine::StopPlayGame(), and Uninit().

00241 {
00242    // If there are no commands, return
00243    int cCmds = m_apCommands.GetSize();
00244    if(cCmds == 0)
00245       return;
00246
00247    // Delete command objects
00248    m_apCommands.SetSize(0);
00249
00250    // Delete the command HTML cell elements
00251    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(TRUE, m_pHH->GetNamedEl(IDS_EL_COMMANDROW,
00252       IID_IHTMLTableRow));
00253    for(int i = 0; i < cCmds; i++)
00254       CHECKHRCOM(spRow->deleteCell(0));
00255
00256    // Hide the command bar
00257    CPtr<IHTMLTableRow2, &IID_IHTMLTableRow2> spRow2(TRUE,
00258       m_pHH->GetNamedEl(IDS_EL_COMMANDBARHOLDER, IID_IHTMLTableRow2));
00259    CVariant v;
00260    v.vt = VT_NULL;
00261    CHECKHRCOM(spRow2->put_height(v));
00262 }

void EnableGameCommand | ( | long | lID,
 |  | BOOL | bEnable
 | ) |

Definition at line 321 of file GameCommandMgr.cpp.

References _ASSERT, GetCommandIndex(), m_apCommands, and m_pHH.

Referenced by CEngine::DoAction(), and CEngine::UndoAction().

00322 {
00323    int iIndex = GetCommandIndex(lID);
00324    _ASSERT(iIndex != -1);
00325
00326    m_apCommands[iIndex]->Enable((IEventHandlerSite*)this, bEnable, m_pHH, iIndex);
00327 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 342 of file GameCommandMgr.cpp.

References _ASSERT, CHTMLHelper::CancelEvent(), IGameCommandMgrSite::HandleCommand(), m_apCommands, m_pHH, and m_pSite.

00343 {
00344    _ASSERT(dwEventID == 0); // Link clicked is the only event we handle
00345
00346    try   // Windows-called code
00347    {
00348       // Cancel the event
00349       m_pHH->CancelEvent();
00350
00351       // Tell the engine what happened
00352       m_pSite->HandleCommand(m_apCommands[lParam]->m_lID);
00353    }
00354    catch(CExcep *pE)
00355    {
00356       pE->Report();
00357       pE->Delete();
00358    }
00359 }

int GetCommandIndex ( long lID )

Definition at line 374 of file GameCommandMgr.cpp.

References CArray< CGameCommand *, CGameCommand * >::GetSize(), and m_apCommands.

Referenced by AddGameCommand(), and EnableGameCommand().

00375 {
00376    // Try to find a match
00377    int cCmds = m_apCommands.GetSize();
00378    for(int i = 0; i < cCmds; i++)
00379       if(m_apCommands[i]->m_lID == lID)
00380          return i;
00381
00382    // No match found
00383    return -1;
00384 }

void Init | ( | IGameCommandMgrSite * | pSite,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 204 of file GameCommandMgr.cpp.

References _ASSERT, m_pHH, and m_pSite.

Referenced by CEngine::InitEngine().

00205 {
00206    // Set member variables' values
00207    _ASSERT(pSite);
00208    m_pSite = pSite;
00209    m_pHH = pHH;
00210 }

void Uninit ( )

Definition at line 223 of file GameCommandMgr.cpp.

References Clear(), and m_pHH.

Referenced by CEngine::Uninit().

00224 {
00225    Clear();
00226    m_pHH = NULL;
00227 }

Member Data Documentation

CPtrArray<CGameCommand*, CGameCommand*> m_apCommands [protected]

Definition at line 95 of file GameCommandMgr.h.

Referenced by AddGameCommand(), Clear(), EnableGameCommand(), EventHandler(), and GetCommandIndex().

CHTMLHelper* m_pHH [protected]

Definition at line 94 of file GameCommandMgr.h.

Referenced by AddGameCommand(), CGameCommandMgr(), Clear(), EnableGameCommand(), EventHandler(), Init(), and Uninit().

IGameCommandMgrSite* m_pSite [protected]

Definition at line 93 of file GameCommandMgr.h.

Referenced by CGameCommandMgr(), EventHandler(), and Init().

The documentation for this class was generated from the following files:
  • GameCommandMgr.h
  • GameCommandMgr.cpp
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameCommandMgr Member List

This is the complete list of members for CGameCommandMgr, including all inherited members.
AddGameCommand(long lID, BSTR bstrText, BSTR bstrHelpText) | CGameCommandMgr |
CGameCommandMgr() | CGameCommandMgr |
Clear() | CGameCommandMgr |
EnableGameCommand(long lID, BOOL bEnable) | CGameCommandMgr |
EventHandler(DWORD dwEventID, LPARAM lParam) | CGameCommandMgr | [virtual]
GetCommandIndex(long lID) | CGameCommandMgr |
Init(IGameCommandMgrSite *pSite, CHTMLHelper *pHH) | CGameCommandMgr |
m_apCommands | CGameCommandMgr | [protected]
m_pHH | CGameCommandMgr | [protected]
m_pSite | CGameCommandMgr | [protected]
Uninit() | CGameCommandMgr |
~CGameCommandMgr() | CGameCommandMgr | [virtual]
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


CGameData Class Reference

#include <GameData.h>

Inheritance diagram for CGameData:

CDispBase IActionSite INDUnknownAndDispatch List of all members.

Public Methods

CGameData (IUndoMgrOwner *pUndoMgrOwner)
virtual | ~CGameData ()
STDMETHOD (get_Data)(VARIANT *p)
STDMETHOD (put_Data)(VARIANT v)
STDMETHOD (NDQueryInterface)(REFIID riid
void | DoAction (CAction *pAction)
void | UndoAction (CAction *pAction)
void | InitGameData ()

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
LPVOID * | ppvObject

Protected Attributes

IUndoMgrOwner * m_pUndoMgrOwner
CVariant m_var

Constructor & Destructor Documentation

CGameData ( IUndoMgrOwner * pUndoMgrOwner )

Definition at line 65 of file GameData.cpp.

References m_pUndoMgrOwner, and ODS.

00066 {
00067    // Set initial values for member variables
00068    m_pUndoMgrOwner = pUndoMgrOwner;
00069    ODS("CGameData constructor");
00070 }

~CGameData ( ) [virtual]

Definition at line 78 of file GameData.cpp.

References ODS.

00079 {
00080    ODS("CGameData destructor");
00081 }

Member Function Documentation

void DoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 169 of file GameData.cpp.

References m_var, and CGameDataAction::m_varNew.

00170 {
00171    // Copy the new data into this object
00172    CGameDataAction *pGDAction = (CGameDataAction*)pAction;
00173    VariantClear(&m_var);
00174    VariantCopy(&m_var, &pGDAction->m_varNew);
00175 }

void InitGameData ( )

Definition at line 208 of file GameData.cpp.

References g_pTypeLib, IID_ISolpackGameData, CDispBase::Init(), ISolpackGameData, and ODS.

00209 {
00210    ODS("CGameData::InitGameData");
00211
00212    Init(g_pTypeLib, IID_ISolpackGameData, (LPDISPATCH)((ISolpackGameData*)this));
00213 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( put_Data )

STDMETHOD ( get_Data )

void UndoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Definition at line 189 of file GameData.cpp.

References m_var, and CGameDataAction::m_varOld.

00190 {
00191    // Copy the old data back into this object
00192    CGameDataAction *pGDAction = (CGameDataAction*)pAction;
00193    VariantClear(&m_var);
00194    VariantCopy(&m_var, &pGDAction->m_varOld);
00195 }

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 39 of file GameData.h.

IUndoMgrOwner* m_pUndoMgrOwner [protected]

Definition at line 55 of file GameData.h.

Referenced by CGameData().

CVariant m_var [protected]

Definition at line 56 of file GameData.h.

Referenced by DoAction(), and UndoAction().

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 46 of file GameData.h.

The documentation for this class was generated from the following files:
  • GameData.h
  • GameData.cpp
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameData Member List

This is the complete list of members for CGameData, including all inherited members.
CDispBase() | CDispBase |
CGameData(IUndoMgrOwner *pUndoMgrOwner) | CGameData |
cNames | CDispBase |
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameData |
DoAction(CAction *pAction) | CGameData | [virtual]
GetDispatch() const | CDispBase | [inline, protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGameData() | CGameData |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_pUndoMgrOwner | CGameData | [protected]
m_var | CGameData | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
ppTInfo | CDispBase |
ppvObject | CGameData |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
STDMETHOD(get_Data)(VARIANT *p) | CGameData |
STDMETHOD(put_Data)(VARIANT v) | CGameData |
STDMETHOD(NDQueryInterface)(REFIID riid | CGameData |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
UndoAction(CAction *pAction) | CGameData | [virtual]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameData() | CGameData | [virtual]
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


CGameDataAction Class Reference

Inheritance diagram for CGameDataAction:

CAction List of all members.

Public Methods

CGameDataAction (IActionSite *pSite)
virtual | ~CGameDataAction ()

Protected Attributes

CVariant m_varOld
CVariant m_varNew

Friends

class | CGameData

Constructor & Destructor Documentation

CGameDataAction ( IActionSite * pSite )

Definition at line 52 of file GameData.cpp.

00052                                                    : CAction(pSite, 0, 0)
00053 {
00054 }

virtual ~CGameDataAction ( ) [inline, virtual]

Definition at line 34 of file GameData.cpp.

00034 {}

Friends And Related Function Documentation

friend class CGameData [friend]

Definition at line 36 of file GameData.cpp.

Member Data Documentation

CVariant m_varNew [protected]

Definition at line 40 of file GameData.cpp.

Referenced by CGameData::DoAction().

CVariant m_varOld [protected]

Definition at line 39 of file GameData.cpp.

Referenced by CGameData::UndoAction().

The documentation for this class was generated from the following file:
  • GameData.cpp
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameDataAction Member List

This is the complete list of members for CGameDataAction, including all inherited members.
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
CGameData class | CGameDataAction | [friend]
CGameDataAction(IActionSite *pSite) | CGameDataAction |
m_dwData | CAction |
m_dwType | CAction |
m_pNext | CAction |
m_pPrev | CAction |
m_pSite | CAction | [protected]
m_varNew | CGameDataAction | [protected]
m_varOld | CGameDataAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
~CGameDataAction() | CGameDataAction | [inline, virtual]
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


CGameInfo Class Reference

#include <GameInfo.h>

Inheritance diagram for CGameInfo:

CDispBase INDUnknownAndDispatch List of all members.

Public Methods

CGameInfo (UINT uGameID, long lDifficulty, CREATEGAMEFN pfnCreate)
virtual | ~CGameInfo ()
STDMETHOD (get_Title)(BSTR *p)
STDMETHOD (get_Rules)(BSTR *p)
STDMETHOD (get_Difficulty)(long *p)
STDMETHOD (NDQueryInterface)(REFIID riid
void | InitGameInfo ()
CGameBase * CreateGame ()

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
LPVOID * | ppvObject

Protected Attributes

UINT | m_uGameID
long | m_lDifficulty
CBSTR m_bstrTitle
CREATEGAMEFN m_pfnCreate

Constructor & Destructor Documentation

CGameInfo | ( | UINT | uGameID,
 |  | long | lDifficulty,
 |  | CREATEGAMEFN | pfnCreate
 | ) |

Definition at line 34 of file GameInfo.cpp.

References CREATEGAMEFN, m_lDifficulty, m_pfnCreate, m_uGameID, and ODS.

00035 {
00036    // Set initial values for member variables
00037    m_uGameID = uGameID;
00038    m_lDifficulty = lDifficulty;
00039    m_pfnCreate = pfnCreate;
00040    ODS("CGameInfo constructor");
00041 }

~CGameInfo ( ) [virtual]

Definition at line 49 of file GameInfo.cpp.

References ODS.

00050 {
00051    ODS("CGameInfo destructor");
00052 }

Member Function Documentation

CGameBase * CreateGame ( )

Definition at line 193 of file GameInfo.cpp.

References m_uGameID.

00194 {
00195    return (m_pfnCreate)(m_uGameID, this);
00196 }

void InitGameInfo ( )

Definition at line 174 of file GameInfo.cpp.

References CBSTR::Assign(), g_pTypeLib, IDS_TITLEBASE, IID_ISolpackGameInfo, CDispBase::Init(), ISolpackGameInfo, m_bstrTitle, and m_uGameID.

Referenced by CGameLib::InitGameLib().

00175 {
00176    Init(g_pTypeLib, IID_ISolpackGameInfo, (LPDISPATCH)((ISolpackGameInfo*)this));
00177
00178    // Load the game title
00179    m_bstrTitle.Assign(m_uGameID + IDS_TITLEBASE);
00180 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( get_Difficulty )

STDMETHOD ( get_Rules )

STDMETHOD ( get_Title )

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 49 of file GameInfo.h.

CBSTR m_bstrTitle [protected]

Definition at line 65 of file GameInfo.h.

Referenced by InitGameInfo().

long m_lDifficulty [protected]

Definition at line 64 of file GameInfo.h.

Referenced by CGameInfo().

CREATEGAMEFN m_pfnCreate [protected]

Definition at line 66 of file GameInfo.h.

Referenced by CGameInfo().

UINT m_uGameID [protected]

Definition at line 63 of file GameInfo.h.

Referenced by CGameInfo(), CreateGame(), and InitGameInfo().

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 57 of file GameInfo.h.

The documentation for this class was generated from the following files:
  • GameInfo.h
  • GameInfo.cpp
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameInfo Member List

This is the complete list of members for CGameInfo, including all inherited members.
CDispBase() | CDispBase |
CGameInfo(UINT uGameID, long lDifficulty, CREATEGAMEFN pfnCreate) | CGameInfo |
cNames | CDispBase |
CreateGame() | CGameInfo |
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameInfo |
GetDispatch() const | CDispBase | [inline, protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGameInfo() | CGameInfo |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_bstrTitle | CGameInfo | [protected]
m_lDifficulty | CGameInfo | [protected]
m_pfnCreate | CGameInfo | [protected]
m_uGameID | CGameInfo | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
ppTInfo | CDispBase |
ppvObject | CGameInfo |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
STDMETHOD(get_Title)(BSTR *p) | CGameInfo |
STDMETHOD(get_Rules)(BSTR *p) | CGameInfo |
STDMETHOD(get_Difficulty)(long *p) | CGameInfo |
STDMETHOD(NDQueryInterface)(REFIID riid | CGameInfo |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameInfo() | CGameInfo | [virtual]
Generated on Wed May 8 12:39:41 2002 for Solitaire Pack by doxygen 1.2.15


CGameLaBelleLucie Class Reference

#include <GameLaBelleLucie.h>

Inheritance diagram for CGameLaBelleLucie:

CGameBase CDispBase INDUnknownAndDispatch List of all members.

Public Methods

CGameLaBelleLucie (UINT uGameID, CGameInfo *pInfo)
virtual | ~CGameLaBelleLucie ()
STDMETHOD (Initialize)(ISolpackApp *pApp)
STDMETHOD (Uninitialize)()
STDMETHOD (Deal)()
STDMETHOD (AutoPlay)()
STDMETHOD (AutoPlayCard)(ISolpackCard *pCard)
STDMETHOD (HandleCommand)(long lID)
STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc
STDMETHOD (DropFragment)(ISolpackFragment *pFrag

Static Public Methods

CGameBase * | Create (UINT uGameID, CGameInfo *pInfo)

Public Attributes

ISolpackCard * pCardSrc
ISolpackCard ISolpackFragment * pFrag
ISolpackPile * pPileDest
ISolpackPile VARIANT_BOOL * | pbValid

Protected Methods

void | UpdateLayout ()
void | DealRound ()
BOOL | IsCardPlayable (int iPileIndex, int *piTryDest)
BOOL | InternalAutoPlayCard (int iPileIndex, ISolpackCard *pCard)
void | ScoreCard (ISolpackFragment *pFrag, int iFoundIndex, ISolpackCard *pCard)
void | AdjustSrcPile (int iPileIndex)
void | UpdatePilePositions ()

Protected Attributes

CSolpackPileArray m_apPiles
CSolpackPileArray m_apFoundations
CSolpackGameDataArray m_apTopCards
CSolpackGameDataPtr m_pNumRounds
long | m_cCardsDealing

Constructor & Destructor Documentation

CGameLaBelleLucie | ( | UINT | uGameID,
 |  | CGameInfo * | pInfo
 | ) |

Definition at line 26 of file GameLaBelleLucie.cpp.

References m_apFoundations, m_apPiles, m_apTopCards, m_cCardsDealing, ODS, CPtrArray< ISolpackGameData *, ISolpackGameData * >::SetRelease(), and CPtrArray< ISolpackPile *, ISolpackPile * >::SetRelease().

Referenced by Create().

00026                                                                    : CGameBase(uGameID, pInfo)
00027 {
00028    // Set up member variables
00029    m_cCardsDealing = 0;
00030
00031    // Signify that the contained pointers are COM interface pointers that
00032    // should be released, not deleted, when destroyed.
00033    m_apPiles.SetRelease(TRUE);
00034    m_apFoundations.SetRelease(TRUE);
00035    m_apTopCards.SetRelease(TRUE);
00036
00037    ODS("CGameLaBelleLucie constructor");
00038 }

~CGameLaBelleLucie ( ) [virtual]

Definition at line 46 of file GameLaBelleLucie.cpp.

References ODS.

00047 {
00048    ODS("CGameLaBelleLucie destructor");
00049 }

Member Function Documentation

void AdjustSrcPile ( int iPileIndex ) [protected]

Definition at line 709 of file GameLaBelleLucie.cpp.

References CHECKHRCOM, m_apPiles, m_apTopCards, and CGameBase::PutCardInData().

Referenced by InternalAutoPlayCard().

00710 {
00711    // Get the new top card for the specified foundation pile and store it
00712    CSolpackCardPtr spNewTop;
00713    long lNumCards = 0;
00714    CHECKHRCOM(m_apPiles[iPileIndex]->get_NumCards(&lNumCards));
00715    if(lNumCards > 0)
00716    {
00717       // The new top card can be dragged
00718       CHECKHRCOM(m_apPiles[iPileIndex]->GetCard(lNumCards - 1, &spNewTop));
00719       CHECKHRCOM(spNewTop->put_CanDrag(VARIANT_TRUE));
00720    }
00721    PutCardInData(m_apTopCards[iPileIndex], spNewTop);
00722 }

CGameBase * Create | ( | UINT | uGameID,
 |  | CGameInfo * | pInfo
 | ) | [static]

Definition at line 469 of file GameLaBelleLucie.cpp.

References CGameLaBelleLucie().

00470 {
00471    return (CGameBase*)(new CGameLaBelleLucie(uGameID, pInfo));
00472 }

void DealRound ( ) [protected]

Definition at line 514 of file GameLaBelleLucie.cpp.

References CHECKHRCOM, CGameBase::GetLongFromData(), m_apPiles, m_apTopCards, m_cCardsDealing, m_pNumRounds, CGameBase::m_spApp, CGameBase::m_spDeck, CGameBase::PutCardInData(), CGameBase::PutLongInData(), and UpdatePilePositions().

00515 {
00516    // If this is the third redeal, disable the game command because the user
00517    // can only redeal 3 times
00518    long lCurRound = GetLongFromData(m_pNumRounds);
00519    if(lCurRound == 3)
00520       CHECKHRCOM(m_spApp->EnableGameCommand(0, VARIANT_FALSE));
00521
00522    // Increment the deal count
00523    PutLongInData(m_pNumRounds, lCurRound + 1);
00524
00525    // Shuffle the deck
00526    CHECKHRCOM(m_spDeck->Shuffle());
00527
00528    // Position the piles before dealing
00529    long lNumCards = 0;
00530    CHECKHRCOM(m_spDeck->get_NumCards(&lNumCards));
00531    m_cCardsDealing = lNumCards;
00532    UpdatePilePositions();
00533
00534    CSolpackFragmentPtr spFrag;
00535    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00536
00537    // Go through each tableau pile
00538    long lTotal = 0;
00539    for(long l = 0; l < 18; l++)
00540    {
00541       CSolpackCardPtr spTopCard;
00542       if(lTotal < lNumCards)
00543       {
00544          // Deal cards in sets of 3, as long as there are more cards
00545          long m;
00546          for(m = 0; m < 3 && lTotal < lNumCards; m++, lTotal++)
00547          {
00548             CSolpackCardPtr spCard;
00549             CHECKHRCOM(m_spDeck->GetCard(m, &spCard));
00550             CHECKHRCOM(spFrag->AddToFragment(spCard));
00551          }
00552          CHECKHRCOM(spFrag->MoveToPile(m_apPiles[l], -1, VARIANT_TRUE, VARIANT_TRUE));
00553          CHECKHRCOM(m_apPiles[l]->GetCard(m-1, &spTopCard));
00554          CHECKHRCOM(spTopCard->put_CanDrag(VARIANT_TRUE));
00555       }
00556       PutCardInData(m_apTopCards[l], spTopCard);
00557    }
00558
00559    // Finalize pile positions
00560    m_cCardsDealing = 0;
00561    UpdatePilePositions();
00562 }

BOOL InternalAutoPlayCard | ( | int | iPileIndex,
 |  | ISolpackCard * | pCard
 | ) | [protected]

Definition at line 649 of file GameLaBelleLucie.cpp.

References AdjustSrcPile(), CHECKHRCOM, IsCardPlayable(), ISolpackCard, CGameBase::m_spApp, CGameBase::pCard, and ScoreCard().

00650 {
00651    // If the card can be played to any foundation, find out which one
00652    int iDest = -1;
00653    if(!IsCardPlayable(iPileIndex, &iDest))
00654       return FALSE;
00655
00656    CSolpackFragmentPtr spFrag;
00657    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00658
00659    // Move the card and process its scoring
00660    CHECKHRCOM(spFrag->AddToFragment(pCard));
00661    ScoreCard(spFrag, iDest, pCard);
00662    AdjustSrcPile(iPileIndex);
00663
00664    return TRUE;
00665 }

BOOL IsCardPlayable | ( | int | iPileIndex,
 |  | int * | piTryDest
 | ) | [protected]

Definition at line 579 of file GameLaBelleLucie.cpp.

References _ASSERT, CHECKHRCOM, CGameBase::GetCardFromData(), m_apFoundations, and m_apTopCards.

Referenced by InternalAutoPlayCard().

00580 {
00581    _ASSERT(piTryDest);
00582    BOOL bCanMove = FALSE;
00583    if(*piTryDest == -1)
00584    {
00585       // Go through the foundations to see if the card can be played to one of
00586       // them
00587       for(int i = 0; i < 4 && !bCanMove; i++)
00588       {
00589          int iTemp = i;
00590          bCanMove = IsCardPlayable(iPileIndex, &iTemp);
00591          if(bCanMove)
00592             *piTryDest = i;
00593       }
00594    } else
00595    {
00596       //See if the card can be played to the specified foundation
00597       CSolpackCardPtr spCard = GetCardFromData(m_apTopCards[iPileIndex]);
00598       if(!spCard)
00599          return FALSE;
00600
00601       long lRankSrc = 0;
00602       CHECKHRCOM(spCard->get_Rank(&lRankSrc));
00603
00604       long lNumCards = 0;
00605       CHECKHRCOM(m_apFoundations[*piTryDest]->get_NumCards(&lNumCards));
00606       if(lNumCards == 0)
00607       {
00608          // The foundation is empty, so the card can be moved if its an ace
00609          if(lRankSrc == RANK_ACE)
00610             bCanMove = TRUE;
00611       } else
00612       {
00613          // The foundation has card(s) in it
00614          CSolpackCardPtr spFoundTop;
00615          CHECKHRCOM(m_apFoundations[*piTryDest]->GetCard(lNumCards - 1, &spFoundTop));
00616
00617          // The card must be of the same suit
00618          long lSuitSrc = 0;
00619          long lSuitDest = 0;
00620          CHECKHRCOM(spCard->get_Suit(&lSuitSrc));
00621          CHECKHRCOM(spFoundTop->get_Suit(&lSuitDest));
00622          if(lSuitSrc == lSuitDest)
00623          {
00624             // The card's rank must be one higher than the foundation's top
00625             // card
00626             long lRankDest = 0;
00627             CHECKHRCOM(spFoundTop->get_Rank(&lRankDest));
00628             if(lRankDest + 1 == lRankSrc)
00629                bCanMove = TRUE;
00630          }
00631       }
00632    }
00633    return bCanMove;
00634 }

void ScoreCard | ( | ISolpackFragment * | pFrag,
 |  | int | iFoundIndex,
 |  | ISolpackCard * | pCard
 | ) | [protected]

Definition at line 681 of file GameLaBelleLucie.cpp.

References CHECKHRCOM, CGameBase::IncrScore(), ISolpackCard, ISolpackFragment, m_apFoundations, CGameBase::m_spApp, CGameBase::pCard, and pFrag.

Referenced by InternalAutoPlayCard().

00682 {
00683    // Increment the score
00684    IncrScore(1);
00685
00686    // Move the card to the specified foundation and disable dragging of it
00687    CHECKHRCOM(pCard->put_CanDrag(VARIANT_FALSE));
00688    CHECKHRCOM(pFrag->MoveToPile(m_apFoundations[iFoundIndex], -1, VARIANT_TRUE, VARIANT_FALSE));
00689
00690    // Check to see if we've won
00691    long lScore = 0;
00692    CHECKHRCOM(m_spApp->get_Score(&lScore));
00693    if(lScore == 52)
00694       CHECKHRCOM(m_spApp->GameWon());
00695 }

STDMETHOD ( DropFragment )

Reimplemented from CGameBase.

STDMETHOD ( SetupFragment )

Reimplemented from CGameBase.

STDMETHOD ( HandleCommand )

Reimplemented from CGameBase.

STDMETHOD ( AutoPlayCard )

Reimplemented from CGameBase.

STDMETHOD ( AutoPlay )

Reimplemented from CGameBase.

STDMETHOD ( Deal )

Reimplemented from CGameBase.

STDMETHOD ( Uninitialize )

Reimplemented from CGameBase.

STDMETHOD ( Initialize )

Reimplemented from CGameBase.

void UpdateLayout ( ) [protected, virtual]

Reimplemented from CGameBase.

Definition at line 487 of file GameLaBelleLucie.cpp.

References CHECKHRCOM, m_apFoundations, m_apPiles, CGameBase::m_lCardHeight, CGameBase::m_lSpacingY, and UpdatePilePositions().

00488 {
00489    // Set the piles' Y coordinates, which are independent of the contents of
00490    // the piles
00491
00492    int i;
00493    for(i = 0; i < 18; i++)
00494       CHECKHRCOM(m_apPiles[i]->put_Y(m_lSpacingY + ((i%4) * (m_lSpacingY + m_lCardHeight))));
00495
00496    for(i = 0; i < 4; i++)
00497       CHECKHRCOM(m_apFoundations[i]->put_Y(m_lSpacingY + (i * (m_lSpacingY + m_lCardHeight))));
00498
00499    // Set the X coordinates, dependent on contents
00500    UpdatePilePositions();
00501 }

void UpdatePilePositions ( ) [protected]

Definition at line 735 of file GameLaBelleLucie.cpp.

References CHECKHRCOM, m_apFoundations, m_apPiles, m_cCardsDealing, CGameBase::m_lCardWidth, CGameBase::m_lSpacingX, and CGameBase::m_lWindowWidth.

Referenced by DealRound(), and UpdateLayout().

00736 {
00737    // Get the widths of a full foundation, and of fans with 1, 2, or 3 cards
00738    long lWidthFound = 0;
00739    CHECKHRCOM(m_apFoundations[0]->WidthWith(13, &lWidthFound));
00740    long alWidthFan[3];
00741    CHECKHRCOM(m_apPiles[0]->WidthWith(1, &alWidthFan[0]));
00742    CHECKHRCOM(m_apPiles[0]->WidthWith(2, &alWidthFan[1]));
00743    CHECKHRCOM(m_apPiles[0]->WidthWith(3, &alWidthFan[2]));
00744
00745    // 1. Go through each row of tableau piles and determine which one needs
00746    //    the most width.
00747    // 2. Determine the new x-spacing of each row
00748    // 3. Position each pile accordingly
00749    // Note: If we are currently dealing, assume piles have 3 cards
00750
00751    int i, j;
00752    long alWidthsReq[4];
00753    long acPiles[4];
00754    long acNonZeroPiles[4];
00755    long alPileWidths[4];
00756    long alNumCards[18];
00757    long alWidths[18];
00758    long lWidthReq = 0;
00759    for(i = 0; i < 4; i++)
00760    {
00761       alWidthsReq[i] = lWidthFound + (2*m_lSpacingX);
00762       alPileWidths[i] = 0;
00763       acNonZeroPiles[i] = 0;
00764       acPiles[i] = ((i == 0 || i == 1) ? 5 : 4);
00765       for(j = 0; j < acPiles[i]; j++)
00766       {
00767          int iCardIndex = j*4 + i;
00768          if(m_cCardsDealing > 0)
00769          {
00770             if(m_cCardsDealing > iCardIndex*3)
00771             {
00772                alNumCards[iCardIndex] = (m_cCardsDealing >= (iCardIndex+1)*3 ?
00773                   3 : m_cCardsDealing % 3);
00774                alWidths[iCardIndex] = alWidthFan[alNumCards[iCardIndex]-1];
00775                alWidthsReq[i] += alWidths[iCardIndex] + m_lSpacingX;
00776                alPileWidths[i] += alWidths[iCardIndex];
00777                acNonZeroPiles[i]++;
00778             } else
00779             {
00780                alNumCards[iCardIndex] = 0;
00781                alWidths[iCardIndex] = 0;
00782             }
00783          } else
00784          {
00785             CHECKHRCOM(m_apPiles[iCardIndex]->get_NumCards(&alNumCards[iCardIndex]));
00786             if(alNumCards[iCardIndex] > 0)
00787             {
00788                CHECKHRCOM(m_apPiles[iCardIndex]->get_Width(&alWidths[iCardIndex]));
00789                alWidthsReq[i] += alWidths[iCardIndex] + m_lSpacingX;
00790                alPileWidths[i] += alWidths[iCardIndex];
00791                acNonZeroPiles[i]++;
00792             } else
00793                alWidths[iCardIndex] = 0;
00794          }
00795       }
00796       if(alWidthsReq[i] > lWidthReq)
00797          lWidthReq = alWidthsReq[i];
00798    }
00799
00800    long lWidthTableau = lWidthReq - lWidthFound - m_lSpacingX;
00801    long lLeft = (m_lWindowWidth < lWidthReq ? 0 :
00802       ((m_lWindowWidth - lWidthReq) / 2));
00803
00804    // Position piles
00805    for(i = 0; i < 4; i++)
00806    {
00807       int newSpcX = (lWidthTableau - alPileWidths[i]) / (acNonZeroPiles[i] + 1);
00808       long lCurX = lLeft + m_lSpacingX;
00809       CHECKHRCOM(m_apFoundations[i]->put_X(lCurX));
00810       lCurX += lWidthFound;
00811       for(j = 0; j < acPiles[i]; j++)
00812       {
00813          int iCardIndex = j*4 + i;
00814          if(alWidths[iCardIndex] > 0)
00815          {
00816             lCurX += newSpcX;
00817             CHECKHRCOM(m_apPiles[iCardIndex]->put_X(lCurX));
00818             lCurX += alWidths[iCardIndex];
00819          } else
00820          {
00821             CHECKHRCOM(m_apPiles[iCardIndex]->put_X(-10-m_lCardWidth));
00822          }
00823       }
00824    }
00825 }

Member Data Documentation

CSolpackPileArray m_apFoundations [protected]

Definition at line 59 of file GameLaBelleLucie.h.

Referenced by CGameLaBelleLucie(), IsCardPlayable(), ScoreCard(), UpdateLayout(), and UpdatePilePositions().

CSolpackPileArray m_apPiles [protected]

Definition at line 58 of file GameLaBelleLucie.h.

Referenced by AdjustSrcPile(), CGameLaBelleLucie(), DealRound(), UpdateLayout(), and UpdatePilePositions().

CSolpackGameDataArray m_apTopCards [protected]

Definition at line 60 of file GameLaBelleLucie.h.

Referenced by AdjustSrcPile(), CGameLaBelleLucie(), DealRound(), and IsCardPlayable().

long m_cCardsDealing [protected]

Definition at line 62 of file GameLaBelleLucie.h.

Referenced by CGameLaBelleLucie(), DealRound(), and UpdatePilePositions().

CSolpackGameDataPtr m_pNumRounds [protected]

Definition at line 61 of file GameLaBelleLucie.h.

Referenced by DealRound().

ISolpackPile VARIANT_BOOL* pbValid

Reimplemented from CGameBase.

Definition at line 44 of file GameLaBelleLucie.h.

ISolpackCard* pCardSrc

Reimplemented from CGameBase.

Definition at line 42 of file GameLaBelleLucie.h.

ISolpackCard ISolpackFragment* pFrag

Reimplemented from CGameBase.

Definition at line 42 of file GameLaBelleLucie.h.

Referenced by ScoreCard().

ISolpackPile* pPileDest

Reimplemented from CGameBase.

Definition at line 44 of file GameLaBelleLucie.h.

The documentation for this class was generated from the following files:
  • GameLaBelleLucie.h
  • GameLaBelleLucie.cpp
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameLaBelleLucie Member List

This is the complete list of members for CGameLaBelleLucie, including all inherited members.
AdjustSrcPile(int iPileIndex) | CGameLaBelleLucie | [protected]
CDispBase() | CDispBase |
CGameBase(UINT uGameID, CGameInfo *pInfo) | CGameBase |
CGameLaBelleLucie(UINT uGameID, CGameInfo *pInfo) | CGameLaBelleLucie |
cNames | CDispBase |
Create(UINT uGameID, CGameInfo *pInfo) | CGameLaBelleLucie | [static]
CreateDeck(ISolpackPile **ppPile) | CGameBase | [protected]
DealRound() | CGameLaBelleLucie | [protected]
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameBase |
GetCardFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetDispatch() const | CDispBase | [inline, protected]
GetLongFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetMetrics() | CGameBase | [protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
IncrScore(long lIncr) | CGameBase | [protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGame() | CGameBase | [virtual]
InternalAutoPlayCard(int iPileIndex, ISolpackCard *pCard) | CGameLaBelleLucie | [protected]
IsCardPlayable(int iPileIndex, int *piTryDest) | CGameLaBelleLucie | [protected]
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_apFoundations | CGameLaBelleLucie | [protected]
m_apPiles | CGameLaBelleLucie | [protected]
m_apTopCards | CGameLaBelleLucie | [protected]
m_bPlaying | CGameBase | [protected]
m_cCardsDealing | CGameLaBelleLucie | [protected]
m_lCardHeight | CGameBase | [protected]
m_lCardWidth | CGameBase | [protected]
m_lSpacingX | CGameBase | [protected]
m_lSpacingY | CGameBase | [protected]
m_lWindowHeight | CGameBase | [protected]
m_lWindowWidth | CGameBase | [protected]
m_pGameInfo | CGameBase | [protected]
m_pNumRounds | CGameLaBelleLucie | [protected]
m_spApp | CGameBase | [protected]
m_spDeck | CGameBase | [protected]
m_spDragSrc | CGameBase | [protected]
m_uGameID | CGameBase | [protected]
ObjectsEqual(IUnknown *pUnk1, IUnknown *pUnk2) | CGameBase | [protected]
pbValid | CGameLaBelleLucie |
pCard | CGameBase |
pCardSrc | CGameLaBelleLucie |
pDispParams | CDispBase |
pExcepInfo | CDispBase |
pFrag | CGameLaBelleLucie |
pPileDest | CGameLaBelleLucie |
ppTInfo | CDispBase |
ppvObject | CGameBase |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PutCardInData(ISolpackGameData *pGameData, ISolpackCard *pCard) | CGameBase | [protected]
PutLongInData(ISolpackGameData *pGameData, long l) | CGameBase | [protected]
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
ScoreCard(ISolpackFragment *pFrag, int iFoundIndex, ISolpackCard *pCard) | CGameLaBelleLucie | [protected]
STDMETHOD(Initialize)(ISolpackApp *pApp) | CGameLaBelleLucie |
STDMETHOD(Uninitialize)() | CGameLaBelleLucie |
STDMETHOD(Deal)() | CGameLaBelleLucie |
STDMETHOD(AutoPlay)() | CGameLaBelleLucie |
STDMETHOD(AutoPlayCard)(ISolpackCard *pCard) | CGameLaBelleLucie |
STDMETHOD(HandleCommand)(long lID) | CGameLaBelleLucie |
STDMETHOD(SetupFragment)(ISolpackPile *pPileSrc | CGameLaBelleLucie |
STDMETHOD(DropFragment)(ISolpackFragment *pFrag | CGameLaBelleLucie |
CGameBase::STDMETHOD(get_Info)(ISolpackGameInfo **ppInfo) | CGameBase |
CGameBase::STDMETHOD(PileClicked)(ISolpackPile *pPile | CGameBase |
CGameBase::STDMETHOD(CancelMove)() | CGameBase |
CGameBase::STDMETHOD(RecalcLayout)() | CGameBase |
CGameBase::STDMETHOD(NDQueryInterface)(REFIID riid | CGameBase |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
UpdateLayout() | CGameLaBelleLucie | [protected, virtual]
UpdatePilePositions() | CGameLaBelleLucie | [protected]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameBase() | CGameBase | [virtual]
~CGameLaBelleLucie() | CGameLaBelleLucie | [virtual]
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


CGameLib Struct Reference

#include <GameLib.h>

Inheritance diagram for CGameLib:

CDispBase INDUnknownAndDispatch List of all members.

Public Methods

CGameLib ()
virtual | ~CGameLib ()
STDMETHOD (get_Author)(BSTR *p)
STDMETHOD (get_Email)(BSTR *p)
STDMETHOD (get_WebSite)(BSTR *p)
STDMETHOD (get_NumGames)(long *p)
STDMETHOD (GetGame)(long lIndex
STDMETHOD (GetGameInfo)(long lIndex
STDMETHOD (NDQueryInterface)(REFIID riid
void | InitGameLib ()

Static Public Methods

HRESULT | CreateInstance (IUnknown **ppObj, ITypeLib *pTypeLib)

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
ISolpackGame ** ppGame
ISolpackGameInfo ** ppGameInfo
LPVOID * | ppvObject

Static Public Attributes

CGameLib::tagGAMEDATA s_aGameData []

Protected Attributes

CPtrArray< CGameInfo *, CGameInfo * > m_apGameInfo

Constructor & Destructor Documentation

CGameLib ( )

Definition at line 45 of file GameLib.cpp.

References m_apGameInfo, ODS, and CPtrArray< CGameInfo *, CGameInfo * >::SetRelease().

Referenced by CreateInstance().

00046 {
00047    // Set up member variables
00048    m_apGameInfo.SetRelease(TRUE);
00049    ODS("CGameLib constructor");
00050 }

~CGameLib ( ) [virtual]

Definition at line 58 of file GameLib.cpp.

References ODS.

00059 {
00060    ODS("CGameLib destructor");
00061 }

Member Function Documentation

HRESULT CreateInstance | ( | IUnknown ** | ppObj,
 |  | ITypeLib * | pTypeLib
 | ) | [static]

Definition at line 262 of file GameLib.cpp.

References CGameLib(), g_pTypeLib, and InitGameLib().

00263 {
00264    if(!ppObj)
00265       return E_POINTER;
00266
00267    // Store the type library pointer to be used by other objects
00268    g_pTypeLib = pTypeLib;
00269    g_pTypeLib->AddRef();
00270
00271    // Create the game library
00272    CGameLib *pNew = new CGameLib();
00273    if(!pNew)
00274       return E_OUTOFMEMORY;
00275
00276    // Set up the game library, appropriately handling any errors
00277    try
00278    {
00279       pNew->InitGameLib();
00280    }
00281    catch(COOMExcep *pE)
00282    {
00283       delete pNew;
00284       pE->Delete();
00285       return E_OUTOFMEMORY;
00286    }
00287    catch(CCOMExcep *pE)
00288    {
00289       delete pNew;
00290       HRESULT hr = pE->m_hr;
00291       pE->Delete();
00292       return hr;
00293    }
00294    catch(CExcep *pE)
00295    {
00296       delete pNew;
00297       pE->Delete();
00298       return E_FAIL;
00299    }
00300
00301    return pNew->QueryInterface(IID_IUnknown, (LPVOID*)ppObj);
00302 }

void InitGameLib ( )

Definition at line 315 of file GameLib.cpp.

References ARRAYSIZE, ENSUREALLOC, g_pTypeLib, IID_ISolpackGameLib, CDispBase::Init(), CGameInfo::InitGameInfo(), ISolpackGameLib, m_apGameInfo, s_aGameData, CPtrArray< CGameInfo *, CGameInfo * >::SetAt(), and CArray< CGameInfo *, CGameInfo * >::SetSize().

Referenced by CreateInstance().

00316 {
00317    Init(g_pTypeLib, IID_ISolpackGameLib, (LPDISPATCH)((ISolpackGameLib*)this));
00318
00319    // Create and initialize the game info objects
00320    int cGames = ARRAYSIZE(s_aGameData);
00321    m_apGameInfo.SetSize(cGames);
00322    for(int i = 0; i < cGames; i++)
00323    {
00324       CGameInfo *pInfo = new CGameInfo(i+1, s_aGameData[i].lDifficulty,
00325          s_aGameData[i].pfnCreate);
00326       ENSUREALLOC(pInfo);
00327       pInfo->AddRef();
00328       m_apGameInfo.SetAt(i, pInfo);
00329       pInfo->InitGameInfo();
00330    }
00331 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( GetGameInfo )

STDMETHOD ( GetGame )

STDMETHOD ( get_NumGames )

STDMETHOD ( get_WebSite )

STDMETHOD ( get_Email )

STDMETHOD ( get_Author )

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Definition at line 39 of file GameLib.h.

CPtrArray<CGameInfo*, CGameInfo*> m_apGameInfo [protected]

Definition at line 66 of file GameLib.h.

Referenced by CGameLib(), and InitGameLib().

ISolpackGame** ppGame

Definition at line 46 of file GameLib.h.

ISolpackGameInfo** ppGameInfo

Definition at line 47 of file GameLib.h.

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 50 of file GameLib.h.

struct CGameLib::tagGAMEDATA s_aGameData[] [static]

Referenced by InitGameLib().

The documentation for this struct was generated from the following files:
  • GameLib.cpp
  • GameLib.h
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameLib Member List

This is the complete list of members for CGameLib, including all inherited members.
CDispBase() | CDispBase |
CGameLib() | CGameLib |
cNames | CDispBase |
CreateInstance(IUnknown **ppObj, ITypeLib *pTypeLib) | CGameLib | [static]
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameLib |
GetDispatch() const | CDispBase | [inline, protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGameLib() | CGameLib |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_apGameInfo | CGameLib | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
ppGame | CGameLib |
ppGameInfo | CGameLib |
ppTInfo | CDispBase |
ppvObject | CGameLib |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
s_aGameData | CGameLib | [static]
STDMETHOD(get_Author)(BSTR *p) | CGameLib |
STDMETHOD(get_Email)(BSTR *p) | CGameLib |
STDMETHOD(get_WebSite)(BSTR *p) | CGameLib |
STDMETHOD(get_NumGames)(long *p) | CGameLib |
STDMETHOD(GetGame)(long lIndex | CGameLib |
STDMETHOD(GetGameInfo)(long lIndex | CGameLib |
STDMETHOD(NDQueryInterface)(REFIID riid | CGameLib |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameLib() | CGameLib | [virtual]
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


CGameLib::tagGAMEDATA struct Reference

tagGAMEDATA Struct Reference

#include <GameLib.h>

List of all members.

Public Attributes

CREATEGAMEFN pfnCreate
long lDifficulty

Member Data Documentation

long lDifficulty

Definition at line 62 of file GameLib.h.

CREATEGAMEFN pfnCreate

Definition at line 61 of file GameLib.h.

The documentation for this struct was generated from the following file:
  • GameLib.h
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


Member List

tagGAMEDATA Member List

This is the complete list of members for tagGAMEDATA, including all inherited members.
lDifficulty | tagGAMEDATA
pfnCreate | tagGAMEDATA
Generated on Wed May 8 12:39:42 2002 for Solitaire Pack by doxygen 1.2.15


CGameMenu Class Reference

#include <GameMenu.h>

Inheritance diagram for CGameMenu:

IGameMenuItemSite IEventHandlerSite List of all members.

Public Methods

CGameMenu ()
virtual | ~CGameMenu ()
void | Init (IMsgProcessor *pMsgProcessor, IGameMenuSite *pSite, IStatusBarMgr *pSBMgr, CLibMgr *pLibMgr, CHTMLHelper *pHH)
void | Uninit ()
void | Show (BOOL bShow)
void | Refresh (IMsgProcessor *pMsgProcessor)
int | GetActiveLib ()
int | GetActiveGame ()
void | ItemClicked (CGameMenuItem *pItem, int iLibIndex, int iGameIndex)
void | ItemDblClicked (CGameMenuItem *pItem, int iLibIndex, int iGameIndex)
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Methods

void | FillGameInfo ()

Protected Attributes

IGameMenuSite * m_pSite
IStatusBarMgr * m_pSBMgr
CLibMgr * m_pLibMgr
CHTMLHelper * m_pHH
BOOL | m_bActive
CTSTRArray m_alpszImgs
CPtrArray< CGameMenuItem *,
CGameMenuItem * > 		m_apItems
CTSTRArray m_alpszDiff
int | m_iActiveLibIndex
int | m_iActiveGameIndex

Constructor & Destructor Documentation

CGameMenu ( )

Definition at line 39 of file GameMenu.cpp.

References m_bActive, m_iActiveGameIndex, m_iActiveLibIndex, m_pHH, m_pLibMgr, m_pSBMgr, and m_pSite.

00040 {
00041    // Set initial values for member variables
00042    m_pSite = NULL;
00043    m_pSBMgr = NULL;
00044    m_pLibMgr = NULL;
00045    m_pHH = NULL;
00046    m_bActive = FALSE;
00047    m_iActiveLibIndex = 0;
00048    m_iActiveGameIndex = 0;
00049 }

~CGameMenu ( ) [virtual]

Definition at line 57 of file GameMenu.cpp.

00058 {
00059 }

Member Function Documentation

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 258 of file GameMenu.cpp.

References CHTMLHelper::CancelEvent(), IGameMenuSite::GameSelected(), GMEVENT_INSTR, GMEVENT_PLAY, m_iActiveGameIndex, m_iActiveLibIndex, m_pHH, m_pSite, and IGameMenuSite::ToggleShowRules().

00259 {
00260    try   // Windows-called code
00261    {
00262       // Cancel the event from bubbling
00263       m_pHH->CancelEvent();
00264
00265       switch(dwEventID)
00266       {
00267          case GMEVENT_INSTR:
00268             m_pSite->ToggleShowRules();
00269             break;
00270          case GMEVENT_PLAY:
00271             m_pSite->GameSelected(m_iActiveLibIndex, m_iActiveGameIndex);
00272             break;
00273       }
00274    }
00275    catch(CExcep *pE)
00276    {
00277       pE->Report();
00278       pE->Delete();
00279    }
00280 }

void FillGameInfo ( ) [protected]

Definition at line 372 of file GameMenu.cpp.

References CBSTR::Addr(), CPtr::Assign(), CHECKHRCOM, DIFFICULTY_HARD, DIFFICULTY_MEDIUM, CLibMgr::GetGameInfo(), CLibMgr::GetLib(), CHTMLHelper::GetNamedEl(), CLibMgr::GetNumLibs(), IDS_EL_MENUDIFFICULTY, IDS_EL_MENUGAME, IDS_EL_MENULIBAUTHOR, IDS_EL_MENULIBEMAIL, IDS_EL_MENULIBWEBSITE, IDS_MAILTOPROTOCOL, CTSTR::Len(), m_alpszDiff, m_iActiveGameIndex, m_iActiveLibIndex, m_pHH, m_pLibMgr, and CHTMLHelper::SetElText().

Referenced by ItemClicked(), and Refresh().

00373 {
00374    if(m_iActiveLibIndex >= m_pLibMgr->GetNumLibs())
00375       return;
00376
00377    CBSTR bstr;
00378    long l;
00379    CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA;
00380
00381    // Get the library that contains this game
00382    CPtr<ISolpackGameLib, &IID_ISolpackGameLib> spLib(TRUE, m_pLibMgr->GetLib(m_iActiveLibIndex));
00383
00384    CHECKHRCOM(spLib->get_Author(bstr.Addr()));
00385    m_pHH->SetElText(IDS_EL_MENULIBAUTHOR, bstr);
00386    bstr = NULL;
00387
00388    // Set the e-mail link
00389    CHECKHRCOM(spLib->get_Email(bstr.Addr()));
00390    m_pHH->SetElText(IDS_EL_MENULIBEMAIL, bstr);
00391    CTSTR lpszEmailHolder(IDS_MAILTOPROTOCOL);
00392    CTSTR lpszEmail(bstr);
00393    CTSTR lpszEmailTotal(TRUE, lpszEmail.Len() + lstrlen(lpszEmailHolder) + 1);
00394    wsprintf(lpszEmailTotal, lpszEmailHolder, lpszEmail);
00395    spA.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_MENULIBEMAIL, IID_IHTMLAnchorElement));
00396    CHECKHRCOM(spA->put_href(CBSTR(lpszEmailTotal)));
00397    bstr = NULL;
00398
00399    // Set the web site link
00400    CHECKHRCOM(spLib->get_WebSite(bstr.Addr()));
00401    m_pHH->SetElText(IDS_EL_MENULIBWEBSITE, bstr);
00402    spA.Assign(TRUE, m_pHH->GetNamedEl(IDS_EL_MENULIBWEBSITE, IID_IHTMLAnchorElement));
00403    CHECKHRCOM(spA->put_href(bstr));
00404    bstr = NULL;
00405
00406    // Get the game info for this game
00407    CPtr<ISolpackGameInfo, &IID_ISolpackGameInfo> spInfo(TRUE,
00408       m_pLibMgr->GetGameInfo(m_iActiveLibIndex, m_iActiveGameIndex));
00409
00410    // Set the game title
00411    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00412    m_pHH->SetElText(IDS_EL_MENUGAME, bstr);
00413
00414    // Set the difficulty string
00415    CHECKHRCOM(spInfo->get_Difficulty(&l));
00416    if(l < DIFFICULTY_EASY || l > DIFFICULTY_HARD)
00417       l = DIFFICULTY_MEDIUM;
00418    m_pHH->SetElText(IDS_EL_MENUDIFFICULTY, CBSTR(m_alpszDiff[l-1]));
00419 }

int GetActiveGame ( )

Definition at line 199 of file GameMenu.cpp.

References m_iActiveGameIndex.

Referenced by CMainWindow::UpdateInstr().

00200 {
00201    return m_iActiveGameIndex;
00202 }

int GetActiveLib ( )

Definition at line 183 of file GameMenu.cpp.

References m_iActiveLibIndex.

Referenced by CMainWindow::UpdateInstr().

00184 {
00185    return m_iActiveLibIndex;
00186 }

void Init | ( | IMsgProcessor * | pMsgProcessor,
 |  | IGameMenuSite * | pSite,
 |  | IStatusBarMgr * | pSBMgr,
 |  | CLibMgr * | pLibMgr,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 77 of file GameMenu.cpp.

References _ASSERT, CHECKHRCOM, CHTMLElementPtr, ENSUREALLOC, CHTMLHelper::GetNamedEl(), GMEVENT_INSTR, GMEVENT_PLAY, IDS_DIFFICULTY_EASY, IDS_EL_MENUINSTR, IDS_EL_MENUPANE, IDS_EL_MENUPLAY, IDS_IMG_SPADE, m_alpszDiff, m_alpszImgs, m_pHH, m_pLibMgr, m_pSBMgr, m_pSite, Refresh(), CArray< CTSTR, CTSTR & >::SetSize(), and CHTMLHelper::ShowElementEx().

Referenced by CMainWindow::HTMLComplete().

00079 {
00080    // Set member variables' values
00081    _ASSERT(pSite);
00082    m_pSite = pSite;
00083    m_pSBMgr = pSBMgr;
00084    m_pLibMgr = pLibMgr;
00085    m_pHH = pHH;
00086
00087    int i;
00088
00089    // Create mouse clicked handlers for the game info pane links
00090    CEventHandler *pHandler = NULL;
00091    CVariant v;
00092
00093    // Game Instructions link
00094    pHandler = new CEventHandler((IEventHandlerSite*)this, GMEVENT_INSTR, 0);
00095    ENSUREALLOC(pHandler);
00096    v.vt = VT_DISPATCH;
00097    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00098    CHECKHRCOM(CHTMLElementPtr(TRUE,
00099       m_pHH->GetNamedEl(IDS_EL_MENUINSTR, IID_IHTMLElement))->put_onclick(v));
00100    VariantClear(&v);
00101
00102    // Play link
00103    pHandler = new CEventHandler((IEventHandlerSite*)this, GMEVENT_PLAY, 0);
00104    ENSUREALLOC(pHandler);
00105    v.vt = VT_DISPATCH;
00106    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00107    CHECKHRCOM(CHTMLElementPtr(TRUE,
00108       m_pHH->GetNamedEl(IDS_EL_MENUPLAY, IID_IHTMLElement))->put_onclick(v));
00109    VariantClear(&v);
00110
00111    // Load difficulty strings
00112    m_alpszDiff.SetSize(3);
00113    for(i = 0; i < 3; i++)
00114       m_alpszDiff[i].Assign(IDS_DIFFICULTY_EASY + i);
00115
00116    // Load strings for menu item images (spade.gif, etc.)
00117    m_alpszImgs.SetSize(4);
00118    for(i = 0; i < 4; i++)
00119       m_alpszImgs[i].Assign(IDS_IMG_SPADE + i);
00120
00121    Refresh(pMsgProcessor);
00122
00123    m_pHH->ShowElementEx(IDS_EL_MENUPANE, TRUE);
00124 }

void ItemClicked | ( | CGameMenuItem * | pItem,
 |  | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [virtual]

Implements IGameMenuItemSite.

Definition at line 218 of file GameMenu.cpp.

References IGameMenuSite::ActiveGameChanged(), FillGameInfo(), m_iActiveGameIndex, m_iActiveLibIndex, and m_pSite.

00219 {
00220    m_iActiveLibIndex = iLibIndex;
00221    m_iActiveGameIndex = iGameIndex;
00222    FillGameInfo();
00223    m_pSite->ActiveGameChanged();
00224 }

void ItemDblClicked | ( | CGameMenuItem * | pItem,
 |  | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [virtual]

Implements IGameMenuItemSite.

Definition at line 240 of file GameMenu.cpp.

References IGameMenuSite::GameSelected(), and m_pSite.

00241 {
00242    m_pSite->GameSelected(iLibIndex, iGameIndex);
00243 }

void Refresh ( IMsgProcessor * pMsgProcessor )

Definition at line 294 of file GameMenu.cpp.

References IGameMenuSite::ActiveGameChanged(), CBSTR::Addr(), CHECKHRCOM, IMsgProcessor::EmptyMessageQueue(), ENSUREALLOC, FillGameInfo(), CLibMgr::GetGameInfo(), CHTMLHelper::GetNamedEl(), CLibMgr::GetNumGames(), CLibMgr::GetNumLibs(), CArray< CGameMenuItem *, CGameMenuItem * >::GetSize(), IDS_EL_MENUHOLDER, IDS_EL_MENUPANE, IDS_STATUS_INITMENU, CGameMenuItem::Init(), m_alpszImgs, m_apItems, m_pHH, m_pLibMgr, m_pSBMgr, m_pSite, IStatusBarMgr::SBSetText(), IStatusBarMgr::SBUpdateTasks(), CPtrArray< CGameMenuItem *, CGameMenuItem * >::SetAt(), CArray< CGameMenuItem *, CGameMenuItem * >::SetSize(), and CHTMLHelper::ShowElementEx().

Referenced by Init(), and CMainWindow::OnCommand().

00295 {
00296    int i;
00297    int cItemsOld = m_apItems.GetSize();
00298    m_apItems.SetSize(0);
00299
00300    // Get number of total games
00301    int cTotalGames = m_pLibMgr->GetNumGames(-1);
00302    m_apItems.SetSize(cTotalGames);
00303    m_pHH->ShowElementEx(IDS_EL_MENUPANE, cTotalGames > 0);
00304
00305    // Retrieve the HTML element that gets filled with menu items
00306    CPtr<IHTMLTable, &IID_IHTMLTable> spTable(TRUE, m_pHH->GetNamedEl(IDS_EL_MENUHOLDER,
00307       IID_IHTMLTable));
00308
00309    // Clear the table
00310    for(i = 0; i < cItemsOld; i++)
00311    {
00312       CHECKHRCOM(spTable->deleteRow(0));
00313    }
00314
00315    // Setup the progress bar
00316    int cGamesSoFar = 0;
00317    m_pSBMgr->SBUpdateTasks(cTotalGames, 0);
00318    m_pSBMgr->SBSetText(CTSTR(IDS_STATUS_INITMENU));
00319
00320    // Process each registered game library
00321    int cLibs = m_pLibMgr->GetNumLibs();
00322    for(i = 0; i < cLibs; i++)
00323    {
00324       // Process each game in each library
00325       int cGames = m_pLibMgr->GetNumGames(i);
00326       for(int j = 0; j < cGames; j++)
00327       {
00328          // Create the game menu item for the game
00329          CGameMenuItem *pItem = new CGameMenuItem((IGameMenuItemSite*)this, m_pHH, i, j);
00330          ENSUREALLOC(pItem);
00331          m_apItems.SetAt(cGamesSoFar, pItem);
00332
00333          // Retrieve the game's title, which is used as the text of the link
00334          CPtr<ISolpackGameInfo, &IID_ISolpackGameInfo> spInfo(TRUE, m_pLibMgr->GetGameInfo(i,
00335             j));
00336          CBSTR bstr;
00337          CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
00338          pItem->Init(spTable, CTSTR(bstr), m_alpszImgs[(cGamesSoFar)%4]);
00339
00340          cGamesSoFar++;
00341
00342          // Update status bar progress
00343          m_pSBMgr->SBUpdateTasks(0, 1);
00344
00345          // Let Windows process messages to keep program responsive
00346          pMsgProcessor->EmptyMessageQueue(TRUE);
00347       }
00348    }
00349
00350    // Clear the status bar message
00351    m_pSBMgr->SBSetText(CTSTR());
00352
00353    if(cTotalGames > 0)
00354    {
00355       FillGameInfo();
00356       m_pSite->ActiveGameChanged();
00357    }
00358 }

void Show ( BOOL bShow )

Definition at line 162 of file GameMenu.cpp.

References IDS_EL_GAMEMENU, m_bActive, m_pHH, and CHTMLHelper::ShowElementEx().

Referenced by CMainWindow::ShowHideGameMenu().

00163 {
00164    if(!m_pHH)
00165       return;
00166
00167    // Show or hide the game menu
00168    m_bActive = bShow;
00169    m_pHH->ShowElementEx(IDS_EL_GAMEMENU, bShow);
00170 }

void Uninit ( )

Definition at line 137 of file GameMenu.cpp.

References CHECKHRCOM, CHTMLElementPtr, CHTMLHelper::GetNamedEl(), IDS_EL_MENUINSTR, IDS_EL_MENUPLAY, m_apItems, m_pHH, and CArray< CGameMenuItem *, CGameMenuItem * >::SetSize().

Referenced by CMainWindow::OnDestroy().

00138 {
00139    CVariant v;
00140    v.vt = VT_NULL;
00141    CHECKHRCOM(CHTMLElementPtr(TRUE,
00142       m_pHH->GetNamedEl(IDS_EL_MENUINSTR, IID_IHTMLElement))->put_onclick(v));
00143    CHECKHRCOM(CHTMLElementPtr(TRUE,
00144       m_pHH->GetNamedEl(IDS_EL_MENUPLAY, IID_IHTMLElement))->put_onclick(v));
00145
00146    m_apItems.SetSize(0);
00147    m_pHH = NULL;
00148 }

Member Data Documentation

CTSTRArray m_alpszDiff [protected]

Definition at line 82 of file GameMenu.h.

Referenced by FillGameInfo(), and Init().

CTSTRArray m_alpszImgs [protected]

Definition at line 79 of file GameMenu.h.

Referenced by Init(), and Refresh().

CPtrArray<CGameMenuItem*, CGameMenuItem*> m_apItems [protected]

Definition at line 80 of file GameMenu.h.

Referenced by Refresh(), and Uninit().

BOOL m_bActive [protected]

Definition at line 77 of file GameMenu.h.

Referenced by CGameMenu(), and Show().

int m_iActiveGameIndex [protected]

Definition at line 84 of file GameMenu.h.

Referenced by CGameMenu(), EventHandler(), FillGameInfo(), GetActiveGame(), and ItemClicked().

int m_iActiveLibIndex [protected]

Definition at line 83 of file GameMenu.h.

Referenced by CGameMenu(), EventHandler(), FillGameInfo(), GetActiveLib(), and ItemClicked().

CHTMLHelper* m_pHH [protected]

Definition at line 76 of file GameMenu.h.

Referenced by CGameMenu(), EventHandler(), FillGameInfo(), Init(), Refresh(), Show(), and Uninit().

CLibMgr* m_pLibMgr [protected]

Definition at line 75 of file GameMenu.h.

Referenced by CGameMenu(), FillGameInfo(), Init(), and Refresh().

IStatusBarMgr* m_pSBMgr [protected]

Definition at line 74 of file GameMenu.h.

Referenced by CGameMenu(), Init(), and Refresh().

IGameMenuSite* m_pSite [protected]

Definition at line 73 of file GameMenu.h.

Referenced by CGameMenu(), EventHandler(), Init(), ItemClicked(), ItemDblClicked(), and Refresh().

The documentation for this class was generated from the following files:
  • GameMenu.h
  • GameMenu.cpp
Generated on Wed May 8 12:39:43 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameMenu Member List

This is the complete list of members for CGameMenu, including all inherited members.
CGameMenu() | CGameMenu |
EventHandler(DWORD dwEventID, LPARAM lParam) | CGameMenu | [virtual]
FillGameInfo() | CGameMenu | [protected]
GetActiveGame() | CGameMenu |
GetActiveLib() | CGameMenu |
Init(IMsgProcessor *pMsgProcessor, IGameMenuSite *pSite, IStatusBarMgr *pSBMgr, CLibMgr *pLibMgr, CHTMLHelper *pHH) | CGameMenu |
ItemClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex) | CGameMenu | [virtual]
ItemDblClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex) | CGameMenu | [virtual]
m_alpszDiff | CGameMenu | [protected]
m_alpszImgs | CGameMenu | [protected]
m_apItems | CGameMenu | [protected]
m_bActive | CGameMenu | [protected]
m_iActiveGameIndex | CGameMenu | [protected]
m_iActiveLibIndex | CGameMenu | [protected]
m_pHH | CGameMenu | [protected]
m_pLibMgr | CGameMenu | [protected]
m_pSBMgr | CGameMenu | [protected]
m_pSite | CGameMenu | [protected]
Refresh(IMsgProcessor *pMsgProcessor) | CGameMenu |
Show(BOOL bShow) | CGameMenu |
Uninit() | CGameMenu |
~CGameMenu() | CGameMenu | [virtual]
Generated on Wed May 8 12:39:43 2002 for Solitaire Pack by doxygen 1.2.15


CGameMenuItem Class Reference

#include <GameMenuItem.h>

Inheritance diagram for CGameMenuItem:

IEventHandlerSite List of all members.

Public Methods

CGameMenuItem (IGameMenuItemSite *pSite, CHTMLHelper *pHH, int iLibIndex, int iGameIndex)
virtual | ~CGameMenuItem ()
void | Init (CPtr< IHTMLTable,&IID_IHTMLTable > &spTable, CTSTR &lpszGameTitle, CTSTR &lpszImg)
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

IGameMenuItemSite * m_pSite
CHTMLHelper * m_pHH
int | m_iLibIndex
int | m_iGameIndex
CHTMLElementPtr m_spEl

Constructor & Destructor Documentation

CGameMenuItem | ( | IGameMenuItemSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | int | iLibIndex,
 |  | int | iGameIndex
 | ) |

Definition at line 37 of file GameMenuItem.cpp.

References _ASSERT, m_iGameIndex, m_iLibIndex, m_pHH, and m_pSite.

00039 {
00040    // Initialize member variables
00041    _ASSERT(pSite);
00042    m_pSite = pSite;
00043    m_pHH = pHH;
00044    m_iLibIndex = iLibIndex;
00045    m_iGameIndex = iGameIndex;
00046 }

~CGameMenuItem ( ) [virtual]

Definition at line 54 of file GameMenuItem.cpp.

References m_spEl.

00055 {
00056    if(m_spEl)
00057    {
00058       // Clear event handlers
00059       CVariant v;
00060       v.vt = VT_NULL;
00061       m_spEl->put_onclick(v);
00062       m_spEl->put_ondblclick(v);
00063    }
00064 }

Member Function Documentation

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 145 of file GameMenuItem.cpp.

References CHTMLHelper::CancelEvent(), GMIEVENT_CLICKED, GMIEVENT_DBLCLICKED, IGameMenuItemSite::ItemClicked(), IGameMenuItemSite::ItemDblClicked(), m_iGameIndex, m_iLibIndex, m_pHH, and m_pSite.

00146 {
00147    try   // Windows-called code
00148    {
00149       // Cancel the event from bubbling
00150       m_pHH->CancelEvent();
00151
00152       switch(dwEventID)
00153       {
00154          case GMIEVENT_CLICKED:
00155             // Tell the menu that a game link was clicked
00156             m_pSite->ItemClicked(this, m_iLibIndex, m_iGameIndex);
00157             break;
00158
00159          case GMIEVENT_DBLCLICKED:
00160             // Tell the menu that a game link was double clicked
00161             m_pSite->ItemDblClicked(this, m_iLibIndex, m_iGameIndex);
00162             break;
00163       }
00164    }
00165    catch(CExcep *pE)
00166    {
00167       pE->Report();
00168       pE->Delete();
00169    }
00170 }

void Init | ( | CPtr< IHTMLTable,&IID_IHTMLTable > & | spTable,
 |  | CTSTR & | lpszGameTitle,
 |  | CTSTR & | lpszImg
 | ) |

Definition at line 80 of file GameMenuItem.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CHTMLHelper::CreateElement(), ENSUREALLOC, GMIEVENT_CLICKED, GMIEVENT_DBLCLICKED, IDS_MENUCELL, IDS_TAG_A, CTSTR::Len(), m_pHH, and m_spEl.

Referenced by CGameMenu::Refresh().

00082 {
00083    // A game menu item creates a row in the menu TABLE element. This row,
00084    // containing one cell, then contains a link (an A element) containing an
00085    // IMG and a SPAN with the title.
00086
00087    // Add the table row and cell
00088    CDispatchPtr spDispRow;
00089    CHECKHRCOM(spTable->insertRow(-1, &spDispRow));
00090
00091    CPtr<IHTMLTableRow, &IID_IHTMLTableRow> spRow(spDispRow);
00092    CDispatchPtr spDispCell;
00093    CHECKHRCOM(spRow->insertCell(-1, &spDispCell));
00094
00095    CHTMLElement2Ptr spEl2Cell(spDispCell);
00096
00097    // Create the link element
00098    m_spEl.Assign(TRUE, m_pHH->CreateElement(IDS_TAG_A, IID_IHTMLElement));
00099    CPtr<IHTMLAnchorElement, &IID_IHTMLAnchorElement> spA(m_spEl);
00100    CHECKHRCOM(spA->put_href(CBSTR(TEXT(""))));
00101
00102    // Set the link's contents
00103    CTSTR lpszCellFormatter(IDS_MENUCELL);
00104    CTSTR lpszCell(TRUE, lpszCellFormatter.Len() + lpszImg.Len() + lpszGameTitle.Len() + 8);
00105    wsprintf(lpszCell, lpszCellFormatter, lpszImg, lpszGameTitle);
00106    CHECKHRCOM(m_spEl->put_innerHTML(CBSTR(lpszCell)));
00107
00108    // Add the link element to the HTML table cell
00109    CHECKHRCOM(spEl2Cell->insertAdjacentElement(CBSTR(TEXT("beforeEnd")), m_spEl, NULL));
00110
00111    // Create event handlers for the link
00112    CEventHandler *pHandler = NULL;
00113    CVariant v;
00114
00115    // Mouse clicked handler
00116    pHandler = new CEventHandler((IEventHandlerSite*)this, GMIEVENT_CLICKED, 0);
00117    ENSUREALLOC(pHandler);
00118    v.vt = VT_DISPATCH;
00119    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00120    CHECKHRCOM(m_spEl->put_onclick(v));
00121    VariantClear(&v);
00122
00123    // Mouse double clicked handler
00124    pHandler = new CEventHandler((IEventHandlerSite*)this, GMIEVENT_DBLCLICKED, 0);
00125    ENSUREALLOC(pHandler);
00126    v.vt = VT_DISPATCH;
00127    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal);
00128    CHECKHRCOM(m_spEl->put_ondblclick(v));
00129    VariantClear(&v);
00130 }

Member Data Documentation

int m_iGameIndex [protected]

Definition at line 66 of file GameMenuItem.h.

Referenced by CGameMenuItem(), and EventHandler().

int m_iLibIndex [protected]

Definition at line 65 of file GameMenuItem.h.

Referenced by CGameMenuItem(), and EventHandler().

CHTMLHelper* m_pHH [protected]

Definition at line 64 of file GameMenuItem.h.

Referenced by CGameMenuItem(), EventHandler(), and Init().

IGameMenuItemSite* m_pSite [protected]

Definition at line 63 of file GameMenuItem.h.

Referenced by CGameMenuItem(), and EventHandler().

CHTMLElementPtr m_spEl [protected]

Definition at line 67 of file GameMenuItem.h.

Referenced by Init(), and ~CGameMenuItem().

The documentation for this class was generated from the following files:
  • GameMenuItem.h
  • GameMenuItem.cpp
Generated on Wed May 8 12:39:43 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameMenuItem Member List

This is the complete list of members for CGameMenuItem, including all inherited members.
CGameMenuItem(IGameMenuItemSite *pSite, CHTMLHelper *pHH, int iLibIndex, int iGameIndex) | CGameMenuItem |
EventHandler(DWORD dwEventID, LPARAM lParam) | CGameMenuItem | [virtual]
Init(CPtr< IHTMLTable,&IID_IHTMLTable > &spTable, CTSTR &lpszGameTitle, CTSTR &lpszImg) | CGameMenuItem |
m_iGameIndex | CGameMenuItem | [protected]
m_iLibIndex | CGameMenuItem | [protected]
m_pHH | CGameMenuItem | [protected]
m_pSite | CGameMenuItem | [protected]
m_spEl | CGameMenuItem | [protected]
~CGameMenuItem() | CGameMenuItem | [virtual]
Generated on Wed May 8 12:39:43 2002 for Solitaire Pack by doxygen 1.2.15


CGameSpider Class Reference

#include <GameSpider.h>

Inheritance diagram for CGameSpider:

CGameBase CDispBase INDUnknownAndDispatch List of all members.

Public Methods

CGameSpider (UINT uGameID, CGameInfo *pInfo)
virtual | ~CGameSpider ()
STDMETHOD (Initialize)(ISolpackApp *pApp)
STDMETHOD (Uninitialize)()
STDMETHOD (Deal)()
STDMETHOD (PileClicked)(ISolpackPile *pPile
STDMETHOD (SetupFragment)(ISolpackPile *pPileSrc
STDMETHOD (DropFragment)(ISolpackFragment *pFrag

Static Public Methods

CGameBase * | Create (UINT uGameID, CGameInfo *pInfo)

Public Attributes

ISolpackCard * pCard
ISolpackCard * pCardSrc
ISolpackCard ISolpackFragment * pFrag
ISolpackPile * pPileDest
ISolpackPile VARIANT_BOOL * | pbValid

Protected Methods

void | UpdateLayout ()
BOOL | DealCard (long m, ISolpackCard *pCard)
BOOL | DoesCardFollow (ISolpackCard *pCardExist, ISolpackCard *pCardFollower, BOOL bMatchSuits=FALSE)
void | AdjustAfterSuccess (int iSrc)
void | CheckPile (long m)

Protected Attributes

CSolpackPilePtr m_spDeck2
CSolpackPilePtr m_spStock
CSolpackPileArray m_apPiles
CSolpackPileArray m_apFoundations
CSolpackGameDataArray m_apTopCards
CSolpackGameDataArray m_apBottomCards
CSolpackGameDataPtr m_pNumPilesGone

Constructor & Destructor Documentation

CGameSpider | ( | UINT | uGameID,
 |  | CGameInfo * | pInfo
 | ) |

Definition at line 26 of file GameSpider.cpp.

References m_apBottomCards, m_apFoundations, m_apPiles, m_apTopCards, ODS, CPtrArray< ISolpackGameData *, ISolpackGameData * >::SetRelease(), and CPtrArray< ISolpackPile *, ISolpackPile * >::SetRelease().

Referenced by Create().

00026                                                        : CGameBase(uGameID, pInfo)
00027 {
00028    ODS("CGameSpider constructor");
00029
00030    // Signify that the contained pointers are COM interface pointers that
00031    // should be released, not deleted, when destroyed.
00032    m_apPiles.SetRelease(TRUE);
00033    m_apFoundations.SetRelease(TRUE);
00034    m_apTopCards.SetRelease(TRUE);
00035    m_apBottomCards.SetRelease(TRUE);
00036 }

~CGameSpider ( ) [virtual]

Definition at line 44 of file GameSpider.cpp.

References ODS.

00045 {
00046    ODS("CGameSpider destructor");
00047 }

Member Function Documentation

void AdjustAfterSuccess ( int iSrc ) [protected]

Definition at line 643 of file GameSpider.cpp.

References CHECKHRCOM, DoesCardFollow(), m_apBottomCards, m_apPiles, m_apTopCards, and CGameBase::PutCardInData().

Referenced by CheckPile().

00644 {
00645    // Determine how many cards are in the pile
00646    long lNumCards = 0;
00647    CHECKHRCOM(m_apPiles[iSrc]->get_NumCards(&lNumCards));
00648    CSolpackCardPtr spCardTop;
00649    CSolpackCardPtr spCardBottom;
00650    if(lNumCards > 0)
00651    {
00652       // There are still cards in the pile
00653       CHECKHRCOM(m_apPiles[iSrc]->GetCard(lNumCards - 1, &spCardTop));
00654       spCardBottom = spCardTop;
00655
00656       // Figure out what card is the "bottom" of the draggable chunk
00657       for(long l = 2; l <= lNumCards; l++)
00658       {
00659          CSolpackCardPtr spCard;
00660          CHECKHRCOM(m_apPiles[iSrc]->GetCard(lNumCards - l, &spCard));
00661          if(DoesCardFollow(spCard, spCardBottom, TRUE))
00662          {
00663             spCardBottom = spCard;
00664          } else
00665             break;
00666       }
00667    }
00668
00669    // Store the top and bottom card pointers
00670    PutCardInData(m_apTopCards[iSrc], spCardTop);
00671    PutCardInData(m_apBottomCards[iSrc], spCardBottom);
00672 }

void CheckPile ( long m ) [protected]

Definition at line 687 of file GameSpider.cpp.

References AdjustAfterSuccess(), CHECKHRCOM, CGameBase::GetLongFromData(), m_apFoundations, m_apPiles, m_pNumPilesGone, CGameBase::m_spApp, CGameBase::PutLongInData(), and CPtr::Release().

00688 {
00689    // There must be at least 13 cards in the pile
00690    long lNumCards = 0;
00691    CHECKHRCOM(m_apPiles[m]->get_NumCards(&lNumCards));
00692    if(lNumCards < 13)
00693       return;
00694
00695    long cPilesGone = GetLongFromData(m_pNumPilesGone);
00696    long lCount = RANK_ACE;
00697    long lSuit = 0;
00698
00699    // Get the topmost card
00700    CSolpackCardPtr spCard;
00701    CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - lCount, &spCard));
00702    CHECKHRCOM(spCard->get_Suit(&lSuit));
00703
00704    // Go through the next 13 cards, stopping when an incorrect card is found
00705    BOOL bOkSoFar = TRUE;
00706    while(lCount <= 13)
00707    {
00708       spCard.Release();
00709       CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - lCount, &spCard));
00710
00711       // Card must be face up
00712       VARIANT_BOOL bFaceUp = VARIANT_FALSE;
00713       CHECKHRCOM(spCard->get_FaceUp(&bFaceUp));
00714       if(bFaceUp == VARIANT_FALSE)
00715          return;
00716
00717       // Cards must be of same suit
00718       long lSuitNew = 0;
00719       CHECKHRCOM(spCard->get_Suit(&lSuitNew));
00720       if(lSuit != lSuitNew)
00721          return;
00722
00723       // Ranks must be ascending
00724       long lRank = 0;
00725       CHECKHRCOM(spCard->get_Rank(&lRank));
00726       if(lRank != lCount)
00727          return;
00728
00729       lCount++;
00730    }
00731
00732    // We have thirteen cards in order, so put them in the fragment
00733    CSolpackFragmentPtr spFrag;
00734    CHECKHRCOM(m_spApp->get_Fragment(&spFrag));
00735    for(long l = 13; l > 0; l--)
00736    {
00737       CSolpackCardPtr spCard;
00738       CHECKHRCOM(m_apPiles[m]->GetCard(lNumCards - l, &spCard));
00739       CHECKHRCOM(spFrag->AddToFragment(spCard));
00740       spCard->put_CanDrag(VARIANT_FALSE);
00741    }
00742
00743    // Move them to the next available "foundation" above the tableau
00744    CHECKHRCOM(spFrag->MoveToPile(m_apFoundations[cPilesGone], -1, VARIANT_TRUE, VARIANT_FALSE));
00745    cPilesGone++;
00746    PutLongInData(m_pNumPilesGone, cPilesGone);
00747    AdjustAfterSuccess(m);
00748
00749    // Check whether all eight sets are gone
00750    if(cPilesGone == 8)
00751       CHECKHRCOM(m_spApp->GameWon());
00752 }

CGameBase * Create | ( | UINT | uGameID,
 |  | CGameInfo * | pInfo
 | ) | [static]

Definition at line 479 of file GameSpider.cpp.

References CGameSpider().

00480 {
00481    return (CGameBase*)(new CGameSpider(uGameID, pInfo));
00482 }

BOOL DealCard | ( | long | m,
 |  | ISolpackCard * | pCard
 | ) | [protected]

Definition at line 549 of file GameSpider.cpp.

References _ASSERT, CHECKHRCOM, DoesCardFollow(), CGameBase::GetCardFromData(), CGameBase::IncrScore(), ISolpackCard, m_apPiles, m_apTopCards, pCard, and CGameBase::PutCardInData().

00550 {
00551    _ASSERT(pCard);
00552
00553    // Determine whether the movement scores points.
00554    // Combining two single cards gives two points. Combining a single card
00555    // with an existing chunk gives one point. Otherwise, zero points.
00556    long lIncr = 0;
00557    CSolpackCardPtr spTop = GetCardFromData(m_apTopCards[m]);
00558    if(spTop)
00559    {
00560       if(DoesCardFollow(spTop, pCard, TRUE))
00561       {
00562          long lIndexTop = 0;
00563          CHECKHRCOM(spTop->get_Index(&lIndexTop));
00564          if(lIndexTop > 0)
00565          {
00566             CSolpackCardPtr spCardBeforeTop;
00567             CHECKHRCOM(m_apPiles[m]->GetCard(lIndexTop - 1, &spCardBeforeTop));
00568             if(DoesCardFollow(spCardBeforeTop, spTop, TRUE))
00569                lIncr--;
00570          }
00571          lIncr += 2;
00572          IncrScore(lIncr);
00573       }
00574    }
00575
00576    // Set the card's dragability and store it as the top card of the pile
00577    pCard->put_CanDrag(VARIANT_TRUE);
00578    PutCardInData(m_apTopCards[m], pCard);
00579
00580    // Return whether or not points were scored
00581    return (lIncr > 0);
00582 }

BOOL DoesCardFollow | ( | ISolpackCard * | pCardExist,
 |  | ISolpackCard * | pCardFollower,
 |  | BOOL | bMatchSuits = FALSE
 | ) | [protected]

Definition at line 598 of file GameSpider.cpp.

References CHECKHRCOM, and ISolpackCard.

Referenced by AdjustAfterSuccess(), and DealCard().

00600 {
00601    // Must have two card objects
00602    if(!pCardExist || !pCardFollower)
00603       return FALSE;
00604
00605    // In place card must be face up
00606    VARIANT_BOOL bFaceUp;
00607    CHECKHRCOM(pCardExist->get_FaceUp(&bFaceUp));
00608    if(bFaceUp != VARIANT_TRUE)
00609       return FALSE;
00610
00611    // If we need to check for matching suits, do so
00612    if(bMatchSuits)
00613    {
00614       long lSuitExist = 0;
00615       long lSuitFollower = 0;
00616       CHECKHRCOM(pCardExist->get_Suit(&lSuitExist));
00617       CHECKHRCOM(pCardFollower->get_Suit(&lSuitFollower));
00618       if(lSuitExist != lSuitFollower)
00619          return FALSE;
00620    }
00621
00622    // Rank of existing must be one more than rank of follower
00623    long lRankExist = 0;
00624    long lRankFollower = 0;
00625    CHECKHRCOM(pCardExist->get_Rank(&lRankExist));
00626    CHECKHRCOM(pCardFollower->get_Rank(&lRankFollower));
00627    return(lRankFollower == lRankExist - 1);
00628 }

STDMETHOD ( DropFragment )

Reimplemented from CGameBase.

STDMETHOD ( SetupFragment )

Reimplemented from CGameBase.

STDMETHOD ( PileClicked )

Reimplemented from CGameBase.

STDMETHOD ( Deal )

Reimplemented from CGameBase.

STDMETHOD ( Uninitialize )

Reimplemented from CGameBase.

STDMETHOD ( Initialize )

Reimplemented from CGameBase.

void UpdateLayout ( ) [protected, virtual]

Reimplemented from CGameBase.

Definition at line 497 of file GameSpider.cpp.

References CHECKHRCOM, m_apFoundations, m_apPiles, CGameBase::m_lCardHeight, CGameBase::m_lCardWidth, CGameBase::m_lSpacingX, CGameBase::m_lSpacingY, CGameBase::m_lWindowWidth, and m_spStock.

00498 {
00499    // Figure out the dimensions of the full stock
00500    long lHeightStock = 0;
00501    CHECKHRCOM(m_spStock->HeightWith(54, &lHeightStock));
00502    long lStockExtra = lHeightStock - m_lCardHeight;
00503    if(lStockExtra > (m_lSpacingY / 2))
00504       lStockExtra += (m_lSpacingY / 2);
00505    else
00506       lStockExtra = m_lSpacingY;
00507
00508    // Calculate where the "left edge" of the tableau should be so that the
00509    // entire tableau is centered horizontally
00510    long lWidthNeeded = (10 * m_lCardWidth) + (12 * m_lSpacingX);
00511    long lLeft = (m_lWindowWidth < lWidthNeeded ? 0 :
00512       ((m_lWindowWidth / 2) - (lWidthNeeded / 2)));
00513
00514    // Position the stock
00515    CHECKHRCOM(m_spStock->put_X(lLeft + m_lSpacingX));
00516    CHECKHRCOM(m_spStock->put_Y(m_lSpacingY));
00517
00518    // Position the tableau piles
00519    int i;
00520    for(i = 0; i < 10; i++)
00521    {
00522       CHECKHRCOM(m_apPiles[i]->put_X(lLeft + m_lSpacingX + (i * (m_lSpacingX + m_lCardWidth))));
00523       CHECKHRCOM(m_apPiles[i]->put_Y(m_lSpacingY + m_lCardHeight + lStockExtra));
00524    }
00525
00526    // Position the foundation piles
00527    for(i = 0; i < 8; i++)
00528    {
00529       CHECKHRCOM(m_apFoundations[i]->put_X
00530          (lLeft + m_lSpacingX + ((i + 2) * (m_lSpacingX + m_lCardWidth))));
00531       CHECKHRCOM(m_apFoundations[i]->put_Y(m_lSpacingY));
00532    }
00533 }

Member Data Documentation

CSolpackGameDataArray m_apBottomCards [protected]

Definition at line 60 of file GameSpider.h.

Referenced by AdjustAfterSuccess(), and CGameSpider().

CSolpackPileArray m_apFoundations [protected]

Definition at line 58 of file GameSpider.h.

Referenced by CGameSpider(), CheckPile(), and UpdateLayout().

CSolpackPileArray m_apPiles [protected]

Definition at line 57 of file GameSpider.h.

Referenced by AdjustAfterSuccess(), CGameSpider(), CheckPile(), DealCard(), and UpdateLayout().

CSolpackGameDataArray m_apTopCards [protected]

Definition at line 59 of file GameSpider.h.

Referenced by AdjustAfterSuccess(), CGameSpider(), and DealCard().

CSolpackGameDataPtr m_pNumPilesGone [protected]

Definition at line 61 of file GameSpider.h.

Referenced by CheckPile().

CSolpackPilePtr m_spDeck2 [protected]

Definition at line 55 of file GameSpider.h.

CSolpackPilePtr m_spStock [protected]

Definition at line 56 of file GameSpider.h.

Referenced by UpdateLayout().

ISolpackPile VARIANT_BOOL* pbValid

Reimplemented from CGameBase.

Definition at line 42 of file GameSpider.h.

ISolpackCard* pCard

Reimplemented from CGameBase.

Definition at line 39 of file GameSpider.h.

Referenced by DealCard().

ISolpackCard* pCardSrc

Reimplemented from CGameBase.

Definition at line 40 of file GameSpider.h.

ISolpackCard ISolpackFragment* pFrag

Reimplemented from CGameBase.

Definition at line 40 of file GameSpider.h.

ISolpackPile* pPileDest

Reimplemented from CGameBase.

Definition at line 42 of file GameSpider.h.

The documentation for this class was generated from the following files:
  • GameSpider.h
  • GameSpider.cpp
Generated on Wed May 8 12:39:43 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CGameSpider Member List

This is the complete list of members for CGameSpider, including all inherited members.
AdjustAfterSuccess(int iSrc) | CGameSpider | [protected]
CDispBase() | CDispBase |
CGameBase(UINT uGameID, CGameInfo *pInfo) | CGameBase |
CGameSpider(UINT uGameID, CGameInfo *pInfo) | CGameSpider |
CheckPile(long m) | CGameSpider | [protected]
cNames | CDispBase |
Create(UINT uGameID, CGameInfo *pInfo) | CGameSpider | [static]
CreateDeck(ISolpackPile **ppPile) | CGameBase | [protected]
DealCard(long m, ISolpackCard *pCard) | CGameSpider | [protected]
DECLARE_IUNKNOWN_AND_IDISPATCH | CGameBase |
DoesCardFollow(ISolpackCard *pCardExist, ISolpackCard *pCardFollower, BOOL bMatchSuits=FALSE) | CGameSpider | [protected]
GetCardFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetDispatch() const | CDispBase | [inline, protected]
GetLongFromData(ISolpackGameData *pGameData) | CGameBase | [protected]
GetMetrics() | CGameBase | [protected]
GetOuterUnknown() const | CDispBase | [inline, protected]
IncrScore(long lIncr) | CGameBase | [protected]
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitGame() | CGameBase | [virtual]
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_apBottomCards | CGameSpider | [protected]
m_apFoundations | CGameSpider | [protected]
m_apPiles | CGameSpider | [protected]
m_apTopCards | CGameSpider | [protected]
m_bPlaying | CGameBase | [protected]
m_lCardHeight | CGameBase | [protected]
m_lCardWidth | CGameBase | [protected]
m_lSpacingX | CGameBase | [protected]
m_lSpacingY | CGameBase | [protected]
m_lWindowHeight | CGameBase | [protected]
m_lWindowWidth | CGameBase | [protected]
m_pGameInfo | CGameBase | [protected]
m_pNumPilesGone | CGameSpider | [protected]
m_spApp | CGameBase | [protected]
m_spDeck | CGameBase | [protected]
m_spDeck2 | CGameSpider | [protected]
m_spDragSrc | CGameBase | [protected]
m_spStock | CGameSpider | [protected]
m_uGameID | CGameBase | [protected]
ObjectsEqual(IUnknown *pUnk1, IUnknown *pUnk2) | CGameBase | [protected]
pbValid | CGameSpider |
pCard | CGameSpider |
pCardSrc | CGameSpider |
pDispParams | CDispBase |
pExcepInfo | CDispBase |
pFrag | CGameSpider |
pPileDest | CGameSpider |
ppTInfo | CDispBase |
ppvObject | CGameBase |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PutCardInData(ISolpackGameData *pGameData, ISolpackCard *pCard) | CGameBase | [protected]
PutLongInData(ISolpackGameData *pGameData, long l) | CGameBase | [protected]
pVarResult | CDispBase |
rgDispId | CDispBase |
rgszNames | CDispBase |
riid | CDispBase |
STDMETHOD(Initialize)(ISolpackApp *pApp) | CGameSpider |
STDMETHOD(Uninitialize)() | CGameSpider |
STDMETHOD(Deal)() | CGameSpider |
STDMETHOD(PileClicked)(ISolpackPile *pPile | CGameSpider |
STDMETHOD(SetupFragment)(ISolpackPile *pPileSrc | CGameSpider |
STDMETHOD(DropFragment)(ISolpackFragment *pFrag | CGameSpider |
CGameBase::STDMETHOD(get_Info)(ISolpackGameInfo **ppInfo) | CGameBase |
CGameBase::STDMETHOD(AutoPlay)() | CGameBase |
CGameBase::STDMETHOD(HandleCommand)(long lID) | CGameBase |
CGameBase::STDMETHOD(CancelMove)() | CGameBase |
CGameBase::STDMETHOD(RecalcLayout)() | CGameBase |
CGameBase::STDMETHOD(NDQueryInterface)(REFIID riid | CGameBase |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
UpdateLayout() | CGameSpider | [protected, virtual]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CGameBase() | CGameBase | [virtual]
~CGameSpider() | CGameSpider | [virtual]
Generated on Wed May 8 12:39:44 2002 for Solitaire Pack by doxygen 1.2.15


CHandle Class Reference

#include <bmws_handle.h>

List of all members.

Public Methods

CHandle ()
CHandle (HANDLE h, HANDLECLOSEFN pfnClose)
~CHandle ()
operator HANDLE () const
void | Assign (HANDLE h, HANDLECLOSEFN pfnClose=NULL)
void | Close ()

Private Attributes

HANDLE | m_h
HANDLECLOSEFN m_pfnClose

Constructor & Destructor Documentation

CHandle ( ) [inline]

Definition at line 36 of file bmws_handle.h.

References m_h, and m_pfnClose.

00037    {
00038       m_h = INVALID_HANDLE_VALUE;
00039       m_pfnClose = NULL;
00040    }

CHandle | ( | HANDLE | h,
 |  | HANDLECLOSEFN | pfnClose
 | ) | [inline]

Definition at line 52 of file bmws_handle.h.

References HANDLECLOSEFN, m_h, and m_pfnClose.

00053    {
00054       m_h = h;
00055       m_pfnClose = pfnClose;
00056    }

~CHandle ( ) [inline]

Definition at line 64 of file bmws_handle.h.

References Close().

00065    {
00066       Close();
00067    }

Member Function Documentation

void Assign | ( | HANDLE | h,
 |  | HANDLECLOSEFN | pfnClose = NULL
 | ) | [inline]

Definition at line 95 of file bmws_handle.h.

References Close(), HANDLECLOSEFN, m_h, and m_pfnClose.

Referenced by CXMLDocument::CXMLDocument(), CXMLDocument::EventHandler(), and CXMLDocument::SaveToFile().

00096    {
00097       Close();
00098       m_h = h;
00099       if(pfnClose)
00100          m_pfnClose = pfnClose;
00101    }

void Close ( ) [inline]

Definition at line 114 of file bmws_handle.h.

References m_h, and m_pfnClose.

Referenced by Assign(), CXMLDocument::LoadFromFile(), CXMLDocument::SaveToFile(), and ~CHandle().

00115    {
00116       if(m_h != INVALID_HANDLE_VALUE)
00117       {
00118          if(m_pfnClose)
00119             m_pfnClose(m_h);
00120          m_h = INVALID_HANDLE_VALUE;
00121       }
00122    }

operator HANDLE ( ) const [inline]

Definition at line 79 of file bmws_handle.h.

References m_h.

00080    {
00081       return m_h;
00082    }

Member Data Documentation

HANDLE m_h [private]

Definition at line 126 of file bmws_handle.h.

Referenced by Assign(), CHandle(), Close(), and operator HANDLE().

HANDLECLOSEFN m_pfnClose [private]

Definition at line 127 of file bmws_handle.h.

Referenced by Assign(), CHandle(), and Close().

The documentation for this class was generated from the following file:
  • bmws_handle.h
Generated on Wed May 8 12:39:44 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHandle Member List

This is the complete list of members for CHandle, including all inherited members.
Assign(HANDLE h, HANDLECLOSEFN pfnClose=NULL) | CHandle | [inline]
CHandle() | CHandle | [inline]
CHandle(HANDLE h, HANDLECLOSEFN pfnClose) | CHandle | [inline]
Close() | CHandle | [inline]
m_h | CHandle | [private]
m_pfnClose | CHandle | [private]
operator HANDLE() const | CHandle | [inline]
~CHandle() | CHandle | [inline]
Generated on Wed May 8 12:39:44 2002 for Solitaire Pack by doxygen 1.2.15


CHelpMgr Class Reference

#include <bmws_helpmgr.h>

List of all members.

Public Methods

CHelpMgr (UINT uidHelpFile, UINT uidDefPopupFile)
virtual | ~CHelpMgr ()
void | ShowHelp (HWND hWnd, LPTSTR lpszTopic=NULL)
void | ShowPopup (HWND hWnd, CTSTR &lpszPopupFile, DWORD *adwIDs, UINT uMsg)
void | DialogCSHelp (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, CTSTR &lpszPopupFile, DWORD *adwIDs)

Protected Attributes

CTSTR m_lpszPopupHolder
CTSTR m_lpszFileName
CTSTR m_lpszDefPopupFile
BOOL | m_bOpened

Constructor & Destructor Documentation

CHelpMgr | ( | UINT | uidHelpFile,
 |  | UINT | uidDefPopupFile
 | ) |

Definition at line 30 of file bmws_helpmgr.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), IDS_BMWS_HELPMGR_POPUPHOLDER, m_bOpened, m_lpszDefPopupFile, m_lpszFileName, and m_lpszPopupHolder.

00031 {
00032    CTSTR lpszTemp(uidHelpFile);
00033    m_lpszFileName.Alloc(MAX_PATH);
00034    GetModuleFileName(NULL, m_lpszFileName, MAX_PATH);
00035    PathRemoveFileSpec(m_lpszFileName);
00036    PathAppend(m_lpszFileName, lpszTemp);
00037    m_lpszDefPopupFile.Assign(uidDefPopupFile);
00038    m_lpszPopupHolder.Assign(IDS_BMWS_HELPMGR_POPUPHOLDER);
00039    m_bOpened = FALSE;
00040 }

~CHelpMgr ( ) [virtual]

Definition at line 48 of file bmws_helpmgr.cpp.

00049 {
00050    if(m_bOpened)
00051       HtmlHelp(NULL, NULL, HH_CLOSE_ALL, 0);
00052 }

Member Function Documentation

void DialogCSHelp | ( | HWND | hwndDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | CTSTR & | lpszPopupFile,
 |  | DWORD * | adwIDs
 | ) |

Definition at line 119 of file bmws_helpmgr.cpp.

References ShowPopup().

Referenced by CCPSoundsDlg::CPSoundsProc(), and CUpdateDlg::DlgProc().

00121 {
00122    if((uMsg == WM_HELP) && (LOWORD(((LPHELPINFO)lParam)->iCtrlId) == 0xffff))
00123       return;
00124    HWND hItem = (uMsg == WM_HELP ? (HWND)((LPHELPINFO)lParam)->hItemHandle : (HWND)wParam);
00125    if(hItem != hwndDlg)
00126       ShowPopup(hItem, lpszPopupFile, adwIDs, uMsg);
00127 }

void ShowHelp | ( | HWND | hWnd,
 |  | LPTSTR | lpszTopic = NULL
 | ) |

Definition at line 67 of file bmws_helpmgr.cpp.

References m_bOpened, and m_lpszFileName.

00068 {
00069    HtmlHelp(hWnd, m_lpszFileName, HH_DISPLAY_TOPIC, (DWORD_PTR)lpszTopic);
00070    m_bOpened = TRUE;
00071 }

void ShowPopup | ( | HWND | hWnd,
 |  | CTSTR & | lpszPopupFile,
 |  | DWORD * | adwIDs,
 |  | UINT | uMsg
 | ) |

Definition at line 89 of file bmws_helpmgr.cpp.

References m_bOpened, m_lpszDefPopupFile, m_lpszFileName, and m_lpszPopupHolder.

Referenced by DialogCSHelp().

00090 {
00091    CTSTR& rlpszPopupFile = (lpszPopupFile ? lpszPopupFile : m_lpszDefPopupFile);
00092    CTSTR lpszTotal(TRUE, lstrlen(m_lpszFileName) + lstrlen(rlpszPopupFile) +
00093       lstrlen(m_lpszPopupHolder) + 1);
00094    wsprintf(lpszTotal, m_lpszPopupHolder, m_lpszFileName, rlpszPopupFile);
00095    HtmlHelp(hWnd, lpszTotal, (uMsg == WM_CONTEXTMENU ? HH_TP_HELP_CONTEXTMENU :
00096       HH_TP_HELP_WM_HELP), (DWORD)adwIDs);
00097    m_bOpened = TRUE;
00098 }

Member Data Documentation

BOOL m_bOpened [protected]

Definition at line 39 of file bmws_helpmgr.h.

Referenced by CHelpMgr(), ShowHelp(), and ShowPopup().

CTSTR m_lpszDefPopupFile [protected]

Definition at line 38 of file bmws_helpmgr.h.

Referenced by CHelpMgr(), and ShowPopup().

CTSTR m_lpszFileName [protected]

Definition at line 37 of file bmws_helpmgr.h.

Referenced by CHelpMgr(), ShowHelp(), and ShowPopup().

CTSTR m_lpszPopupHolder [protected]

Definition at line 36 of file bmws_helpmgr.h.

Referenced by CHelpMgr(), and ShowPopup().

The documentation for this class was generated from the following files:
  • bmws_helpmgr.h
  • bmws_helpmgr.cpp
Generated on Wed May 8 12:39:44 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHelpMgr Member List

This is the complete list of members for CHelpMgr, including all inherited members.
CHelpMgr(UINT uidHelpFile, UINT uidDefPopupFile) | CHelpMgr |
DialogCSHelp(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, CTSTR &lpszPopupFile, DWORD *adwIDs) | CHelpMgr |
m_bOpened | CHelpMgr | [protected]
m_lpszDefPopupFile | CHelpMgr | [protected]
m_lpszFileName | CHelpMgr | [protected]
m_lpszPopupHolder | CHelpMgr | [protected]
ShowHelp(HWND hWnd, LPTSTR lpszTopic=NULL) | CHelpMgr |
ShowPopup(HWND hWnd, CTSTR &lpszPopupFile, DWORD *adwIDs, UINT uMsg) | CHelpMgr |
~CHelpMgr() | CHelpMgr | [virtual]
Generated on Wed May 8 12:39:44 2002 for Solitaire Pack by doxygen 1.2.15


CHelpPane Class Reference

#include <HelpPane.h>

Inheritance diagram for CHelpPane:

CHWND IEventSinkSite CRefCount List of all members.

Public Methods

CHelpPane ()
virtual | ~CHelpPane ()
void | Register ()
BOOL | Create (HWND hwndParent)
void | UpdateFont ()
void | CancelResize ()
void | SetGame (CBSTR &bstr)
void | SetInstr (CBSTR &bstr)
HRESULT | EventSink (LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)

Static Public Methods

LRESULT CALLBACK | BarWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK | PaneWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Static Public Attributes

BOOL | s_bRegistered = FALSE

Protected Methods

BOOL | OnCreate ()
void | OnSize (int nWidth, int nHeight)
LRESULT | OnNotify (WPARAM wParam, LPARAM lParam)
void | UpdateColors (WPARAM wParam, LPARAM lParam)
BOOL | OnCreatePane ()
void | OnSizePane (int nWidth, int nHeight)
void | OnDestroyPane ()
void | HTMLComplete ()

Protected Attributes

CBrowserContainer * m_pBrowserContainer
CWebBrowser2Ptr m_spBrowser
CHTMLHelper * m_pHH
CTSTR m_lpszPaneClass
CHWND * m_pRebar
CHWND * m_pXTB
CHWND * m_pPane
HFONT | m_hFont
CBSTR m_bstrGame
CBSTR m_bstrInstr
BOOL | m_bResizing

Constructor & Destructor Documentation

CHelpPane ( )

Definition at line 52 of file HelpPane.cpp.

References m_bResizing, m_hFont, m_pBrowserContainer, m_pHH, m_pPane, m_pRebar, and m_pXTB.

00053 {
00054    // Set initial values for member variables
00055    m_pBrowserContainer = NULL;
00056    m_pHH = NULL;
00057    m_pRebar = NULL;
00058    m_pXTB = NULL;
00059    m_pPane = NULL;
00060    m_hFont = NULL;
00061    m_bResizing = FALSE;
00062 }

~CHelpPane ( ) [virtual]

Definition at line 70 of file HelpPane.cpp.

References m_pPane, m_pRebar, m_pXTB, SAFEDELETE, and CHWND::SendMessage().

00071 {
00072    // Destroy all window objects
00073    if(m_pXTB)
00074    {
00075       HIMAGELIST himl = (HIMAGELIST)m_pXTB->SendMessage(TB_GETIMAGELIST, 0, 0);
00076       if(himl)
00077          ImageList_Destroy(himl);
00078    }
00079    SAFEDELETE(m_pXTB);
00080    SAFEDELETE(m_pPane);
00081    SAFEDELETE(m_pRebar);
00082 }

Member Function Documentation

LRESULT CALLBACK BarWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 153 of file HelpPane.cpp.

References CancelResize(), IDM_HELP_GAMEINSTRUCTIONS, m_bResizing, CHWND::m_hWnd, OnCreate(), OnNotify(), OnSize(), UpdateColors(), WM_PANESIZE_END, WM_PANESIZE_MOVE, and WM_PANESIZE_START.

Referenced by Register().

00154 {
00155    // Retrieve "this" pointer from window handle
00156    CHelpPane *pThis = (CHelpPane*)GetWindowLong(hWnd, GWL_USERDATA);
00157
00158    try   // Windows-called code
00159    {
00160       switch(uMsg)
00161       {
00162          // Called before the window is created.
00163          case WM_NCCREATE:
00164             // Store the "this" pointer with the window handle
00165             pThis = (CHelpPane*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00166             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00167             pThis->m_hWnd = hWnd;
00168             return TRUE;
00169
00170          // Called when the window is created
00171          case WM_CREATE:
00172             return (pThis->OnCreate() ? 0 : -1);
00173
00174          // Called when the user is sizing the window
00175          case WM_SIZE:
00176             pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00177             return 0;
00178
00179          // Called when system color settings have changed
00180          case WM_SYSCOLORCHANGE:
00181             pThis->UpdateColors(wParam, lParam);
00182             break;
00183
00184          // Called when the Close toolbar button is clicked
00185          case WM_COMMAND:
00186             if(LOWORD(wParam) == IDM_HELP_GAMEINSTRUCTIONS)
00187             {
00188                ::SendMessage(GetParent(pThis->m_hWnd), WM_COMMAND, wParam, lParam);
00189                return 0;
00190             }
00191             break;
00192
00193          // Called when a common control event occurs
00194          case WM_NOTIFY:
00195             return pThis->OnNotify(wParam, lParam);
00196
00197          // Called when the user moves the mouse
00198          case WM_MOUSEMOVE:
00199             if(pThis->m_bResizing)
00200                ::SendMessage(GetParent(hWnd), WM_PANESIZE_MOVE, MAKEPOINTS(lParam).y, 0);
00201             return 0;
00202
00203          // Called when the left mouse button is pushed
00204          case WM_LBUTTONDOWN:
00205             pThis->m_bResizing = TRUE;
00206             SetCapture(hWnd);
00207             ::SendMessage(GetParent(hWnd), WM_PANESIZE_START, 0, 0);
00208             ::SendMessage(hWnd, WM_ENTERSIZEMOVE, 0, 0);
00209             return 0;
00210
00211          // Called when the left mouse button is released
00212          case WM_LBUTTONUP:
00213             pThis->CancelResize();
00214             ::SendMessage(GetParent(hWnd), WM_PANESIZE_END, 0, 0);
00215             return 0;
00216       }
00217    }
00218    catch(CExcep *pE)
00219    {
00220       pE->Report();
00221       pE->Delete();
00222    }
00223
00224    // Let Windows process the message
00225    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00226 }

void CancelResize ( )

Definition at line 812 of file HelpPane.cpp.

References m_bResizing, and CHWND::SendMessage().

Referenced by BarWndProc().

00813 {
00814    if(m_bResizing)
00815    {
00816       m_bResizing = FALSE;
00817       ReleaseCapture();
00818       SendMessage(WM_EXITSIZEMOVE, 0, 0);
00819    }
00820 }

BOOL Create ( HWND hwndParent )

Definition at line 127 of file HelpPane.cpp.

References CHWND::CreateWindowEx(), and CHWND::m_lpszClassName.

00128 {
00129    CreateWindowEx(WS_EX_TOOLWINDOW, m_lpszClassName, NULL, WS_CHILD |
00130       WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 0, 0, hwndParent, NULL,
00131       (LPVOID)this);
00132
00133    return TRUE;
00134 }

HRESULT EventSink | ( | LPARAM | lParam,
 |  | DISPID | dispid,
 |  | DISPPARAMS FAR * | pdispparams
 | ) | [virtual]

Implements IEventSinkSite.

void HTMLComplete ( ) [protected]

Definition at line 774 of file HelpPane.cpp.

References CHECKHRCOM, ENSUREALLOC, IDS_EL_BODY, IDS_EL_HELPGAME, IDS_EL_HELPINSTR, m_bstrGame, m_bstrInstr, m_pHH, m_spBrowser, and CHTMLHelper::SetElText().

00775 {
00776    if(m_pHH)
00777       return;
00778
00779    CWaitCursor wait;
00780
00781    // Get the HTML document object from the web browser
00782    CPtr<IDispatch, &IID_IDispatch> spDocDisp;
00783    CHECKHRCOM(m_spBrowser->get_Document(&spDocDisp));
00784    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTMLDoc = spDocDisp;
00785    m_pHH = new CHTMLHelper(spHTMLDoc);
00786    ENSUREALLOC(m_pHH);
00787
00788    // Prevent the HTML from being selected or dragged
00789    m_pHH->ProtectUI(IDS_EL_BODY);
00790
00791    // Initialize the HTML helper for adding document styles
00792    m_pHH->InitAddStyle();
00793
00794    // Display the current game title and rules
00795    if(m_bstrGame)
00796       m_pHH->SetElText(IDS_EL_HELPGAME, m_bstrGame);
00797    if(m_bstrInstr)
00798       m_pHH->SetElText(IDS_EL_HELPINSTR, m_bstrInstr);
00799 }

BOOL OnCreate ( ) [protected]

Definition at line 240 of file HelpPane.cpp.

References CHWND::CHWND(), CHWND::CreateWindowEx(), ENSUREALLOC, ERROR_ERRORINS_INT, g_hInst, ID_HELPPANEREBAR, IDB_BARCLOSE, IDM_HELP_GAMEINSTRUCTIONS, IDS_BMWS_REMEDY_RESTART, IDS_ERR_IMLCREATE, IDS_ERR_LOADIMAGE, IDS_TB_CLOSE, m_hFont, CHWND::m_hWnd, m_lpszPaneClass, m_pPane, m_pRebar, m_pXTB, CHWND::SendMessage(), THROW, and UpdateFont().

Referenced by BarWndProc().

00241 {
00242    HIMAGELIST himl = NULL;
00243
00244    try
00245    {
00246       UpdateFont();
00247
00248       // Create and initialize the rebar window
00249       m_pRebar = new CHWND();
00250       ENSUREALLOC(m_pRebar);
00251
00252       m_pRebar->CreateWindowEx(0, REBARCLASSNAME, NULL, RBS_DBLCLKTOGGLE | RBS_VARHEIGHT |
00253          RBS_AUTOSIZE | RBS_VERTICALGRIPPER | CCS_BOTTOM | CCS_NODIVIDER | CCS_NOPARENTALIGN |
00254          CCS_NORESIZE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE |
00255          WS_OVERLAPPED, 0, 0, 0, 0, m_hWnd, NULL, NULL);
00256
00257       REBARINFO rbi;
00258       REBARBANDINFO rbBand;
00259
00260       rbi.cbSize = sizeof(REBARINFO);  // Required when using this struct.
00261       rbi.fMask  = 0;
00262       rbi.himl   = (HIMAGELIST)NULL;
00263       if(!m_pRebar->SendMessage(RB_SETBARINFO, 0, (LPARAM)&rbi))
00264          return FALSE;
00265
00266       m_pRebar->SendMessage(RB_SETBKCOLOR, 0, (LPARAM)GetSysColor(COLOR_3DFACE));
00267
00268       // Create the Close toolbar
00269       m_pXTB = new CHWND();
00270       ENSUREALLOC(m_pXTB);
00271
00272       m_pXTB->CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | TBSTYLE_FLAT |
00273          TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | CCS_NODIVIDER | CCS_NORESIZE | CCS_NOMOVEY |
00274          CCS_NOPARENTALIGN | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 20, 18,
00275          *m_pRebar, NULL, NULL);
00276
00277       m_pXTB->SendMessage(TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
00278       m_pXTB->SendMessage(TB_SETMAXTEXTROWS, 0, 0);
00279
00280       // Load the Close toolbar bitmap
00281       HBITMAP hbm;
00282       himl = ImageList_Create(13, 11, ILC_COLORDDB, 0, 1);
00283       if(!himl)
00284          THROW(new CExcepEx(IDS_ERR_IMLCREATE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00285
00286       hbm = CreateMappedBitmap(g_hInst, IDB_BARCLOSE, 0, NULL, 1);
00287       if(!hbm)
00288          THROW(new CExcepEx(IDS_ERR_LOADIMAGE, IDS_BMWS_REMEDY_RESTART, IDB_BARCLOSE, 0,
00289             ERROR_ERRORINS_INT), CExcepEx*);
00290
00291       ImageList_Add(himl, hbm, NULL);
00292       DeleteObject(hbm);
00293       m_pXTB->SendMessage(TB_SETIMAGELIST, 0, (LPARAM)himl);
00294
00295       CTSTR lpszClose(IDS_TB_CLOSE);
00296       TBBUTTON atbButtons[1];
00297       atbButtons[0].iBitmap = 0;
00298       atbButtons[0].idCommand = IDM_HELP_GAMEINSTRUCTIONS;
00299       atbButtons[0].fsState = TBSTATE_ENABLED;
00300       atbButtons[0].fsStyle = BTNS_BUTTON;
00301       atbButtons[0].dwData = 0;
00302       atbButtons[0].iString = (int)(LPTSTR)lpszClose;
00303
00304       m_pXTB->SendMessage(TB_ADDBUTTONS, (UINT)1, (LPARAM)atbButtons);
00305       m_pXTB->SendMessage(TB_AUTOSIZE, 0, 0);
00306
00307       // Create the Pane window
00308       m_pPane = new CHWND();
00309       ENSUREALLOC(m_pPane);
00310       m_pPane->CreateWindowEx(0, m_lpszPaneClass, NULL, WS_CHILD | WS_VISIBLE |
00311          WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 0, 0, *m_pRebar, NULL, (LPVOID)this);
00312
00313       RECT rcRR;
00314       GetWindowRect(*m_pRebar, &rcRR);
00315
00316       // Set up the rebar
00317       ZeroMemory(&rbBand, sizeof(rbBand));
00318       rbBand.cbSize = sizeof(REBARBANDINFO);
00319       rbBand.fMask = RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_HEADERSIZE;
00320       rbBand.cyMinChild = 16;
00321       rbBand.cxMinChild = 0;
00322       rbBand.cyMaxChild = 32000;
00323       rbBand.cyIntegral = 1;
00324       rbBand.fStyle = RBBS_FIXEDBMP | RBBS_NOGRIPPER | RBBS_VARIABLEHEIGHT | RBBS_FIXEDSIZE;
00325       rbBand.wID = ID_HELPPANEREBAR;
00326       rbBand.hwndChild = *m_pPane;
00327
00328       HFONT hfOld;
00329       HDC hdc;
00330       TEXTMETRIC tm;
00331
00332       hdc = GetDC(*m_pRebar);
00333       hfOld = (HFONT)SelectObject(hdc, m_hFont);
00334       GetTextMetrics(hdc, &tm);
00335       SelectObject(hdc, hfOld);
00336       ReleaseDC(*m_pRebar, hdc);
00337       rbBand.cxHeader = tm.tmHeight + 9;
00338       if(rbBand.cxHeader < 21)
00339          rbBand.cxHeader = 21;
00340
00341       m_pRebar->SendMessage(RB_INSERTBAND, -1, (LPARAM)&rbBand);
00342    }
00343    catch(CExcep *pE)
00344    {
00345       if(himl)
00346          ImageList_Destroy(himl);
00347       pE->Report();
00348       pE->Delete();
00349       return FALSE;
00350    }
00351
00352    return TRUE;
00353 }

BOOL OnCreatePane ( ) [protected]

Definition at line 512 of file HelpPane.cpp.

References CHECKHRCOM, CreateResURL(), ENSUREALLOC, g_hInstLC, IDS_HELPHTML, CBrowserContainer::Init(), m_pBrowserContainer, m_pPane, and m_spBrowser.

Referenced by PaneWndProc().

00513 {
00514    try
00515    {
00516       // Create and initialize the browser container
00517       m_pBrowserContainer = new CBrowserContainer(TRUE, TRUE);
00518       ENSUREALLOC(m_pBrowserContainer);
00519       m_pBrowserContainer->AddRef();
00520       m_pBrowserContainer->Init(*m_pPane, &m_spBrowser, (IEventSinkSite*)this, 0);
00521       m_spBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
00522
00523       // Prepare to navigate the browser to our instruction-holding HTML file
00524       CTSTR lpszHtml = CreateResURL(g_hInstLC, CTSTR(IDS_HELPHTML));
00525
00526       // Remove below line to use the resource instead of the file
00527       //lpszHtml.Assign(TEXT("C:\\Programming\\Microsoft Visual Studio\\MyProjects\\Solitaire Pack\\SolpckLC\\res\\help.html"));
00528
00529       VARIANT v;
00530       v.vt = VT_I4;
00531       v.lVal = navNoHistory;
00532       CHECKHRCOM(m_spBrowser->Navigate(CBSTR(lpszHtml), &v, NULL, NULL, NULL));
00533    }
00534    catch(CExcep *pE)
00535    {
00536       pE->Report();
00537       pE->Delete();
00538       return FALSE;
00539    }
00540
00541    return TRUE;
00542 }

void OnDestroyPane ( ) [protected]

Definition at line 577 of file HelpPane.cpp.

References m_pBrowserContainer, m_pHH, m_spBrowser, CPtr< IWebBrowser2,&IID_IWebBrowser2 >::Release(), SAFEDELETE, and CBrowserContainer::Uninit().

Referenced by PaneWndProc().

00578 {
00579    // Delete the HTML helper object
00580    SAFEDELETE(m_pHH);
00581
00582    // Uninitialize and free the browser container
00583    m_spBrowser.Release();
00584    if(m_pBrowserContainer)
00585    {
00586       m_pBrowserContainer->Uninit();
00587       m_pBrowserContainer->Release();
00588       m_pBrowserContainer = NULL;
00589    }
00590 }

LRESULT OnNotify | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 391 of file HelpPane.cpp.

References ID_HELPPANEREBAR, and m_hFont.

Referenced by BarWndProc().

00392 {
00393    // This function draws the rebar's 3D bevel.
00394    if(((LPNMHDR)lParam)->code != NM_CUSTOMDRAW)
00395       return FALSE;
00396
00397    LPNMCUSTOMDRAW lpnmcd = (LPNMCUSTOMDRAW)lParam;
00398    switch(lpnmcd->dwDrawStage)
00399    {
00400       case CDDS_PREPAINT:
00401          return CDRF_NOTIFYITEMDRAW;
00402
00403       case CDDS_ITEMPREPAINT:
00404          return CDRF_NOTIFYPOSTPAINT;
00405
00406       case CDDS_ITEMPOSTPAINT:
00407          if(lpnmcd->dwItemSpec == ID_HELPPANEREBAR)
00408          {
00409             // Custom draw the rebar to look like IE's bars
00410             HFONT hfOld;
00411             HPEN hpenOld;
00412             TEXTMETRIC tm;
00413             LONG lHeight;
00414             RECT rc;
00415
00416             hfOld = (HFONT)SelectObject(lpnmcd->hdc, m_hFont);
00417             GetTextMetrics(lpnmcd->hdc, &tm);
00418             SelectObject(lpnmcd->hdc, hfOld);
00419             CopyRect(&rc, &lpnmcd->rc);
00420             lHeight = tm.tmHeight;
00421             if(lHeight < 12)
00422                lHeight = 12;
00423             rc.left += 3;
00424             rc.right = rc.left + lHeight;
00425             hpenOld = (HPEN)SelectObject(lpnmcd->hdc, CreatePen(PS_SOLID, 1,
00426                GetSysColor(COLOR_3DSHADOW)));
00427             MoveToEx(lpnmcd->hdc, rc.right + 4, rc.bottom, NULL);
00428             LineTo(lpnmcd->hdc, rc.right + 4, rc.top);
00429             DeleteObject(SelectObject(lpnmcd->hdc, CreatePen(PS_SOLID, 1,
00430                GetSysColor(COLOR_3DHILIGHT))));
00431             MoveToEx(lpnmcd->hdc, rc.right + 5, rc.bottom, NULL);
00432             LineTo(lpnmcd->hdc, rc.right + 5, rc.top);
00433             DeleteObject(SelectObject(lpnmcd->hdc, hpenOld));
00434          }
00435          break;
00436    }
00437
00438    return 0;
00439 }

void OnSize | ( | int | nWidth,
 |  | int | nHeight
 | ) | [protected]

Definition at line 369 of file HelpPane.cpp.

References CXY_SPLITTER, m_pRebar, and m_pXTB.

Referenced by BarWndProc().

00370 {
00371    MoveWindow(*m_pRebar, 0, CXY_SPLITTER, nWidth, nHeight - CXY_SPLITTER, TRUE);
00372    RECT rcRR;
00373    GetWindowRect(*m_pRebar, &rcRR);
00374    MoveWindow(*m_pXTB, 0, 1, 20, 18, TRUE);
00375 }

void OnSizePane | ( | int | nWidth,
 |  | int | nHeight
 | ) | [protected]

Definition at line 558 of file HelpPane.cpp.

References m_pBrowserContainer, and CBrowserContainer::SetLocation().

Referenced by PaneWndProc().

00559 {
00560    // Position the browser container
00561    if(m_pBrowserContainer)
00562       m_pBrowserContainer->SetLocation(0, 0, nWidth, nHeight);
00563 }

LRESULT CALLBACK PaneWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 458 of file HelpPane.cpp.

References CHWND::m_hWnd, m_pPane, OnCreatePane(), OnDestroyPane(), and OnSizePane().

Referenced by Register().

00459 {
00460    // Retrieve "this" pointer from window handle
00461    CHelpPane *pThis = (CHelpPane*)GetWindowLong(hWnd, GWL_USERDATA);
00462
00463    try   // Windows-called code
00464    {
00465       switch(uMsg)
00466       {
00467          // Called before the window is created.
00468          case WM_NCCREATE:
00469             // Store the "this" pointer with the window handle
00470             pThis = (CHelpPane*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00471             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00472             pThis->m_pPane->m_hWnd = hWnd;
00473             return TRUE;
00474
00475          // Called when the window is created
00476          case WM_CREATE:
00477             return (pThis->OnCreatePane() ? 0 : -1);
00478
00479          // Called when the user is sizing the window
00480          case WM_SIZE:
00481             pThis->OnSizePane(LOWORD(lParam), HIWORD(lParam));
00482             return 0;
00483
00484          // Called before the window is destroyed
00485          case WM_DESTROY:
00486             pThis->OnDestroyPane();
00487             return 0;
00488       }
00489    }
00490    catch(CExcep *pE)
00491    {
00492       pE->Report();
00493       pE->Delete();
00494    }
00495
00496    // Let Windows process the message
00497    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00498 }

void Register ( )

Reimplemented from CHWND.

Definition at line 97 of file HelpPane.cpp.

References CTSTR::Assign(), BarWndProc(), IDS_BARCLASSNAME, IDS_PANECLASSNAME, CHWND::m_lpszClassName, m_lpszPaneClass, PaneWndProc(), CHWND::RegisterWindowClass(), and s_bRegistered.

00098 {
00099    // Load the class names; register the classes, if not already registered.
00100    m_lpszClassName.Assign(IDS_BARCLASSNAME);
00101    m_lpszPaneClass.Assign(IDS_PANECLASSNAME);
00102
00103    if(s_bRegistered)
00104       return;
00105
00106    RegisterWindowClass(m_lpszClassName, CS_SAVEBITS, (WNDPROC)BarWndProc, NULL,
00107       (HBRUSH)(COLOR_3DFACE+1), NULL, LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS)));
00108    RegisterWindowClass(m_lpszPaneClass, 0, (WNDPROC)PaneWndProc, NULL, (HBRUSH)(COLOR_WINDOW+1),
00109       NULL);
00110
00111    s_bRegistered = TRUE;
00112 }

void SetGame ( CBSTR & bstr )

Definition at line 693 of file HelpPane.cpp.

References IDS_EL_HELPGAME, m_bstrGame, m_pHH, and CHTMLHelper::SetElText().

00694 {
00695    m_bstrGame = bstr;
00696    if(m_pHH)
00697       m_pHH->SetElText(IDS_EL_HELPGAME, m_bstrGame);
00698 }

void SetInstr ( CBSTR & bstr )

Definition at line 712 of file HelpPane.cpp.

References CHECKHRCOM, IDS_EL_HELPINSTR, m_bstrInstr, m_pHH, CHTMLHelper::m_spWindow2, and CHTMLHelper::SetElText().

00713 {
00714    m_bstrInstr = bstr;
00715    if(m_pHH)
00716    {
00717       // Set the text, and scroll the window back to the top
00718       m_pHH->SetElText(IDS_EL_HELPINSTR, m_bstrInstr);
00719       CHECKHRCOM(m_pHH->m_spWindow2->scrollTo(0, 0));
00720    }
00721 }

void UpdateColors | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 652 of file HelpPane.cpp.

References ERROR_ERRORINS_INT, g_hInst, IDB_BARCLOSE, IDS_BMWS_REMEDY_RESTART, IDS_ERR_IMLCREATE, IDS_ERR_LOADIMAGE, m_pRebar, m_pXTB, CHWND::SendMessage(), and THROW.

Referenced by BarWndProc().

00653 {
00654    HBITMAP hbm;
00655    HIMAGELIST himl;
00656    REBARBANDINFO rbbi;
00657
00658    // Create a new image list for the toolbar
00659    himl = ImageList_Create(13, 11, ILC_COLORDDB, 0, 1);
00660    if(!himl)
00661       THROW(new CExcepEx(IDS_ERR_IMLCREATE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00662    hbm = CreateMappedBitmap(g_hInst, IDB_BARCLOSE, 0, NULL, 1);
00663    if(!hbm)
00664    {
00665       ImageList_Destroy(himl);
00666       THROW(new CExcepEx(IDS_ERR_LOADIMAGE, IDS_BMWS_REMEDY_RESTART, IDB_BARCLOSE, 0,
00667          ERROR_ERRORINS_INT), CExcepEx*);
00668    }
00669
00670    ImageList_Add(himl, hbm, NULL);
00671    DeleteObject(hbm);
00672    m_pXTB->SendMessage(TB_SETIMAGELIST, 0, (LPARAM)himl);
00673    m_pRebar->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00674    rbbi.cbSize = sizeof(REBARBANDINFO);
00675    rbbi.fMask = RBBIM_COLORS;
00676    m_pRebar->SendMessage(RB_GETBANDINFO, 0, (LPARAM)&rbbi);
00677    rbbi.clrBack = GetSysColor(COLOR_3DFACE);
00678    m_pRebar->SendMessage(RB_SETBANDINFO, 0, (LPARAM)&rbbi);
00679 }

void UpdateFont ( )

Definition at line 603 of file HelpPane.cpp.

References m_hFont, m_pRebar, m_pXTB, and CHWND::SendMessage().

Referenced by OnCreate().

00604 {
00605    HDC hdc;
00606    TEXTMETRIC tm;
00607    HFONT hfOld;
00608    NONCLIENTMETRICS ninfo;
00609    REBARBANDINFO rbbi;
00610
00611    if(m_hFont)
00612       DeleteObject(m_hFont);
00613
00614    // Get the font that Windows uses for menus
00615    ninfo.cbSize = sizeof(ninfo);
00616    SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ninfo), &ninfo, 0);
00617    m_hFont = CreateFontIndirect(&ninfo.lfMenuFont);
00618
00619    if(m_pRebar)
00620    {
00621       // Set the size of the rebar header based on the font
00622       hdc = GetDC(*m_pRebar);
00623       hfOld = (HFONT)SelectObject(hdc, m_hFont);
00624       GetTextMetrics(hdc, &tm);
00625       SelectObject(hdc, hfOld);
00626       ReleaseDC(*m_pRebar, hdc);
00627       rbbi.cbSize = sizeof(REBARBANDINFO);
00628       rbbi.fMask = RBBIM_HEADERSIZE;
00629       rbbi.cxHeader = tm.tmHeight + 9;
00630       if(rbbi.cxHeader < 21)
00631          rbbi.cxHeader = 21;
00632
00633       m_pRebar->SendMessage(RB_SETBANDINFO, 0, (LPARAM)&rbbi);
00634
00635       MoveWindow(*m_pXTB, 0, 1, 20, 18, TRUE);
00636    }
00637 }

Member Data Documentation

BOOL m_bResizing [protected]

Definition at line 89 of file HelpPane.h.

Referenced by BarWndProc(), CancelResize(), and CHelpPane().

CBSTR m_bstrGame [protected]

Definition at line 86 of file HelpPane.h.

Referenced by HTMLComplete(), and SetGame().

CBSTR m_bstrInstr [protected]

Definition at line 87 of file HelpPane.h.

Referenced by HTMLComplete(), and SetInstr().

HFONT m_hFont [protected]

Definition at line 84 of file HelpPane.h.

Referenced by CHelpPane(), OnCreate(), OnNotify(), and UpdateFont().

CTSTR m_lpszPaneClass [protected]

Definition at line 80 of file HelpPane.h.

Referenced by OnCreate(), and Register().

CBrowserContainer* m_pBrowserContainer [protected]

Definition at line 76 of file HelpPane.h.

Referenced by CHelpPane(), OnCreatePane(), OnDestroyPane(), and OnSizePane().

CHTMLHelper* m_pHH [protected]

Definition at line 78 of file HelpPane.h.

Referenced by CHelpPane(), HTMLComplete(), OnDestroyPane(), SetGame(), and SetInstr().

CHWND* m_pPane [protected]

Definition at line 83 of file HelpPane.h.

Referenced by CHelpPane(), OnCreate(), OnCreatePane(), PaneWndProc(), and ~CHelpPane().

CHWND* m_pRebar [protected]

Definition at line 81 of file HelpPane.h.

Referenced by CHelpPane(), OnCreate(), OnSize(), UpdateColors(), UpdateFont(), and ~CHelpPane().

CHWND* m_pXTB [protected]

Definition at line 82 of file HelpPane.h.

Referenced by CHelpPane(), OnCreate(), OnSize(), UpdateColors(), UpdateFont(), and ~CHelpPane().

CWebBrowser2Ptr m_spBrowser [protected]

Definition at line 77 of file HelpPane.h.

Referenced by HTMLComplete(), OnCreatePane(), and OnDestroyPane().

BOOL s_bRegistered = FALSE [static]

Definition at line 42 of file HelpPane.cpp.

Referenced by Register().

The documentation for this class was generated from the following files:
  • HelpPane.h
  • HelpPane.cpp
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHelpPane Member List

This is the complete list of members for CHelpPane, including all inherited members.
BarWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CHelpPane | [static]
CancelResize() | CHelpPane |
CenterWindow(HWND hWnd) | CHWND | [static]
CHelpPane() | CHelpPane |
CHWND() | CHWND | [inline]
Create(HWND hwndParent) | CHelpPane |
CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam) | CHWND |
CRefCount() | CRefCount | [inline]
downcount() | CRefCount | [inline]
EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams) | CHelpPane | [virtual]
HTMLComplete() | CHelpPane | [protected]
m_bResizing | CHelpPane | [protected]
m_bstrGame | CHelpPane | [protected]
m_bstrInstr | CHelpPane | [protected]
m_hFont | CHelpPane | [protected]
m_hWnd | CHWND |
m_lpszClassName | CHWND | [protected]
m_lpszPaneClass | CHelpPane | [protected]
m_pBrowserContainer | CHelpPane | [protected]
m_pHH | CHelpPane | [protected]
m_pPane | CHelpPane | [protected]
m_pRebar | CHelpPane | [protected]
m_pXTB | CHelpPane | [protected]
m_spBrowser | CHelpPane | [protected]
OnCreate() | CHelpPane | [protected]
OnCreatePane() | CHelpPane | [protected]
OnDestroyPane() | CHelpPane | [protected]
OnNotify(WPARAM wParam, LPARAM lParam) | CHelpPane | [protected]
OnSize(int nWidth, int nHeight) | CHelpPane | [protected]
OnSizePane(int nWidth, int nHeight) | CHelpPane | [protected]
operator HWND() const | CHWND | [inline]
PaneWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CHelpPane | [static]
Register() | CHelpPane |
RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL) | CHWND | [static]
s_bRegistered | CHelpPane | [static]
SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) | CHWND | [inline]
SetGame(CBSTR &bstr) | CHelpPane |
SetInstr(CBSTR &bstr) | CHelpPane |
ShowWindow(int nCmdShow) | CHWND | [inline]
upcount() | CRefCount | [inline]
UpdateColors(WPARAM wParam, LPARAM lParam) | CHelpPane | [protected]
UpdateFont() | CHelpPane |
~CHelpPane() | CHelpPane | [virtual]
~CHWND() | CHWND | [inline, virtual]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


CHlinkWindow Class Reference

#include <bmws_hlink.h>

List of all members.

Public Methods

CHlinkWindow (HWND hWnd, CTSTR &lpszUrl)
CHlinkWindow (HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID)
~CHlinkWindow ()
HWND | GetWindow ()
void | Paint (LPDRAWITEMSTRUCT lpdis, COLORREF color)
void | Execute ()

Protected Methods

void | CommonSetup (HWND hWnd)

Protected Attributes

CTSTR m_lpszText
CTSTR m_lpszUrl
IHlinkWindowSite * m_pSite
DWORD | m_dwID
HWND | m_hWnd
HFONT | m_hFont

Constructor & Destructor Documentation

CHlinkWindow | ( | HWND | hWnd,
 |  | CTSTR & | lpszUrl
 | ) |

Definition at line 32 of file bmws_hlink.cpp.

References _ASSERT, CommonSetup(), m_lpszUrl, and m_pSite.

00033 {
00034    _ASSERT(hWnd);
00035    m_pSite = NULL;
00036    m_lpszUrl = lpszUrl;
00037    CommonSetup(hWnd);
00038 }

CHlinkWindow | ( | HWND | hWnd,
 |  | IHlinkWindowSite * | pSite,
 |  | DWORD | dwID
 | ) |

Definition at line 51 of file bmws_hlink.cpp.

References _ASSERT, CommonSetup(), m_dwID, and m_pSite.

00052 {
00053    _ASSERT(hWnd);
00054    m_pSite = pSite;
00055    m_dwID = dwID;
00056    CommonSetup(hWnd);
00057 }

~CHlinkWindow ( )

Definition at line 65 of file bmws_hlink.cpp.

References m_hFont.

00066 {
00067    if(m_hFont)
00068       DeleteObject(m_hFont);
00069 }

Member Function Documentation

void CommonSetup ( HWND hWnd ) [protected]

Definition at line 134 of file bmws_hlink.cpp.

References m_hFont, and m_hWnd.

Referenced by CHlinkWindow().

00135 {
00136    m_hWnd = hWnd;
00137    HFONT hFont = (HFONT)SendMessage(m_hWnd, WM_GETFONT, 0, 0);
00138    LOGFONT lf;
00139    GetObject(hFont, sizeof(LOGFONT), &lf);
00140    lf.lfUnderline = TRUE;
00141    m_hFont = CreateFontIndirect(&lf);
00142    SendMessage(m_hWnd, WM_SETFONT, (WPARAM)m_hFont, TRUE);
00143
00144    // Get the current window position
00145    RECT rc;
00146    GetWindowRect(m_hWnd, &rc);
00147
00148    HWND hWndParent = GetParent(m_hWnd);
00149    if(hWndParent)
00150    {
00151       ScreenToClient(hWndParent, (LPPOINT)&rc);
00152       ScreenToClient(hWndParent, ((LPPOINT)&rc)+1);
00153    }
00154
00155    // Get the size of the window text
00156    int iLength = GetWindowTextLength(m_hWnd) + 1;
00157    CTSTR lpszWndText(TRUE, iLength);
00158    GetWindowText(m_hWnd, lpszWndText, iLength);
00159
00160    HDC hdc = GetDC(m_hWnd);
00161    HFONT hFontOld = (HFONT)SelectObject(hdc, m_hFont);
00162    SIZE sizeText;
00163    GetTextExtentPoint32(hdc, lpszWndText, iLength, &sizeText);
00164    SelectObject(hdc, hFontOld);
00165    ReleaseDC(m_hWnd, hdc);
00166
00167    // Get the text justification via the window style
00168    DWORD dwStyle = GetWindowLong(m_hWnd, GWL_STYLE);
00169
00170    // Recalc the window size and position based on the text justification
00171    if((dwStyle & BS_VCENTER) == BS_VCENTER)
00172       InflateRect(&rc, 0, -((rc.bottom - rc.top) - sizeText.cy)/2);
00173    else
00174       rc.bottom = rc.top + sizeText.cy;
00175
00176    if((dwStyle & BS_CENTER) == BS_CENTER)
00177       InflateRect(&rc, -((rc.right - rc.left) - sizeText.cx)/2, 0);
00178    else if((dwStyle & BS_RIGHT) == BS_RIGHT)
00179       rc.left = rc.right - sizeText.cx;
00180    else // SS_LEFT = 0, so we can't test for it explicitly
00181       rc.right = rc.left + sizeText.cx;
00182
00183    InflateRect(&rc, 1, 2);
00184
00185    // Move the window
00186    SetWindowPos(m_hWnd, NULL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
00187       SWP_NOZORDER);
00188 }

void Execute ( )

Definition at line 113 of file bmws_hlink.cpp.

References ExecURL(), IHlinkWindowSite::HlinkClicked(), m_dwID, m_lpszUrl, and m_pSite.

00114 {
00115    if(m_pSite)
00116       m_pSite->HlinkClicked(m_dwID);
00117    else
00118       ExecURL(m_lpszUrl);
00119 }

HWND GetWindow ( ) [inline]

Definition at line 59 of file bmws_hlink.h.

References m_hWnd.

00059 { return m_hWnd; }

void Paint | ( | LPDRAWITEMSTRUCT | lpdis,
 |  | COLORREF | color
 | ) |

Definition at line 85 of file bmws_hlink.cpp.

References m_hWnd.

00086 {
00087    if((lpdis->itemAction & ODA_DRAWENTIRE) || (lpdis->itemAction & ODA_SELECT))
00088    {
00089       int iLen = GetWindowTextLength(m_hWnd) + 1;
00090       CTSTR lpszText(TRUE, iLen);
00091       GetWindowText(m_hWnd, lpszText, iLen);
00092       SetTextColor(lpdis->hDC, color);
00093       SetBkMode(lpdis->hDC, TRANSPARENT);
00094       DrawText(lpdis->hDC, lpszText, -1, &lpdis->rcItem, DT_CENTER | DT_VCENTER |
00095          DT_SINGLELINE);
00096    }
00097    if((lpdis->itemAction & ODA_FOCUS) || (lpdis->itemState & ODS_FOCUS))
00098       DrawFocusRect(lpdis->hDC, &lpdis->rcItem);
00099 }

Member Data Documentation

DWORD m_dwID [protected]

Definition at line 69 of file bmws_hlink.h.

Referenced by CHlinkWindow(), and Execute().

HFONT m_hFont [protected]

Definition at line 71 of file bmws_hlink.h.

Referenced by CommonSetup(), and ~CHlinkWindow().

HWND m_hWnd [protected]

Definition at line 70 of file bmws_hlink.h.

Referenced by CommonSetup(), GetWindow(), and Paint().

CTSTR m_lpszText [protected]

Definition at line 66 of file bmws_hlink.h.

CTSTR m_lpszUrl [protected]

Definition at line 67 of file bmws_hlink.h.

Referenced by CHlinkWindow(), and Execute().

IHlinkWindowSite* m_pSite [protected]

Definition at line 68 of file bmws_hlink.h.

Referenced by CHlinkWindow(), and Execute().

The documentation for this class was generated from the following files:
  • bmws_hlink.h
  • bmws_hlink.cpp
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHlinkWindow Member List

This is the complete list of members for CHlinkWindow, including all inherited members.
CHlinkWindow(HWND hWnd, CTSTR &lpszUrl) | CHlinkWindow |
CHlinkWindow(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID) | CHlinkWindow |
CommonSetup(HWND hWnd) | CHlinkWindow | [protected]
Execute() | CHlinkWindow |
GetWindow() | CHlinkWindow | [inline]
m_dwID | CHlinkWindow | [protected]
m_hFont | CHlinkWindow | [protected]
m_hWnd | CHlinkWindow | [protected]
m_lpszText | CHlinkWindow | [protected]
m_lpszUrl | CHlinkWindow | [protected]
m_pSite | CHlinkWindow | [protected]
Paint(LPDRAWITEMSTRUCT lpdis, COLORREF color) | CHlinkWindow |
~CHlinkWindow() | CHlinkWindow |
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


CHlinkWindowMgr Class Reference

#include <bmws_hlink.h>

Inheritance diagram for CHlinkWindowMgr:

CRefCount List of all members.

Public Methods

CHlinkWindowMgr (UINT cWnds, COLORREF color)
virtual | ~CHlinkWindowMgr ()
void | AddWnd (HWND hWnd, CTSTR &lpszUrl)
void | AddWnd (HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID)
DWORD | PreprocessMsg (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult)

Protected Attributes

HCURSOR | m_hCur
CHlinkWindowPtrArray m_aHlinks
COLORREF | m_color
UINT | m_cWnds

Constructor & Destructor Documentation

CHlinkWindowMgr | ( | UINT | cWnds,
 |  | COLORREF | color
 | ) |

Definition at line 200 of file bmws_hlink.cpp.

References g_hInst, IDC_BMWS_HLINK_HANDCUR, m_aHlinks, m_color, m_cWnds, m_hCur, and CArray< CHlinkWindow *, CHlinkWindow * >::SetSize().

00201 {
00202    m_aHlinks.SetSize(cWnds);
00203    m_hCur = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_BMWS_HLINK_HANDCUR));
00204    m_color = color;
00205    m_cWnds = 0;
00206 }

~CHlinkWindowMgr ( ) [virtual]

Definition at line 214 of file bmws_hlink.cpp.

References m_hCur.

00215 {
00216    if(m_hCur)
00217       DestroyCursor(m_hCur);
00218 }

Member Function Documentation

void AddWnd | ( | HWND | hWnd,
 |  | IHlinkWindowSite * | pSite,
 |  | DWORD | dwID
 | ) |

Definition at line 255 of file bmws_hlink.cpp.

References ENSUREALLOC, m_aHlinks, m_cWnds, and CPtrArray< CHlinkWindow *, CHlinkWindow * >::SetAt().

00256 {
00257    CHlinkWindow *pNew = new CHlinkWindow(hWnd, pSite, dwID);
00258    ENSUREALLOC(pNew);
00259    m_aHlinks.SetAt(m_cWnds, pNew);
00260    m_cWnds++;
00261 }

void AddWnd | ( | HWND | hWnd,
 |  | CTSTR & | lpszUrl
 | ) |

Definition at line 233 of file bmws_hlink.cpp.

References ENSUREALLOC, m_aHlinks, m_cWnds, and CPtrArray< CHlinkWindow *, CHlinkWindow * >::SetAt().

Referenced by RegistrationProc().

00234 {
00235    CHlinkWindow *pNew = new CHlinkWindow(hWnd, lpszUrl);
00236    ENSUREALLOC(pNew);
00237    m_aHlinks.SetAt(m_cWnds, pNew);
00238    m_cWnds++;
00239 }

DWORD PreprocessMsg | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam,
 |  | LRESULT * | pResult
 | ) |

Definition at line 283 of file bmws_hlink.cpp.

References CArray< CHlinkWindow *, CHlinkWindow * >::GetSize(), HLINK_PPM_CONTINUE, HLINK_PPM_RETURNNORMAL, m_aHlinks, m_color, and m_hCur.

Referenced by RegistrationProc().

00285 {
00286    switch(uMsg)
00287    {
00288       case WM_SETCURSOR:
00289       {
00290          HWND hWndCtl = (HWND)wParam;
00291          int cItems = m_aHlinks.GetSize();
00292          for(int i = 0; i < cItems; i++)
00293          {
00294             if(m_aHlinks[i] && (hWndCtl == m_aHlinks[i]->GetWindow()))
00295             {
00296                if(m_hCur)
00297                   SetCursor(m_hCur);
00298                *pResult = TRUE;
00299                return HLINK_PPM_RETURNNORMAL;
00300             }
00301          }
00302       } break;
00303
00304       case WM_DRAWITEM:
00305       {
00306          int cItems = m_aHlinks.GetSize();
00307          for(int i = 0; i < cItems; i++)
00308          {
00309             if(m_aHlinks[i] &&
00310                (wParam == (UINT)GetWindowLong(m_aHlinks[i]->GetWindow(), GWL_ID)))
00311             {
00312                m_aHlinks[i]->Paint((LPDRAWITEMSTRUCT)lParam, m_color);
00313                *pResult = TRUE;
00314                return HLINK_PPM_RETURNNORMAL;
00315             }
00316          }
00317       } break;
00318
00319       case WM_COMMAND:
00320       {
00321          HWND hWndCtl = (HWND)lParam;
00322          if(LOWORD(wParam) == IDOK)
00323             hWndCtl = GetFocus();
00324          int cItems = m_aHlinks.GetSize();
00325          for(int i = 0; i < cItems; i++)
00326          {
00327             if(m_aHlinks[i] && (hWndCtl == m_aHlinks[i]->GetWindow()))
00328             {
00329                m_aHlinks[i]->Execute();
00330                *pResult = 0;
00331                return HLINK_PPM_RETURNNORMAL;
00332             }
00333          }
00334       } break;
00335    }
00336    return HLINK_PPM_CONTINUE;
00337 }

Member Data Documentation

CHlinkWindowPtrArray m_aHlinks [protected]

Definition at line 96 of file bmws_hlink.h.

Referenced by AddWnd(), CHlinkWindowMgr(), and PreprocessMsg().

COLORREF m_color [protected]

Definition at line 97 of file bmws_hlink.h.

Referenced by CHlinkWindowMgr(), and PreprocessMsg().

UINT m_cWnds [protected]

Definition at line 98 of file bmws_hlink.h.

Referenced by AddWnd(), and CHlinkWindowMgr().

HCURSOR m_hCur [protected]

Definition at line 95 of file bmws_hlink.h.

Referenced by CHlinkWindowMgr(), PreprocessMsg(), and ~CHlinkWindowMgr().

The documentation for this class was generated from the following files:
  • bmws_hlink.h
  • bmws_hlink.cpp
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHlinkWindowMgr Member List

This is the complete list of members for CHlinkWindowMgr, including all inherited members.
AddWnd(HWND hWnd, CTSTR &lpszUrl) | CHlinkWindowMgr |
AddWnd(HWND hWnd, IHlinkWindowSite *pSite, DWORD dwID) | CHlinkWindowMgr |
CHlinkWindowMgr(UINT cWnds, COLORREF color) | CHlinkWindowMgr |
CRefCount() | CRefCount | [inline]
downcount() | CRefCount | [inline]
m_aHlinks | CHlinkWindowMgr | [protected]
m_color | CHlinkWindowMgr | [protected]
m_cWnds | CHlinkWindowMgr | [protected]
m_hCur | CHlinkWindowMgr | [protected]
PreprocessMsg(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult) | CHlinkWindowMgr |
upcount() | CRefCount | [inline]
~CHlinkWindowMgr() | CHlinkWindowMgr | [virtual]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLChk Class Reference

#include <bmws_htmlchk.h>

Inheritance diagram for CHTMLChk:

CHTMLControl IEventHandlerSite List of all members.

Public Methods

CHTMLChk (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL)
virtual | ~CHTMLChk ()
void | ResetChanged ()
BOOL | Changed ()
void | SetCheck (BOOL bCheck)
BOOL | GetCheck ()
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

CPtr< IHTMLInputElement,&IID_IHTMLInputElement > | m_spInputEl
BOOL | m_bOrig

Constructor & Destructor Documentation

CHTMLChk | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uID,
 |  | LPARAM | lParam,
 |  | IHTMLElement * | pEl = NULL
 | ) |

Definition at line 28 of file bmws_htmlchk.cpp.

References CPtr< IHTMLInputElement,&IID_IHTMLInputElement >::Assign(), CHECKHRCOM, ENSUREALLOC, CHTMLControl::m_spEl, m_spInputEl, and ResetChanged().

00029                                       : CHTMLControl(pSite, pHH, uID, lParam, pEl)
00030 {
00031    m_spInputEl.Assign(m_spEl);
00032    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00033    ENSUREALLOC(pHandler);
00034    CVariant vHandler;
00035    vHandler.vt = VT_DISPATCH;
00036    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00037    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00038
00039    ResetChanged();
00040 }

~CHTMLChk ( ) [virtual]

Definition at line 48 of file bmws_htmlchk.cpp.

References CHTMLControl::m_spEl.

00049 {
00050    VARIANT vHandler;
00051    VariantInit(&vHandler);
00052    vHandler.vt = VT_NULL;
00053    m_spEl->put_onclick(vHandler);
00054 }

Member Function Documentation

BOOL Changed ( ) [virtual]

Implements CHTMLControl.

Definition at line 85 of file bmws_htmlchk.cpp.

References CHECKHRCOM, m_bOrig, and m_spInputEl.

00086 {
00087    VARIANT_BOOL vb;
00088    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00089    return (m_bOrig != (vb == VARIANT_TRUE));
00090 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CHTMLControl.

Definition at line 141 of file bmws_htmlchk.cpp.

References IHTMLControlSite::ControlChanged(), CHTMLControl::m_lParam, CHTMLControl::m_pSite, and CHTMLControl::m_uID.

00142 {
00143    try   // Windows-called code
00144    {
00145       if(m_pSite)
00146          m_pSite->ControlChanged(this, m_uID, m_lParam);
00147    }
00148    catch(CExcep *pE)
00149    {
00150       pE->Report();
00151       pE->Delete();
00152    }
00153 }

BOOL GetCheck ( )

Definition at line 120 of file bmws_htmlchk.cpp.

References CHECKHRCOM, and m_spInputEl.

00121 {
00122    VARIANT_BOOL vb;
00123    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00124    return (vb == VARIANT_TRUE);
00125 }

void ResetChanged ( ) [virtual]

Implements CHTMLControl.

Definition at line 67 of file bmws_htmlchk.cpp.

References CHECKHRCOM, m_bOrig, and m_spInputEl.

Referenced by CHTMLChk().

00068 {
00069    VARIANT_BOOL vb;
00070    CHECKHRCOM(m_spInputEl->get_checked(&vb));
00071    m_bOrig = (vb == VARIANT_TRUE);
00072 }

void SetCheck ( BOOL bCheck )

Definition at line 104 of file bmws_htmlchk.cpp.

References CHECKHRCOM, and m_spInputEl.

00105 {
00106    CHECKHRCOM(m_spInputEl->put_checked(bCheck ? VARIANT_TRUE : VARIANT_FALSE));
00107 }

Member Data Documentation

BOOL m_bOrig [protected]

Definition at line 42 of file bmws_htmlchk.h.

Referenced by Changed(), and ResetChanged().

CPtr<IHTMLInputElement, &IID_IHTMLInputElement> m_spInputEl [protected]

Definition at line 41 of file bmws_htmlchk.h.

Referenced by Changed(), CHTMLChk(), GetCheck(), ResetChanged(), and SetCheck().

The documentation for this class was generated from the following files:
  • bmws_htmlchk.h
  • bmws_htmlchk.cpp
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLChk Member List

This is the complete list of members for CHTMLChk, including all inherited members.
Changed() | CHTMLChk | [virtual]
CHTMLChk(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLChk |
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLChk | [virtual]
GetCheck() | CHTMLChk |
GetEl() | CHTMLControl | [virtual]
m_bOrig | CHTMLChk | [protected]
m_bParamIsUnk | CHTMLControl | [protected]
m_lParam | CHTMLControl | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_spInputEl | CHTMLChk | [protected]
m_uID | CHTMLControl | [protected]
ResetChanged() | CHTMLChk | [virtual]
SetCheck(BOOL bCheck) | CHTMLChk |
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
~CHTMLChk() | CHTMLChk | [virtual]
~CHTMLControl() | CHTMLControl | [virtual]
Generated on Wed May 8 12:39:45 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLChooseColor Class Reference

#include <bmws_htmlchoosecolor.h>

Inheritance diagram for CHTMLChooseColor:

CHTMLControl IEventHandlerSite List of all members.

Public Methods

CHTMLChooseColor (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, UINT uidHolder, IHTMLChooseColorSite *pCCSite, IHTMLElement *pEl=NULL)
virtual | ~CHTMLChooseColor ()
void | ResetChanged ()
BOOL | Changed ()
COLORREF | GetColor ()
void | SetColor (COLORREF color)
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

IHTMLChooseColorSite * m_pCCSite
COLORREF | m_color
COLORREF | m_colorOrig
UINT | m_uidHolder

Constructor & Destructor Documentation

CHTMLChooseColor | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uID,
 |  | LPARAM | lParam,
 |  | UINT | uidHolder,
 |  | IHTMLChooseColorSite * | pCCSite,
 |  | IHTMLElement * | pEl = NULL
 | ) |

Definition at line 33 of file bmws_htmlchoosecolor.cpp.

References CHECKHRCOM, ENSUREALLOC, m_color, m_pCCSite, CHTMLControl::m_spEl, m_uidHolder, and ResetChanged().

00035                                                       : CHTMLControl(pSite, pHH, uID, lParam,
00036                                    pEl)
00037 {
00038    m_pCCSite = pCCSite;
00039    m_uidHolder = uidHolder;
00040    m_color = RGB(0, 0, 0);
00041
00042    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00043    ENSUREALLOC(pHandler);
00044    CVariant vHandler;
00045    vHandler.vt = VT_DISPATCH;
00046    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00047    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00048
00049    ResetChanged();
00050 }

~CHTMLChooseColor ( ) [virtual]

Definition at line 58 of file bmws_htmlchoosecolor.cpp.

References CHTMLControl::m_spEl.

00059 {
00060    VARIANT vHandler;
00061    VariantInit(&vHandler);
00062    vHandler.vt = VT_NULL;
00063    m_spEl->put_onclick(vHandler);
00064 }

Member Function Documentation

BOOL Changed ( ) [virtual]

Implements CHTMLControl.

Definition at line 93 of file bmws_htmlchoosecolor.cpp.

References m_color, and m_colorOrig.

00094 {
00095    return (m_color != m_colorOrig);
00096 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CHTMLControl.

Definition at line 112 of file bmws_htmlchoosecolor.cpp.

References ChooseColorEx(), IHTMLControlSite::ControlChanged(), IHTMLChooseColorSite::GetColorInfo(), m_color, CHTMLControl::m_lParam, m_pCCSite, CHTMLControl::m_pSite, CHTMLControl::m_uID, and SetColor().

00113 {
00114    try   // Windows-called code
00115    {
00116       CTSTR lpszTitle;
00117       HWND hWnd = NULL;
00118       if(m_pCCSite)
00119          hWnd = m_pCCSite->GetColorInfo(this, m_uID, m_lParam, lpszTitle);
00120       if(ChooseColorEx((COLORREF*)&m_color, hWnd, lpszTitle))
00121       {
00122          SetColor(m_color);
00123          if(m_pSite)
00124             m_pSite->ControlChanged(this, m_uID, m_lParam);
00125       }
00126    }
00127    catch(CExcep *pE)
00128    {
00129       pE->Report();
00130       pE->Delete();
00131    }
00132 }

COLORREF GetColor ( )

Definition at line 145 of file bmws_htmlchoosecolor.cpp.

References m_color.

00146 {
00147    return m_color;
00148 }

void ResetChanged ( ) [virtual]

Implements CHTMLControl.

Definition at line 77 of file bmws_htmlchoosecolor.cpp.

References m_color, and m_colorOrig.

Referenced by CHTMLChooseColor().

00078 {
00079    m_colorOrig = m_color;
00080 }

void SetColor ( COLORREF color )

Definition at line 162 of file bmws_htmlchoosecolor.cpp.

References CHECKHRCOM, CTSTR::Len(), m_color, CHTMLControl::m_spEl, and m_uidHolder.

Referenced by EventHandler().

00163 {
00164    m_color = color;
00165
00166    CHTMLStylePtr spStyle;
00167    CHECKHRCOM(m_spEl->get_style(&spStyle));
00168    CVariant v;
00169    CTSTR lpszHolder(m_uidHolder);
00170    CTSTR lpszTotal(TRUE, lpszHolder.Len() + 16);
00171    wsprintf(lpszTotal, lpszHolder, GetRValue(color), GetGValue(color), GetBValue(color));
00172    v.vt = VT_BSTR;
00173    v.bstrVal = CBSTR(lpszTotal).Detach();
00174    CHECKHRCOM(spStyle->put_backgroundColor(v));
00175 }

Member Data Documentation

COLORREF m_color [protected]

Definition at line 62 of file bmws_htmlchoosecolor.h.

Referenced by Changed(), CHTMLChooseColor(), EventHandler(), GetColor(), ResetChanged(), and SetColor().

COLORREF m_colorOrig [protected]

Definition at line 63 of file bmws_htmlchoosecolor.h.

Referenced by Changed(), and ResetChanged().

IHTMLChooseColorSite* m_pCCSite [protected]

Definition at line 61 of file bmws_htmlchoosecolor.h.

Referenced by CHTMLChooseColor(), and EventHandler().

UINT m_uidHolder [protected]

Definition at line 64 of file bmws_htmlchoosecolor.h.

Referenced by CHTMLChooseColor(), and SetColor().

The documentation for this class was generated from the following files:
  • bmws_htmlchoosecolor.h
  • bmws_htmlchoosecolor.cpp
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLChooseColor Member List

This is the complete list of members for CHTMLChooseColor, including all inherited members.
Changed() | CHTMLChooseColor | [virtual]
CHTMLChooseColor(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, UINT uidHolder, IHTMLChooseColorSite *pCCSite, IHTMLElement *pEl=NULL) | CHTMLChooseColor |
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLChooseColor | [virtual]
GetColor() | CHTMLChooseColor |
GetEl() | CHTMLControl | [virtual]
m_bParamIsUnk | CHTMLControl | [protected]
m_color | CHTMLChooseColor | [protected]
m_colorOrig | CHTMLChooseColor | [protected]
m_lParam | CHTMLControl | [protected]
m_pCCSite | CHTMLChooseColor | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_uID | CHTMLControl | [protected]
m_uidHolder | CHTMLChooseColor | [protected]
ResetChanged() | CHTMLChooseColor | [virtual]
SetColor(COLORREF color) | CHTMLChooseColor |
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
~CHTMLChooseColor() | CHTMLChooseColor | [virtual]
~CHTMLControl() | CHTMLControl | [virtual]
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLControl Class Reference

#include <bmws_htmlcontrol.h>

Inheritance diagram for CHTMLControl:

IEventHandlerSite CHTMLChk CHTMLChooseColor CHTMLEdit CHTMLRadioGroup CHTMLSelect List of all members.

Public Methods

CHTMLControl (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL)
virtual | ~CHTMLControl ()
virtual void | ResetChanged ()=0
virtual BOOL | Changed ()=0
virtual CHTMLElementPtr & | GetEl ()
void | SetParamIsUnk (BOOL bParamIsUnk)
virtual void | EventHandler (DWORD dwEventID, LPARAM lParam)=0

Protected Attributes

CHTMLElementPtr m_spEl
IHTMLControlSite * m_pSite
LPARAM | m_lParam
CHTMLHelper * m_pHH
UINT | m_uID
BOOL | m_bParamIsUnk

Constructor & Destructor Documentation

CHTMLControl | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uID,
 |  | LPARAM | lParam,
 |  | IHTMLElement * | pEl = NULL
 | ) |

Definition at line 28 of file bmws_htmlcontrol.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHTMLHelper::GetNamedEl(), m_bParamIsUnk, m_lParam, m_pHH, m_pSite, m_spEl, and m_uID.

00030 {
00031    m_pSite = pSite;
00032    m_lParam = lParam;
00033    m_pHH = pHH;
00034    m_uID = uID;
00035    if(pEl)
00036       m_spEl.Assign(pEl);
00037    else if(m_uID != (UINT)-1)
00038       m_spEl.Assign(TRUE, m_pHH->GetNamedEl(uID, IID_IHTMLElement));
00039    m_bParamIsUnk = FALSE;
00040 }

~CHTMLControl ( ) [virtual]

Definition at line 48 of file bmws_htmlcontrol.cpp.

References m_lParam.

00049 {
00050    if(m_bParamIsUnk)
00051       ((IUnknown*)m_lParam)->Release();
00052 }

Member Function Documentation

virtual BOOL Changed ( ) [pure virtual]

Implemented in CHTMLChk, CHTMLChooseColor, CHTMLEdit, CHTMLRadioGroup, and CHTMLSelect.

virtual void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Implements IEventHandlerSite.

Implemented in CHTMLChk, CHTMLChooseColor, CHTMLEdit, CHTMLRadioGroup, and CHTMLSelect.

CHTMLElementPtr & GetEl ( ) [virtual]

Definition at line 65 of file bmws_htmlcontrol.cpp.

References m_spEl.

00066 {
00067    return m_spEl;
00068 }

virtual void ResetChanged ( ) [pure virtual]

Implemented in CHTMLChk, CHTMLChooseColor, CHTMLEdit, CHTMLRadioGroup, and CHTMLSelect.

void SetParamIsUnk ( BOOL bParamIsUnk )

Definition at line 84 of file bmws_htmlcontrol.cpp.

References m_bParamIsUnk, and m_lParam.

00085 {
00086    m_bParamIsUnk = bParamIsUnk;
00087    if(m_bParamIsUnk)
00088       ((IUnknown*)m_lParam)->AddRef();
00089 }

Member Data Documentation

BOOL m_bParamIsUnk [protected]

Definition at line 67 of file bmws_htmlcontrol.h.

Referenced by CHTMLControl(), and SetParamIsUnk().

LPARAM m_lParam [protected]

Definition at line 64 of file bmws_htmlcontrol.h.

Referenced by CHTMLControl(), CHTMLSelect::EventHandler(), CHTMLEdit::EventHandler(), CHTMLChooseColor::EventHandler(), CHTMLChk::EventHandler(), SetParamIsUnk(), and ~CHTMLControl().

CHTMLHelper* m_pHH [protected]

Definition at line 65 of file bmws_htmlcontrol.h.

Referenced by CHTMLSelect::Add(), CHTMLEdit::Changed(), CHTMLControl(), CHTMLEdit::EventHandler(), and CHTMLEdit::ResetChanged().

IHTMLControlSite* m_pSite [protected]

Definition at line 63 of file bmws_htmlcontrol.h.

Referenced by CHTMLControl(), CHTMLRadioGroup::ControlChanged(), CHTMLSelect::EventHandler(), CHTMLEdit::EventHandler(), CHTMLChooseColor::EventHandler(), and CHTMLChk::EventHandler().

CHTMLElementPtr m_spEl [protected]

Definition at line 62 of file bmws_htmlcontrol.h.

Referenced by CHTMLEdit::Changed(), CHTMLChk::CHTMLChk(), CHTMLChooseColor::CHTMLChooseColor(), CHTMLControl(), CHTMLEdit::CHTMLEdit(), CHTMLSelect::CHTMLSelect(), GetEl(), CHTMLEdit::ResetChanged(), CHTMLChooseColor::SetColor(), CHTMLChk::~CHTMLChk(), CHTMLChooseColor::~CHTMLChooseColor(), and CHTMLEdit::~CHTMLEdit().

UINT m_uID [protected]

Definition at line 66 of file bmws_htmlcontrol.h.

Referenced by CHTMLControl(), CHTMLSelect::EventHandler(), CHTMLEdit::EventHandler(), CHTMLChooseColor::EventHandler(), and CHTMLChk::EventHandler().

The documentation for this class was generated from the following files:
  • bmws_htmlcontrol.h
  • bmws_htmlcontrol.cpp
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLControl Member List

This is the complete list of members for CHTMLControl, including all inherited members.
Changed()=0 | CHTMLControl | [pure virtual]
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
EventHandler(DWORD dwEventID, LPARAM lParam)=0 | CHTMLControl | [pure virtual]
GetEl() | CHTMLControl | [virtual]
m_bParamIsUnk | CHTMLControl | [protected]
m_lParam | CHTMLControl | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_uID | CHTMLControl | [protected]
ResetChanged()=0 | CHTMLControl | [pure virtual]
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
~CHTMLControl() | CHTMLControl | [virtual]
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLEdit Class Reference

#include <bmws_htmledit.h>

Inheritance diagram for CHTMLEdit:

CHTMLControl IEventHandlerSite List of all members.

Public Methods

CHTMLEdit (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, BOOL bNumber, BOOL bTextArea, LPARAM lParam, IHTMLElement *pEl=NULL)
virtual | ~CHTMLEdit ()
void | ResetChanged ()
BOOL | Changed ()
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

BOOL | m_bNumber
BOOL | m_bTextArea
CBSTR m_bstrOrig

Constructor & Destructor Documentation

CHTMLEdit | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uID,
 |  | BOOL | bNumber,
 |  | BOOL | bTextArea,
 |  | LPARAM | lParam,
 |  | IHTMLElement * | pEl = NULL
 | ) |

Definition at line 40 of file bmws_htmledit.cpp.

References CHECKHRCOM, ENSUREALLOC, HTMLEDIT_CHANGE, HTMLEDIT_KEYPRESS, HTMLEDIT_PASTE, m_bNumber, m_bTextArea, CHTMLControl::m_spEl, and ResetChanged().

00041                                                                        : CHTMLControl(pSite, pHH,
00042                      uID, lParam, pEl)
00043 {
00044    m_bTextArea = bTextArea;
00045    m_bNumber = bNumber;
00046    CEventHandler *pHandler = NULL;
00047    CVariant vHandler;
00048
00049    if(!bTextArea)
00050    {
00051       CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spInputEl(m_spEl);
00052       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_CHANGE, 0);
00053       ENSUREALLOC(pHandler);
00054       vHandler.vt = VT_DISPATCH;
00055       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00056       CHECKHRCOM(spInputEl->put_onchange(vHandler));
00057    }
00058    if(bNumber)
00059    {
00060       VariantClear(&vHandler);
00061       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_KEYPRESS, 0);
00062       ENSUREALLOC(pHandler);
00063       vHandler.vt = VT_DISPATCH;
00064       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00065       CHECKHRCOM(m_spEl->put_onkeypress(vHandler));
00066
00067       VariantClear(&vHandler);
00068       pHandler = new CEventHandler((IEventHandlerSite*)this, HTMLEDIT_PASTE, 0);
00069       ENSUREALLOC(pHandler);
00070       vHandler.vt = VT_DISPATCH;
00071       pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00072       CHTMLElement2Ptr spEl2(m_spEl);
00073       CHECKHRCOM(spEl2->put_onpaste(vHandler));
00074    }
00075
00076    ResetChanged();
00077 }

~CHTMLEdit ( ) [virtual]

Definition at line 85 of file bmws_htmledit.cpp.

References m_bTextArea, and CHTMLControl::m_spEl.

00086 {
00087    VARIANT vHandler;
00088    VariantInit(&vHandler);
00089    vHandler.vt = VT_NULL;
00090    if(!m_bTextArea)
00091    {
00092       CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spInputEl(m_spEl);
00093       spInputEl->put_onchange(vHandler);
00094    }
00095    if(m_bNumber)
00096    {
00097       m_spEl->put_onkeypress(vHandler);
00098       CHTMLElement2Ptr spEl2(m_spEl);
00099       spEl2->put_onpaste(vHandler);
00100    }
00101 }

Member Function Documentation

BOOL Changed ( ) [virtual]

Implements CHTMLControl.

Definition at line 131 of file bmws_htmledit.cpp.

References CBSTR::Equals(), CHTMLHelper::GetElTextWithEl(), m_bstrOrig, m_bTextArea, CHTMLControl::m_pHH, and CHTMLControl::m_spEl.

00132 {
00133    return !m_bstrOrig.Equals(m_pHH->GetElTextWithEl(m_spEl, !m_bTextArea));
00134 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CHTMLControl.

Definition at line 150 of file bmws_htmledit.cpp.

References CHTMLHelper::CancelEvent(), CHECKHRCOM, IHTMLControlSite::ControlChanged(), CHTMLHelper::GetEvent(), HTMLEDIT_CHANGE, HTMLEDIT_KEYPRESS, HTMLEDIT_PASTE, IDS_BMWS_HTMLEDIT_CLIP_TEXT, CHTMLControl::m_lParam, CTSTR::m_lpsz, CHTMLControl::m_pHH, CHTMLControl::m_pSite, and CHTMLControl::m_uID.

00151 {
00152    try   // Windows-called code
00153    {
00154       switch(dwEventID)
00155       {
00156          case HTMLEDIT_KEYPRESS:
00157          {
00158             CHTMLEventObjPtr spEventObj = m_pHH->GetEvent();
00159             long lKeyCode = 0;
00160             CHECKHRCOM(spEventObj->get_keyCode(&lKeyCode));
00161             if(lKeyCode < 48 || lKeyCode > 57)
00162             {
00163                VARIANT v;
00164                v.vt = VT_BOOL;
00165                v.boolVal = VARIANT_FALSE;
00166                CHECKHRCOM(spEventObj->put_returnValue(v));
00167             }
00168          } break;
00169
00170          case HTMLEDIT_PASTE:
00171          {
00172             CVariant vc;
00173             if(SUCCEEDED(m_pHH->GetClipboardData()->getData(CBSTR(IDS_BMWS_HTMLEDIT_CLIP_TEXT),
00174                &vc)))
00175             {
00176                if(vc.vt == VT_BSTR)
00177                {
00178                   CTSTR lpszData(vc.bstrVal);
00179                   int iMax = lstrlen(lpszData);
00180                   BOOL bValid = (iMax <= 4);
00181                   for(int i = 0; i < iMax && bValid; i++)
00182                      bValid = ((lpszData.m_lpsz[i] >= 48) && (lpszData.m_lpsz[i] <= 57));
00183                   if(!bValid)
00184                      m_pHH->CancelEvent();
00185                }
00186             }
00187          } break;
00188
00189          case HTMLEDIT_CHANGE:
00190          {
00191             if(m_pSite)
00192                m_pSite->ControlChanged(this, m_uID, m_lParam);
00193          } break;
00194       }
00195    }
00196    catch(CExcep *pE)
00197    {
00198       pE->Report();
00199       pE->Delete();
00200    }
00201 }

void ResetChanged ( ) [virtual]

Implements CHTMLControl.

Definition at line 115 of file bmws_htmledit.cpp.

References CHTMLHelper::GetElTextWithEl(), m_bstrOrig, m_bTextArea, CHTMLControl::m_pHH, and CHTMLControl::m_spEl.

Referenced by CHTMLEdit().

00116 {
00117    m_bstrOrig = m_pHH->GetElTextWithEl(m_spEl, !m_bTextArea);
00118 }

Member Data Documentation

BOOL m_bNumber [protected]

Definition at line 39 of file bmws_htmledit.h.

Referenced by CHTMLEdit().

CBSTR m_bstrOrig [protected]

Definition at line 41 of file bmws_htmledit.h.

Referenced by Changed(), and ResetChanged().

BOOL m_bTextArea [protected]

Definition at line 40 of file bmws_htmledit.h.

Referenced by Changed(), CHTMLEdit(), ResetChanged(), and ~CHTMLEdit().

The documentation for this class was generated from the following files:
  • bmws_htmledit.h
  • bmws_htmledit.cpp
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLEdit Member List

This is the complete list of members for CHTMLEdit, including all inherited members.
Changed() | CHTMLEdit | [virtual]
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
CHTMLEdit(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, BOOL bNumber, BOOL bTextArea, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLEdit |
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLEdit | [virtual]
GetEl() | CHTMLControl | [virtual]
m_bNumber | CHTMLEdit | [protected]
m_bParamIsUnk | CHTMLControl | [protected]
m_bstrOrig | CHTMLEdit | [protected]
m_bTextArea | CHTMLEdit | [protected]
m_lParam | CHTMLControl | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_uID | CHTMLControl | [protected]
ResetChanged() | CHTMLEdit | [virtual]
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
~CHTMLControl() | CHTMLControl | [virtual]
~CHTMLEdit() | CHTMLEdit | [virtual]
Generated on Wed May 8 12:39:46 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLEnable Class Reference

#include <bmws_htmlenable.h>

Inheritance diagram for CHTMLEnable:

CHTMLLink CHTMLStatic List of all members.

Public Methods

CHTMLEnable (CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, IHTMLEnableSite *pSite=NULL)
virtual | ~CHTMLEnable ()
virtual void | Enable (BOOL bEnable)=0
CHTMLElementPtr & GetEl ()

Protected Methods

void | EnableHelper (BOOL bEnable, UINT uidHolder, UINT uidDisabled)

Protected Attributes

IHTMLEnableSite * m_pSite
CHTMLElementPtr m_spElParent
CHTMLElementPtr m_spEl
CHTMLHelper * m_pHH
CTSTR m_lpszText
CTSTR m_lpszExtraAttrs
BOOL | m_bEnabled

Constructor & Destructor Documentation

CHTMLEnable | ( | CHTMLHelper * | pHH,
 |  | CHTMLElementPtr & | spElParent,
 |  | CTSTR & | lpszText,
 |  | CTSTR & | lpszExtraAttrs,
 |  | IHTMLEnableSite * | pSite = NULL
 | ) |

Definition at line 27 of file bmws_htmlenable.cpp.

References CTSTR::Assign(), CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), m_bEnabled, m_lpszExtraAttrs, m_lpszText, m_pHH, m_pSite, and m_spElParent.

00029 {
00030    m_pSite = pSite;
00031    m_pHH = pHH;
00032    m_spElParent.Assign(spElParent);
00033    m_lpszText.Assign(lpszText);
00034    if(lpszExtraAttrs)
00035       m_lpszExtraAttrs.Assign(lpszExtraAttrs);
00036    else
00037       m_lpszExtraAttrs.Assign(TEXT(" "));
00038    m_bEnabled = FALSE;
00039 }

virtual ~CHTMLEnable ( ) [inline, virtual]

Definition at line 51 of file bmws_htmlenable.h.

00051 {}

Member Function Documentation

virtual void Enable ( BOOL bEnable ) [pure virtual]

Implemented in CHTMLLink, and CHTMLStatic.

void EnableHelper | ( | BOOL | bEnable,
 |  | UINT | uidHolder,
 |  | UINT | uidDisabled
 | ) | [protected]

Definition at line 71 of file bmws_htmlenable.cpp.

References CTSTR::Assign(), CHECKHRCOM, CTSTR::Len(), m_bEnabled, m_lpszExtraAttrs, m_lpszText, m_pHH, m_pSite, m_spEl, m_spElParent, IHTMLEnableSite::PostEnable(), and IHTMLEnableSite::PreDisable().

Referenced by CHTMLStatic::Enable(), and CHTMLLink::Enable().

00072 {
00073    if(m_pSite && (m_spEl != NULL) && !bEnable)
00074       m_pSite->PreDisable(this, m_spEl);
00075    m_bEnabled = bEnable;
00076    CTSTR lpszHolder(uidHolder);
00077    CTSTR lpszDisabled;
00078    if(!bEnable)
00079       lpszDisabled.Assign(uidDisabled);
00080    else
00081       lpszDisabled.Assign(TEXT(" "));
00082    CTSTR lpszFinal(TRUE, lpszHolder.Len() + lpszDisabled.Len() + m_lpszText.Len() +
00083       m_lpszExtraAttrs.Len() + 2);
00084    wsprintf(lpszFinal, lpszHolder, lpszDisabled, m_lpszExtraAttrs, m_lpszText);
00085    CHECKHRCOM(m_spElParent->put_innerHTML(CBSTR(lpszFinal)));
00086
00087    m_spEl = m_pHH->GetChild(m_spElParent);
00088
00089    if(m_pSite && bEnable)
00090       m_pSite->PostEnable(this, m_spEl);
00091 }

CHTMLElementPtr & GetEl ( )

Definition at line 52 of file bmws_htmlenable.cpp.

References m_spEl.

00053 {
00054    return m_spEl;
00055 }

Member Data Documentation

BOOL m_bEnabled [protected]

Definition at line 65 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), EnableHelper(), and CHTMLLink::EventHandler().

CTSTR m_lpszExtraAttrs [protected]

Definition at line 64 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), and EnableHelper().

CTSTR m_lpszText [protected]

Definition at line 63 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), and EnableHelper().

CHTMLHelper* m_pHH [protected]

Definition at line 62 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), EnableHelper(), and CHTMLLink::EventHandler().

IHTMLEnableSite* m_pSite [protected]

Definition at line 59 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), and EnableHelper().

CHTMLElementPtr m_spEl [protected]

Definition at line 61 of file bmws_htmlenable.h.

Referenced by CHTMLLink::Cleanup(), CHTMLLink::Enable(), EnableHelper(), and GetEl().

CHTMLElementPtr m_spElParent [protected]

Definition at line 60 of file bmws_htmlenable.h.

Referenced by CHTMLEnable(), and EnableHelper().

The documentation for this class was generated from the following files:
  • bmws_htmlenable.h
  • bmws_htmlenable.cpp
Generated on Wed May 8 12:39:47 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLEnable Member List

This is the complete list of members for CHTMLEnable, including all inherited members.
CHTMLEnable(CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, IHTMLEnableSite *pSite=NULL) | CHTMLEnable |
Enable(BOOL bEnable)=0 | CHTMLEnable | [pure virtual]
EnableHelper(BOOL bEnable, UINT uidHolder, UINT uidDisabled) | CHTMLEnable | [protected]
GetEl() | CHTMLEnable |
m_bEnabled | CHTMLEnable | [protected]
m_lpszExtraAttrs | CHTMLEnable | [protected]
m_lpszText | CHTMLEnable | [protected]
m_pHH | CHTMLEnable | [protected]
m_pSite | CHTMLEnable | [protected]
m_spEl | CHTMLEnable | [protected]
m_spElParent | CHTMLEnable | [protected]
~CHTMLEnable() | CHTMLEnable | [inline, virtual]
Generated on Wed May 8 12:39:47 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLHelper Class Reference

#include <bmws_htmlhelpers.h>

List of all members.

Public Methods

CHTMLHelper (IHTMLDocument2 *pDoc2)
LPVOID | GetEl (BSTR bstrID, REFIID riid)
LPVOID | GetNamedEl (UINT uID, REFIID riid)
LPVOID | GetNumberedEl (UINT uidFormatter, UINT uiIndex, REFIID riid)
void | ShowElement (IHTMLElement *pEl, BOOL bShow)
void | ShowElementEx (UINT uID, BOOL bShow)
void | SetElText (UINT uID, CBSTR &bstrText, BOOL bEdit=FALSE)
void | SetElTextWithEl (CHTMLElementPtr &spEl, CBSTR &bstrText, BOOL bEdit=FALSE)
LPVOID | CreateElement (UINT uIDTag, REFIID riid)
CBSTR | GetElText (UINT uID, BOOL bEdit=FALSE)
CBSTR | GetElTextWithEl (CHTMLElementPtr &spEl, BOOL bEdit=FALSE)
CHTMLEventObjPtr GetEvent ()
void | CancelEvent ()
CHTMLRuleStylePtr | GetRuleStyle (UINT uID, long lIndex)
void | FocusElement (CHTMLElementPtr &pEl, BOOL bFocus)
void | FocusElementEx (UINT uID, BOOL bFocus)
CHTMLStylePtr | GetStyle (UINT uID)

Public Attributes

CPtr< IHTMLDocument3,&IID_IHTMLDocument3 > | m_spDoc3
CPtr< IHTMLWindow2,&IID_IHTMLWindow2 > | m_spWindow2
CBSTR m_bstrBeforeEnd

Protected Methods

CHTMLStyleSheetPtr | GetStyleSheet (UINT uID)

Constructor & Destructor Documentation

CHTMLHelper ( IHTMLDocument2 * pDoc2 )

Definition at line 60 of file bmws_htmlhelpers.cpp.

References CBSTR::Assign(), CPtr< IHTMLDocument3,&IID_IHTMLDocument3 >::Assign(), IDS_BMWS_HTML_BEFOREEND, m_bstrBeforeEnd, m_spDoc3, m_spWindow2, and ODS.

00061 {
00062    ODS("CHTMLHelper constructor");
00063    m_spDoc3.Assign(pDoc2);
00064    pDoc2->get_parentWindow(&m_spWindow2);
00065    m_bstrBeforeEnd.Assign(IDS_BMWS_HTML_BEFOREEND);
00066 #ifdef BMWS_HTMLHELPERS_PROTECTUI
00067    m_uidBody = (UINT)-1;
00068 #endif // BMWS_HTMLHELPERS_PROTECTUI
00069 }

Member Function Documentation

void CancelEvent ( )

Definition at line 567 of file bmws_htmlhelpers.cpp.

References BMWS_HH_GETEVENT, CHECKHRCOM, HHInternalExcep(), and m_spWindow2.

Referenced by CGameMenuItem::EventHandler(), CGameMenu::EventHandler(), CGameCommandMgr::EventHandler(), CHTMLLink::EventHandler(), and CHTMLEdit::EventHandler().

00568 {
00569    CHTMLEventObjPtr spEventObj;
00570    try
00571    {
00572       CHECKHRCOM(m_spWindow2->get_event(&spEventObj));
00573       VARIANT v;
00574       v.vt = VT_BOOL;
00575       v.boolVal = VARIANT_FALSE;
00576       CHECKHRCOM(spEventObj->put_returnValue(v));
00577    }
00578    catch(CCOMExcep *pE)
00579    {
00580       HHInternalExcep(pE, BMWS_HH_GETEVENT);
00581    }
00582 }

LPVOID CreateElement | ( | UINT | uIDTag,
 |  | REFIID | riid
 | ) |

Definition at line 335 of file bmws_htmlhelpers.cpp.

References CPtr::Assign(), BMWS_HH_CREATEELEMENT, CHECKHRCOM, HHInternalExcep(), and m_spDoc3.

Referenced by CHTMLSelect::Add(), CGameCommand::Enable(), CGameMenuItem::Init(), CCard::InitCard(), and CPile::InitPile().

00336 {
00337    LPVOID pv = NULL;
00338    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc2;
00339    CHTMLElementPtr spEl;
00340
00341    try
00342    {
00343       spDoc2.Assign(m_spDoc3);
00344       CHECKHRCOM(spDoc2->createElement(CBSTR(uIDTag), &spEl));
00345       CHECKHRCOM(spEl->QueryInterface(riid, &pv));
00346    }
00347    catch(CCOMExcep *pE)
00348    {
00349       HHInternalExcep(pE, BMWS_HH_CREATEELEMENT);
00350    }
00351
00352    return pv;
00353 }

void FocusElement | ( | CHTMLElementPtr & | pEl,
 |  | BOOL | bFocus
 | ) |

Definition at line 676 of file bmws_htmlhelpers.cpp.

References BMWS_HH_FOCUSELEMENT, CHECKHRCOM, and HHInternalExcep().

Referenced by FocusElementEx().

00677 {
00678    try
00679    {
00680       CHTMLElement2Ptr spEl2 = pEl;
00681       if(bFocus)
00682       {
00683          CHECKHRCOM(spEl2->focus());
00684          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl;
00685          if(SUCCEEDED(pEl->QueryInterface(IID_IHTMLInputTextElement, (LPVOID*)&spTextEl)))
00686          {
00687             CHECKHRCOM(spTextEl->select());
00688          }
00689       } else
00690       {
00691          CHECKHRCOM(spEl2->blur());
00692       }
00693    }
00694    catch(CCOMExcep *pE)
00695    {
00696       HHInternalExcep(pE, BMWS_HH_FOCUSELEMENT);
00697    }
00698 }

void FocusElementEx | ( | UINT | uID,
 |  | BOOL | bFocus
 | ) |

Definition at line 717 of file bmws_htmlhelpers.cpp.

References CHTMLElementPtr, FocusElement(), and GetNamedEl().

00718 {
00719    FocusElement(CHTMLElementPtr(TRUE, GetNamedEl(uID, IID_IHTMLElement)), bFocus);
00720 }

LPVOID GetEl | ( | BSTR | bstrID,
 |  | REFIID | riid
 | ) |

Definition at line 130 of file bmws_htmlhelpers.cpp.

References CHECKHRCOM, ERROR_ERRORINS_LPTSTR, IDS_BMWS_HTML_E_NOELEMENT, IDS_BMWS_REMEDY_RESTART, m_spDoc3, RETHROWCOM, and THROW.

Referenced by GetNamedEl(), and GetNumberedEl().

00131 {
00132    LPVOID pv = NULL;
00133    CHTMLElementPtr spEl;
00134    try
00135    {
00136       CHECKHRCOM(m_spDoc3->getElementById(bstrID, &spEl));
00137       CHECKHRCOM(spEl->QueryInterface(riid, &pv));
00138    }
00139    catch(CCOMExcep *pE)
00140    {
00141       RETHROWCOM(pE);
00142       THROW(new CExcepEx(IDS_BMWS_HTML_E_NOELEMENT, IDS_BMWS_REMEDY_RESTART,
00143          (UINT_PTR)(LPTSTR)CTSTR(bstrID), 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00144    }
00145
00146    return pv;
00147 }

CBSTR GetElText | ( | UINT | uID,
 |  | BOOL | bEdit = FALSE
 | ) |

Definition at line 372 of file bmws_htmlhelpers.cpp.

References BMWS_HH_GETTEXT, GetElTextWithEl(), GetNamedEl(), and HHInternalExcep().

00373 {
00374    CBSTR bstrReturn;
00375    try
00376    {
00377       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00378       bstrReturn = GetElTextWithEl(spEl, bEdit);
00379    }
00380    catch(CCOMExcep *pE)
00381    {
00382       HHInternalExcep(pE, BMWS_HH_GETTEXT);
00383    }
00384    return bstrReturn;
00385 }

CBSTR GetElTextWithEl | ( | CHTMLElementPtr & | spEl,
 |  | BOOL | bEdit = FALSE
 | ) |

Definition at line 404 of file bmws_htmlhelpers.cpp.

References CBSTR::Addr(), BMWS_HH_GETTEXT, CHECKHRCOM, and HHInternalExcep().

Referenced by CHTMLEdit::Changed(), GetElText(), and CHTMLEdit::ResetChanged().

00405 {
00406    CBSTR bstrReturn;
00407    try
00408    {
00409       if(bEdit)
00410       {
00411          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl(spEl);
00412          CHECKHRCOM(spTextEl->get_value(bstrReturn.Addr()));
00413       } else
00414       {
00415          CHECKHRCOM(spEl->get_innerText(bstrReturn.Addr()));
00416       }
00417    }
00418    catch(CCOMExcep *pE)
00419    {
00420       HHInternalExcep(pE, BMWS_HH_GETTEXT);
00421    }
00422    return bstrReturn;
00423 }

CHTMLEventObjPtr GetEvent ( )

Definition at line 540 of file bmws_htmlhelpers.cpp.

References BMWS_HH_GETEVENT, CHECKHRCOM, HHInternalExcep(), and m_spWindow2.

Referenced by CEngineObj::EventHandler(), CEngine::EventHandler(), CHTMLEdit::EventHandler(), CEngine::MouseDown(), and CEngine::MouseMove().

00541 {
00542    CHTMLEventObjPtr pEventObj;
00543    try
00544    {
00545       CHECKHRCOM(m_spWindow2->get_event(&pEventObj));
00546    }
00547    catch(CCOMExcep *pE)
00548    {
00549       HHInternalExcep(pE, BMWS_HH_GETEVENT);
00550    }
00551    return pEventObj;
00552 }

LPVOID GetNamedEl | ( | UINT | uID,
 |  | REFIID | riid
 | ) |

Definition at line 165 of file bmws_htmlhelpers.cpp.

References GetEl().

Referenced by CGameCommandMgr::AddGameCommand(), C3DShatter::C3DShatter(), CHTMLControl::CHTMLControl(), CHTMLRadioGroup::CHTMLRadioGroup(), CGameCommandMgr::Clear(), C3DShatter::DoAnimation(), C3DShatter::EndAnimation(), CGameMenu::FillGameInfo(), FocusElementEx(), GetElText(), GetStyle(), GetStyleSheet(), CGameMenu::Init(), CGameCommand::Init(), CFragment::InitFragment(), CPile::InitPile(), CEngine::PlayGame(), CGameMenu::Refresh(), SetElText(), ShowElementEx(), CEngine::StopPlayGame(), CGameMenu::Uninit(), and CUserPrefs::UpdateAppearance().

00166 {
00167    return GetEl(CBSTR(uID), riid);
00168 }

LPVOID GetNumberedEl | ( | UINT | uidFormatter,
 |  | UINT | uiIndex,
 |  | REFIID | riid
 | ) |

Definition at line 189 of file bmws_htmlhelpers.cpp.

References GetEl().

00190 {
00191    return GetEl(CBSTR(CTSTR(uidFormatter), uiIndex), riid);
00192 }

CHTMLRuleStylePtr GetRuleStyle | ( | UINT | uID,
 |  | long | lIndex
 | ) |

Definition at line 633 of file bmws_htmlhelpers.cpp.

References CPtr::Assign(), BMWS_HH_GETRULESTYLE, CHECKHRCOM, GetStyleSheet(), and HHInternalExcep().

00634 {
00635    CHTMLRuleStylePtr pRuleStyle;
00636    try
00637    {
00638 #ifdef BMWS_HTMLHELPERS_ADDSTYLE
00639       CPtr<IHTMLStyleSheet, &IID_IHTMLStyleSheet> spSheet;
00640       if((uID == 0) || (uID == (UINT)-1))
00641          spSheet.Assign(m_spStyleSheet);
00642       else
00643          spSheet = GetStyleSheet(uID);
00644 #else
00645       CPtr<IHTMLStyleSheet, &IID_IHTMLStyleSheet> spSheet = GetStyleSheet(uID);
00646 #endif
00647       CPtr<IHTMLStyleSheetRulesCollection, &IID_IHTMLStyleSheetRulesCollection> spRules;
00648       CHECKHRCOM(spSheet->get_rules(&spRules));
00649       CPtr<IHTMLStyleSheetRule, &IID_IHTMLStyleSheetRule> spRule;
00650       CHECKHRCOM(spRules->item(lIndex, &spRule));
00651       CHECKHRCOM(spRule->get_style(&pRuleStyle));
00652    }
00653    catch(CCOMExcep *pE)
00654    {
00655       HHInternalExcep(pE, BMWS_HH_GETRULESTYLE);
00656    }
00657
00658    return pRuleStyle;
00659 }

CHTMLStylePtr GetStyle ( UINT uID )

Definition at line 1195 of file bmws_htmlhelpers.cpp.

References BMWS_HH_GETSTYLE, CHECKHRCOM, GetNamedEl(), and HHInternalExcep().

01196 {
01197    CHTMLStylePtr spReturn;
01198    try
01199    {
01200       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
01201       CHECKHRCOM(spEl->get_style(&spReturn));
01202    }
01203    catch(CCOMExcep *pE)
01204    {
01205       HHInternalExcep(pE, BMWS_HH_GETSTYLE);
01206    }
01207    return spReturn;
01208 }

CHTMLStyleSheetPtr GetStyleSheet ( UINT uID ) [protected]

Definition at line 1124 of file bmws_htmlhelpers.cpp.

References CPtr::Assign(), CHECKHRCOM, CHTMLStyleElementPtr, GetNamedEl(), and m_spDoc3.

Referenced by GetRuleStyle().

01125 {
01126    CHTMLStyleSheetPtr pReturn;
01127    if(uID == (UINT)-1)
01128    {
01129       CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc2(m_spDoc3);
01130       CPtr<IHTMLStyleSheetsCollection, &IID_IHTMLStyleSheetsCollection> spSheets;
01131       CHECKHRCOM(spDoc2->get_styleSheets(&spSheets));
01132       CVariant vInd, vOut, vOutCoerced;
01133       vInd.vt = VT_UINT;
01134       vInd.lVal = 0;
01135       CHECKHRCOM(spSheets->item(&vInd, &vOut));
01136       CHECKHRCOM(VariantChangeType(&vOutCoerced, &vOut, 0, VT_DISPATCH));
01137       pReturn.Assign(vOutCoerced.pdispVal);
01138    } else
01139    {
01140       CHECKHRCOM(CHTMLStyleElementPtr(TRUE, GetNamedEl(uID,
01141          IID_IHTMLStyleElement))->get_styleSheet(&pReturn));
01142    }
01143    return pReturn;
01144 }

void SetElText | ( | UINT | uID,
 |  | CBSTR & | bstrText,
 |  | BOOL | bEdit = FALSE
 | ) |

Definition at line 268 of file bmws_htmlhelpers.cpp.

References BMWS_HH_SETTEXT, GetNamedEl(), HHInternalExcep(), and SetElTextWithEl().

Referenced by CMainWindow::DoHelpPane(), CGameMenu::FillGameInfo(), CMainWindow::HTMLComplete(), CHelpPane::HTMLComplete(), CHelpPane::SetGame(), and CHelpPane::SetInstr().

00269 {
00270    try
00271    {
00272       CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00273       SetElTextWithEl(spEl, bstrText, bEdit);
00274    }
00275    catch(CCOMExcep *pE)
00276    {
00277       HHInternalExcep(pE, BMWS_HH_SETTEXT);
00278    }
00279 }

void SetElTextWithEl | ( | CHTMLElementPtr & | spEl,
 |  | CBSTR & | bstrText,
 |  | BOOL | bEdit = FALSE
 | ) |

Definition at line 299 of file bmws_htmlhelpers.cpp.

References BMWS_HH_SETTEXT, CHECKHRCOM, and HHInternalExcep().

Referenced by CGameCommand::Enable(), and SetElText().

00300 {
00301    try
00302    {
00303       if(bEdit)
00304       {
00305          CPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement> spTextEl(spEl);
00306          CHECKHRCOM(spTextEl->put_value(bstrText));
00307       } else
00308       {
00309          CHECKHRCOM(spEl->put_innerText(bstrText));
00310       }
00311    }
00312    catch(CCOMExcep *pE)
00313    {
00314       HHInternalExcep(pE, BMWS_HH_SETTEXT);
00315    }
00316 }

void ShowElement | ( | IHTMLElement * | pEl,
 |  | BOOL | bShow
 | ) |

Definition at line 209 of file bmws_htmlhelpers.cpp.

References CBSTR::Assign(), BMWS_HH_SHOWELEMENT, CHECKHRCOM, HHInternalExcep(), and IDS_BMWS_HTML_DISPLAYNONE.

Referenced by CDeck::InitDeck(), and ShowElementEx().

00210 {
00211    try
00212    {
00213       CPtr<IHTMLStyle, &IID_IHTMLStyle> spStyle;
00214       CHECKHRCOM(pEl->get_style(&spStyle));
00215       CBSTR bstrStyleDisplay;
00216
00217       if(!bShow)
00218          bstrStyleDisplay.Assign(IDS_BMWS_HTML_DISPLAYNONE);
00219       CHECKHRCOM(spStyle->put_display(bstrStyleDisplay));
00220    }
00221    catch(CCOMExcep *pE)
00222    {
00223       HHInternalExcep(pE, BMWS_HH_SHOWELEMENT);
00224    }
00225 }

void ShowElementEx | ( | UINT | uID,
 |  | BOOL | bShow
 | ) |

Definition at line 244 of file bmws_htmlhelpers.cpp.

References GetNamedEl(), and ShowElement().

Referenced by C3DShatter::DoAnimation(), C3DShatter::EndAnimation(), CGameMenu::Init(), CEngine::PlayGame(), CGameMenu::Refresh(), CGameMenu::Show(), and CEngine::StopPlayGame().

00245 {
00246    CHTMLElementPtr spEl(TRUE, GetNamedEl(uID, IID_IHTMLElement));
00247    ShowElement(spEl, bShow);
00248 }

Member Data Documentation

CBSTR m_bstrBeforeEnd

Definition at line 123 of file bmws_htmlhelpers.h.

Referenced by CHTMLHelper(), CPile::InitPile(), CPile::ReceiveCards(), CPile::SetCardIndex(), and CCard::SetPile().

CPtr<IHTMLDocument3, &IID_IHTMLDocument3> m_spDoc3

Definition at line 120 of file bmws_htmlhelpers.h.

Referenced by CHTMLHelper(), CreateElement(), GetEl(), and GetStyleSheet().

CPtr<IHTMLWindow2, &IID_IHTMLWindow2> m_spWindow2

Definition at line 121 of file bmws_htmlhelpers.h.

Referenced by CancelEvent(), CHTMLHelper(), GetEvent(), and CHelpPane::SetInstr().

The documentation for this class was generated from the following files:
  • bmws_htmlhelpers.h
  • bmws_htmlhelpers.cpp
Generated on Wed May 8 12:39:47 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLHelper Member List

This is the complete list of members for CHTMLHelper, including all inherited members.
CancelEvent() | CHTMLHelper |
CHTMLHelper(IHTMLDocument2 *pDoc2) | CHTMLHelper |
CreateElement(UINT uIDTag, REFIID riid) | CHTMLHelper |
FocusElement(CHTMLElementPtr &pEl, BOOL bFocus) | CHTMLHelper |
FocusElementEx(UINT uID, BOOL bFocus) | CHTMLHelper |
GetEl(BSTR bstrID, REFIID riid) | CHTMLHelper |
GetElText(UINT uID, BOOL bEdit=FALSE) | CHTMLHelper |
GetElTextWithEl(CHTMLElementPtr &spEl, BOOL bEdit=FALSE) | CHTMLHelper |
GetEvent() | CHTMLHelper |
GetNamedEl(UINT uID, REFIID riid) | CHTMLHelper |
GetNumberedEl(UINT uidFormatter, UINT uiIndex, REFIID riid) | CHTMLHelper |
GetRuleStyle(UINT uID, long lIndex) | CHTMLHelper |
GetStyle(UINT uID) | CHTMLHelper |
GetStyleSheet(UINT uID) | CHTMLHelper | [protected]
m_bstrBeforeEnd | CHTMLHelper |
m_spDoc3 | CHTMLHelper |
m_spWindow2 | CHTMLHelper |
SetElText(UINT uID, CBSTR &bstrText, BOOL bEdit=FALSE) | CHTMLHelper |
SetElTextWithEl(CHTMLElementPtr &spEl, CBSTR &bstrText, BOOL bEdit=FALSE) | CHTMLHelper |
ShowElement(IHTMLElement *pEl, BOOL bShow) | CHTMLHelper |
ShowElementEx(UINT uID, BOOL bShow) | CHTMLHelper |
Generated on Wed May 8 12:39:47 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLLink Class Reference

#include <bmws_htmllink.h>

Inheritance diagram for CHTMLLink:

CHTMLEnable IEventHandlerSite List of all members.

Public Methods

CHTMLLink (IHTMLLinkSite *pSite, CHTMLHelper *pHH, DWORD dwEventID, LPARAM lParam, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, BOOL bParamIsUnk=FALSE, IHTMLEnableSite *pEnableSite=NULL)
virtual | ~CHTMLLink ()
void | Enable (BOOL bEnable)
virtual void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Methods

void | Cleanup ()

Protected Attributes

IHTMLLinkSite * m_pLinkSite
DWORD | m_dwEventID
LPARAM | m_lParam
BOOL | m_bParamIsUnk

Constructor & Destructor Documentation

CHTMLLink | ( | IHTMLLinkSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | DWORD | dwEventID,
 |  | LPARAM | lParam,
 |  | CHTMLElementPtr & | spElParent,
 |  | CTSTR & | lpszText,
 |  | CTSTR & | lpszExtraAttrs,
 |  | BOOL | bParamIsUnk = FALSE,
 |  | IHTMLEnableSite * | pEnableSite = NULL
 | ) |

Definition at line 33 of file bmws_htmllink.cpp.

References m_bParamIsUnk, m_dwEventID, m_lParam, and m_pLinkSite.

00035                                                                      : CHTMLEnable(pHH,
00036                      spElParent, lpszText, lpszExtraAttrs, pEnableSite)
00037 {
00038    m_pLinkSite = pSite;
00039    m_dwEventID = dwEventID;
00040    m_lParam = lParam;
00041    m_bParamIsUnk = bParamIsUnk;
00042    if(m_bParamIsUnk)
00043       ((IUnknown*)lParam)->AddRef();
00044 }

~CHTMLLink ( ) [virtual]

Definition at line 52 of file bmws_htmllink.cpp.

References Cleanup(), and m_lParam.

00053 {
00054    Cleanup();
00055    if(m_bParamIsUnk)
00056       ((IUnknown*)m_lParam)->Release();
00057 }

Member Function Documentation

void Cleanup ( ) [protected]

Definition at line 125 of file bmws_htmllink.cpp.

References CHTMLEnable::m_spEl.

Referenced by Enable(), and ~CHTMLLink().

00126 {
00127    if(m_spEl)
00128    {
00129       VARIANT vHandler;
00130       VariantInit(&vHandler);
00131       vHandler.vt = VT_NULL;
00132       m_spEl->put_onclick(vHandler);
00133    }
00134 }

void Enable ( BOOL bEnable ) [virtual]

Implements CHTMLEnable.

Definition at line 71 of file bmws_htmllink.cpp.

References CHECKHRCOM, Cleanup(), CHTMLEnable::EnableHelper(), ENSUREALLOC, IDS_BMWS_HTMLLINK_DISABLED, IDS_BMWS_HTMLLINK_HOLDER, m_dwEventID, m_lParam, and CHTMLEnable::m_spEl.

00072 {
00073    Cleanup();
00074
00075    EnableHelper(bEnable, IDS_BMWS_HTMLLINK_HOLDER, IDS_BMWS_HTMLLINK_DISABLED);
00076
00077    CEventHandler *pHandler = new CEventHandler((IEventHandlerSite*)this, m_dwEventID, m_lParam);
00078    ENSUREALLOC(pHandler);
00079
00080    CVariant vHandler;
00081    vHandler.vt = VT_DISPATCH;
00082    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00083    CHECKHRCOM(m_spEl->put_onclick(vHandler));
00084 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 99 of file bmws_htmllink.cpp.

References CHTMLHelper::CancelEvent(), IHTMLLinkSite::LinkClicked(), CHTMLEnable::m_bEnabled, CHTMLEnable::m_pHH, and m_pLinkSite.

00100 {
00101    try   // Windows-called code
00102    {
00103       m_pHH->CancelEvent();
00104       if(m_bEnabled && m_pLinkSite)
00105          m_pLinkSite->LinkClicked(this, dwEventID, lParam);
00106    }
00107    catch(CExcep *pE)
00108    {
00109       pE->Report();
00110       pE->Delete();
00111    }
00112 }

Member Data Documentation

BOOL m_bParamIsUnk [protected]

Definition at line 64 of file bmws_htmllink.h.

Referenced by CHTMLLink().

DWORD m_dwEventID [protected]

Definition at line 62 of file bmws_htmllink.h.

Referenced by CHTMLLink(), and Enable().

LPARAM m_lParam [protected]

Definition at line 63 of file bmws_htmllink.h.

Referenced by CHTMLLink(), Enable(), and ~CHTMLLink().

IHTMLLinkSite* m_pLinkSite [protected]

Definition at line 61 of file bmws_htmllink.h.

Referenced by CHTMLLink(), and EventHandler().

The documentation for this class was generated from the following files:
  • bmws_htmllink.h
  • bmws_htmllink.cpp
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLLink Member List

This is the complete list of members for CHTMLLink, including all inherited members.
CHTMLEnable(CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, IHTMLEnableSite *pSite=NULL) | CHTMLEnable |
CHTMLLink(IHTMLLinkSite *pSite, CHTMLHelper *pHH, DWORD dwEventID, LPARAM lParam, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, BOOL bParamIsUnk=FALSE, IHTMLEnableSite *pEnableSite=NULL) | CHTMLLink |
Cleanup() | CHTMLLink | [protected]
Enable(BOOL bEnable) | CHTMLLink | [virtual]
EnableHelper(BOOL bEnable, UINT uidHolder, UINT uidDisabled) | CHTMLEnable | [protected]
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLLink | [virtual]
GetEl() | CHTMLEnable |
m_bEnabled | CHTMLEnable | [protected]
m_bParamIsUnk | CHTMLLink | [protected]
m_dwEventID | CHTMLLink | [protected]
m_lParam | CHTMLLink | [protected]
m_lpszExtraAttrs | CHTMLEnable | [protected]
m_lpszText | CHTMLEnable | [protected]
m_pHH | CHTMLEnable | [protected]
m_pLinkSite | CHTMLLink | [protected]
m_pSite | CHTMLEnable | [protected]
m_spEl | CHTMLEnable | [protected]
m_spElParent | CHTMLEnable | [protected]
~CHTMLEnable() | CHTMLEnable | [inline, virtual]
~CHTMLLink() | CHTMLLink | [virtual]
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLRadioGroup Class Reference

#include <bmws_htmlradiogroup.h>

Inheritance diagram for CHTMLRadioGroup:

CHTMLControl IHTMLControlSite IEventHandlerSite List of all members.

Public Methods

CHTMLRadioGroup (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uidFirst, UINT cElements)
void | ResetChanged ()
BOOL | Changed ()
void | EventHandler (DWORD dwEventID, LPARAM lParam)
virtual void | ControlChanged (CHTMLControl *pControl, UINT uID, LPARAM lParam)
int | GetChecked ()
void | SetChecked (int iIndex)

Protected Attributes

CPtrArray< CHTMLChk *, CHTMLChk * > m_apControls
CPtrArray< IHTMLInputElement *,
IHTMLInputElement * > 		m_apInputEls
int | m_iIndex
int | m_iRecentIndex
UINT | m_uidFirst

Constructor & Destructor Documentation

CHTMLRadioGroup | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uidFirst,
 |  | UINT | cElements
 | ) |

Definition at line 27 of file bmws_htmlradiogroup.cpp.

References ENSUREALLOC, CHTMLHelper::GetNamedEl(), m_apControls, m_apInputEls, m_iIndex, m_iRecentIndex, m_uidFirst, ResetChanged(), CPtrArray< CHTMLChk *, CHTMLChk * >::SetAt(), CPtrArray< IHTMLInputElement *, IHTMLInputElement * >::SetAt(), CPtrArray< IHTMLInputElement *, IHTMLInputElement * >::SetRelease(), CArray< IHTMLInputElement *, IHTMLInputElement * >::SetSize(), and CArray< CHTMLChk *, CHTMLChk * >::SetSize().

00028                                                  : CHTMLControl(pSite, pHH, -1, -1)
00029 {
00030    m_iIndex = -1;
00031    m_iRecentIndex = -1;
00032    m_uidFirst = uidFirst;
00033    m_apControls.SetSize(cElements);
00034    m_apInputEls.SetSize(cElements);
00035    m_apInputEls.SetRelease(TRUE);
00036    for(UINT i = 0; i < cElements; i++)
00037    {
00038       IHTMLInputElement *pInputEl = (IHTMLInputElement*)pHH->GetNamedEl(uidFirst + i,
00039          IID_IHTMLInputElement);
00040       m_apInputEls.SetAt(i, pInputEl);
00041       CHTMLChk *pChk = new CHTMLChk((IHTMLControlSite*)this, pHH, uidFirst + i, (LPARAM)i, NULL);
00042       ENSUREALLOC(pChk);
00043       m_apControls.SetAt(i, pChk);
00044    }
00045
00046    ResetChanged();
00047 }

Member Function Documentation

BOOL Changed ( ) [virtual]

Implements CHTMLControl.

Definition at line 77 of file bmws_htmlradiogroup.cpp.

References GetChecked(), and m_iIndex.

00078 {
00079    return (m_iIndex != GetChecked());
00080 }

void ControlChanged | ( | CHTMLControl * | pControl,
 |  | UINT | uID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IHTMLControlSite.

Definition at line 97 of file bmws_htmlradiogroup.cpp.

References IHTMLControlSite::ControlChanged(), GetChecked(), m_iRecentIndex, CHTMLControl::m_pSite, and m_uidFirst.

00098 {
00099    int i = GetChecked();
00100    if(m_iRecentIndex != i)
00101    {
00102       m_iRecentIndex = i;
00103       m_pSite->ControlChanged(this, m_uidFirst, lParam);
00104    }
00105 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [inline, virtual]

Implements CHTMLControl.

Definition at line 36 of file bmws_htmlradiogroup.h.

00036 {}

int GetChecked ( )

Definition at line 118 of file bmws_htmlradiogroup.cpp.

References CHECKHRCOM, CArray< IHTMLInputElement *, IHTMLInputElement * >::GetSize(), and m_apInputEls.

Referenced by Changed(), ControlChanged(), and ResetChanged().

00119 {
00120    VARIANT_BOOL vb;
00121    int cElements = m_apInputEls.GetSize();
00122    for(int i = 0; i < cElements; i++)
00123    {
00124       CHECKHRCOM(m_apInputEls[i]->get_checked(&vb));
00125       if(vb == VARIANT_TRUE)
00126          return i;
00127    }
00128    return -1;
00129 }

void ResetChanged ( ) [virtual]

Implements CHTMLControl.

Definition at line 60 of file bmws_htmlradiogroup.cpp.

References GetChecked(), m_iIndex, and m_iRecentIndex.

Referenced by CHTMLRadioGroup().

00061 {
00062    m_iIndex = GetChecked();
00063    m_iRecentIndex = m_iIndex;
00064 }

void SetChecked ( int iIndex )

Definition at line 143 of file bmws_htmlradiogroup.cpp.

References _ASSERT, CHECKHRCOM, CArray< IHTMLInputElement *, IHTMLInputElement * >::GetSize(), m_apInputEls, and m_iRecentIndex.

00144 {
00145    _ASSERT((iIndex >= 0) && (iIndex < m_apInputEls.GetSize()));
00146    m_iRecentIndex = iIndex;
00147    CHECKHRCOM(m_apInputEls[iIndex]->put_checked(VARIANT_TRUE));
00148 }

Member Data Documentation

CPtrArray<CHTMLChk*, CHTMLChk*> m_apControls [protected]

Definition at line 45 of file bmws_htmlradiogroup.h.

Referenced by CHTMLRadioGroup().

CPtrArray<IHTMLInputElement*, IHTMLInputElement*> m_apInputEls [protected]

Definition at line 46 of file bmws_htmlradiogroup.h.

Referenced by CHTMLRadioGroup(), GetChecked(), and SetChecked().

int m_iIndex [protected]

Definition at line 47 of file bmws_htmlradiogroup.h.

Referenced by Changed(), CHTMLRadioGroup(), and ResetChanged().

int m_iRecentIndex [protected]

Definition at line 48 of file bmws_htmlradiogroup.h.

Referenced by CHTMLRadioGroup(), ControlChanged(), ResetChanged(), and SetChecked().

UINT m_uidFirst [protected]

Definition at line 49 of file bmws_htmlradiogroup.h.

Referenced by CHTMLRadioGroup(), and ControlChanged().

The documentation for this class was generated from the following files:
  • bmws_htmlradiogroup.h
  • bmws_htmlradiogroup.cpp
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLRadioGroup Member List

This is the complete list of members for CHTMLRadioGroup, including all inherited members.
Changed() | CHTMLRadioGroup | [virtual]
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
CHTMLRadioGroup(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uidFirst, UINT cElements) | CHTMLRadioGroup |
ControlChanged(CHTMLControl *pControl, UINT uID, LPARAM lParam) | CHTMLRadioGroup | [virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLRadioGroup | [inline, virtual]
GetChecked() | CHTMLRadioGroup |
GetEl() | CHTMLControl | [virtual]
m_apControls | CHTMLRadioGroup | [protected]
m_apInputEls | CHTMLRadioGroup | [protected]
m_bParamIsUnk | CHTMLControl | [protected]
m_iIndex | CHTMLRadioGroup | [protected]
m_iRecentIndex | CHTMLRadioGroup | [protected]
m_lParam | CHTMLControl | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_uID | CHTMLControl | [protected]
m_uidFirst | CHTMLRadioGroup | [protected]
ResetChanged() | CHTMLRadioGroup | [virtual]
SetChecked(int iIndex) | CHTMLRadioGroup |
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
~CHTMLControl() | CHTMLControl | [virtual]
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLSelect Class Reference

#include <bmws_htmlselect.h>

Inheritance diagram for CHTMLSelect:

CHTMLControl IEventHandlerSite List of all members.

Public Methods

CHTMLSelect (IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL)
virtual | ~CHTMLSelect ()
void | ResetChanged ()
BOOL | Changed ()
void | Add (long lIndex, CBSTR &bstrText)
void | Remove (long lIndex)
void | Replace (long lIndex, CBSTR &bstrNewText)
long | GetSelected ()
void | SetSelected (long lIndex)
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

CPtr< IHTMLSelectElement,
&IID_IHTMLSelectElement > 		m_spSelectEl
long | m_lOrig

Constructor & Destructor Documentation

CHTMLSelect | ( | IHTMLControlSite * | pSite,
 |  | CHTMLHelper * | pHH,
 |  | UINT | uID,
 |  | LPARAM | lParam,
 |  | IHTMLElement * | pEl = NULL
 | ) |

Definition at line 29 of file bmws_htmlselect.cpp.

References CPtr< IHTMLSelectElement,&IID_IHTMLSelectElement >::Assign(), CHECKHRCOM, ENSUREALLOC, CHTMLControl::m_spEl, m_spSelectEl, and ResetChanged().

00030                                             : CHTMLControl(pSite, pHH, uID, lParam, pEl)
00031 {
00032    m_spSelectEl.Assign(m_spEl);
00033    CEventHandler *pHandler = NULL;
00034    CVariant vHandler;
00035
00036    pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00037    ENSUREALLOC(pHandler);
00038    vHandler.vt = VT_DISPATCH;
00039    pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00040    CHECKHRCOM(m_spSelectEl->put_onchange(vHandler));
00041
00042    ResetChanged();
00043 }

~CHTMLSelect ( ) [virtual]

Definition at line 51 of file bmws_htmlselect.cpp.

References m_spSelectEl.

00052 {
00053    VARIANT vHandler;
00054    VariantInit(&vHandler);
00055    vHandler.vt = VT_NULL;
00056    m_spSelectEl->put_onchange(vHandler);
00057 }

Member Function Documentation

void Add | ( | long | lIndex,
 |  | CBSTR & | bstrText
 | ) |

Definition at line 135 of file bmws_htmlselect.cpp.

References CHECKHRCOM, CHTMLHelper::CreateElement(), IDS_BMWS_HTMLSELECT_OPTIONTAG, CHTMLControl::m_pHH, and m_spSelectEl.

00136 {
00137    CHTMLElementPtr spOption(TRUE, m_pHH->CreateElement(IDS_BMWS_HTMLSELECT_OPTIONTAG,
00138       IID_IHTMLElement));
00139    CPtr<IHTMLOptionElement, &IID_IHTMLOptionElement> spOptionEl(spOption);
00140    CHECKHRCOM(spOptionEl->put_text(bstrText));
00141    VARIANT v;
00142    v.vt = VT_I4;
00143    v.lVal = lIndex;
00144    CHECKHRCOM(m_spSelectEl->add(spOption, v));
00145 }

BOOL Changed ( ) [virtual]

Implements CHTMLControl.

Definition at line 86 of file bmws_htmlselect.cpp.

References CHECKHRCOM, m_lOrig, and m_spSelectEl.

00087 {
00088    long lIndex = 0;
00089    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&lIndex));
00090    return (m_lOrig != lIndex);
00091 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CHTMLControl.

Definition at line 107 of file bmws_htmlselect.cpp.

References IHTMLControlSite::ControlChanged(), CHTMLControl::m_lParam, CHTMLControl::m_pSite, and CHTMLControl::m_uID.

00108 {
00109    try   // Windows-called code
00110    {
00111       if(m_pSite)
00112          m_pSite->ControlChanged(this, m_uID, m_lParam);
00113    }
00114    catch(CExcep *pE)
00115    {
00116       pE->Report();
00117       pE->Delete();
00118    }
00119 }

long GetSelected ( )

Definition at line 199 of file bmws_htmlselect.cpp.

References CHECKHRCOM, and m_spSelectEl.

00200 {
00201    long lIndex;
00202    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&lIndex));
00203    return lIndex;
00204 }

void Remove ( long lIndex )

Definition at line 159 of file bmws_htmlselect.cpp.

References CHECKHRCOM, and m_spSelectEl.

00160 {
00161    CHECKHRCOM(m_spSelectEl->remove(lIndex));
00162 }

void Replace | ( | long | lIndex,
 |  | CBSTR & | bstrNewText
 | ) |

Definition at line 177 of file bmws_htmlselect.cpp.

References CHECKHRCOM, and m_spSelectEl.

00178 {
00179    CPtr<IDispatch, &IID_IDispatch> spDispOption;
00180    VARIANT vIndex;
00181    vIndex.vt = VT_I4;
00182    vIndex.lVal = lIndex;
00183    CHECKHRCOM(m_spSelectEl->item(vIndex, vIndex, &spDispOption));
00184    CPtr<IHTMLOptionElement, &IID_IHTMLOptionElement> spOptionEl(spDispOption);
00185    CHECKHRCOM(spOptionEl->put_text(bstrNewText));
00186 }

void ResetChanged ( ) [virtual]

Implements CHTMLControl.

Definition at line 70 of file bmws_htmlselect.cpp.

References CHECKHRCOM, m_lOrig, and m_spSelectEl.

Referenced by CHTMLSelect().

00071 {
00072    CHECKHRCOM(m_spSelectEl->get_selectedIndex(&m_lOrig));
00073 }

void SetSelected ( long lIndex )

Definition at line 218 of file bmws_htmlselect.cpp.

References CHECKHRCOM, and m_spSelectEl.

00219 {
00220    CHECKHRCOM(m_spSelectEl->put_selectedIndex(lIndex));
00221 }

Member Data Documentation

long m_lOrig [protected]

Definition at line 45 of file bmws_htmlselect.h.

Referenced by Changed(), and ResetChanged().

CPtr<IHTMLSelectElement, &IID_IHTMLSelectElement> m_spSelectEl [protected]

Definition at line 44 of file bmws_htmlselect.h.

Referenced by Add(), Changed(), CHTMLSelect(), GetSelected(), Remove(), Replace(), ResetChanged(), SetSelected(), and ~CHTMLSelect().

The documentation for this class was generated from the following files:
  • bmws_htmlselect.h
  • bmws_htmlselect.cpp
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLSelect Member List

This is the complete list of members for CHTMLSelect, including all inherited members.
Add(long lIndex, CBSTR &bstrText) | CHTMLSelect |
Changed() | CHTMLSelect | [virtual]
CHTMLControl(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLControl |
CHTMLSelect(IHTMLControlSite *pSite, CHTMLHelper *pHH, UINT uID, LPARAM lParam, IHTMLElement *pEl=NULL) | CHTMLSelect |
EventHandler(DWORD dwEventID, LPARAM lParam) | CHTMLSelect | [virtual]
GetEl() | CHTMLControl | [virtual]
GetSelected() | CHTMLSelect |
m_bParamIsUnk | CHTMLControl | [protected]
m_lOrig | CHTMLSelect | [protected]
m_lParam | CHTMLControl | [protected]
m_pHH | CHTMLControl | [protected]
m_pSite | CHTMLControl | [protected]
m_spEl | CHTMLControl | [protected]
m_spSelectEl | CHTMLSelect | [protected]
m_uID | CHTMLControl | [protected]
Remove(long lIndex) | CHTMLSelect |
Replace(long lIndex, CBSTR &bstrNewText) | CHTMLSelect |
ResetChanged() | CHTMLSelect | [virtual]
SetParamIsUnk(BOOL bParamIsUnk) | CHTMLControl |
SetSelected(long lIndex) | CHTMLSelect |
~CHTMLControl() | CHTMLControl | [virtual]
~CHTMLSelect() | CHTMLSelect | [virtual]
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


CHTMLStatic Class Reference

#include <bmws_htmlstatic.h>

Inheritance diagram for CHTMLStatic:

CHTMLEnable List of all members.

Public Methods

CHTMLStatic (CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, UINT uidFormatter=(UINT)-1, IHTMLEnableSite *pSite=NULL)
virtual | ~CHTMLStatic ()
void | Enable (BOOL bEnable)

Protected Attributes

UINT | m_uidFormatter

Constructor & Destructor Documentation

CHTMLStatic | ( | CHTMLHelper * | pHH,
 |  | CHTMLElementPtr & | spElParent,
 |  | CTSTR & | lpszText,
 |  | CTSTR & | lpszExtraAttrs,
 |  | UINT | uidFormatter = (UINT)-1,
 |  | IHTMLEnableSite * | pSite = NULL
 | ) |

Definition at line 32 of file bmws_htmlstatic.cpp.

References IDS_BMWS_HTMLSTATIC_HOLDER, and m_uidFormatter.

00033                                                                                            :
00034                          CHTMLEnable(pHH, spElParent, lpszText, lpszExtraAttrs, pSite)
00035 {
00036    m_uidFormatter = (uidFormatter == (UINT)-1 ? IDS_BMWS_HTMLSTATIC_HOLDER : uidFormatter);
00037 }

~CHTMLStatic ( ) [virtual]

Definition at line 45 of file bmws_htmlstatic.cpp.

00046 {
00047 }

Member Function Documentation

void Enable ( BOOL bEnable ) [virtual]

Implements CHTMLEnable.

Definition at line 61 of file bmws_htmlstatic.cpp.

References CHTMLEnable::EnableHelper(), IDS_BMWS_HTMLSTATIC_DISABLED, and m_uidFormatter.

00062 {
00063    EnableHelper(bEnable, m_uidFormatter, IDS_BMWS_HTMLSTATIC_DISABLED);
00064 }

Member Data Documentation

UINT m_uidFormatter [protected]

Definition at line 35 of file bmws_htmlstatic.h.

Referenced by CHTMLStatic(), and Enable().

The documentation for this class was generated from the following files:
  • bmws_htmlstatic.h
  • bmws_htmlstatic.cpp
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHTMLStatic Member List

This is the complete list of members for CHTMLStatic, including all inherited members.
CHTMLEnable(CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, IHTMLEnableSite *pSite=NULL) | CHTMLEnable |
CHTMLStatic(CHTMLHelper *pHH, CHTMLElementPtr &spElParent, CTSTR &lpszText, CTSTR &lpszExtraAttrs, UINT uidFormatter=(UINT)-1, IHTMLEnableSite *pSite=NULL) | CHTMLStatic |
Enable(BOOL bEnable) | CHTMLStatic | [virtual]
EnableHelper(BOOL bEnable, UINT uidHolder, UINT uidDisabled) | CHTMLEnable | [protected]
GetEl() | CHTMLEnable |
m_bEnabled | CHTMLEnable | [protected]
m_lpszExtraAttrs | CHTMLEnable | [protected]
m_lpszText | CHTMLEnable | [protected]
m_pHH | CHTMLEnable | [protected]
m_pSite | CHTMLEnable | [protected]
m_spEl | CHTMLEnable | [protected]
m_spElParent | CHTMLEnable | [protected]
m_uidFormatter | CHTMLStatic | [protected]
~CHTMLEnable() | CHTMLEnable | [inline, virtual]
~CHTMLStatic() | CHTMLStatic | [virtual]
Generated on Wed May 8 12:39:48 2002 for Solitaire Pack by doxygen 1.2.15


CHWND Class Reference

#include <bmws_window.h>

Inheritance diagram for CHWND:

CRefCount CHelpPane CMainWindow CSplashWindow CStatusBar List of all members.

Public Methods

CHWND ()
virtual | ~CHWND ()
operator HWND () const
void | Register ()
BOOL | ShowWindow (int nCmdShow)
LRESULT | SendMessage (UINT Msg, WPARAM wParam, LPARAM lParam)
void | CreateWindowEx (DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam)

Static Public Methods

void | RegisterWindowClass (LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL)
void | CenterWindow (HWND hWnd)

Public Attributes

HWND | m_hWnd

Protected Attributes

CTSTR m_lpszClassName

Constructor & Destructor Documentation

CHWND ( ) [inline]

Definition at line 45 of file bmws_window.h.

References m_hWnd.

Referenced by CStatusBar::Create(), and CHelpPane::OnCreate().

00046    {
00047       m_hWnd = NULL;
00048    }

virtual ~CHWND ( ) [inline, virtual]

Definition at line 56 of file bmws_window.h.

References m_hWnd.

00057    {
00058       if(IsWindow(m_hWnd))
00059          DestroyWindow(m_hWnd);
00060    }

Member Function Documentation

void CenterWindow ( HWND hWnd ) [static]

Definition at line 187 of file bmws_window.cpp.

Referenced by CDlg::BMWSDlgProc(), ChooseColorDialogHook(), CUpdateDlg::DlgProc(), OFNDialogHook(), RegistrationProc(), SingleOFNDialogHook(), and CSplashWindow::SplashWndProc().

00188 {
00189    RECT rcChild;
00190    GetWindowRect(hWnd, &rcChild);
00191    RECT rcArea;
00192    RECT rcCenter;
00193    long lStyle = GetWindowLong(hWnd, GWL_STYLE);
00194    HWND hWndParent = ((lStyle & WS_CHILD) ? GetParent(hWnd) : GetWindow(hWnd, GW_OWNER));
00195
00196    if(!hWndParent || (!(GetWindowLong(hWndParent, GWL_STYLE) & WS_VISIBLE)) ||
00197       (GetWindowLong(hWndParent, GWL_STYLE) & WS_MINIMIZE))
00198    {
00199       hWndParent = GetDesktopWindow();
00200    }
00201
00202    GetWindowRect(hWndParent, &rcCenter);
00203
00204    // find dialog's upper left based on rcCenter
00205    int xLeft = (rcCenter.left + rcCenter.right) / 2 - (rcChild.right - rcChild.left) / 2;
00206    int yTop = (rcCenter.top + rcCenter.bottom) / 2 - (rcChild.bottom - rcChild.top) / 2;
00207
00208    SystemParametersInfo(SPI_GETWORKAREA, 0, &rcArea, 0);
00209
00210    // if the window is outside the window, move it inside
00211    if (xLeft < rcArea.left)
00212       xLeft = rcArea.left;
00213    else if (xLeft + (rcChild.right - rcChild.left) > rcArea.right)
00214       xLeft = rcArea.right - (rcChild.right - rcChild.left);
00215
00216    if (yTop < rcArea.top)
00217       yTop = rcArea.top;
00218    else if (yTop + (rcChild.bottom - rcChild.top) > rcArea.bottom)
00219       yTop = rcArea.bottom - (rcChild.bottom - rcChild.top);
00220
00221    SetWindowPos(hWnd, NULL, xLeft, yTop, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
00222 }

void CreateWindowEx | ( | DWORD | dwExStyle,
 |  | LPCTSTR | lpClassName,
 |  | LPCTSTR | lpWindowName,
 |  | DWORD | dwStyle,
 |  | int | x,
 |  | int | y,
 |  | int | nWidth,
 |  | int | nHeight,
 |  | HWND | hWndParent,
 |  | HMENU | hMenu,
 |  | LPVOID | lpParam
 | ) |

Definition at line 50 of file bmws_window.cpp.

References ERROR_ERRORINS_LPTSTR, g_hInst, IDS_BMWS_REMEDY_RESTART, IDS_BMWS_WINDOW_E_CREATEWND, m_hWnd, and THROW.

Referenced by CStatusBar::Create(), CMainWindow::Create(), CHelpPane::Create(), CSplashWindow::Create(), and CHelpPane::OnCreate().

00053 {
00054    m_hWnd = ::CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth,
00055       nHeight, hwndParent, hMenu, g_hInst, lpParam);
00056
00057    if(!m_hWnd)
00058       THROW(new CExcepEx(IDS_BMWS_WINDOW_E_CREATEWND, IDS_BMWS_REMEDY_RESTART,
00059          (UINT_PTR)(LPTSTR)lpClassName, 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00060 }

operator HWND ( ) const [inline]

Definition at line 72 of file bmws_window.h.

References m_hWnd.

00073    {
00074       return m_hWnd;
00075    }

void Register ( ) [inline]

Reimplemented in CSplashWindow, CHelpPane, and CMainWindow.

Definition at line 91 of file bmws_window.h.

00092    {
00093    }

void RegisterWindowClass | ( | LPTSTR | lpszClassName,
 |  | UINT | uiStyle,
 |  | WNDPROC | fnWndProc,
 |  | LPTSTR | lpszIcon,
 |  | HBRUSH | hbrBackground,
 |  | LPTSTR | lpszMenu,
 |  | HCURSOR | hCursor = NULL
 | ) | [static]

Definition at line 155 of file bmws_window.cpp.

References ERROR_ERRORINS_LPTSTR, g_hInst, IDS_BMWS_REMEDY_RESTART, IDS_BMWS_WINDOW_E_REGWNDCLASS, and THROW.

Referenced by CMainWindow::Register(), and CHelpPane::Register().

00158 {
00159    WNDCLASS wc;
00160
00161    wc.style          = uiStyle;
00162    wc.lpfnWndProc    = fnWndProc;
00163    wc.cbClsExtra     = 0;
00164    wc.cbWndExtra     = 0;
00165    wc.hInstance      = g_hInst;
00166    wc.hIcon          = (lpszIcon ? LoadIcon(g_hInst, lpszIcon) : NULL);
00167    wc.hCursor        = (hCursor ? hCursor : LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)));
00168    wc.hbrBackground  = hbrBackground;
00169    wc.lpszMenuName   = lpszMenu;
00170    wc.lpszClassName  = lpszClassName;
00171
00172    if(!RegisterClass(&wc))
00173       THROW(new CExcepEx(IDS_BMWS_WINDOW_E_REGWNDCLASS, IDS_BMWS_REMEDY_RESTART,
00174          (UINT_PTR)(LPTSTR)lpszClassName, 0, ERROR_ERRORINS_LPTSTR), CExcepEx*);
00175 }

LRESULT SendMessage | ( | UINT | Msg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [inline]

Definition at line 125 of file bmws_window.h.

References m_hWnd.

Referenced by CStatusBar::CancelHelpText(), CHelpPane::CancelResize(), CStatusBar::Create(), CMainWindow::GameSelected(), CMainWindow::OnCommand(), CMainWindow::OnCreate(), CHelpPane::OnCreate(), CStatusBar::SetHelpText(), CStatusBar::SetProgress(), CStatusBar::SetScore(), CStatusBar::SetStatusText(), CHelpPane::UpdateColors(), CHelpPane::UpdateFont(), and CHelpPane::~CHelpPane().

00126    {
00127       return ::SendMessage(m_hWnd, Msg, wParam, lParam);
00128    }

BOOL ShowWindow ( int nCmdShow ) [inline]

Definition at line 106 of file bmws_window.h.

References m_hWnd.

Referenced by CStatusBar::CancelHelpText(), CMainWindow::HTMLComplete(), and CStatusBar::SetHelpText().

00107    {
00108       return IsWindow(m_hWnd) ? ::ShowWindow(m_hWnd, nCmdShow) : FALSE;
00109    }

Member Data Documentation

HWND m_hWnd

Definition at line 143 of file bmws_window.h.

Referenced by CHelpPane::BarWndProc(), CHWND(), CStatusBar::Create(), CreateWindowEx(), CMainWindow::DoHelpPane(), CMainWindow::HTMLComplete(), CMainWindow::MainWndProc(), CMainWindow::OnCommand(), CMainWindow::OnCreate(), CHelpPane::OnCreate(), operator HWND(), CMainWindow::OptionStatusBar(), CHelpPane::PaneWndProc(), CMainWindow::PostMsg(), CMainWindow::PreprocessMessage(), CMainWindow::PresentUpdate(), CMainWindow::RemoveRegMenuItem(), CSolpackApp::Run(), SendMessage(), CMainWindow::ShowHideEngine(), ShowWindow(), CSplashWindow::SplashWndProc(), and ~CHWND().

CTSTR m_lpszClassName [protected]

Definition at line 146 of file bmws_window.h.

Referenced by CMainWindow::Create(), CHelpPane::Create(), CMainWindow::Register(), and CHelpPane::Register().

The documentation for this class was generated from the following files:
  • bmws_window.h
  • bmws_window.cpp
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CHWND Member List

This is the complete list of members for CHWND, including all inherited members.
CenterWindow(HWND hWnd) | CHWND | [static]
CHWND() | CHWND | [inline]
CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam) | CHWND |
CRefCount() | CRefCount | [inline]
downcount() | CRefCount | [inline]
m_hWnd | CHWND |
m_lpszClassName | CHWND | [protected]
operator HWND() const | CHWND | [inline]
Register() | CHWND | [inline]
RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL) | CHWND | [static]
SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) | CHWND | [inline]
ShowWindow(int nCmdShow) | CHWND | [inline]
upcount() | CRefCount | [inline]
~CHWND() | CHWND | [inline, virtual]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


CKey Class Reference

#include <bmws_key.h>

List of all members.

Public Methods

CKey ()
CKey (HKEY hKey)
CKey (CKey &key)
~CKey ()
operator HKEY () const
HKEY * | operator & ()
BOOL | operator! ()
operator BOOL () const
const CKey & | operator= (const CKey &keySrc)

Private Attributes

HKEY | m_hKey

Constructor & Destructor Documentation

CKey ( ) [inline]

Definition at line 28 of file bmws_key.h.

References m_hKey.

00029    {
00030       m_hKey = NULL;
00031    }

CKey ( HKEY hKey ) [inline]

Definition at line 42 of file bmws_key.h.

References m_hKey.

00043    {
00044       m_hKey = hKey;
00045    }

CKey ( CKey & key ) [inline]

Definition at line 56 of file bmws_key.h.

References m_hKey.

00057    {
00058       if(m_hKey)
00059          RegCloseKey(m_hKey);
00060       m_hKey = key.m_hKey;
00061    }

~CKey ( ) [inline]

Definition at line 69 of file bmws_key.h.

References m_hKey.

00070    {
00071       if(m_hKey)
00072          RegCloseKey(m_hKey);
00073    }

Member Function Documentation

HKEY* operator & ( ) [inline]

Definition at line 100 of file bmws_key.h.

References m_hKey.

00101    {
00102       return &m_hKey;
00103    }

operator BOOL ( ) const [inline]

Definition at line 130 of file bmws_key.h.

References m_hKey.

00131    {
00132       return (m_hKey != NULL);
00133    }

operator HKEY ( ) const [inline]

Definition at line 85 of file bmws_key.h.

References m_hKey.

00086    {
00087       return m_hKey;
00088    }

BOOL operator! ( ) [inline]

Definition at line 115 of file bmws_key.h.

References m_hKey.

00116    {
00117       return (m_hKey == NULL);
00118    }

const CKey& operator= ( const CKey & keySrc ) [inline]

Definition at line 147 of file bmws_key.h.

References m_hKey.

00148    {
00149       if(m_hKey)
00150          RegCloseKey(m_hKey);
00151       m_hKey = keySrc.m_hKey;
00152       return *this;
00153    }

Member Data Documentation

HKEY m_hKey [private]

Definition at line 157 of file bmws_key.h.

Referenced by CKey(), operator &(), operator BOOL(), operator HKEY(), operator!(), operator=(), and ~CKey().

The documentation for this class was generated from the following file:
  • bmws_key.h
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CKey Member List

This is the complete list of members for CKey, including all inherited members.
CKey() | CKey | [inline]
CKey(HKEY hKey) | CKey | [inline]
CKey(CKey &key) | CKey | [inline]
m_hKey | CKey | [private]
operator &() | CKey | [inline]
operator BOOL() const | CKey | [inline]
operator HKEY() const | CKey | [inline]
operator!() | CKey | [inline]
operator=(const CKey &keySrc) | CKey | [inline]
~CKey() | CKey | [inline]
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


CLib Class Reference

#include <bmws_lib.h>

List of all members.

Public Methods

CLib (LPTSTR lpszModule, BOOL bDataFile=FALSE)
~CLib ()
operator HINSTANCE () const

Private Attributes

HMODULE m_hModule

Constructor & Destructor Documentation

CLib | ( | LPTSTR | lpszModule,
 |  | BOOL | bDataFile = FALSE
 | ) | [inline]

Definition at line 33 of file bmws_lib.h.

References m_hModule.

00034    {
00035       m_hModule = bDataFile ? LoadLibraryEx(lpszModule, NULL, LOAD_LIBRARY_AS_DATAFILE)
00036                             : LoadLibrary(lpszModule);
00037    }

~CLib ( ) [inline]

Definition at line 45 of file bmws_lib.h.

References m_hModule.

00046    {
00047       if(m_hModule)
00048          FreeLibrary(m_hModule);
00049    }

Member Function Documentation

operator HINSTANCE ( ) const [inline]

Definition at line 61 of file bmws_lib.h.

References m_hModule.

00062    {
00063       return m_hModule;
00064    }

Member Data Documentation

HMODULE m_hModule [private]

Definition at line 68 of file bmws_lib.h.

Referenced by CLib(), operator HINSTANCE(), and ~CLib().

The documentation for this class was generated from the following file:
  • bmws_lib.h
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CLib Member List

This is the complete list of members for CLib, including all inherited members.
CLib(LPTSTR lpszModule, BOOL bDataFile=FALSE) | CLib | [inline]
m_hModule | CLib | [private]
operator HINSTANCE() const | CLib | [inline]
~CLib() | CLib | [inline]
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


CLibMgr Class Reference

#include <LibMgr.h>

List of all members.

Public Methods

CLibMgr ()
virtual | ~CLibMgr ()
void | Refresh ()
int | GetNumLibs ()
int | GetNumGames (int iLibIndex)
ISolpackGameLib * | GetLib (int iLibIndex)
ISolpackGameInfo * | GetGameInfo (int iLibIndex, int iGameIndex)
ISolpackGame * | GetGame (int iLibIndex, int iGameIndex)
BOOL | RegLibrary (CTSTR &lpszFile)

Protected Attributes

CPtrArray< ISolpackGameLib *,
ISolpackGameLib * > 		m_apLibs
int | m_cGames

Constructor & Destructor Documentation

CLibMgr ( )

Definition at line 27 of file LibMgr.cpp.

References m_apLibs, m_cGames, and CPtrArray< ISolpackGameLib *, ISolpackGameLib * >::SetRelease().

00028 {
00029    // Set initial value of member variable
00030    m_cGames = 0;
00031
00032    // Signify that the contained pointers are COM interface pointers that
00033    // should be released, not deleted, when destroyed.
00034    m_apLibs.SetRelease(TRUE);
00035 }

~CLibMgr ( ) [virtual]

Definition at line 43 of file LibMgr.cpp.

00044 {
00045 }

Member Function Documentation

ISolpackGame * GetGame | ( | int | iLibIndex,
 |  | int | iGameIndex
 | ) |

Definition at line 196 of file LibMgr.cpp.

References CHECKHRCOM, ISolpackGame, and m_apLibs.

Referenced by CEngine::PlayGame().

00197 {
00198    ISolpackGame *pReturn = NULL;
00199    CHECKHRCOM(m_apLibs[iLibIndex]->GetGame(iGameIndex, &pReturn));
00200    return pReturn;
00201 }

ISolpackGameInfo * GetGameInfo | ( | int | iLibIndex,
 |  | int | iGameIndex
 | ) |

Definition at line 176 of file LibMgr.cpp.

References CHECKHRCOM, ISolpackGameInfo, and m_apLibs.

Referenced by CGameMenu::FillGameInfo(), CMainWindow::GameSelected(), CGameMenu::Refresh(), and CMainWindow::UpdateInstr().

00177 {
00178    ISolpackGameInfo *pReturn = NULL;
00179    CHECKHRCOM(m_apLibs[iLibIndex]->GetGameInfo(iGameIndex, &pReturn));
00180    return pReturn;
00181 }

ISolpackGameLib * GetLib ( int iLibIndex )

Definition at line 156 of file LibMgr.cpp.

References ISolpackGameLib, and m_apLibs.

Referenced by CGameMenu::FillGameInfo().

00157 {
00158    m_apLibs[iLibIndex]->AddRef();
00159    return m_apLibs[iLibIndex];
00160 }

int GetNumGames ( int iLibIndex )

Definition at line 130 of file LibMgr.cpp.

References CHECKHRCOM, m_apLibs, and m_cGames.

Referenced by CGameMenu::Refresh(), and CMainWindow::UpdateInstr().

00131 {
00132    long l = 0;
00133
00134    if(iLibIndex >= 0)
00135    {
00136       // Just a single library
00137       CHECKHRCOM(m_apLibs[iLibIndex]->get_NumGames(&l));
00138    } else
00139       l = m_cGames;
00140
00141    return l;
00142 }

int GetNumLibs ( )

Definition at line 112 of file LibMgr.cpp.

References CArray< ISolpackGameLib *, ISolpackGameLib * >::GetSize(), and m_apLibs.

Referenced by CGameMenu::FillGameInfo(), and CGameMenu::Refresh().

00113 {
00114    return m_apLibs.GetSize();
00115 }

void Refresh ( )

Definition at line 58 of file LibMgr.cpp.

References CArray< ISolpackGameLib *, ISolpackGameLib * >::Add(), CATID_SolpackGameLibs, CHECKHRCOM, IID_ISolpackGameLib, m_apLibs, m_cGames, and CArray< ISolpackGameLib *, ISolpackGameLib * >::SetSize().

Referenced by CMainWindow::HTMLComplete(), and CMainWindow::OnCommand().

00059 {
00060    m_apLibs.SetSize(0);
00061    m_cGames = 0;
00062
00063    // Use Windows's Component Categories manager object
00064    CPtr<ICatInformation, &IID_ICatInformation> spCatInfo;
00065    CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_ALL,
00066       IID_ICatInformation, (LPVOID*)&spCatInfo));
00067
00068    // Array of Categories
00069    CATID IDs[1];
00070    IDs[0] = CATID_SolpackGameLibs;
00071
00072    // Get the IEnumCLSID interface
00073    IEnumCLSID* pEnum = NULL;
00074    CHECKHRCOM(spCatInfo->EnumClassesOfCategories(1, IDs, 0, NULL, &pEnum));
00075
00076    CLSID clsid;
00077
00078    // Go through each registered game library
00079    HRESULT hr = pEnum->Next(1, &clsid, NULL);
00080    while(hr != S_FALSE)
00081    {
00082       CHECKHRCOM(hr);
00083
00084       // Create an instance of the game library object and store it.
00085       CPtr<ISolpackGameLib, &IID_ISolpackGameLib> spTempLib;
00086       if(SUCCEEDED(CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER |
00087          CLSCTX_LOCAL_SERVER, IID_ISolpackGameLib, (LPVOID*)&spTempLib)))
00088       {
00089          m_apLibs.Add(spTempLib);
00090          spTempLib->AddRef();
00091
00092          long l;
00093          CHECKHRCOM(spTempLib->get_NumGames(&l));
00094          m_cGames += l;
00095       }
00096
00097       hr = pEnum->Next(1, &clsid, NULL);
00098    }
00099 }

BOOL RegLibrary ( CTSTR & lpszFile )

Definition at line 215 of file LibMgr.cpp.

References ODS.

Referenced by CMainWindow::OnCommand().

00216 {
00217    // Try to load the library DLL file
00218    CLib hDLL(lpszFile);
00219    if(hDLL == NULL)
00220    {
00221       ODS("RegLibrary: LoadLibrary() failed");
00222       return FALSE;
00223    }
00224
00225    // Retrieve the DllRegisterServer entry point function
00226    typedef HRESULT (CALLBACK *HCRET)(void);
00227    HCRET lpfnDllRegisterServer;
00228    lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, TEXT("DllRegisterServer"));
00229    if(NULL == lpfnDllRegisterServer)
00230    {
00231       ODS("RegLibrary: DllRegisterServer() does not exist");
00232       return FALSE;
00233    }
00234
00235    // Register the DLL
00236    if(FAILED((*lpfnDllRegisterServer)()))
00237    {
00238       ODS("RegLibrary: DllRegisterServer() failed");
00239       return FALSE;
00240    }
00241
00242    return TRUE;
00243 }

Member Data Documentation

CPtrArray<ISolpackGameLib*, ISolpackGameLib*> m_apLibs [protected]

Definition at line 49 of file LibMgr.h.

Referenced by CLibMgr(), GetGame(), GetGameInfo(), GetLib(), GetNumGames(), GetNumLibs(), and Refresh().

int m_cGames [protected]

Definition at line 50 of file LibMgr.h.

Referenced by CLibMgr(), GetNumGames(), and Refresh().

The documentation for this class was generated from the following files:
  • LibMgr.h
  • LibMgr.cpp
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CLibMgr Member List

This is the complete list of members for CLibMgr, including all inherited members.
CLibMgr() | CLibMgr |
GetGame(int iLibIndex, int iGameIndex) | CLibMgr |
GetGameInfo(int iLibIndex, int iGameIndex) | CLibMgr |
GetLib(int iLibIndex) | CLibMgr |
GetNumGames(int iLibIndex) | CLibMgr |
GetNumLibs() | CLibMgr |
m_apLibs | CLibMgr | [protected]
m_cGames | CLibMgr | [protected]
Refresh() | CLibMgr |
RegLibrary(CTSTR &lpszFile) | CLibMgr |
~CLibMgr() | CLibMgr | [virtual]
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


CLimitSingleInstance Class Reference

#include <bmws_limitsingleinstance.h>

List of all members.

Public Methods

CLimitSingleInstance ()
BOOL | TestPrevInstance (LPTSTR lpszClass, LPTSTR lpszMessage)

Protected Attributes

DWORD | m_dwLastError
CHandle m_hMutex

Constructor & Destructor Documentation

CLimitSingleInstance ( ) [inline]

Definition at line 31 of file bmws_limitsingleinstance.h.

References m_dwLastError, and m_hMutex.

00031                           : m_hMutex(CreateMutex(NULL, FALSE, BMWS_APPID), CloseHandle)
00032    {
00033       m_dwLastError = GetLastError();
00034    }

Member Function Documentation

BOOL TestPrevInstance | ( | LPTSTR | lpszClass,
 |  | LPTSTR | lpszMessage
 | ) |

Definition at line 35 of file bmws_limitsingleinstance.cpp.

References m_dwLastError.

00036 {
00037    if(m_dwLastError != ERROR_ALREADY_EXISTS)
00038       return FALSE;
00039
00040    if(!lpszClass)
00041       return TRUE;
00042
00043    // Determine if another window with the class name exists
00044    HWND hWndPrev = FindWindow(lpszClass, NULL);
00045    if(hWndPrev)
00046    {
00047       // If so, check for popups.
00048       HWND hWndChild = GetLastActivePopup(hWndPrev);
00049
00050       // If iconic, restore the main window
00051       if(IsIconic(hWndPrev))
00052          ShowWindow(hWndPrev, SW_RESTORE);
00053
00054       if(lpszMessage)
00055       {
00056          static TCHAR buf[1024];
00057          int iLen = max(lstrlen(lpszMessage) * sizeof(TCHAR), 1024);
00058          CopyMemory(buf, lpszMessage, iLen);
00059          COPYDATASTRUCT cds;
00060          cds.dwData = 6007;
00061          cds.cbData = iLen;
00062          cds.lpData = buf;
00063          SendMessage(hWndPrev, WM_COPYDATA, NULL, (LPARAM)&cds);
00064       }
00065       // Bring the main window or its popup to the foreground
00066       SetForegroundWindow(hWndChild);
00067    }
00068
00069    return TRUE;
00070 }

Member Data Documentation

DWORD m_dwLastError [protected]

Definition at line 39 of file bmws_limitsingleinstance.h.

Referenced by CLimitSingleInstance(), and TestPrevInstance().

CHandle m_hMutex [protected]

Definition at line 40 of file bmws_limitsingleinstance.h.

Referenced by CLimitSingleInstance().

The documentation for this class was generated from the following files:
  • bmws_limitsingleinstance.h
  • bmws_limitsingleinstance.cpp
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CLimitSingleInstance Member List

This is the complete list of members for CLimitSingleInstance, including all inherited members.
CLimitSingleInstance() | CLimitSingleInstance | [inline]
m_dwLastError | CLimitSingleInstance | [protected]
m_hMutex | CLimitSingleInstance | [protected]
TestPrevInstance(LPTSTR lpszClass, LPTSTR lpszMessage) | CLimitSingleInstance |
Generated on Wed May 8 12:39:49 2002 for Solitaire Pack by doxygen 1.2.15


CMainWindow Class Reference

#include <MainWindow.h>

Inheritance diagram for CMainWindow:

IEventSinkSite IUpdateDlgSite IUpdateSite IGameMenuSite IEngineSite IUserPrefsSite IStatusBarMgr CHWND List of all members.

Public Methods

CMainWindow (IMsgProcessor *pMsgProcessor)
virtual | ~CMainWindow ()
void | Register ()
BOOL | Create (CSplashWindow *pSplash, int nCmdShow)
BOOL | PreprocessMessage (LPMSG lpMsg)
virtual void | UpdateDone (double dAvailVersion, CBSTR &bstrExtra)
virtual void | GetCheckUpdate (BOOL *pbNewVer, BOOL *pbExtras, CTSTR &lpszNewVerText, CTSTR &lpszExtrasText)
virtual void | SetCheckUpdate (BOOL bNewVer, BOOL bExtras)
HRESULT | EventSink (LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)
void | SetScore (long lScore)
BOOL | GetShowTooltips ()
BOOL | GetAnim ()
void | PlayCPSound (UINT uIndex)
void | PostMsg (UINT uMsg, WPARAM wParam, LPARAM lParam)
void | GameSelected (int iLibIndex, int iGameIndex)
void | ToggleShowRules ()
void | ActiveGameChanged ()
void | OptionStatusBar (BOOL bShow)
void | OptionTooltips (BOOL bShow)
CHTMLHelper * GetHH ()
void | SBSetText (CTSTR &lpszStatus)
void | SBUpdateTasks (int cAdd, int cCompleted)

Static Public Methods

LRESULT CALLBACK | MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Static Public Attributes

BOOL | s_bRegistered = FALSE

Protected Methods

BOOL | OnCreate ()
void | OnSize (int nWidth, int nHeight, int cyHelpPane=-1)
void | OnDestroy ()
LRESULT | OnCommand (WORD wCmd, LPARAM lParam)
void | OnMenuSelect (UINT idCmd, UINT uFlags, HMENU hMenu)
void | RemoveRegMenuItem ()
void | PresentUpdate ()
void | DoHelpPane (BOOL bShow)
void | HTMLComplete ()
void | ShowHideGameMenu (BOOL bShow)
void | ShowHideEngine (BOOL bShow)
void | CheckRecalcNeeded ()
void | UpdateInstr ()

Protected Attributes

IMsgProcessor * m_pMsgProcessor
int | m_nCmdShow
CPointer< CSplashWindow > m_pSplash
CPointer< CHelpPane > m_pHelpPane
CUserPrefs m_userPrefs
CLibMgr m_libMgr
CPointer< CStatusBar > m_pSB
int | m_cTasks
int | m_cTasksDone
CBrowserContainer * m_pBrowserContainer
CWebBrowser2Ptr m_spBrowser
CHTMLHelper * m_pHH
BOOL | m_bNavigated
CEngine * m_pEngine
CGameMenu m_gameMenu
BOOL | m_bPresentUpdate
double | m_dAvailVersion
CBSTR m_bstrExtras
int | m_cyHelpPaneSize
BOOL | m_bPaneSizing
BOOL | m_bSizing
RECT | m_rcSizeBefore
HACCEL | m_hAccelTable
DWORD | m_dwState

Constructor & Destructor Documentation

CMainWindow ( IMsgProcessor * pMsgProcessor )

Definition at line 71 of file MainWindow.cpp.

References _ASSERT, m_bNavigated, m_bPaneSizing, m_bPresentUpdate, m_bSizing, m_cTasks, m_cTasksDone, m_cyHelpPaneSize, m_dAvailVersion, m_dwState, m_pBrowserContainer, m_pEngine, m_pHH, m_pMsgProcessor, m_userPrefs, MW_UNINIT, and CUserPrefs::SetSite().

00072 {
00073    // Set initial values for member variables
00074    _ASSERT(pMsgProcessor);
00075    m_pMsgProcessor = pMsgProcessor;
00076    m_bPresentUpdate = FALSE;
00077    m_dAvailVersion = 0.0;
00078    m_cyHelpPaneSize = 0;
00079    m_bPaneSizing = FALSE;
00080    m_bSizing = FALSE;
00081    m_pBrowserContainer = NULL;
00082    m_pHH = NULL;
00083    m_bNavigated = FALSE;
00084    m_pEngine = NULL;
00085    m_userPrefs.SetSite((IUserPrefsSite*)this);
00086    m_cTasks = 0;
00087    m_cTasksDone = 0;
00088    m_dwState = MW_UNINIT;
00089 }

~CMainWindow ( ) [virtual]

Definition at line 97 of file MainWindow.cpp.

00098 {
00099 }

Member Function Documentation

void ActiveGameChanged ( ) [virtual]

Implements IGameMenuSite.

Definition at line 1113 of file MainWindow.cpp.

References UpdateInstr().

01114 {
01115    if(m_pHelpPane)
01116       UpdateInstr();
01117 }

void CheckRecalcNeeded ( ) [protected]

Definition at line 1459 of file MainWindow.cpp.

References m_pBrowserContainer, m_pEngine, m_rcSizeBefore, and CEngine::RecalcLayout().

Referenced by MainWndProc(), and OnSize().

01460 {
01461    if(m_pBrowserContainer)
01462    {
01463       // Figure out if the size of the browser container actually changed
01464       RECT rc;
01465       m_pBrowserContainer->GetLocation(&rc);
01466       if(((m_rcSizeBefore.right - m_rcSizeBefore.left) != (rc.right - rc.left)) ||
01467          ((m_rcSizeBefore.bottom - m_rcSizeBefore.top) != (rc.bottom - rc.top)))
01468       {
01469          m_pBrowserContainer->GetLocation(&m_rcSizeBefore);
01470          if(m_pEngine)
01471             m_pEngine->RecalcLayout();
01472       }
01473    }
01474 }

BOOL Create | ( | CSplashWindow * | pSplash,
 |  | int | nCmdShow
 | ) |

Definition at line 141 of file MainWindow.cpp.

References CHECKHRCOM, CreateResURL(), CHWND::CreateWindowEx(), ERROR_ERRORINS_INT, g_colorHlink, g_hInstLC, g_szAppTitle, GetHlinkColor(), GetProductKey(), IDR_SOLPACKACCEL, IDS_BMWS_ERROR_ACCEL, IDS_BMWS_REMEDY_RESTART, IDS_MAINHTML, IDS_REG_MAINWNDPLACEMENT, m_dwState, m_hAccelTable, CHWND::m_lpszClassName, m_nCmdShow, m_pSplash, m_spBrowser, m_userPrefs, MW_CREATING, MW_UNINIT, MW_WAITFORHTML, CUserPrefs::ReadRegistry(), RemoveRegMenuItem(), and THROW.

Referenced by CSolpackApp::CreateMainWindow().

00142 {
00143    m_dwState = MW_CREATING;
00144    try
00145    {
00146       m_pSplash = pSplash;
00147       m_nCmdShow = nCmdShow;
00148
00149       // Load the main window's accelerators
00150       m_hAccelTable = LoadAccelerators(g_hInstLC, MAKEINTRESOURCE(IDR_SOLPACKACCEL));
00151       if(!m_hAccelTable)
00152          THROW(new CExcepEx(IDS_BMWS_ERROR_ACCEL, IDS_BMWS_REMEDY_RESTART, IDR_SOLPACKACCEL, 0,
00153             ERROR_ERRORINS_INT), CExcepEx*);
00154
00155       // Read in user preferences
00156       m_userPrefs.ReadRegistry();
00157
00158       // Randomize
00159       FILETIME ft;
00160       GetSystemTimeAsFileTime(&ft);
00161       srand((unsigned int)ft.dwLowDateTime);
00162
00163       // Get the user's IE hyperlink color (for use in hyperlink controls in dialogs)
00164       g_colorHlink = GetHlinkColor();
00165
00166       // Create the main window.
00167       // Note: OnCreate() will be called before this function returns
00168       CreateWindowEx(0, m_lpszClassName, g_szAppTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN |
00169          WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, (LPVOID)this);
00170
00171       // If Solpack has been registered, remove the Register menu item
00172       if(g_lpszUserName)
00173          RemoveRegMenuItem();
00174
00175       // Restore the main window position from the registry setting
00176       CKey hKeyProduct;
00177       if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00178          if(RestoreWindowPlacement(hKeyProduct, IDS_REG_MAINWNDPLACEMENT, m_nCmdShow))
00179             m_nCmdShow = -1;  // -1 means we don't need to call ShowWindow later
00180
00181       // Prepare to navigate the browser to our UI's HTML file
00182       CTSTR lpszHtml = CreateResURL(g_hInstLC, CTSTR(IDS_MAINHTML));
00183
00184       // Remove below line to use the resource instead of the file
00185       //lpszHtml.Assign(TEXT("C:\\Programming\\Microsoft Visual Studio\\MyProjects\\Solitaire Pack\\SolpckLC\\res\\index.html"));
00186
00187       m_dwState = MW_WAITFORHTML;
00188       VARIANT v;
00189       v.vt = VT_I4;
00190       v.lVal = navNoHistory | navNoReadFromCache | navNoWriteToCache;
00191       CHECKHRCOM(m_spBrowser->Navigate(CBSTR(lpszHtml), &v, NULL, NULL, NULL));
00192    }
00193    catch(CExcep *pE)
00194    {
00195       m_dwState = MW_UNINIT;
00196       throw pE;
00197    }
00198
00199    return TRUE;
00200 }

void DoHelpPane ( BOOL bShow ) [protected]

Definition at line 1224 of file MainWindow.cpp.

References ENSUREALLOC, IDM_HELP_GAMEINSTRUCTIONS, IDS_EL_MENUINSTR, IDS_HIDERULES, IDS_SHOWRULES, CUserPrefs::m_bHelpPane, CHWND::m_hWnd, m_pHelpPane, m_pHH, m_userPrefs, OnSize(), CHTMLHelper::SetElText(), SETTING_GENERAL, UpdateInstr(), and CUserPrefs::WriteRegistry().

Referenced by OnCommand(), OnCreate(), and ToggleShowRules().

01225 {
01226    m_userPrefs.m_bHelpPane = bShow;
01227
01228    // Adjust menu item check mark
01229    CheckMenuItem(GetSubMenu(GetMenu(m_hWnd), 2), IDM_HELP_GAMEINSTRUCTIONS, MF_BYCOMMAND |
01230       (bShow ? MF_CHECKED : MF_UNCHECKED));
01231
01232    m_pHelpPane = NULL;
01233    if(m_userPrefs.m_bHelpPane)
01234    {
01235       // Create new help pane object
01236       m_pHelpPane = new CHelpPane();
01237       ENSUREALLOC(m_pHelpPane);
01238       m_pHelpPane->Register();
01239       m_pHelpPane->Create(m_hWnd);
01240
01241       UpdateInstr();
01242    }
01243
01244    if(m_pHH)
01245       m_pHH->SetElText(IDS_EL_MENUINSTR,
01246          CBSTR(m_pHelpPane == NULL ? IDS_SHOWRULES : IDS_HIDERULES));
01247
01248    // Re-layout the main window
01249    RECT rc;
01250    GetClientRect(m_hWnd, &rc);
01251    OnSize(rc.right - rc.left, rc.bottom - rc.top);
01252
01253    m_userPrefs.WriteRegistry(SETTING_GENERAL);
01254 }

HRESULT EventSink | ( | LPARAM | lParam,
 |  | DISPID | dispid,
 |  | DISPPARAMS FAR * | pdispparams
 | ) | [virtual]

Implements IEventSinkSite.

void GameSelected | ( | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [virtual]

Implements IGameMenuSite.

Definition at line 1062 of file MainWindow.cpp.

References CBSTR::Addr(), CHECKHRCOM, g_szAppTitle, CLibMgr::GetGameInfo(), IDS_TITLEBARHOLDER, CBSTR::Len(), CTSTR::Len(), m_dwState, m_libMgr, m_pEngine, MW_GAMEMENU, CEngine::PlayGame(), CHWND::SendMessage(), ShowHideEngine(), and ShowHideGameMenu().

01063 {
01064    if(m_dwState == MW_GAMEMENU)
01065    {
01066       // Switch to the engine
01067       ShowHideGameMenu(FALSE);
01068       ShowHideEngine(TRUE);
01069
01070       // Retrieve the title
01071       CBSTR bstr;
01072       CSolpackGameInfoPtr spInfo(TRUE, m_libMgr.GetGameInfo(iLibIndex, iGameIndex));
01073       CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
01074
01075       // Modify the window's title bar
01076       CTSTR lpszHolder(IDS_TITLEBARHOLDER);
01077       CTSTR lpszTotal(TRUE, lpszHolder.Len() + lstrlen(g_szAppTitle) + bstr.Len());
01078       wsprintf(lpszTotal, lpszHolder, g_szAppTitle, CTSTR(bstr));
01079       SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)lpszTotal);
01080
01081       // Start the game
01082       m_pEngine->PlayGame(iLibIndex, iGameIndex);
01083    }
01084 }

BOOL GetAnim ( ) [virtual]

Implements IEngineSite.

Definition at line 1007 of file MainWindow.cpp.

References CUserPrefs::m_bAnimCards, and m_userPrefs.

01008 {
01009    return m_userPrefs.m_bAnimCards;
01010 }

void GetCheckUpdate | ( | BOOL * | pbNewVer,
 |  | BOOL * | pbExtras,
 |  | CTSTR & | lpszNewVerText,
 |  | CTSTR & | lpszExtrasText
 | ) | [virtual]

Implements IUpdateDlgSite.

Definition at line 878 of file MainWindow.cpp.

References CUserPrefs::m_bCheckExtras, CUserPrefs::m_bCheckVer, and m_userPrefs.

00880 {
00881    *pbNewVer = m_userPrefs.m_bCheckVer;
00882    *pbExtras = m_userPrefs.m_bCheckExtras;
00883
00884    // Text parameters are not modified, so default text is displayed
00885 }

CHTMLHelper * GetHH ( ) [virtual]

Implements IUserPrefsSite.

Definition at line 1318 of file MainWindow.cpp.

References m_pHH.

01319 {
01320    return m_pHH;
01321 }

BOOL GetShowTooltips ( ) [virtual]

Implements IEngineSite.

Definition at line 991 of file MainWindow.cpp.

References CUserPrefs::m_bTooltips, and m_userPrefs.

00992 {
00993    return m_userPrefs.m_bTooltips;
00994 }

void HTMLComplete ( ) [protected]

Definition at line 1334 of file MainWindow.cpp.

References CHECKHRCOM, ENSUREALLOC, IDS_EL_BODY, IDS_EL_MENUINSTR, IDS_HIDERULES, IDS_SHOWRULES, CGameMenu::Init(), CEngine::InitEngine(), m_dwState, m_gameMenu, CHWND::m_hWnd, m_libMgr, m_nCmdShow, m_pEngine, m_pHelpPane, m_pHH, m_pMsgProcessor, m_pSplash, m_spBrowser, m_userPrefs, MW_INITHTML, MW_WAITFORHTML, PresentUpdate(), CLibMgr::Refresh(), CHTMLHelper::SetElText(), ShowHideGameMenu(), CHWND::ShowWindow(), THROW, UA_ALL, and CUserPrefs::UpdateAppearance().

01335 {
01336    if(m_dwState != MW_WAITFORHTML)  // Have we already handled this event?
01337       return;
01338
01339    m_dwState = MW_INITHTML;
01340
01341    // Get the HTML document object from the web browser
01342    CDispatchPtr spDocDisp;
01343    CHECKHRCOM(m_spBrowser->get_Document(&spDocDisp));
01344    if(!spDocDisp)
01345       THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
01346    CPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTMLDoc = spDocDisp;
01347    m_pHH = new CHTMLHelper(spHTMLDoc);
01348    ENSUREALLOC(m_pHH);
01349
01350    // Prevent the HTML from being selected or dragged
01351    m_pHH->ProtectUI(IDS_EL_BODY);
01352
01353    // Initialize the HTML helper for adding document styles
01354    m_pHH->InitAddStyle();
01355
01356    // Apply all appearance settings to the HTML
01357    m_userPrefs.UpdateAppearance(UA_ALL);
01358
01359    // We're all set up now, so destroy the splash screen
01360    if(m_pSplash)
01361    {
01362       DestroyWindow(*m_pSplash);
01363       m_pSplash = NULL;
01364    }
01365
01366    // Show the main window
01367    if(m_nCmdShow >= 0)
01368    {
01369       ShowWindow(m_nCmdShow);
01370       UpdateWindow(m_hWnd);
01371    }
01372
01373    // If we already know there's new stuff available, present it to the user
01374    if(m_bPresentUpdate)
01375       PresentUpdate();
01376
01377    // Enumerate the registered game libraries
01378    m_libMgr.Refresh();
01379
01380    // Create and initialize the engine
01381    m_pEngine = new CEngine();
01382    ENSUREALLOC(m_pEngine);
01383    m_pEngine->AddRef();
01384    m_pEngine->InitEngine(m_pMsgProcessor, (IEngineSite*)this, (IStatusBarMgr*)this, &m_libMgr,
01385       m_pHH);
01386
01387    m_pHH->SetElText(IDS_EL_MENUINSTR,
01388       CBSTR(m_pHelpPane == NULL ? IDS_SHOWRULES : IDS_HIDERULES));
01389
01390    // Initialize the game menu and then show it
01391    m_gameMenu.Init(m_pMsgProcessor, (IGameMenuSite*)this, (IStatusBarMgr*)this, &m_libMgr,
01392       m_pHH);
01393    ShowHideGameMenu(TRUE);
01394 }

LRESULT CALLBACK MainWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 265 of file MainWindow.cpp.

References CEngine::CancelMouseEvent(), CUndoMgr::CanRedo(), CUndoMgr::CanUndo(), CheckRecalcNeeded(), CY_BROWSER_MIN, CY_HELPPANE_MIN, g_bExited, CEngine::GetUndoMgr(), IDM_GAME_REDO, IDM_GAME_UNDO, m_bPaneSizing, m_bSizing, CUserPrefs::m_cyHelpPane, m_cyHelpPaneSize, CHWND::m_hWnd, m_pBrowserContainer, m_pEngine, m_pHelpPane, m_pSB, m_rcSizeBefore, m_userPrefs, OnCommand(), OnCreate(), OnDestroy(), OnMenuSelect(), OnSize(), CEngine::TryCommand(), WM_PANESIZE_END, WM_PANESIZE_MOVE, and WM_PANESIZE_START.

Referenced by Register().

00266 {
00267    // Retrieve "this" pointer from window handle
00268    CMainWindow *pThis = (CMainWindow*)GetWindowLong(hWnd, GWL_USERDATA);
00269
00270    try   // Windows-called code
00271    {
00272       switch(uMsg)
00273       {
00274          // Called before the window is created.
00275          case WM_NCCREATE:
00276             // Store the "this" pointer with the window handle
00277             pThis = (CMainWindow*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
00278             SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00279             pThis->m_hWnd = hWnd;
00280             return TRUE;
00281
00282          // Called when the window is created
00283          case WM_CREATE:
00284             return (pThis->OnCreate() ? 0 : -1);
00285
00286          // Called when the user is sizing the window
00287          case WM_SIZE:
00288             if(wParam != SIZE_MINIMIZED)
00289                pThis->OnSize(LOWORD(lParam), HIWORD(lParam));
00290             return 0;
00291
00292          // Called before the window is destroyed
00293          case WM_DESTROY:
00294             pThis->OnDestroy();
00295             return 0;
00296
00297          // Called when system color settings have changed
00298          case WM_SYSCOLORCHANGE:
00299             if(pThis->m_pHelpPane)
00300                pThis->m_pHelpPane->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00301             if(pThis->m_pSB)
00302                pThis->m_pSB->SendMessage(WM_SYSCOLORCHANGE, wParam, lParam);
00303             break;
00304
00305          // Called when some system metric changed
00306          case WM_SETTINGCHANGE:
00307             if(pThis->m_pHelpPane)
00308                pThis->m_pHelpPane->UpdateFont();
00309             break;
00310
00311          // Called when the Close box is clicked
00312          case WM_CLOSE:
00313             g_bExited = TRUE;
00314             if(pThis->m_pEngine)
00315                pThis->m_pEngine->TryCommand((UINT)-1, 0, 0);
00316             PostMessage(hWnd, WM_USER, 0, 0);
00317             return 0;
00318
00319          // Called when a menu item is clicked
00320          case WM_COMMAND:
00321             if(pThis->OnCommand(LOWORD(wParam), lParam) == 0)
00322                return 0;
00323             break;
00324
00325          // Called before displaying popup menus
00326          case WM_INITMENU:
00327             if(pThis->m_pEngine)
00328             {
00329                HMENU hMenuGame = GetSubMenu((HMENU)wParam, 0);
00330                CUndoMgr *pUndoMgr = pThis->m_pEngine->GetUndoMgr();
00331                EnableMenuItem(hMenuGame, IDM_GAME_UNDO, MF_BYCOMMAND | (pUndoMgr->CanUndo() ?
00332                   MF_ENABLED : MF_GRAYED));
00333                EnableMenuItem(hMenuGame, IDM_GAME_REDO, MF_BYCOMMAND | (pUndoMgr->CanRedo() ?
00334                   MF_ENABLED : MF_GRAYED));
00335             }
00336             return 0;
00337
00338          // Called when the mouse moves over a menu item
00339          case WM_MENUSELECT:
00340             pThis->OnMenuSelect((UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (HMENU)lParam);
00341             return 0;
00342
00343          // Called when the user begins sizing or moving the window
00344          case WM_ENTERSIZEMOVE:
00345             if(pThis->m_pBrowserContainer)
00346                pThis->m_pBrowserContainer->GetLocation(&pThis->m_rcSizeBefore);
00347             pThis->m_bSizing = TRUE;
00348             return 0;
00349
00350          // Called when the user finishes sizing or moving the window
00351          case WM_EXITSIZEMOVE:
00352             pThis->m_bSizing = FALSE;
00353             pThis->CheckRecalcNeeded();
00354             return 0;
00355
00356          // Called when the application loses focus
00357          case WM_ACTIVATE:
00358             if((LOWORD(wParam) == WA_INACTIVE) && (pThis->m_pEngine != NULL))
00359                pThis->m_pEngine->CancelMouseEvent();
00360             return 0;
00361
00362          // Custom message; called when the user starts resizing the help pane
00363          case WM_PANESIZE_START:
00364             pThis->m_cyHelpPaneSize = pThis->m_userPrefs.m_cyHelpPane;
00365             pThis->m_bPaneSizing = TRUE;
00366             break;
00367
00368          // Custom message; called while the user resizes the help pane
00369          case WM_PANESIZE_MOVE:
00370          {
00371             RECT rc;
00372             GetClientRect(hWnd, &rc);
00373             pThis->m_cyHelpPaneSize -= (int)wParam;
00374             if(pThis->m_cyHelpPaneSize < CY_HELPPANE_MIN)   // Don't size too small
00375                pThis->m_cyHelpPaneSize = CY_HELPPANE_MIN;   // or too large
00376             else if(rc.bottom - rc.top - pThis->m_cyHelpPaneSize < CY_BROWSER_MIN)
00377                pThis->m_cyHelpPaneSize = rc.bottom - rc.top - CY_BROWSER_MIN;
00378             pThis->OnSize(rc.right - rc.left, rc.bottom - rc.top, pThis->m_cyHelpPaneSize);
00379          } break;
00380
00381          // Custom message; called when the user finishes resizing the help pane
00382          case WM_PANESIZE_END:
00383             pThis->m_userPrefs.m_cyHelpPane = pThis->m_cyHelpPaneSize;
00384             pThis->m_bPaneSizing = FALSE;
00385             pThis->CheckRecalcNeeded();
00386             break;
00387       }
00388    }
00389    catch(CExcep *pE)
00390    {
00391       pE->Report();
00392       pE->Delete();
00393    }
00394
00395    // Let Windows process the message
00396    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00397 }

LRESULT OnCommand | ( | WORD | wCmd,
 |  | LPARAM | lParam
 | ) | [protected]

Definition at line 573 of file MainWindow.cpp.

References DoHelpPane(), CUserPrefs::DoOptions(), g_bExited, g_colorHlink, g_szAppTitle, GetProductKey(), GetRegisteredName(), IDC_ABOUT_REGISTER, IDM_GAME_AUTOPLAY, IDM_GAME_DEAL, IDM_GAME_EXIT, IDM_GAME_GAMESMENU, IDM_GAME_REDO, IDM_GAME_UNDO, IDM_HELP_ABOUT, IDM_HELP_CONTENTSANDINDEX, IDM_HELP_GAMEINSTRUCTIONS, IDM_HELP_REGISTER, IDM_OPTIONS_ADDGAMELIBRARY, IDM_OPTIONS_PROGRAMOPTIONS, IDS_ADDGAMELIBTITLE, IDS_DEFEXT, IDS_FILTER, IDS_REGISTEREDGREETING, IDS_REGISTERURL, CTSTR::Len(), CUserPrefs::m_bHelpPane, m_dwState, m_gameMenu, CHWND::m_hWnd, m_libMgr, m_pEngine, m_pMsgProcessor, m_userPrefs, MW_ENGINE, CGameMenu::Refresh(), CLibMgr::Refresh(), CLibMgr::RegLibrary(), RemoveRegMenuItem(), CDlg::Run(), CHWND::SendMessage(), ShowHideEngine(), ShowHideGameMenu(), ShowRegistrationDialog(), SingleOFN(), SOLPACK_HASHVALUE, CEngine::StopPlayGame(), and CEngine::TryCommand().

Referenced by MainWndProc().

00574 {
00575    switch(wCmd)
00576    {
00577       //----------------------------------------------------------------------
00578       //
00579       // IDM_GAME_DEAL command
00580       //    Deals a new game.
00581       //
00582       // IDM_GAME_AUTOPLAY command
00583       //    Plays all possible cards to the foundation(s).
00584       //
00585       // IDM_GAME_UNDO command
00586       //    Undoes the previous move.
00587       //
00588       // IDM_GAME_REDO command
00589       //    Redoes the previously undone move.
00590       //
00591       //----------------------------------------------------------------------
00592       case IDM_GAME_DEAL:
00593       case IDM_GAME_AUTOPLAY:
00594       case IDM_GAME_UNDO:
00595       case IDM_GAME_REDO:
00596          if(m_dwState == MW_ENGINE)
00597             m_pEngine->TryCommand(WM_COMMAND, MAKELONG(wCmd, 0), lParam);
00598          break;
00599
00600       //----------------------------------------------------------------------
00601       //
00602       // IDM_GAME_GAMESMENU command
00603       //    Ends the current game and displays the games menu.
00604       //
00605       //----------------------------------------------------------------------
00606       case IDM_GAME_GAMESMENU:
00607          if(m_dwState == MW_ENGINE)
00608          {
00609             // Engine must be idle before we can continue
00610             if(m_pEngine->TryCommand(WM_COMMAND, MAKELONG(wCmd, 0), lParam))
00611             {
00612                m_pEngine->StopPlayGame();
00613                ShowHideEngine(FALSE);
00614                ShowHideGameMenu(TRUE);
00615                SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)g_szAppTitle);
00616             }
00617          }
00618          break;
00619
00620       //----------------------------------------------------------------------
00621       //
00622       // IDM_GAME_EXIT command
00623       //    Quits Solitaire Pack.
00624       //
00625       //----------------------------------------------------------------------
00626       case IDM_GAME_EXIT:
00627          if(m_pEngine)
00628             m_pEngine->TryCommand((UINT)-1, 0, 0);
00629          g_bExited = TRUE;
00630          break;
00631
00632       //----------------------------------------------------------------------
00633       //
00634       // IDM_OPTIONS_PROGRAMOPTIONS command
00635       //    Changes options.
00636       //
00637       //----------------------------------------------------------------------
00638       case IDM_OPTIONS_PROGRAMOPTIONS:
00639          m_userPrefs.DoOptions(m_hWnd);
00640          break;
00641
00642       //----------------------------------------------------------------------
00643       //
00644       // IDM_OPTIONS_ADDGAMELIBRARY command
00645       //    Registers a game library and adds its games to the menu.
00646       //
00647       //----------------------------------------------------------------------
00648       case IDM_OPTIONS_ADDGAMELIBRARY:
00649       {
00650          // Present the File Open dialog box
00651          CTSTR lpszTheFile;
00652          if(SingleOFN(lpszTheFile, IDS_FILTER, NULL, m_hWnd, OFN_FILEMUSTEXIST |
00653             OFN_HIDEREADONLY, CTSTR(IDS_ADDGAMELIBTITLE), CTSTR(), IDS_DEFEXT) == 1)
00654          {
00655             // We have a file, so try to register it
00656             CWaitCursor wait;
00657             if(m_libMgr.RegLibrary(lpszTheFile))
00658             {
00659                m_libMgr.Refresh();
00660                m_gameMenu.Refresh(m_pMsgProcessor);
00661             }
00662          }
00663       } break;
00664
00665       //----------------------------------------------------------------------
00666       //
00667       // IDM_HELP_CONTENTSANDINDEX command
00668       //    Opens Help.
00669       //
00670       //----------------------------------------------------------------------
00671       case IDM_HELP_CONTENTSANDINDEX:
00672 //       g_pHelp->ShowHelp(m_hWnd);
00673          break;
00674
00675       //----------------------------------------------------------------------
00676       //
00677       // IDM_HELP_GAMEINSTRUCTIONS command
00678       //    Displays instructions on how to play the current game.
00679       //
00680       //----------------------------------------------------------------------
00681       case IDM_HELP_GAMEINSTRUCTIONS:
00682          DoHelpPane(!m_userPrefs.m_bHelpPane);
00683          break;
00684
00685       //----------------------------------------------------------------------
00686       //
00687       // IDM_HELP_ABOUT command
00688       //    Displays the About box.
00689       //
00690       //----------------------------------------------------------------------
00691       case IDM_HELP_ABOUT:
00692       {
00693          CAboutDlg a;
00694          if(a.Run(m_hWnd) != IDC_ABOUT_REGISTER)
00695             break;   // Break if OK button was clicked
00696       } // continue on if Register button was clicked
00697
00698       //----------------------------------------------------------------------
00699       //
00700       // IDM_HELP_REGISTER command
00701       //    Displays the Registration dialog box.
00702       //
00703       //----------------------------------------------------------------------
00704       case IDM_HELP_REGISTER:
00705       {
00706          // Display the Registration dialog box
00707          CKey hKeyProduct;
00708          GetProductKey(hKeyProduct, FALSE);
00709          CTSTR lpszApp(IDS_APP_TITLE);
00710          if(ShowRegistrationDialog(m_hWnd, hKeyProduct, lpszApp, CTSTR(IDS_REGISTERURL),
00711             g_colorHlink, SOLPACK_HASHVALUE))
00712          {
00713             // The user registered successfully
00714             g_lpszUserName = GetRegisteredName(hKeyProduct, lpszApp, SOLPACK_HASHVALUE);
00715             CTSTR lpszGreetingHolder(IDS_REGISTEREDGREETING);
00716             CTSTR lpszGreeting(TRUE, g_lpszUserName.Len() + lpszGreetingHolder.Len() + 1);
00717             wsprintf(lpszGreeting, lpszGreetingHolder, g_lpszUserName);
00718             MessageBox(m_hWnd, lpszGreeting, g_szAppTitle, MB_OK);
00719             RemoveRegMenuItem();
00720          }
00721          break;
00722       }
00723
00724       default:
00725          return 1;   // Unhandled command
00726    }
00727    return 0;
00728 }

BOOL OnCreate ( ) [protected]

Definition at line 411 of file MainWindow.cpp.

References CheckForUpdate(), DoHelpPane(), ENSUREALLOC, g_hInstLC, g_hWnd, g_szAppTitle, IDR_MAINMENU, IDS_BMWS_ERROR_COMMCTRL, IDS_BMWS_REMEDY_RESTART, IDS_UPDATEXML, CBrowserContainer::Init(), CUserPrefs::m_bCheckExtras, CUserPrefs::m_bCheckVer, CUserPrefs::m_bHelpPane, CUserPrefs::m_bStatusBar, CHWND::m_hWnd, m_pBrowserContainer, m_spBrowser, m_userPrefs, OptionStatusBar(), CHWND::SendMessage(), and THROW.

Referenced by MainWndProc().

00412 {
00413    g_hWnd = m_hWnd;  // Set the global main window handle
00414
00415    // Load the menu for this window
00416    SetMenu(m_hWnd, LoadMenu(g_hInstLC, MAKEINTRESOURCE(IDR_MAINMENU)));
00417
00418    try
00419    {
00420       // Initialize the common controls
00421       INITCOMMONCONTROLSEX icex;
00422       icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00423       icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES | ICC_PROGRESS_CLASS;
00424       if(!InitCommonControlsEx(&icex))
00425          THROW(new CExcepEx(IDS_BMWS_ERROR_COMMCTRL, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00426
00427       // Create and show help pane, if supposed to
00428       if(m_userPrefs.m_bHelpPane)
00429          DoHelpPane(TRUE);
00430
00431       // Create and show status bar, if supposed to
00432       if(m_userPrefs.m_bStatusBar)
00433          OptionStatusBar(TRUE);
00434
00435       // Create and initialize the web browser container
00436       m_pBrowserContainer = new CBrowserContainer(FALSE);
00437       ENSUREALLOC(m_pBrowserContainer);
00438       m_pBrowserContainer->AddRef();
00439       m_pBrowserContainer->Init(m_hWnd, &m_spBrowser, (IEventSinkSite*)this, 0);
00440       m_spBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
00441    }
00442    catch(CExcep *pE)
00443    {
00444       pE->Report();
00445       pE->Delete();
00446       return FALSE;
00447    }
00448
00449    // Set title of window
00450    SendMessage(WM_SETTEXT, 0, (LPARAM)(LPTSTR)g_szAppTitle);
00451
00452    // If the user's online, check for updated versions of Solpack
00453    CheckForUpdate(IDS_UPDATEXML, (IUpdateSite*)this, m_userPrefs.m_bCheckVer,
00454       m_userPrefs.m_bCheckExtras);
00455
00456    return TRUE;
00457 }

void OnDestroy ( ) [protected]

Definition at line 518 of file MainWindow.cpp.

References CleanupCheckForUpdate(), GetProductKey(), IDS_REG_MAINWNDPLACEMENT, m_dwState, m_gameMenu, m_pBrowserContainer, m_pEngine, m_pHelpPane, m_pHH, m_spBrowser, m_userPrefs, MW_INITHTML, CPtr< IWebBrowser2,&IID_IWebBrowser2 >::Release(), SAFEDELETE, SAFERELEASE, SETTING_ALL, CBrowserContainer::Uninit(), CGameMenu::Uninit(), CEngine::Uninit(), and CUserPrefs::WriteRegistry().

Referenced by MainWndProc().

00519 {
00520    // Release the engine object
00521    if(m_pEngine)
00522       m_pEngine->Uninit();
00523    SAFERELEASE(m_pEngine);
00524
00525    // Release the game menu
00526    if(m_dwState >= MW_INITHTML)
00527       m_gameMenu.Uninit();
00528
00529    CleanupCheckForUpdate();
00530
00531    // Store settings
00532    m_userPrefs.WriteRegistry(SETTING_ALL);
00533
00534    m_pHelpPane = NULL;
00535
00536    // Delete the HTML helper object
00537    SAFEDELETE(m_pHH);
00538
00539    // Uninitialize and free the browser container
00540    m_spBrowser.Release();
00541    if(m_pBrowserContainer)
00542    {
00543       m_pBrowserContainer->Uninit();
00544       m_pBrowserContainer->Release();
00545       m_pBrowserContainer = NULL;
00546    }
00547
00548    // Save window placement in registry
00549    CKey hKeyProduct;
00550    if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00551       SaveWindowPlacement(hKeyProduct, IDS_REG_MAINWNDPLACEMENT);
00552
00553    // Tell Windows we're ready to quit
00554    PostQuitMessage(0);
00555 }

void OnMenuSelect | ( | UINT | idCmd,
 |  | UINT | uFlags,
 |  | HMENU | hMenu
 | ) | [protected]

Definition at line 746 of file MainWindow.cpp.

References IDM_GAME_EXIT, IDS_SC_MAXIMIZE, IDS_SC_MINIMIZE, IDS_SC_MOVE, IDS_SC_RESTORE, IDS_SC_SIZE, IDS_SC_TASKLIST, IDS_SYSMENU, and m_pSB.

Referenced by MainWndProc().

00747 {
00748    if(!m_pSB)
00749       return;
00750
00751    if(!hMenu && (LOWORD(uFlags) == 0xffff))
00752    {
00753       // Menu is being closed;
00754       m_pSB->CancelHelpText();
00755       return;
00756    }
00757
00758    // Set uHelp to be the string resource identifier of the help string for the
00759    // given menu item or popup
00760    UINT uHelp;
00761
00762    if(uFlags & MF_SEPARATOR)
00763    {
00764       // Over a separator; use blank text
00765       uHelp = (UINT)-1;
00766    } else if(uFlags & (MF_SYSMENU))
00767    {
00768       // Somewhere in the system menu
00769       if(uFlags & MF_POPUP)
00770       {
00771          // The system menu itself
00772          uHelp = IDS_SYSMENU;
00773       } else
00774       {
00775          // Find out which system menu item is being used
00776          switch(idCmd)
00777          {
00778             case SC_SIZE:
00779                uHelp = IDS_SC_SIZE;
00780                break;
00781             case SC_MOVE:
00782                uHelp = IDS_SC_MOVE;
00783                break;
00784             case SC_MINIMIZE:
00785                uHelp = IDS_SC_MINIMIZE;
00786                break;
00787             case SC_MAXIMIZE:
00788                uHelp = IDS_SC_MAXIMIZE;
00789                break;
00790             case SC_CLOSE:
00791                uHelp = 10000 + IDM_GAME_EXIT;
00792                break;
00793             case SC_RESTORE:
00794                uHelp = IDS_SC_RESTORE;
00795                break;
00796             case SC_TASKLIST:
00797                uHelp = IDS_SC_TASKLIST;
00798                break;
00799          }
00800       }
00801    } else if(uFlags & MF_POPUP)
00802    {
00803       // Some popup menu
00804       uHelp = 12000 - idCmd;
00805    } else
00806       // A menu item
00807       uHelp = 10000 + idCmd;
00808
00809    m_pSB->SetHelpText(uHelp);
00810 }

void OnSize | ( | int | nWidth,
 |  | int | nHeight,
 |  | int | cyHelpPane = -1
 | ) | [protected]

Definition at line 476 of file MainWindow.cpp.

References CheckRecalcNeeded(), m_bPaneSizing, m_bSizing, CUserPrefs::m_cyHelpPane, m_pBrowserContainer, m_pHelpPane, m_pSB, m_userPrefs, and CBrowserContainer::SetLocation().

Referenced by DoHelpPane(), MainWndProc(), OptionStatusBar(), and PreprocessMessage().

00477 {
00478    // Calculate height that status bar occupies (zero if its not showing); position status bar
00479    int cyStatusBar = 0;
00480    if(m_pSB)
00481    {
00482       RECT rc;
00483       GetClientRect(*m_pSB, &rc);
00484       cyStatusBar = rc.bottom - rc.top;
00485       MoveWindow(*m_pSB, 0, nHeight - cyStatusBar, nWidth, cyStatusBar, TRUE);
00486    }
00487
00488    // Position help pane
00489    if(m_pHelpPane)
00490    {
00491       if(cyHelpPane == -1)
00492          cyHelpPane = m_userPrefs.m_cyHelpPane;
00493       MoveWindow(*m_pHelpPane, 0, nHeight - cyHelpPane - cyStatusBar, nWidth, cyHelpPane, TRUE);
00494    } else
00495       cyHelpPane = 0;
00496
00497    // Position the browser container
00498    if(m_pBrowserContainer)
00499       m_pBrowserContainer->SetLocation(0, 0, nWidth, nHeight - cyHelpPane - cyStatusBar);
00500
00501    // See if we need to call the current game's RecalcLayout
00502    if(!m_bSizing && !m_bPaneSizing)
00503       CheckRecalcNeeded();
00504 }

void OptionStatusBar ( BOOL bShow ) [virtual]

Implements IUserPrefsSite.

Definition at line 1268 of file MainWindow.cpp.

References ENSUREALLOC, CUserPrefs::m_bStatusBar, CHWND::m_hWnd, m_pSB, m_userPrefs, and OnSize().

Referenced by OnCreate().

01269 {
01270    m_userPrefs.m_bStatusBar = bShow;
01271
01272    m_pSB = NULL;
01273    if(bShow)
01274    {
01275       // Create the status bar object
01276       m_pSB = new CStatusBar();
01277       ENSUREALLOC(m_pSB);
01278       m_pSB->Create(m_hWnd);
01279    }
01280
01281    // Re-layout the main window
01282    RECT rc;
01283    GetClientRect(m_hWnd, &rc);
01284    OnSize(rc.right - rc.left, rc.bottom - rc.top);
01285 }

void OptionTooltips ( BOOL bShow ) [virtual]

Implements IUserPrefsSite.

Definition at line 1299 of file MainWindow.cpp.

References CUserPrefs::m_bTooltips, m_pEngine, m_userPrefs, and CEngine::UpdateTooltips().

01300 {
01301    m_userPrefs.m_bTooltips = bShow;
01302
01303    // Toggle tooltips
01304    m_pEngine->UpdateTooltips();
01305 }

void PlayCPSound ( UINT uIndex ) [virtual]

Implements IEngineSite.

Definition at line 1024 of file MainWindow.cpp.

References CUserPrefs::m_pCPSounds, m_userPrefs, and CCPSounds::Play().

01025 {
01026    m_userPrefs.m_pCPSounds->Play(uIndex);
01027 }

void PostMsg | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEngineSite.

Definition at line 1043 of file MainWindow.cpp.

References CHWND::m_hWnd.

01044 {
01045    PostMessage(m_hWnd, uMsg, wParam, lParam);
01046 }

BOOL PreprocessMessage ( LPMSG lpMsg )

Definition at line 215 of file MainWindow.cpp.

References m_bPaneSizing, m_hAccelTable, CHWND::m_hWnd, m_pBrowserContainer, m_pHelpPane, OnSize(), CBrowserContainer::SetFocus(), and CBrowserContainer::TranslateKey().

Referenced by CSolpackApp::ProcessMessage().

00216 {
00217    // Handle keyboard accelerators
00218    if(TranslateAccelerator(m_hWnd, m_hAccelTable, lpMsg))
00219       return TRUE;
00220
00221    // Only interested in keyboard messages
00222    if((lpMsg->message >= WM_KEYFIRST) && (lpMsg->message <= WM_KEYLAST))
00223    {
00224       // If the help pane is being resized and user presses Escape, then cancel the size.
00225       if((lpMsg->wParam == VK_ESCAPE) && m_bPaneSizing)
00226       {
00227          RECT rc;
00228          GetClientRect(m_hWnd, &rc);
00229          OnSize(rc.right - rc.left, rc.bottom - rc.top);
00230          m_bPaneSizing = FALSE;
00231          m_pHelpPane->CancelResize();
00232          return TRUE;
00233       }
00234
00235       // Let the browser container handle the keyboard message.
00236       if(m_pBrowserContainer)
00237       {
00238          if(lpMsg->wParam == VK_TAB)
00239             m_pBrowserContainer->SetFocus();
00240          return (m_pBrowserContainer->TranslateKey(lpMsg) == S_OK);
00241       }
00242    }
00243
00244    // We didn't handle the message
00245    return FALSE;
00246 }

void PresentUpdate ( ) [protected]

Definition at line 1186 of file MainWindow.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), FormatDouble(), g_colorHlink, IDS_NEWVERHOLDER, IDS_SITEURL, m_bPresentUpdate, m_bstrExtras, m_dAvailVersion, CHWND::m_hWnd, and CDlg::Run().

Referenced by HTMLComplete(), and UpdateDone().

01187 {
01188    // Determine what is available and make the text to display it.
01189    m_bPresentUpdate = FALSE;
01190    CTSTR lpszVer;
01191    CTSTR lpszExtra;
01192    CTSTR lpszTotal;
01193    if(m_dAvailVersion > BMWS_APP_VER)
01194    {
01195       lpszVer.Alloc(128);
01196       wsprintf(lpszVer, CTSTR(IDS_NEWVERHOLDER), FormatDouble(m_dAvailVersion));
01197    }
01198    if(m_bstrExtras)
01199       lpszExtra = (BSTR)m_bstrExtras;
01200    if((m_dAvailVersion > BMWS_APP_VER) && m_bstrExtras)
01201    {
01202       lpszTotal.Alloc(lstrlen(lpszVer) + lstrlen(lpszExtra) + 8);
01203       wsprintf(lpszTotal, TEXT("%s\r\n\r\n%s"), lpszVer, lpszExtra);
01204    } else
01205       lpszTotal.Assign((m_dAvailVersion > BMWS_APP_VER) ? lpszVer : lpszExtra);
01206
01207    // Create the standard update dialog box
01208    CUpdateDlg dlg((IUpdateDlgSite*)this, IDS_SITEURL, lpszTotal, g_colorHlink);
01209    dlg.Run(m_hWnd);
01210 }

void Register ( )

Reimplemented from CHWND.

Definition at line 114 of file MainWindow.cpp.

References CTSTR::Assign(), IDI_SOLPACK, IDS_CLASSNAME, CHWND::m_lpszClassName, MainWndProc(), CHWND::RegisterWindowClass(), and s_bRegistered.

Referenced by CSolpackApp::CreateMainWindow().

00115 {
00116    // Load the class name; register the class, if not already registered.
00117    m_lpszClassName.Assign(IDS_CLASSNAME);
00118
00119    if(s_bRegistered)
00120       return;
00121
00122    RegisterWindowClass(m_lpszClassName, 0, (WNDPROC)MainWndProc, MAKEINTRESOURCE(IDI_SOLPACK),
00123       (HBRUSH)(COLOR_3DFACE+1), NULL);
00124    s_bRegistered = TRUE;
00125 }

void RemoveRegMenuItem ( ) [protected]

Definition at line 823 of file MainWindow.cpp.

References IDM_HELP_REGISTER, and CHWND::m_hWnd.

Referenced by Create(), and OnCommand().

00824 {
00825    HMENU hMenu = GetSubMenu(GetMenu(m_hWnd), 2);
00826    RemoveMenu(hMenu, 2, MF_BYPOSITION);
00827    RemoveMenu(hMenu, IDM_HELP_REGISTER, MF_BYCOMMAND);
00828    DrawMenuBar(m_hWnd);
00829 }

void SBSetText ( CTSTR & lpszStatus ) [virtual]

Implements IStatusBarMgr.

Definition at line 1133 of file MainWindow.cpp.

References m_pSB.

01134 {
01135    if(m_pSB)
01136       m_pSB->SetStatusText(lpszStatus);
01137 }

void SBUpdateTasks | ( | int | cAdd,
 |  | int | cCompleted
 | ) | [virtual]

Implements IStatusBarMgr.

Definition at line 1153 of file MainWindow.cpp.

References _ASSERT, m_cTasks, m_cTasksDone, and m_pSB.

01154 {
01155    // Update internal counter
01156    m_cTasks += cAdd;
01157    m_cTasksDone += cCompleted;
01158
01159    if(m_cTasks == m_cTasksDone)
01160    {
01161       // We've completed all pending tasks, so reset progress bar
01162       m_cTasks = 0;
01163       m_cTasksDone = 0;
01164       if(m_pSB)
01165          m_pSB->SetProgress(0);
01166    } else
01167    {
01168       // Update progress bar with progress so far
01169       _ASSERT(m_cTasks != 0);
01170       if(m_pSB)
01171          m_pSB->SetProgress((32768 / m_cTasks) * (m_cTasksDone + 1));
01172    }
01173 }

void SetCheckUpdate | ( | BOOL | bNewVer,
 |  | BOOL | bExtras
 | ) | [virtual]

Implements IUpdateDlgSite.

Definition at line 901 of file MainWindow.cpp.

References CUserPrefs::m_bCheckExtras, CUserPrefs::m_bCheckVer, m_userPrefs, SETTING_NOTIFY, and CUserPrefs::WriteRegistry().

00902 {
00903    // Store new settings
00904    m_userPrefs.m_bCheckVer = bNewVer;
00905    m_userPrefs.m_bCheckExtras = bExtras;
00906    m_userPrefs.WriteRegistry(SETTING_NOTIFY);
00907 }

void SetScore ( long lScore ) [virtual]

Implements IEngineSite.

Definition at line 975 of file MainWindow.cpp.

References m_pSB.

00976 {
00977    m_pSB->SetScore(lScore);
00978 }

void ShowHideEngine ( BOOL bShow ) [protected]

Definition at line 1428 of file MainWindow.cpp.

References IDM_GAME_AUTOPLAY, IDM_GAME_DEAL, IDM_GAME_GAMESMENU, m_dwState, CHWND::m_hWnd, m_pSB, and MW_ENGINE.

Referenced by GameSelected(), and OnCommand().

01429 {
01430    // Get the Game submenu (of the main window menu)
01431    HMENU hGameMenu = GetSubMenu(GetMenu(m_hWnd), 0);
01432
01433    // Enable or disable flags
01434    UINT uEnable = MF_BYCOMMAND | (bShow ? MF_ENABLED : MF_GRAYED);
01435
01436    // Enable or disable menu items
01437    EnableMenuItem(hGameMenu, IDM_GAME_DEAL, uEnable);
01438    EnableMenuItem(hGameMenu, IDM_GAME_AUTOPLAY, uEnable);
01439    EnableMenuItem(hGameMenu, IDM_GAME_GAMESMENU, uEnable);
01440
01441    if(bShow)
01442       m_dwState = MW_ENGINE;
01443    else
01444       m_pSB->SetStatusText(CTSTR());
01445 }

void ShowHideGameMenu ( BOOL bShow ) [protected]

Definition at line 1409 of file MainWindow.cpp.

References m_dwState, m_gameMenu, MW_GAMEMENU, and CGameMenu::Show().

Referenced by GameSelected(), HTMLComplete(), and OnCommand().

01410 {
01411    m_gameMenu.Show(bShow);
01412    if(bShow)
01413       m_dwState = MW_GAMEMENU;
01414 }

void ToggleShowRules ( ) [virtual]

Implements IGameMenuSite.

Definition at line 1097 of file MainWindow.cpp.

References DoHelpPane(), and m_pHelpPane.

01098 {
01099    DoHelpPane(m_pHelpPane == NULL);
01100 }

void UpdateDone | ( | double | dAvailVersion,
 |  | CBSTR & | bstrExtra
 | ) | [virtual]

Implements IUpdateSite.

Definition at line 847 of file MainWindow.cpp.

References m_bPresentUpdate, m_bstrExtras, m_dAvailVersion, and PresentUpdate().

00848 {
00849    // Did we actually find something?
00850    if(dAvailVersion > BMWS_APP_VER || bstrExtra)
00851    {
00852       m_dAvailVersion = dAvailVersion;
00853       m_bstrExtras = bstrExtra;
00854       if(m_pHH)
00855       {
00856          PresentUpdate();         // Present update now
00857       } else
00858          m_bPresentUpdate = TRUE; // Wait for main window to be ready before presenting update
00859    }
00860 }

void UpdateInstr ( ) [protected]

Definition at line 1488 of file MainWindow.cpp.

References CBSTR::Addr(), CHECKHRCOM, CGameMenu::GetActiveGame(), CGameMenu::GetActiveLib(), CLibMgr::GetGameInfo(), CLibMgr::GetNumGames(), m_gameMenu, m_libMgr, and m_pHelpPane.

Referenced by ActiveGameChanged(), and DoHelpPane().

01489 {
01490    // If we have no games, there are no instructions to show
01491    if(m_libMgr.GetNumGames(-1) < 1)
01492       return;
01493
01494    // Retrieve the game information object
01495    CBSTR bstr;
01496    CSolpackGameInfoPtr spInfo(TRUE, m_libMgr.GetGameInfo(m_gameMenu.GetActiveLib(),
01497       m_gameMenu.GetActiveGame()));
01498
01499    // Store the title and rules strings
01500    CHECKHRCOM(spInfo->get_Title(bstr.Addr()));
01501    m_pHelpPane->SetGame(bstr);
01502    bstr = NULL;
01503    CHECKHRCOM(spInfo->get_Rules(bstr.Addr()));
01504    m_pHelpPane->SetInstr(bstr);
01505 }

Member Data Documentation

BOOL m_bNavigated [protected]

Definition at line 123 of file MainWindow.h.

Referenced by CMainWindow().

BOOL m_bPaneSizing [protected]

Definition at line 133 of file MainWindow.h.

Referenced by CMainWindow(), MainWndProc(), OnSize(), and PreprocessMessage().

BOOL m_bPresentUpdate [protected]

Definition at line 128 of file MainWindow.h.

Referenced by CMainWindow(), PresentUpdate(), and UpdateDone().

BOOL m_bSizing [protected]

Definition at line 134 of file MainWindow.h.

Referenced by CMainWindow(), MainWndProc(), and OnSize().

CBSTR m_bstrExtras [protected]

Definition at line 130 of file MainWindow.h.

Referenced by PresentUpdate(), and UpdateDone().

int m_cTasks [protected]

Definition at line 117 of file MainWindow.h.

Referenced by CMainWindow(), and SBUpdateTasks().

int m_cTasksDone [protected]

Definition at line 118 of file MainWindow.h.

Referenced by CMainWindow(), and SBUpdateTasks().

int m_cyHelpPaneSize [protected]

Definition at line 132 of file MainWindow.h.

Referenced by CMainWindow(), and MainWndProc().

double m_dAvailVersion [protected]

Definition at line 129 of file MainWindow.h.

Referenced by CMainWindow(), PresentUpdate(), and UpdateDone().

DWORD m_dwState [protected]

Definition at line 139 of file MainWindow.h.

Referenced by CMainWindow(), Create(), GameSelected(), HTMLComplete(), OnCommand(), OnDestroy(), ShowHideEngine(), and ShowHideGameMenu().

CGameMenu m_gameMenu [protected]

Definition at line 126 of file MainWindow.h.

Referenced by HTMLComplete(), OnCommand(), OnDestroy(), ShowHideGameMenu(), and UpdateInstr().

HACCEL m_hAccelTable [protected]

Definition at line 137 of file MainWindow.h.

Referenced by Create(), and PreprocessMessage().

CLibMgr m_libMgr [protected]

Definition at line 112 of file MainWindow.h.

Referenced by GameSelected(), HTMLComplete(), OnCommand(), and UpdateInstr().

int m_nCmdShow [protected]

Definition at line 107 of file MainWindow.h.

Referenced by Create(), and HTMLComplete().

CBrowserContainer* m_pBrowserContainer [protected]

Definition at line 120 of file MainWindow.h.

Referenced by CheckRecalcNeeded(), CMainWindow(), MainWndProc(), OnCreate(), OnDestroy(), OnSize(), and PreprocessMessage().

CEngine* m_pEngine [protected]

Definition at line 125 of file MainWindow.h.

Referenced by CheckRecalcNeeded(), CMainWindow(), GameSelected(), HTMLComplete(), MainWndProc(), OnCommand(), OnDestroy(), and OptionTooltips().

CPointer<CHelpPane> m_pHelpPane [protected]

Definition at line 110 of file MainWindow.h.

Referenced by DoHelpPane(), HTMLComplete(), MainWndProc(), OnDestroy(), OnSize(), PreprocessMessage(), ToggleShowRules(), and UpdateInstr().

CHTMLHelper* m_pHH [protected]

Definition at line 122 of file MainWindow.h.

Referenced by CMainWindow(), DoHelpPane(), GetHH(), HTMLComplete(), and OnDestroy().

IMsgProcessor* m_pMsgProcessor [protected]

Definition at line 106 of file MainWindow.h.

Referenced by CMainWindow(), HTMLComplete(), and OnCommand().

CPointer<CStatusBar> m_pSB [protected]

Definition at line 116 of file MainWindow.h.

Referenced by MainWndProc(), OnMenuSelect(), OnSize(), OptionStatusBar(), SBSetText(), SBUpdateTasks(), SetScore(), and ShowHideEngine().

CPointer<CSplashWindow> m_pSplash [protected]

Definition at line 109 of file MainWindow.h.

Referenced by Create(), and HTMLComplete().

RECT m_rcSizeBefore [protected]

Definition at line 135 of file MainWindow.h.

Referenced by CheckRecalcNeeded(), and MainWndProc().

CWebBrowser2Ptr m_spBrowser [protected]

Definition at line 121 of file MainWindow.h.

Referenced by Create(), HTMLComplete(), OnCreate(), and OnDestroy().

CUserPrefs m_userPrefs [protected]

Definition at line 111 of file MainWindow.h.

Referenced by CMainWindow(), Create(), DoHelpPane(), GetAnim(), GetCheckUpdate(), GetShowTooltips(), HTMLComplete(), MainWndProc(), OnCommand(), OnCreate(), OnDestroy(), OnSize(), OptionStatusBar(), OptionTooltips(), PlayCPSound(), and SetCheckUpdate().

BOOL s_bRegistered = FALSE [static]

Definition at line 60 of file MainWindow.cpp.

Referenced by Register().

The documentation for this class was generated from the following files:
  • MainWindow.h
  • MainWindow.cpp
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CMainWindow Member List

This is the complete list of members for CMainWindow, including all inherited members.
ActiveGameChanged() | CMainWindow | [virtual]
CenterWindow(HWND hWnd) | CHWND | [static]
CheckRecalcNeeded() | CMainWindow | [protected]
CHWND() | CHWND | [inline]
CMainWindow(IMsgProcessor *pMsgProcessor) | CMainWindow |
Create(CSplashWindow *pSplash, int nCmdShow) | CMainWindow |
CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam) | CHWND |
CRefCount() | CRefCount | [inline]
DoHelpPane(BOOL bShow) | CMainWindow | [protected]
downcount() | CRefCount | [inline]
EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams) | CMainWindow | [virtual]
GameSelected(int iLibIndex, int iGameIndex) | CMainWindow | [virtual]
GetAnim() | CMainWindow | [virtual]
GetCheckUpdate(BOOL *pbNewVer, BOOL *pbExtras, CTSTR &lpszNewVerText, CTSTR &lpszExtrasText) | CMainWindow | [virtual]
GetHH() | CMainWindow | [virtual]
GetShowTooltips() | CMainWindow | [virtual]
HTMLComplete() | CMainWindow | [protected]
m_bNavigated | CMainWindow | [protected]
m_bPaneSizing | CMainWindow | [protected]
m_bPresentUpdate | CMainWindow | [protected]
m_bSizing | CMainWindow | [protected]
m_bstrExtras | CMainWindow | [protected]
m_cTasks | CMainWindow | [protected]
m_cTasksDone | CMainWindow | [protected]
m_cyHelpPaneSize | CMainWindow | [protected]
m_dAvailVersion | CMainWindow | [protected]
m_dwState | CMainWindow | [protected]
m_gameMenu | CMainWindow | [protected]
m_hAccelTable | CMainWindow | [protected]
m_hWnd | CHWND |
m_libMgr | CMainWindow | [protected]
m_lpszClassName | CHWND | [protected]
m_nCmdShow | CMainWindow | [protected]
m_pBrowserContainer | CMainWindow | [protected]
m_pEngine | CMainWindow | [protected]
m_pHelpPane | CMainWindow | [protected]
m_pHH | CMainWindow | [protected]
m_pMsgProcessor | CMainWindow | [protected]
m_pSB | CMainWindow | [protected]
m_pSplash | CMainWindow | [protected]
m_rcSizeBefore | CMainWindow | [protected]
m_spBrowser | CMainWindow | [protected]
m_userPrefs | CMainWindow | [protected]
MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CMainWindow | [static]
OnCommand(WORD wCmd, LPARAM lParam) | CMainWindow | [protected]
OnCreate() | CMainWindow | [protected]
OnDestroy() | CMainWindow | [protected]
OnMenuSelect(UINT idCmd, UINT uFlags, HMENU hMenu) | CMainWindow | [protected]
OnSize(int nWidth, int nHeight, int cyHelpPane=-1) | CMainWindow | [protected]
operator HWND() const | CHWND | [inline]
OptionStatusBar(BOOL bShow) | CMainWindow | [virtual]
OptionTooltips(BOOL bShow) | CMainWindow | [virtual]
PlayCPSound(UINT uIndex) | CMainWindow | [virtual]
PostMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) | CMainWindow | [virtual]
PreprocessMessage(LPMSG lpMsg) | CMainWindow |
PresentUpdate() | CMainWindow | [protected]
Register() | CMainWindow |
RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL) | CHWND | [static]
RemoveRegMenuItem() | CMainWindow | [protected]
s_bRegistered | CMainWindow | [static]
SBSetText(CTSTR &lpszStatus) | CMainWindow | [virtual]
SBUpdateTasks(int cAdd, int cCompleted) | CMainWindow | [virtual]
SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) | CHWND | [inline]
SetCheckUpdate(BOOL bNewVer, BOOL bExtras) | CMainWindow | [virtual]
SetScore(long lScore) | CMainWindow | [virtual]
ShowHideEngine(BOOL bShow) | CMainWindow | [protected]
ShowHideGameMenu(BOOL bShow) | CMainWindow | [protected]
ShowWindow(int nCmdShow) | CHWND | [inline]
ToggleShowRules() | CMainWindow | [virtual]
upcount() | CRefCount | [inline]
UpdateDone(double dAvailVersion, CBSTR &bstrExtra) | CMainWindow | [virtual]
UpdateInstr() | CMainWindow | [protected]
~CHWND() | CHWND | [inline, virtual]
~CMainWindow() | CMainWindow | [virtual]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


COOMExcep Class Reference

#include <bmws_error.h>

Inheritance diagram for COOMExcep:

CExcep List of all members.

Public Methods

COOMExcep ()
virtual void Report ()

Constructor & Destructor Documentation

COOMExcep ( ) [inline]

Definition at line 264 of file bmws_error.h.

References IDS_BMWS_ERROR_OOM.

00264                : CExcep(IDS_BMWS_ERROR_OOM, FALSE)
00265    {
00266    }

Member Function Documentation

virtual void Report ( ) [inline, virtual]

Reimplemented from CExcep.

Definition at line 269 of file bmws_error.h.

References g_hWnd, HandleError(), IDS_BMWS_REMEDY_RESTART, and CExcep::m_code.

00274    {
00275 #ifdef _DEBUG
00276       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART, 0, 0, bFirst ? ERROR_FIRSTCHANCE : 0);
00277 #else
00278       HandleError(g_hWnd, m_code, IDS_BMWS_REMEDY_RESTART);
00279 #endif
00280    }

The documentation for this class was generated from the following file:
  • bmws_error.h
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


Member List

COOMExcep Member List

This is the complete list of members for COOMExcep, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
COOMExcep() | COOMExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
Report() | COOMExcep | [inline, virtual]
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


CPidl Class Reference

#include <bmws_pidl.h>

List of all members.

Public Methods

CPidl ()
CPidl (LPITEMIDLIST pidl)
~CPidl ()
operator LPITEMIDLIST () const
LPITEMIDLIST * | operator & ()
void | Assign (LPITEMIDLIST pidl)
void | Free ()

Private Attributes

LPITEMIDLIST | m_pidl

Constructor & Destructor Documentation

CPidl ( ) [inline]

Definition at line 37 of file bmws_pidl.h.

References m_pidl.

00038    {
00039       m_pidl = NULL;
00040    }

CPidl ( LPITEMIDLIST pidl ) [inline]

Definition at line 51 of file bmws_pidl.h.

References m_pidl.

00052    {
00053       m_pidl = pidl;
00054    }

~CPidl ( ) [inline]

Definition at line 62 of file bmws_pidl.h.

References Free().

00063    {
00064       Free();
00065    }

Member Function Documentation

void Assign ( LPITEMIDLIST pidl ) [inline]

Definition at line 106 of file bmws_pidl.h.

References Free(), and m_pidl.

00107    {
00108       Free();
00109       m_pidl = pidl;
00110    }

void Free ( ) [inline]

Definition at line 123 of file bmws_pidl.h.

References CHECKHRCOM, and m_pidl.

Referenced by Assign(), and ~CPidl().

00124    {
00125       if(m_pidl != NULL)
00126       {
00127          CPtr<IMalloc, &IID_IMalloc> spMalloc;
00128          CHECKHRCOM(SHGetMalloc(&spMalloc));
00129          spMalloc->Free(m_pidl);
00130          m_pidl = NULL;
00131       }
00132    }

LPITEMIDLIST* operator & ( ) [inline]

Definition at line 92 of file bmws_pidl.h.

References m_pidl.

00093    {
00094       return &m_pidl;
00095    }

operator LPITEMIDLIST ( ) const [inline]

Definition at line 77 of file bmws_pidl.h.

References m_pidl.

00078    {
00079       return m_pidl;
00080    }

Member Data Documentation

LPITEMIDLIST m_pidl [private]

Definition at line 136 of file bmws_pidl.h.

Referenced by Assign(), CPidl(), Free(), operator &(), and operator LPITEMIDLIST().

The documentation for this class was generated from the following file:
  • bmws_pidl.h
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPidl Member List

This is the complete list of members for CPidl, including all inherited members.
Assign(LPITEMIDLIST pidl) | CPidl | [inline]
CPidl() | CPidl | [inline]
CPidl(LPITEMIDLIST pidl) | CPidl | [inline]
Free() | CPidl | [inline]
m_pidl | CPidl | [private]
operator &() | CPidl | [inline]
operator LPITEMIDLIST() const | CPidl | [inline]
~CPidl() | CPidl | [inline]
Generated on Wed May 8 12:39:52 2002 for Solitaire Pack by doxygen 1.2.15


CPile Class Reference

#include <Pile.h>

Inheritance diagram for CPile:

CDispBase CEngineObj ICardPileSite IActionSite INDUnknownAndDispatch IEventHandlerSite CDeck CFragment List of all members.

Public Methods

CPile (long lType)
virtual | ~CPile ()
STDMETHOD (get_Type)(long *p)
STDMETHOD (get_X)(long *p)
STDMETHOD (put_X)(long v)
STDMETHOD (get_Y)(long *p)
STDMETHOD (put_Y)(long v)
STDMETHOD (get_Width)(long *p)
STDMETHOD (get_Height)(long *p)
STDMETHOD (get_NumCards)(long *p)
STDMETHOD (get_CommentTooltip)(BSTR *pbstrText)
STDMETHOD (put_CommentTooltip)(BSTR bstrText)
STDMETHOD (get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow)
STDMETHOD (put_ShowNumCardsTooltip)(VARIANT_BOOL bShow)
STDMETHOD (get_BaseType)(long *p)
STDMETHOD (put_BaseType)(long v)
STDMETHOD (Shuffle)()
STDMETHOD (GetCard)(long lIndex
STDMETHOD (WidthWith)(long lNumCards
STDMETHOD (HeightWith)(long lNumCards
STDMETHOD (NDQueryInterface)(REFIID riid
void | DoAction (CAction *pAction)
void | UndoAction (CAction *pAction)
void | InitPile (IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH)
void | TooltipPrefChanged ()
int | GetNumCards ()
void | TransferCards (CPtrArray< CCard *, CCard * > &apDest)
void | TransferCards (long lIndex, long cCards, CPtrArray< CCard *, CCard * > &apDest)
void | ClearTransferred ()
long | PreReceiveCards (long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1)
void | ReceiveCards (long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1)
POINT | GetCardSpot (long lIndex)
void | UpdateLayout (int iBegin=0, int iEnd=-1)
void | ClearCards ()
BOOL | PtInPile (POINT pt)
BOOL | RgnInPile (HRGN hRgn)
HRESULT | GetPileInterface (ISolpackPile **pp)
void | SetCardIndex (CCard *pCard, long lOldIndex, long *plNewIndex)
void | PileSetElCapture ()
void | PileReleaseElCapture ()

Public Attributes

DECLARE_IUNKNOWN_AND_IDISPATCH
ISolpackCard ** ppCard
long * | plWidth
long * | plHeight
LPVOID * | ppvObject
long | m_lType
long | m_lX
long | m_lY

Protected Methods

void | UpdateTooltip ()
void | UpdateBaseImg ()
void | UpdateDims ()
SIZE | GetSizeWith (int cCards)
void | SetElCapture ()
void | ReleaseElCapture ()

Protected Attributes

IPileSite * m_pSite
CHTMLImgElementPtr m_spImgElBase
long | m_lBaseType
CTSTR m_lpszTooltip
BOOL | m_bShowNumCards
long | m_lWidth
long | m_lHeight
HRGN | m_hRgn
CPtrArray< CCard *, CCard * > m_apCards
CArray< BOOL, BOOL > | m_abTransferred

Constructor & Destructor Documentation

CPile ( long lType )

Definition at line 134 of file Pile.cpp.

References ENGOBJ_PILE, m_apCards, m_bShowNumCards, CEngineObj::m_dwEngObjType, m_hRgn, m_lBaseType, m_lHeight, m_lType, m_lWidth, m_lX, m_lY, m_pSite, ODS, CPtrArray< CCard *, CCard * >::SetRelease(), and CArray< CCard *, CCard * >::SetSize().

00135 {
00136    // Set initial values for member variables
00137    m_dwEngObjType = ENGOBJ_PILE;
00138    m_pSite = NULL;
00139    m_bShowNumCards = FALSE;
00140    m_lType = lType;
00141    m_lBaseType = (m_lType == PILE_DECK ? BASE_NONE : BASE_FRAME);
00142    m_lX = 0;
00143    m_lY = 0;
00144    m_lWidth = 0;
00145    m_lHeight = 0;
00146    m_hRgn = NULL;
00147    m_apCards.SetSize(0, 8);
00148
00149    // Signify that the contained pointers are COM interface pointers that
00150    // should be released, not deleted, when destroyed.
00151    m_apCards.SetRelease(TRUE);
00152    ODS("CPile constructor");
00153 }

~CPile ( ) [virtual]

Definition at line 161 of file Pile.cpp.

References m_hRgn, CEngineObj::m_spEl, ODS, and SAFERELEASE.

00162 {
00163    if(m_hRgn)
00164       DeleteObject(m_hRgn);
00165    if(m_spEl)
00166    {
00167       // Remove the pile element from the HTML document
00168       IHTMLDOMNode *pNode = NULL;
00169       if(SUCCEEDED(m_spEl->QueryInterface(IID_IHTMLDOMNode, (LPVOID*)&pNode)))
00170       {
00171          IHTMLDOMNode *pRemoved = NULL;
00172          pNode->removeNode(VARIANT_TRUE, &pRemoved);
00173          SAFERELEASE(pRemoved);
00174          SAFERELEASE(pNode);
00175       }
00176    }
00177    ODS("CPile destructor");
00178 }

Member Function Documentation

void ClearCards ( )

Definition at line 1195 of file Pile.cpp.

References m_abTransferred, m_apCards, CArray< BOOL, BOOL >::SetSize(), and CArray< CCard *, CCard * >::SetSize().

Referenced by CEngine::CleanupGame(), and CFragmentAddPile::ClearSrc().

01196 {
01197    m_apCards.SetSize(0);
01198    m_abTransferred.SetSize(0);
01199 }

void ClearTransferred ( )

Definition at line 985 of file Pile.cpp.

References CArray< CCard *, CCard * >::GetSize(), m_abTransferred, m_apCards, CArray< BOOL, BOOL >::RemoveAt(), and CPtrArray< CCard *, CCard * >::RemoveAt().

Referenced by CFragmentAddCard::ClearSrc(), and CFragment::PileToFrag().

00986 {
00987    int cCurCards = m_apCards.GetSize();
00988    for(int i = 0; i < cCurCards; )
00989    {
00990       if(m_abTransferred[i])
00991       {
00992          // Removed transferred cards from our array
00993          m_apCards.RemoveAt(i);
00994          m_abTransferred.RemoveAt(i);
00995          cCurCards--;
00996       } else
00997       {
00998          // Update the index of the cards that weren't transferred
00999          m_apCards[i]->SetIndex(i);
01000          i++;
01001       }
01002    }
01003 }

void DoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Reimplemented in CFragment.

Definition at line 679 of file Pile.cpp.

References ACTION_BASETYPE, ACTION_COMMENT, ACTION_PILEX, ACTION_PILEY, ACTION_SHOWNUMCARDS, ACTION_SHUFFLE, CArray< CCard *, CCard * >::Append(), CTSTR::Assign(), CHECKHRCOM, CArray< CCard *, CCard * >::GetSize(), m_apCards, CPileShuffleAction::m_apCardsNew, m_bShowNumCards, CAction::m_dwData, CAction::m_dwType, m_hRgn, m_lBaseType, CPileCommentAction::m_lpszNew, m_lpszTooltip, m_lX, m_lY, CEngineObj::m_spEl, CEngineObj::m_spStyle, CArray< CCard *, CCard * >::SetSize(), UpdateBaseImg(), UpdateLayout(), and UpdateTooltip().

Referenced by CFragment::DoAction().

00680 {
00681    switch(pAction->m_dwType)
00682    {
00683       case ACTION_COMMENT:
00684       {
00685          // Set the tooltip to the new string
00686          CPileCommentAction *pPCAction = (CPileCommentAction*)pAction;
00687          m_lpszTooltip.Assign(pPCAction->m_lpszNew);
00688          UpdateTooltip();
00689       } break;
00690
00691       case ACTION_SHOWNUMCARDS:
00692          // Set the new setting
00693          m_bShowNumCards = (BOOL)pAction->m_dwData;
00694          UpdateTooltip();
00695          break;
00696
00697       case ACTION_PILEX:
00698       {
00699          // Position pile
00700          long lOffsetX = (long)pAction->m_dwData;
00701          OffsetRgn(m_hRgn, lOffsetX, 0);
00702          m_lX += lOffsetX;
00703          CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00704       } break;
00705
00706       case ACTION_PILEY:
00707       {
00708          // Position pile
00709          long lOffsetY = (long)pAction->m_dwData;
00710          OffsetRgn(m_hRgn, 0, lOffsetY);
00711          m_lY += lOffsetY;
00712          CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00713       } break;
00714
00715       case ACTION_BASETYPE:
00716       {
00717          // Update the base image
00718          m_lBaseType += (long)pAction->m_dwData;
00719          UpdateBaseImg();
00720       } break;
00721
00722       case ACTION_SHUFFLE:
00723       {
00724          // Store the shuffled order as the current order
00725          CPileShuffleAction *pPSAction = (CPileShuffleAction*)pAction;
00726          m_apCards.SetSize(0);
00727          m_apCards.Append(pPSAction->m_apCardsNew);
00728          int cCards = pPSAction->m_apCardsNew.GetSize();
00729          int i;
00730          for(i = 0; i < cCards; i++)
00731             m_apCards[i]->AddRef();
00732          CHTMLElement2Ptr spEl2(m_spEl);
00733
00734          // Set each card in its new position
00735          for(i = 0; i < cCards; i++)
00736          {
00737             m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00738             m_apCards[i]->SetIndex(i);
00739          }
00740          UpdateLayout();
00741       } break;
00742    }
00743 }

POINT GetCardSpot ( long lIndex )

Definition at line 1155 of file Pile.cpp.

References CX_STACKSPC, CX_TABLEAURIGHTSPC, CX_TALON3SPC, CY_STACKSPC, CY_TABLEAUDOWNSPC, CY_TALON3SPC, and NUMCARDSINSTACKGROUP.

Referenced by UpdateLayout().

01156 {
01157    POINT pt;
01158    pt.x = 0;
01159    pt.y = 0;
01160
01161    // Calculate card spot based on index and pile type
01162    switch(m_lType)
01163    {
01164       case PILE_STACK:
01165       case PILE_TALON:
01166          pt.x += (lIndex / NUMCARDSINSTACKGROUP) * CX_STACKSPC;
01167          pt.y += (lIndex / NUMCARDSINSTACKGROUP) * CY_STACKSPC;
01168          break;
01169       case PILE_TABLEAURIGHT:
01170          pt.x = lIndex * CX_TABLEAURIGHTSPC;
01171          break;
01172       case PILE_TABLEAUDOWN:
01173          pt.y = lIndex * CY_TABLEAUDOWNSPC;
01174          break;
01175       case PILE_TALON3:
01176          pt.x = (lIndex % 3) * CX_TALON3SPC;
01177          pt.y = (lIndex % 3) * CY_TALON3SPC;
01178          break;
01179    }
01180
01181    return pt;
01182 }

int GetNumCards ( )

Definition at line 910 of file Pile.cpp.

References CArray< CCard *, CCard * >::GetSize(), and m_apCards.

Referenced by CFragment::FragToPile().

00911 {
00912    return m_apCards.GetSize();
00913 }

HRESULT GetPileInterface ( ISolpackPile ** pp ) [virtual]

Implements ICardPileSite.

Definition at line 1255 of file Pile.cpp.

References IID_ISolpackPile, and ISolpackPile.

01256 {
01257    return QueryInterface(IID_ISolpackPile, (LPVOID*)pp);
01258 }

SIZE GetSizeWith ( int cCards ) [protected]

Definition at line 1497 of file Pile.cpp.

References CARDHEIGHT, CARDWIDTH, CX_STACKSPC, CX_TABLEAURIGHTSPC, CX_TALON3SPC, CY_STACKSPC, CY_TABLEAUDOWNSPC, CY_TALON3SPC, and NUMCARDSINSTACKGROUP.

Referenced by UpdateLayout().

01498 {
01499    SIZE s;
01500    s.cx = CARDWIDTH;
01501    s.cy = CARDHEIGHT;
01502
01503    // Based on the number of dimensions and pile type, retrieve the dimensions
01504    if(cCards > 0)
01505    {
01506       switch(m_lType)
01507       {
01508          case PILE_STACK:
01509          case PILE_TALON:
01510             s.cx += (((cCards - 1) / NUMCARDSINSTACKGROUP) * CX_STACKSPC);
01511             s.cy += (((cCards - 1) / NUMCARDSINSTACKGROUP) * CY_STACKSPC);
01512             break;
01513          case PILE_TABLEAUDOWN:
01514             s.cy += ((cCards - 1) * CY_TABLEAUDOWNSPC);
01515             break;
01516          case PILE_TABLEAURIGHT:
01517             s.cx += ((cCards - 1) * CX_TABLEAURIGHTSPC);
01518             break;
01519          case PILE_TALON3:
01520             s.cx += (((cCards >= 3) ? 2 : (cCards-1)) * CX_TALON3SPC);
01521             s.cy += (((cCards >= 3) ? 2 : (cCards-1)) * CY_TALON3SPC);
01522             break;
01523          case PILE_FRAGMENT:
01524             s.cx = 0;
01525             s.cy = 0;
01526             break;
01527       }
01528    }
01529    return s;
01530 }

void InitPile | ( | IPileSite * | pSite,
 |  | IEngineObjSite * | pEngObjSite,
 |  | CHTMLHelper * | pHH
 | ) |

Definition at line 838 of file Pile.cpp.

References _ASSERT, CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Assign(), CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CHTMLHelper::CreateElement(), g_pTypeLib, CHTMLHelper::GetNamedEl(), IDS_CLASS_PILEBASE, IDS_EL_TABLEAU, IDS_TAG_IMG, IDS_TAG_SPAN, IID_ISolpackPile, CDispBase::Init(), CEngineObj::InitEngineObj(), ISolpackPile, CHTMLHelper::m_bstrBeforeEnd, m_lType, CEngineObj::m_pHH, m_pSite, CEngineObj::m_spEl, m_spImgElBase, CEngineObj::m_spStyle, ODS, CEngineObj::SetEventHandlers(), UpdateBaseImg(), UpdateDims(), and UpdateLayout().

Referenced by CEngine::AddDeck(), and CEngine::InitEngine().

00839 {
00840    ODS("CPile::InitPile starting");
00841    InitEngineObj(pEngObjSite, pHH);
00842
00843    // Set member variables' values
00844    _ASSERT(pSite);
00845    m_pSite = pSite;
00846
00847    if(m_lType != PILE_FRAGMENT)
00848    {
00849       Init(g_pTypeLib, IID_ISolpackPile, (LPDISPATCH)((ISolpackPile*)this));
00850
00851       // Create the Span element
00852       m_spEl.Assign(TRUE, pHH->CreateElement(IDS_TAG_SPAN, IID_IHTMLElement));
00853
00854       // Set the pile's position style to absolute
00855       CHECKHRCOM(m_spEl->get_style(&m_spStyle));
00856       CPtr<IHTMLStyle2, &IID_IHTMLStyle2> spStyle2(m_spStyle);
00857       CHECKHRCOM(spStyle2->put_position(CBSTR(TEXT("absolute"))));
00858
00859       // Create and the pile base image element to the pile span
00860       m_spImgElBase.Assign(TRUE, pHH->CreateElement(IDS_TAG_IMG, IID_IHTMLImgElement));
00861       CHTMLElementPtr spElTemp(m_spImgElBase);
00862       spElTemp->put_className(CBSTR(IDS_CLASS_PILEBASE));
00863       CHTMLElement2Ptr spEl2(m_spEl);
00864       CHECKHRCOM(spEl2->insertAdjacentElement(pHH->m_bstrBeforeEnd, spElTemp, NULL));
00865       UpdateBaseImg();
00866
00867       // Add the pile span element to the tableau element
00868       CHTMLElement2Ptr spTableau2(TRUE, m_pHH->GetNamedEl(IDS_EL_TABLEAU, IID_IHTMLElement2));
00869       CHECKHRCOM(spTableau2->insertAdjacentElement(pHH->m_bstrBeforeEnd, m_spEl, NULL));
00870
00871       UpdateDims();
00872
00873       // Create and attach handlers for mouse events
00874       SetEventHandlers();
00875    }
00876
00877    UpdateLayout();
00878
00879    ODS("CPile::InitPile finished");
00880 }

void PileReleaseElCapture ( ) [inline, virtual]

Implements ICardPileSite.

Definition at line 106 of file Pile.h.

References ReleaseElCapture().

00106 { ReleaseElCapture(); }

void PileSetElCapture ( ) [inline, virtual]

Implements ICardPileSite.

Definition at line 105 of file Pile.h.

References SetElCapture().

00105 { SetElCapture(); }

long PreReceiveCards | ( | long | lIndex,
 |  | CPtrArray< CCard *, CCard * > & | apSrc,
 |  | long | lIndexStart = 0,
 |  | long | cCards = -1
 | ) |

Definition at line 1023 of file Pile.cpp.

References CArray< BOOL, BOOL >::Add(), CArray< CCard *, CCard * >::Add(), CHTMLElement2Ptr, CArray< CCard *, CCard * >::GetSize(), CArray< TP, TPA >::GetSize(), CArray< BOOL, BOOL >::InsertAt(), CArray< CCard *, CCard * >::InsertAt(), m_abTransferred, m_apCards, CArray< BOOL, BOOL >::SetAt(), CPtrArray< CCard *, CCard * >::SetAt(), CArray< BOOL, BOOL >::SetAtGrow(), CArray< CCard *, CCard * >::SetAtGrow(), and UpdateLayout().

Referenced by CFragmentAddCard::DoPreReceive(), CFragmentAddPile::DoPreReceive(), CFragment::FragToPile(), and CDeck::ReclaimCards().

01025 {
01026    // This function lets us store pointers to the card objects. However, the
01027    // cards' HTML elements are still part of the previous pile/fragment.
01028
01029    // Figure out how many cards we are dealing with and where the cards go
01030    if(cCards == -1)
01031       cCards = apSrc.GetSize();
01032    int iCardsOld = m_apCards.GetSize();
01033    if(lIndex < 0)
01034       lIndex = iCardsOld;
01035
01036    // See if we have to add "empty" slots in order to position card correctly
01037    int i;
01038    int iDiff = (lIndex - iCardsOld);
01039    if(iDiff < 0)
01040       iDiff = 0;
01041    int cCardsTotal = iCardsOld + cCards + iDiff;
01042    if(iDiff > 0)
01043    {
01044       // Add empty slots
01045       for(int j = 0; j < iDiff; j++)
01046       {
01047          m_apCards.Add(NULL);
01048          m_abTransferred.Add(TRUE);
01049       }
01050    }
01051
01052    // Add cards to our array in the specified point
01053    for(i = 0; i < cCards; i++)
01054    {
01055       if(lIndex+i >= m_apCards.GetSize())
01056       {
01057          m_apCards.SetAtGrow(lIndex+i, apSrc[lIndexStart+i]);
01058          m_abTransferred.SetAtGrow(lIndex+i, FALSE);
01059       } else if(m_abTransferred[lIndex+i])
01060       {
01061          m_apCards.SetAt(lIndex+i, apSrc[lIndexStart+i]);
01062          m_abTransferred.SetAt(lIndex+i, FALSE);
01063       } else
01064       {
01065          m_apCards.InsertAt(lIndex+i, apSrc[lIndexStart+i]);
01066          m_abTransferred.InsertAt(lIndex+i, FALSE);
01067       }
01068       m_apCards[lIndex+i]->AddRef();
01069       m_apCards[lIndex+i]->SetPile((ICardPileSite*)this, CHTMLElement2Ptr());
01070    }
01071
01072    // Set cards' indices
01073    int cNewCards = m_apCards.GetSize();
01074    for(i = lIndex; i < cNewCards; i++)
01075    {
01076       if(m_apCards[i])
01077          m_apCards[i]->SetIndex(i);
01078    }
01079    UpdateLayout(lIndex + cCards);
01080    return lIndex;
01081 }

BOOL PtInPile ( POINT pt )

Definition at line 1213 of file Pile.cpp.

References m_hRgn.

01214 {
01215    return PtInRegion(m_hRgn, pt.x, pt.y);
01216 }

void ReceiveCards | ( | long | lIndex,
 |  | CPtrArray< CCard *, CCard * > & | apSrc,
 |  | long | lIndexStart = 0,
 |  | long | cCards = -1
 | ) |

Definition at line 1100 of file Pile.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CArray< CCard *, CCard * >::GetSize(), CArray< TP, TPA >::GetSize(), m_abTransferred, m_apCards, CHTMLHelper::m_bstrBeforeEnd, CEngineObj::m_pHH, CEngineObj::m_spEl, CArray< BOOL, BOOL >::SetAt(), and UpdateLayout().

Referenced by CFragmentAddCard::DoReceive(), CFragmentAddPile::DoReceive(), CFragment::FragToPile(), and CDeck::ReclaimCards().

01102 {
01103    // Figure out indices
01104    if(cCards == -1)
01105       cCards = apSrc.GetSize();
01106    long lIndexBefore = lIndex + cCards;
01107    int iCardsOld = m_apCards.GetSize() - cCards;
01108
01109    // Figure out what card HTML element to insert the cards before
01110    CHTMLElementPtr spElBefore;
01111    if(lIndexBefore >= iCardsOld + cCards)
01112       lIndexBefore = iCardsOld + cCards;
01113    else
01114       spElBefore.Assign(m_apCards[lIndexBefore]->GetElement());
01115    CHTMLElement2Ptr spEl2(m_spEl);
01116
01117    // Transfer cards' elements into their proper spot
01118    for(int i = 0; i < cCards; i++)
01119    {
01120       m_abTransferred.SetAt(lIndex+i, FALSE);
01121       CHTMLElementPtr spElCur = m_apCards[lIndex+i]->GetElement();
01122       if(spElBefore)
01123       {
01124          // Insert card element before another element
01125          CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNode(spElCur);
01126          CVariant v;
01127          v.vt = VT_DISPATCH;
01128          CHECKHRCOM(spElBefore->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
01129
01130          CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNodeThis(m_spEl);
01131          CHECKHRCOM(spNodeThis->insertBefore(spNode, v, NULL));
01132       } else
01133       {
01134          // Insert card element at the end of our element
01135          CHTMLElement2Ptr spEl2(m_spEl);
01136          CHECKHRCOM(spEl2->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, spElCur, NULL));
01137       }
01138    }
01139    UpdateLayout(lIndex, lIndex + cCards);
01140 }

void ReleaseElCapture ( ) [protected, virtual]

Implements CEngineObj.

Definition at line 1560 of file Pile.cpp.

References CEngineObj::m_spEl.

Referenced by PileReleaseElCapture().

01561 {
01562    CHTMLElement2Ptr spEl2(m_spEl);
01563    spEl2->releaseCapture();
01564 }

BOOL RgnInPile ( HRGN hRgn )

Definition at line 1231 of file Pile.cpp.

References m_hRgn.

01232 {
01233    // Test for a non-null intersection of our pile's region and the specified
01234    // region
01235    HRGN hRgnTemp = CreateRectRgn(0, 0, 0, 0);
01236    int i = CombineRgn(hRgnTemp, m_hRgn, hRgn, RGN_AND);
01237    DeleteObject(hRgnTemp);
01238    return (i != NULLREGION);
01239 }

void SetCardIndex | ( | CCard * | pCard,
 |  | long | lOldIndex,
 |  | long * | plNewIndex
 | ) | [virtual]

Implements ICardPileSite.

Definition at line 1277 of file Pile.cpp.

References CPtr< IHTMLElement,&IID_IHTMLElement >::Assign(), CHECKHRCOM, CCard::GetElement(), CArray< CCard *, CCard * >::GetSize(), CArray< BOOL, BOOL >::InsertAt(), CArray< CCard *, CCard * >::InsertAt(), m_abTransferred, m_apCards, CHTMLHelper::m_bstrBeforeEnd, CEngineObj::m_pHH, CEngineObj::m_spEl, CArray< BOOL, BOOL >::RemoveAt(), CPtrArray< CCard *, CCard * >::RemoveAt(), and UpdateLayout().

01278 {
01279    pCard->AddRef();
01280
01281    // Figure out what index to put the card at
01282    int cCards = m_apCards.GetSize()-1;
01283    CHTMLElementPtr spElBefore;
01284    if(*plNewIndex < 0 || *plNewIndex >= cCards)
01285       *plNewIndex = cCards;
01286    else
01287       spElBefore.Assign(m_apCards[(*plNewIndex)+(lOldIndex < *plNewIndex ? 1 : 0)]->
01288          GetElement());
01289
01290    // Remove the card from the old index and put it at the new index
01291    m_apCards.RemoveAt(lOldIndex);
01292    m_abTransferred.RemoveAt(lOldIndex);
01293    m_apCards.InsertAt(*plNewIndex, pCard);
01294    m_abTransferred.InsertAt(*plNewIndex, FALSE);
01295
01296    // Transfer card element into its proper spot
01297    CHTMLElementPtr spElCur = pCard->GetElement();
01298    if(spElBefore)
01299    {
01300       // Insert card element before another element
01301       CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNode(spElCur);
01302       CVariant v;
01303       v.vt = VT_DISPATCH;
01304       CHECKHRCOM(spElBefore->QueryInterface(IID_IDispatch, (LPVOID*)&v.pdispVal));
01305
01306       CPtr<IHTMLDOMNode, &IID_IHTMLDOMNode> spNodeThis(m_spEl);
01307       CHECKHRCOM(spNodeThis->insertBefore(spNode, v, NULL));
01308    } else
01309    {
01310       // Insert card element at the end of our element
01311       CHTMLElement2Ptr spEl2(m_spEl);
01312       CHECKHRCOM(spEl2->insertAdjacentElement(m_pHH->m_bstrBeforeEnd, spElCur, NULL));
01313    }
01314
01315    long lNew = (*plNewIndex);
01316
01317    long lMin = min(lOldIndex, lNew);
01318    long lMax = max(lOldIndex, lNew);
01319
01320    // Update the indices of other cards that changed
01321    CHTMLElement2Ptr spEl2(m_spEl);
01322    for(int i = lMin; i <= lMax; i++)
01323       m_apCards[i]->SetIndex(i);
01324    UpdateLayout(lMin, lMax);
01325 }

void SetElCapture ( ) [protected, virtual]

Implements CEngineObj.

Definition at line 1543 of file Pile.cpp.

References CEngineObj::m_spEl.

Referenced by PileSetElCapture().

01544 {
01545    CHTMLElement2Ptr spEl2(m_spEl);
01546    spEl2->setCapture();
01547 }

STDMETHOD ( NDQueryInterface )

Reimplemented from CDispBase.

STDMETHOD ( HeightWith )

STDMETHOD ( WidthWith )

STDMETHOD ( GetCard )

Reimplemented in CFragment.

STDMETHOD ( Shuffle )

Reimplemented in CFragment.

STDMETHOD ( put_BaseType )

Reimplemented in CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_BaseType )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( put_ShowNumCardsTooltip )

Reimplemented in CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_ShowNumCardsTooltip )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( put_CommentTooltip )

Reimplemented in CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_CommentTooltip )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_NumCards )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_Height )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_Width )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( put_Y )

Reimplemented in CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_Y )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( put_X )

Reimplemented in CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_X )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

STDMETHOD ( get_Type )

Reimplemented in CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, CFragment, and CFragment.

void TooltipPrefChanged ( )

Definition at line 894 of file Pile.cpp.

References UpdateTooltip().

00895 {
00896    UpdateTooltip();
00897 }

void TransferCards | ( | long | lIndex,
 |  | long | cCards,
 |  | CPtrArray< CCard *, CCard * > & | apDest
 | ) |

Definition at line 954 of file Pile.cpp.

References _ASSERT, CArray< TP, TPA >::Add(), CArray< CCard *, CCard * >::GetSize(), m_abTransferred, m_apCards, and CArray< BOOL, BOOL >::SetAt().

00955 {
00956    _ASSERT(lIndex >= 0);
00957    _ASSERT(lIndex < m_apCards.GetSize());
00958    _ASSERT(lIndex + cCards <= m_apCards.GetSize());
00959
00960    // Copy the desired card pointers from our array to the specified array.
00961    // Note that our array still also has pointers to the cards at this point.
00962    int i;
00963    for(i = 0; i < cCards; i++)
00964    {
00965       CCard *pCard = m_apCards[lIndex+i];
00966       pCard->AddRef();
00967       apDest.Add(pCard);
00968
00969       // Mark that the card was transferred out
00970       m_abTransferred.SetAt(lIndex+i, TRUE);
00971    }
00972 }

void TransferCards ( CPtrArray< CCard *, CCard * > & apDest )

Definition at line 927 of file Pile.cpp.

References CArray< TP, TPA >::Add(), CArray< CCard *, CCard * >::GetSize(), and m_apCards.

Referenced by CFragment::PileToFrag(), CFragmentAddCard::Setup(), and CFragmentAddPile::Setup().

00928 {
00929    // Copy card pointers from our array to the specified array. Note that our
00930    // array still also has pointers to the cards at this point.
00931    int cCards = m_apCards.GetSize();
00932    for(int i = 0; i < cCards; i++)
00933    {
00934       apDest.Add(m_apCards[i]);
00935       m_apCards[i]->AddRef();
00936    }
00937 }

void UndoAction ( CAction * pAction ) [virtual]

Implements IActionSite.

Reimplemented in CFragment.

Definition at line 757 of file Pile.cpp.

References ACTION_BASETYPE, ACTION_COMMENT, ACTION_PILEX, ACTION_PILEY, ACTION_SHOWNUMCARDS, ACTION_SHUFFLE, CArray< CCard *, CCard * >::Append(), CTSTR::Assign(), CHECKHRCOM, CArray< CCard *, CCard * >::GetSize(), m_apCards, CPileShuffleAction::m_apCardsNew, CPileShuffleAction::m_apCardsOld, m_bShowNumCards, CAction::m_dwData, CAction::m_dwType, m_hRgn, m_lBaseType, CPileCommentAction::m_lpszOld, m_lpszTooltip, m_lX, m_lY, CEngineObj::m_spEl, CEngineObj::m_spStyle, CArray< CCard *, CCard * >::SetSize(), UpdateBaseImg(), UpdateLayout(), and UpdateTooltip().

Referenced by CFragment::UndoAction().

00758 {
00759    switch(pAction->m_dwType)
00760    {
00761       case ACTION_COMMENT:
00762       {
00763          // Set the tooltip to the previous string
00764          CPileCommentAction *pPCAction = (CPileCommentAction*)pAction;
00765          m_lpszTooltip.Assign(pPCAction->m_lpszOld);
00766          UpdateTooltip();
00767       } break;
00768
00769       case ACTION_SHOWNUMCARDS:
00770          // Set the previous setting
00771          m_bShowNumCards = !(BOOL)pAction->m_dwData;
00772          UpdateTooltip();
00773          break;
00774
00775       case ACTION_PILEX:
00776       {
00777          // Position pile in old position
00778          long lOffsetX = (long)pAction->m_dwData;
00779          OffsetRgn(m_hRgn, -lOffsetX, 0);
00780          m_lX -= lOffsetX;
00781          CHECKHRCOM(m_spStyle->put_pixelLeft(m_lX));
00782       } break;
00783
00784       case ACTION_PILEY:
00785       {
00786          // Position pile in old position
00787          long lOffsetY = (long)pAction->m_dwData;
00788          OffsetRgn(m_hRgn, 0, -lOffsetY);
00789          m_lY -= lOffsetY;
00790          CHECKHRCOM(m_spStyle->put_pixelTop(m_lY));
00791       } break;
00792
00793       case ACTION_BASETYPE:
00794       {
00795          // Set the previous pile type
00796          m_lBaseType -= (long)pAction->m_dwData;
00797          UpdateBaseImg();
00798       } break;
00799
00800       case ACTION_SHUFFLE:
00801       {
00802          // Store the previous order as the current order
00803          CPileShuffleAction *pPSAction = (CPileShuffleAction*)pAction;
00804          m_apCards.SetSize(0);
00805          m_apCards.Append(pPSAction->m_apCardsOld);
00806          int cCards = pPSAction->m_apCardsNew.GetSize();
00807          int i;
00808          for(i = 0; i < cCards; i++)
00809             m_apCards[i]->AddRef();
00810          CHTMLElement2Ptr spEl2(m_spEl);
00811
00812          // Set each card in its new position
00813          for(i = 0; i < cCards; i++)
00814          {
00815             m_apCards[i]->SetPile((ICardPileSite*)this, spEl2);
00816             m_apCards[i]->SetIndex(i);
00817          }
00818          UpdateLayout();
00819       } break;
00820    }
00821 }

void UpdateBaseImg ( ) [protected]

Definition at line 1388 of file Pile.cpp.

References CHECKHRCOM, IDS_IMG_BASE_NONE, m_lBaseType, and m_spImgElBase.

Referenced by DoAction(), InitPile(), and UndoAction().

01389 {
01390    CHECKHRCOM(m_spImgElBase->put_src(CBSTR(m_lBaseType + IDS_IMG_BASE_NONE)));
01391 }

void UpdateDims ( ) [protected]

Definition at line 1404 of file Pile.cpp.

References CHECKHRCOM, m_lHeight, m_lWidth, and CEngineObj::m_spStyle.

Referenced by InitPile(), and UpdateLayout().

01405 {
01406    CHECKHRCOM(m_spStyle->put_pixelWidth(m_lWidth));
01407    CHECKHRCOM(m_spStyle->put_pixelHeight(m_lHeight));
01408 }

void UpdateLayout | ( | int | iBegin = 0,
 |  | int | iEnd = -1
 | ) |

Definition at line 1425 of file Pile.cpp.

References CARDHEIGHT, CARDWIDTH, GetCardSpot(), CArray< CCard *, CCard * >::GetSize(), GetSizeWith(), m_abTransferred, m_apCards, m_hRgn, m_lHeight, m_lType, m_lWidth, m_lX, m_lY, UpdateDims(), and UpdateTooltip().

Referenced by CFragment::CancelAdditions(), DoAction(), CFragment::DoAction(), CFragment::FragToPile(), CEngine::HandleTryDrop(), CDeck::InitDeck(), InitPile(), CFragment::PileToFrag(), PreReceiveCards(), ReceiveCards(), SetCardIndex(), and UndoAction().

01426 {
01427    int i;
01428    int cCards = m_apCards.GetSize();
01429
01430    if(m_lType != PILE_FRAGMENT)
01431    {
01432       SIZE s = GetSizeWith(cCards);
01433
01434       if(cCards > 0)
01435       {
01436          if((iEnd < 0) || (iEnd >= cCards))
01437             iEnd = cCards-1;
01438
01439          // Within the desired range, update the position of each card
01440          // of the pile
01441          for(i = iBegin; i <= iEnd; i++)
01442          {
01443             if(!m_abTransferred[i])
01444             {
01445                POINT pt = GetCardSpot(i);
01446                m_apCards[i]->SetPosition(pt.x, pt.y);
01447             }
01448          }
01449       }
01450
01451       // Update the pile dimensions and tooltip
01452       m_lWidth = s.cx;
01453       m_lHeight = s.cy;
01454
01455       UpdateDims();
01456       UpdateTooltip();
01457    }
01458
01459    // Create the pile region
01460    if(m_hRgn)
01461       DeleteObject(m_hRgn);
01462    if(m_lType == PILE_FRAGMENT || m_lType == PILE_DECK)
01463       m_hRgn = CreateRectRgn(0, 0, 0, 0);
01464    else
01465       m_hRgn = CreateRectRgn(m_lX, m_lY, m_lX + CARDWIDTH, m_lY + CARDHEIGHT);
01466
01467    if(m_lType != PILE_DECK)
01468    {
01469       // Build up the pile's region
01470       for(i = 0; i < cCards; i++)
01471       {
01472          if(m_apCards[i])
01473          {
01474             // Or the card's region with this pile's region so far
01475             POINT pt = m_apCards[i]->GetPosition();
01476             HRGN h = CreateRectRgn(m_lX + pt.x, m_lY + pt.y, m_lX + pt.x + CARDWIDTH,
01477                m_lY + pt.y + CARDHEIGHT);
01478             CombineRgn(m_hRgn, m_hRgn, h, RGN_OR);
01479             DeleteObject(h);
01480          }
01481       }
01482    }
01483 }

void UpdateTooltip ( ) [protected]

Definition at line 1339 of file Pile.cpp.

References CHECKHRCOM, CTSTR::Format(), IPileSite::GetShowTooltips(), CArray< CCard *, CCard * >::GetSize(), IDS_NUMCARDSTOOLTIP, CTSTR::Len(), m_apCards, m_bShowNumCards, CTSTR::m_lpsz, m_lpszTooltip, m_lType, m_pSite, and CEngineObj::m_spEl.

Referenced by DoAction(), TooltipPrefChanged(), UndoAction(), and UpdateLayout().

01340 {
01341    // Decks and fragments can't have tooltips
01342    if((m_lType == PILE_DECK) || (m_lType == PILE_FRAGMENT))
01343       return;
01344
01345    if(m_pSite->GetShowTooltips() && (m_lpszTooltip || m_bShowNumCards))
01346    {
01347       // Build up the string, consisting of either a tooltip, a "__ cards"
01348       // string, or both
01349
01350       CTSTR lpszNumCards;
01351       if(m_bShowNumCards)
01352          lpszNumCards.Format(CTSTR(IDS_NUMCARDSTOOLTIP), m_apCards.GetSize());
01353
01354       CTSTR lpszFinal(TRUE, m_lpszTooltip.Len() + lpszNumCards.Len() + 8);
01355       LPTSTR lpsz = lpszFinal.m_lpsz;
01356       if(m_lpszTooltip)
01357       {
01358          lstrcpy(lpsz, m_lpszTooltip);
01359          lpsz += (m_lpszTooltip.Len() * sizeof(TCHAR));
01360          if(m_bShowNumCards)
01361          {
01362             lstrcpy(lpsz, TEXT("\n"));
01363             lpsz += (sizeof(TCHAR));
01364          }
01365       }
01366
01367       if(m_bShowNumCards)
01368          lstrcpy(lpsz, lpszNumCards);
01369
01370       // Set the tooltip
01371       CHECKHRCOM(m_spEl->put_title(CBSTR(lpszFinal)));
01372    } else
01373       CHECKHRCOM(m_spEl->put_title(NULL));   // No tooltip
01374 }

Member Data Documentation

DECLARE_IUNKNOWN_AND_IDISPATCH

Reimplemented in CFragment.

Definition at line 57 of file Pile.h.

CArray<BOOL, BOOL> m_abTransferred [protected]

Definition at line 133 of file Pile.h.

Referenced by ClearCards(), ClearTransferred(), CDeck::InitDeck(), CFragment::PileToFrag(), PreReceiveCards(), ReceiveCards(), SetCardIndex(), TransferCards(), and UpdateLayout().

CPtrArray<CCard*, CCard*> m_apCards [protected]

Definition at line 132 of file Pile.h.

Referenced by CFragment::Animate(), ClearCards(), ClearTransferred(), CPile(), DoAction(), CFragment::DoAction(), CFragment::FragToPile(), GetNumCards(), CDeck::InitDeck(), CFragment::PileToFrag(), PreReceiveCards(), ReceiveCards(), SetCardIndex(), TransferCards(), UndoAction(), UpdateLayout(), and UpdateTooltip().

BOOL m_bShowNumCards [protected]

Definition at line 126 of file Pile.h.

Referenced by CPile(), DoAction(), UndoAction(), and UpdateTooltip().

HRGN m_hRgn [protected]

Definition at line 130 of file Pile.h.

Referenced by CPile(), DoAction(), CFragment::GetPileRgn(), PtInPile(), RgnInPile(), UndoAction(), UpdateLayout(), and ~CPile().

long m_lBaseType [protected]

Definition at line 124 of file Pile.h.

Referenced by CPile(), DoAction(), UndoAction(), and UpdateBaseImg().

long m_lHeight [protected]

Definition at line 129 of file Pile.h.

Referenced by CPile(), UpdateDims(), and UpdateLayout().

CTSTR m_lpszTooltip [protected]

Definition at line 125 of file Pile.h.

Referenced by DoAction(), UndoAction(), and UpdateTooltip().

long m_lType

Definition at line 108 of file Pile.h.

Referenced by CPile(), InitPile(), UpdateLayout(), and UpdateTooltip().

long m_lWidth [protected]

Definition at line 128 of file Pile.h.

Referenced by CPile(), UpdateDims(), and UpdateLayout().

long m_lX

Definition at line 109 of file Pile.h.

Referenced by CFragment::Animate(), CFragment::CancelAdditions(), CPile(), DoAction(), CFragment::DoAction(), CFragment::FragToPile(), CFragment::MoveBy(), CFragment::PileToFrag(), CFragmentAddCard::Setup(), CFragmentAddPile::Setup(), UndoAction(), and UpdateLayout().

long m_lY

Definition at line 110 of file Pile.h.

Referenced by CFragment::Animate(), CFragment::CancelAdditions(), CPile(), DoAction(), CFragment::DoAction(), CFragment::FragToPile(), CFragment::MoveBy(), CFragment::PileToFrag(), CFragmentAddCard::Setup(), CFragmentAddPile::Setup(), UndoAction(), and UpdateLayout().

IPileSite* m_pSite [protected]

Definition at line 120 of file Pile.h.

Referenced by CFragment::CFragment(), CPile(), CFragment::FragToPile(), InitPile(), CFragment::PileToFrag(), and UpdateTooltip().

CHTMLImgElementPtr m_spImgElBase [protected]

Definition at line 122 of file Pile.h.

Referenced by InitPile(), and UpdateBaseImg().

long* plHeight

Definition at line 77 of file Pile.h.

long* plWidth

Definition at line 76 of file Pile.h.

ISolpackCard** ppCard

Definition at line 75 of file Pile.h.

LPVOID* ppvObject

Reimplemented from CDispBase.

Definition at line 80 of file Pile.h.

The documentation for this class was generated from the following files:
  • Pile.h
  • Pile.cpp
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPile Member List

This is the complete list of members for CPile, including all inherited members.
CDispBase() | CDispBase |
CEngineObj() | CEngineObj |
ClearCards() | CPile |
ClearTransferred() | CPile |
cNames | CDispBase |
CPile(long lType) | CPile |
DECLARE_IUNKNOWN_AND_IDISPATCH | CPile |
DoAction(CAction *pAction) | CPile | [virtual]
EventHandler(DWORD dwEventID, LPARAM lParam) | CEngineObj | [virtual]
GetCardSpot(long lIndex) | CPile |
GetDispatch() const | CDispBase | [inline, protected]
GetNumCards() | CPile |
GetOuterUnknown() const | CDispBase | [inline, protected]
GetPileInterface(ISolpackPile **pp) | CPile | [virtual]
GetSizeWith(int cCards) | CPile | [protected]
GetType() | CEngineObj |
Init(LPTYPELIB pTypeLib, REFIID riid, LPDISPATCH pDisp) | CDispBase | [protected, virtual]
InitEngineObj(IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CEngineObj |
InitPile(IPileSite *pSite, IEngineObjSite *pEngObjSite, CHTMLHelper *pHH) | CPile |
lcid | CDispBase |
lcid | CDispBase |
lcid | CDispBase |
m_abTransferred | CPile | [protected]
m_apCards | CPile | [protected]
m_bShowNumCards | CPile | [protected]
m_dwEngObjType | CEngineObj | [protected]
m_hRgn | CPile | [protected]
m_lBaseType | CPile | [protected]
m_lHeight | CPile | [protected]
m_lpszTooltip | CPile | [protected]
m_lType | CPile |
m_lWidth | CPile | [protected]
m_lX | CPile |
m_lY | CPile |
m_pEngObjSite | CEngineObj | [protected]
m_pHH | CEngineObj | [protected]
m_pSite | CPile | [protected]
m_spEl | CEngineObj | [protected]
m_spImgElBase | CPile | [protected]
m_spStyle | CEngineObj | [protected]
pDispParams | CDispBase |
pExcepInfo | CDispBase |
PileReleaseElCapture() | CPile | [inline, virtual]
PileSetElCapture() | CPile | [inline, virtual]
plHeight | CPile |
plWidth | CPile |
ppCard | CPile |
ppTInfo | CDispBase |
ppvObject | CPile |
PreReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
PtInPile(POINT pt) | CPile |
puArgErr | CDispBase |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
PURE | INDUnknownAndDispatch |
pVarResult | CDispBase |
ReceiveCards(long lIndex, CPtrArray< CCard *, CCard * > &apSrc, long lIndexStart=0, long cCards=-1) | CPile |
ReleaseElCapture() | CPile | [protected, virtual]
rgDispId | CDispBase |
RgnInPile(HRGN hRgn) | CPile |
rgszNames | CDispBase |
riid | CDispBase |
SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex) | CPile | [virtual]
SetElCapture() | CPile | [protected, virtual]
SetEventHandlers() | CEngineObj | [protected]
STDMETHOD(get_Type)(long *p) | CPile |
STDMETHOD(get_X)(long *p) | CPile |
STDMETHOD(put_X)(long v) | CPile |
STDMETHOD(get_Y)(long *p) | CPile |
STDMETHOD(put_Y)(long v) | CPile |
STDMETHOD(get_Width)(long *p) | CPile |
STDMETHOD(get_Height)(long *p) | CPile |
STDMETHOD(get_NumCards)(long *p) | CPile |
STDMETHOD(get_CommentTooltip)(BSTR *pbstrText) | CPile |
STDMETHOD(put_CommentTooltip)(BSTR bstrText) | CPile |
STDMETHOD(get_ShowNumCardsTooltip)(VARIANT_BOOL *pbShow) | CPile |
STDMETHOD(put_ShowNumCardsTooltip)(VARIANT_BOOL bShow) | CPile |
STDMETHOD(get_BaseType)(long *p) | CPile |
STDMETHOD(put_BaseType)(long v) | CPile |
STDMETHOD(Shuffle)() | CPile |
STDMETHOD(GetCard)(long lIndex | CPile |
STDMETHOD(WidthWith)(long lNumCards | CPile |
STDMETHOD(HeightWith)(long lNumCards | CPile |
STDMETHOD(NDQueryInterface)(REFIID riid | CPile |
STDMETHOD_(ULONG, NDAddRef)() | CDispBase |
STDMETHOD_(ULONG, NDRelease)() | CDispBase |
TooltipPrefChanged() | CPile |
TransferCards(CPtrArray< CCard *, CCard * > &apDest) | CPile |
TransferCards(long lIndex, long cCards, CPtrArray< CCard *, CCard * > &apDest) | CPile |
UndoAction(CAction *pAction) | CPile | [virtual]
UpdateBaseImg() | CPile | [protected]
UpdateDims() | CPile | [protected]
UpdateLayout(int iBegin=0, int iEnd=-1) | CPile |
UpdateTooltip() | CPile | [protected]
wFlags | CDispBase |
~CDispBase() | CDispBase | [virtual]
~CEngineObj() | CEngineObj | [virtual]
~CPile() | CPile | [virtual]
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


CPileCommentAction Class Reference

Inheritance diagram for CPileCommentAction:

CAction List of all members.

Public Methods

CPileCommentAction (IActionSite *pSite)
virtual | ~CPileCommentAction ()

Protected Attributes

CTSTR m_lpszOld
CTSTR m_lpszNew

Friends

class | CPile

Constructor & Destructor Documentation

CPileCommentAction ( IActionSite * pSite )

Definition at line 121 of file Pile.cpp.

References ACTION_COMMENT.

00121                                                          : CAction(pSite, ACTION_COMMENT, 0)
00122 {
00123 }

virtual ~CPileCommentAction ( ) [inline, virtual]

Definition at line 103 of file Pile.cpp.

00103 {}

Friends And Related Function Documentation

friend class CPile [friend]

Definition at line 105 of file Pile.cpp.

Member Data Documentation

CTSTR m_lpszNew [protected]

Definition at line 109 of file Pile.cpp.

Referenced by CPile::DoAction().

CTSTR m_lpszOld [protected]

Definition at line 108 of file Pile.cpp.

Referenced by CPile::UndoAction().

The documentation for this class was generated from the following file:
  • Pile.cpp
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPileCommentAction Member List

This is the complete list of members for CPileCommentAction, including all inherited members.
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
CPile class | CPileCommentAction | [friend]
CPileCommentAction(IActionSite *pSite) | CPileCommentAction |
m_dwData | CAction |
m_dwType | CAction |
m_lpszNew | CPileCommentAction | [protected]
m_lpszOld | CPileCommentAction | [protected]
m_pNext | CAction |
m_pPrev | CAction |
m_pSite | CAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
~CPileCommentAction() | CPileCommentAction | [inline, virtual]
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


CPileShuffleAction Class Reference

Inheritance diagram for CPileShuffleAction:

CAction List of all members.

Public Methods

CPileShuffleAction (IActionSite *pSite)
virtual | ~CPileShuffleAction ()

Protected Attributes

CPtrArray< CCard *, CCard * > m_apCardsOld
CPtrArray< CCard *, CCard * > m_apCardsNew

Friends

class | CPile

Constructor & Destructor Documentation

CPileShuffleAction ( IActionSite * pSite )

Definition at line 84 of file Pile.cpp.

References ACTION_SHUFFLE, m_apCardsNew, m_apCardsOld, and CPtrArray< CCard *, CCard * >::SetRelease().

00084                                                          : CAction(pSite, ACTION_SHUFFLE, 0)
00085 {
00086    // Signify that the contained pointers are COM interface pointers that
00087    // should be released, not deleted, when destroyed.
00088    m_apCardsOld.SetRelease(TRUE);
00089    m_apCardsNew.SetRelease(TRUE);
00090 }

virtual ~CPileShuffleAction ( ) [inline, virtual]

Definition at line 66 of file Pile.cpp.

00066 {}

Friends And Related Function Documentation

friend class CPile [friend]

Definition at line 68 of file Pile.cpp.

Member Data Documentation

CPtrArray<CCard*, CCard*> m_apCardsNew [protected]

Definition at line 72 of file Pile.cpp.

Referenced by CPileShuffleAction(), CPile::DoAction(), and CPile::UndoAction().

CPtrArray<CCard*, CCard*> m_apCardsOld [protected]

Definition at line 71 of file Pile.cpp.

Referenced by CPileShuffleAction(), and CPile::UndoAction().

The documentation for this class was generated from the following file:
  • Pile.cpp
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPileShuffleAction Member List

This is the complete list of members for CPileShuffleAction, including all inherited members.
CAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CAction |
CPile class | CPileShuffleAction | [friend]
CPileShuffleAction(IActionSite *pSite) | CPileShuffleAction |
m_apCardsNew | CPileShuffleAction | [protected]
m_apCardsOld | CPileShuffleAction | [protected]
m_dwData | CAction |
m_dwType | CAction |
m_pNext | CAction |
m_pPrev | CAction |
m_pSite | CAction | [protected]
Redo() | CAction |
Undo() | CAction |
~CAction() | CAction | [virtual]
~CPileShuffleAction() | CPileShuffleAction | [inline, virtual]
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


TemplateCPointer class Reference

CPointer Class Template Reference

#include <bmws_pointer.h>

List of all members.

Public Methods

CPointer ()
CPointer (T *p)
~CPointer ()
operator T * ()
T & | operator * ()
T * | operator-> ()
CPointer & | operator= (CPointer< T > &p)
CPointer & | operator= (T *p)
BOOL | operator! ()
operator BOOL () const

Private Attributes

T * | m_p

template<class T>
class CPointer< T >

Constructor & Destructor Documentation

CPointer ( ) [inline]

Definition at line 116 of file bmws_pointer.h.

00117    {
00118       m_p = NULL;
00119    }

CPointer ( T * p ) [inline]

Definition at line 130 of file bmws_pointer.h.

00131    {
00132       m_p = p;
00133       if(m_p)
00134          m_p->upcount();
00135    }

~CPointer ( ) [inline]

Definition at line 143 of file bmws_pointer.h.

00144    {
00145       if(m_p)
00146          m_p->downcount();
00147    }

Member Function Documentation

T& operator * ( ) [inline]

Definition at line 174 of file bmws_pointer.h.

00175    {
00176       _ASSERT(m_p);
00177       return *m_p;
00178    }

operator BOOL ( ) const [inline]

Definition at line 258 of file bmws_pointer.h.

00259    {
00260       return (m_p != NULL);
00261    }

operator T * ( ) [inline]

Definition at line 159 of file bmws_pointer.h.

00160    {
00161       return m_p;
00162    }

BOOL operator! ( ) [inline]

Definition at line 243 of file bmws_pointer.h.

00244    {
00245       return (m_p == NULL);
00246    }

T* operator-> ( ) [inline]

Definition at line 190 of file bmws_pointer.h.

00191    {
00192       _ASSERT(m_p);
00193       return m_p;
00194    }

CPointer& operator= ( T * p ) [inline]

Definition at line 223 of file bmws_pointer.h.

00224    {
00225       if(m_p)
00226          m_p->downcount();
00227       m_p = p;
00228       if(m_p)
00229          m_p->upcount();
00230       return *this;
00231    }

CPointer& operator= ( CPointer< T > & p ) [inline]

Definition at line 207 of file bmws_pointer.h.

Referenced by CPointer< CStatusBar >::operator=().

00208    {
00209       return operator=((T*)p);
00210    }

Member Data Documentation

T* m_p [private]

Definition at line 265 of file bmws_pointer.h.

Referenced by CPointer< CStatusBar >::CPointer(), CPointer< CStatusBar >::operator *(), CPointer< CStatusBar >::operator BOOL(), CPointer< CStatusBar >::operator T *(), CPointer< CStatusBar >::operator!(), CPointer< CStatusBar >::operator->(), CPointer< CStatusBar >::operator=(), and CPointer< CStatusBar >::~CPointer().

The documentation for this class was generated from the following file:
  • bmws_pointer.h
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPointer Member List

This is the complete list of members for CPointer, including all inherited members.
CPointer() | CPointer | [inline]
CPointer(T *p) | CPointer | [inline]
m_p | CPointer | [private]
operator *() | CPointer | [inline]
operator BOOL() const | CPointer | [inline]
operator T *() | CPointer | [inline]
operator!() | CPointer | [inline]
operator->() | CPointer | [inline]
operator=(CPointer< T > &p) | CPointer | [inline]
operator=(T *p) | CPointer | [inline]
~CPointer() | CPointer | [inline]
Generated on Wed May 8 12:39:54 2002 for Solitaire Pack by doxygen 1.2.15


TemplateCPtr class Reference

CPtr Class Template Reference

#include <bmws_ptr.h>

List of all members.

Public Methods

CPtr ()
CPtr (const CPtr< T, piid > &lp)
CPtr (BOOL, LPVOID pI)
CPtr (IUnknown *pI)
~CPtr ()
void | Release ()
operator T * ()
T & | operator * ()
T ** | operator & ()
T * | operator-> ()
T * | operator= (T *pI)
CPtr< T, piid > & | operator= (const CPtr< T, piid > &lp)
BOOL | operator! ()
operator BOOL () const
T * | Assign (IUnknown *pI)
void | Assign (BOOL, LPVOID pI)

Private Attributes

T * | m_pI

template<class T, const IID * piid>
class CPtr< T, piid >

Constructor & Destructor Documentation

CPtr ( ) [inline]

Definition at line 40 of file bmws_ptr.h.

00041    {
00042       m_pI = NULL;
00043    }

CPtr ( const CPtr< T, piid > & lp ) [inline]

Definition at line 54 of file bmws_ptr.h.

00055    {
00056       m_pI = lp.m_pI;
00057       if(m_pI)
00058          m_pI->AddRef();
00059    }

CPtr | ( | BOOL | ,
 |  | LPVOID | pI
 | ) | [inline]

Definition at line 71 of file bmws_ptr.h.

00072    {
00073       m_pI = (T*)pI;
00074    }

CPtr ( IUnknown * pI ) [inline]

Definition at line 86 of file bmws_ptr.h.

00087    {
00088       m_pI = NULL;
00089       if(pI)
00090          CHECKHRCOM(pI->QueryInterface(*piid, (LPVOID*)&m_pI));
00091    }

~CPtr ( ) [inline]

Definition at line 99 of file bmws_ptr.h.

00100    {
00101       Release();
00102    }

Member Function Documentation

void Assign | ( | BOOL | ,
 |  | LPVOID | pI
 | ) | [inline]

Definition at line 290 of file bmws_ptr.h.

00291    {
00292       SAFERELEASE(m_pI);
00293       m_pI = (T*)pI;
00294    }

T* Assign ( IUnknown * pI ) [inline]

Definition at line 272 of file bmws_ptr.h.

Referenced by CHTMLHelper::CreateElement(), C3DShatter::DoAnimation(), CGameMenu::FillGameInfo(), CHTMLHelper::GetRuleStyle(), and CHTMLHelper::GetStyleSheet().

00273    {
00274       SAFERELEASE(m_pI);
00275       if(pI)
00276          CHECKHRCOM(pI->QueryInterface(*piid, (LPVOID*)&m_pI));
00277       return m_pI;
00278    }

T** operator & ( ) [inline]

Definition at line 162 of file bmws_ptr.h.

00163    {
00164       return &m_pI;
00165    }

T& operator * ( ) [inline]

Definition at line 145 of file bmws_ptr.h.

00146    {
00147       if(!m_pI)
00148          THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
00149       return *m_pI;
00150    }

operator BOOL ( ) const [inline]

Definition at line 255 of file bmws_ptr.h.

00256    {
00257       return (m_pI != NULL);
00258    }

operator T * ( ) [inline]

Definition at line 130 of file bmws_ptr.h.

00131    {
00132       return m_pI;
00133    }

BOOL operator! ( ) [inline]

Definition at line 240 of file bmws_ptr.h.

00241    {
00242       return (m_pI == NULL);
00243    }

T* operator-> ( ) [inline]

Definition at line 177 of file bmws_ptr.h.

00178    {
00179       if(!m_pI)
00180          THROW(new CCOMExcep(E_FAIL), CCOMExcep*);
00181       return m_pI;
00182    }

CPtr<T, piid>& operator= ( const CPtr< T, piid > & lp ) [inline]

Definition at line 220 of file bmws_ptr.h.

00221    {
00222       IUnknown *pOld = m_pI;
00223       m_pI = lp.m_pI;
00224       if(m_pI)
00225          m_pI->AddRef();
00226       SAFERELEASE(pOld);
00227       return *this;
00228    }

T* operator= ( T * pI ) [inline]

Definition at line 196 of file bmws_ptr.h.

00197    {
00198       if(m_pI != pI)
00199       {
00200          IUnknown *pOld = m_pI;
00201          m_pI = pI;
00202          if(m_pI)
00203             m_pI->AddRef();
00204          SAFERELEASE(pOld);
00205       }
00206       return m_pI;
00207    }

void Release ( ) [inline]

Definition at line 115 of file bmws_ptr.h.

Referenced by CGameSpider::CheckPile(), and CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::~CPtr().

00116    {
00117       SAFERELEASE(m_pI);
00118    }

Member Data Documentation

T* m_pI [private]

Definition at line 298 of file bmws_ptr.h.

Referenced by CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Assign(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::CPtr(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator &(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator *(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator BOOL(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator T *(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator!(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator->(), CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::operator=(), and CPtr< IHTMLImgElement,&IID_IHTMLImgElement >::Release().

The documentation for this class was generated from the following file:
  • bmws_ptr.h
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPtr Member List

This is the complete list of members for CPtr, including all inherited members.
Assign(IUnknown *pI) | CPtr | [inline]
Assign(BOOL, LPVOID pI) | CPtr | [inline]
CPtr() | CPtr | [inline]
CPtr(const CPtr< T, piid > &lp) | CPtr | [inline]
CPtr(BOOL, LPVOID pI) | CPtr | [inline]
CPtr(IUnknown *pI) | CPtr | [inline]
m_pI | CPtr | [private]
operator &() | CPtr | [inline]
operator *() | CPtr | [inline]
operator BOOL() const | CPtr | [inline]
operator T *() | CPtr | [inline]
operator!() | CPtr | [inline]
operator->() | CPtr | [inline]
operator=(T *pI) | CPtr | [inline]
operator=(const CPtr< T, piid > &lp) | CPtr | [inline]
Release() | CPtr | [inline]
~CPtr() | CPtr | [inline]
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


TemplateCPtrArray class Reference

CPtrArray Class Template Reference

#include <bmws_array.h>

Inheritance diagram for CPtrArray:

CArray< TP, TPA > List of all members.

Public Methods

CPtrArray ()
CPtrArray (TP *a, int nCount)
virtual | ~CPtrArray ()
void | SetRelease (BOOL bRelease)
virtual void | SetAt (int nIndex, TPA newElement)
virtual void | RemoveAt (int nIndex, int nCount=1)

Protected Attributes

BOOL | m_bRelease

template<class TP, class TPA>
class CPtrArray< TP, TPA >

Constructor & Destructor Documentation

CPtrArray ( ) [inline]

Definition at line 603 of file bmws_array.h.

00603                : CArray<TP, TPA>()
00604    {
00605       m_bRelease = FALSE;
00606    }

CPtrArray | ( | TP * | a,
 |  | int | nCount
 | ) | [inline]

Definition at line 618 of file bmws_array.h.

00618                                 : CArray(a, nCount)
00619    {
00620       m_bRelease = FALSE;
00621    }

~CPtrArray ( ) [virtual]

Definition at line 681 of file bmws_array.h.

References CArray< TP, TPA >::m_nSize, CArray< TP, TPA >::m_pData, RemoveAt(), and SAFEFREEMEMORY.

00682 {
00683    if(m_pData != NULL)
00684    {
00685       RemoveAt(0, m_nSize);
00686       SAFEFREEMEMORY(m_pData);
00687    }
00688 }

Member Function Documentation

void RemoveAt | ( | int | nIndex,
 |  | int | nCount = 1
 | ) | [virtual]

Reimplemented from CArray< TP, TPA >.

Definition at line 703 of file bmws_array.h.

References _ASSERT, CArray< TP, TPA >::m_nSize, and CArray< TP, TPA >::m_pData.

Referenced by ~CPtrArray().

00704 {
00705    _ASSERT(nIndex >= 0);
00706    _ASSERT(nCount >= 0);
00707    _ASSERT((nIndex + nCount) <= m_nSize);
00708
00709    // just remove a range
00710    int nMoveCount = m_nSize - (nIndex + nCount);
00711    int nCount2 = nCount;
00712    TP* pElements = &m_pData[nIndex];
00713    for (; nCount2--; pElements++)
00714       if(*pElements)
00715       {
00716          if(m_bRelease)
00717             ((IUnknown*)(*pElements))->Release();
00718          else
00719             delete *pElements;
00720       }
00721    if(nMoveCount)
00722       MoveMemory(&m_pData[nIndex], &m_pData[nIndex + nCount], nMoveCount * sizeof(TP));
00723    m_nSize -= nCount;
00724 }

virtual void SetAt | ( | int | nIndex,
 |  | TPA | newElement
 | ) | [inline, virtual]

Reimplemented from CArray< TP, TPA >.

Definition at line 656 of file bmws_array.h.

00657    {
00658       _ASSERT((nIndex >= 0) && (nIndex < m_nSize));
00659       if(m_pData[nIndex])
00660       {
00661          if(m_bRelease)
00662             ((IUnknown*)((TP)m_pData[nIndex]))->Release();
00663          else
00664             delete (TP)m_pData[nIndex];
00665       }
00666       CArray<TP, TPA>::SetAt(nIndex, newElement);
00667    }

void SetRelease ( BOOL bRelease ) [inline]

Definition at line 638 of file bmws_array.h.

00639    {
00640       m_bRelease = bRelease;
00641    }

Member Data Documentation

BOOL m_bRelease [protected]

Definition at line 672 of file bmws_array.h.

Referenced by CPtrArray< CFragmentAdd *, CFragmentAdd * >::CPtrArray(), and CPtrArray< CFragmentAdd *, CFragmentAdd * >::SetRelease().

The documentation for this class was generated from the following file:
  • bmws_array.h
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CPtrArray Member List

This is the complete list of members for CPtrArray, including all inherited members.
Add(TPA newElement) | CArray< TP, TPA > | [inline]
Append(const CArray &src) | CArray< TP, TPA > |
CArray() | CArray< TP, TPA > |
CArray(TP *a, int nCount) | CArray< TP, TPA > |
Copy(const CArray &src) | CArray< TP, TPA > |
CPtrArray() | CPtrArray | [inline]
CPtrArray(TP *a, int nCount) | CPtrArray | [inline]
ElementAt(int nIndex) | CArray< TP, TPA > | [inline]
GetAt(int nIndex) const | CArray< TP, TPA > | [inline]
GetData() const | CArray< TP, TPA > | [inline]
GetData() | CArray< TP, TPA > | [inline]
GetSize() const | CArray< TP, TPA > | [inline]
InsertAt(int nIndex, TPA newElement, int nCount=1) | CArray< TP, TPA > |
InsertAt(int nIndex, CArray *pNewArray) | CArray< TP, TPA > |
m_bRelease | CPtrArray | [protected]
m_nGrowBy | CArray< TP, TPA > | [protected]
m_nMaxSize | CArray< TP, TPA > | [protected]
m_nSize | CArray< TP, TPA > | [protected]
m_pData | CArray< TP, TPA > | [protected]
operator[](int nIndex) const | CArray< TP, TPA > | [inline]
operator[](int nIndex) | CArray< TP, TPA > | [inline]
RemoveAll() | CArray< TP, TPA > | [inline]
RemoveAt(int nIndex, int nCount=1) | CPtrArray | [virtual]
SetAt(int nIndex, TPA newElement) | CPtrArray | [inline, virtual]
SetAtGrow(int nIndex, TPA newElement) | CArray< TP, TPA > |
SetRelease(BOOL bRelease) | CPtrArray | [inline]
SetSize(int nNewSize, int nGrowBy=-1) | CArray< TP, TPA > |
~CArray() | CArray< TP, TPA > | [virtual]
~CPtrArray() | CPtrArray | [virtual]
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


CQuitExcep Class Reference

#include <ProcessMsg.h>

Inheritance diagram for CQuitExcep:

CExcep List of all members.

Public Methods

CQuitExcep ()
virtual void Report ()

Constructor & Destructor Documentation

CQuitExcep ( ) [inline]

Definition at line 34 of file ProcessMsg.h.

00034                 : CExcep(0)
00035    {
00036    }

Member Function Documentation

virtual void Report ( ) [inline, virtual]

Reimplemented from CExcep.

Definition at line 38 of file ProcessMsg.h.

00039    {
00040    }

The documentation for this class was generated from the following file:
  • ProcessMsg.h
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CQuitExcep Member List

This is the complete list of members for CQuitExcep, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
CQuitExcep() | CQuitExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
Report() | CQuitExcep | [inline, virtual]
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


CRefCount Class Reference

#include <bmws_pointer.h>

Inheritance diagram for CRefCount:

CHlinkWindowMgr CHWND CShellDataObj CXMLDocument CXMLElement CHelpPane CMainWindow CSplashWindow CStatusBar CCompoundXMLDocument List of all members.

Public Methods

CRefCount ()
virtual | ~CRefCount ()
void | upcount ()
void | downcount ()

Private Attributes

int | m_cRefs

Constructor & Destructor Documentation

CRefCount ( ) [inline]

Definition at line 30 of file bmws_pointer.h.

References m_cRefs.

00031    {
00032       m_cRefs = 0;
00033 #ifdef BMWS_TRACKMEMALLOC
00034       m_scTotalCreated++;
00035 #endif
00036    }

virtual ~CRefCount ( ) [inline, virtual]

Definition at line 44 of file bmws_pointer.h.

00045    {
00046 #ifdef BMWS_TRACKMEMALLOC
00047       m_scTotalDeleted++;
00048 #endif
00049    }

Member Function Documentation

void downcount ( ) [inline]

Definition at line 79 of file bmws_pointer.h.

References m_cRefs.

00080    {
00081       m_cRefs--;
00082       if(m_cRefs == 0)
00083          delete this;
00084    }

void upcount ( ) [inline]

Definition at line 63 of file bmws_pointer.h.

References m_cRefs.

00064    {
00065       m_cRefs++;
00066    }

Member Data Documentation

int m_cRefs [private]

Definition at line 94 of file bmws_pointer.h.

Referenced by CRefCount(), downcount(), and upcount().

The documentation for this class was generated from the following file:
  • bmws_pointer.h
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CRefCount Member List

This is the complete list of members for CRefCount, including all inherited members.
CRefCount() | CRefCount | [inline]
downcount() | CRefCount | [inline]
m_cRefs | CRefCount | [private]
upcount() | CRefCount | [inline]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


CRegDlgInfo Class Reference

Inheritance diagram for CRegDlgInfo:

IHlinkWindowSite List of all members.

Public Methods

CRegDlgInfo ()
virtual | ~CRegDlgInfo ()
virtual void | HlinkClicked (DWORD dwID)

Public Attributes

HKEY | hKeyProduct
CTSTR * plpszProduct
CTSTR * plpszURL
int | iHash
int | bValid
CHlinkWindowMgr * pHlinkMgr
COLORREF | color
HWND | hDlg

Constructor & Destructor Documentation

CRegDlgInfo ( )

Definition at line 57 of file bmws_regservices.cpp.

References hDlg, and pHlinkMgr.

00058 {
00059    hDlg = NULL;
00060    pHlinkMgr = NULL;
00061 }

~CRegDlgInfo ( ) [virtual]

Definition at line 69 of file bmws_regservices.cpp.

References pHlinkMgr, and SAFEDELETE.

00070 {
00071    SAFEDELETE(pHlinkMgr);
00072 }

Member Function Documentation

void HlinkClicked ( DWORD dwID ) [virtual]

Implements IHlinkWindowSite.

Definition at line 86 of file bmws_regservices.cpp.

References ExecURL(), hDlg, and plpszURL.

00087 {
00088    EndDialog(hDlg, IDCANCEL);
00089    ExecURL(*plpszURL);
00090 }

Member Data Documentation

int bValid

Definition at line 45 of file bmws_regservices.cpp.

Referenced by ShowRegistrationDialog().

COLORREF color

Definition at line 47 of file bmws_regservices.cpp.

Referenced by RegistrationProc(), and ShowRegistrationDialog().

HWND hDlg

Definition at line 48 of file bmws_regservices.cpp.

Referenced by CRegDlgInfo(), HlinkClicked(), RegistrationProc(), and ShowRegistrationDialog().

HKEY hKeyProduct

Definition at line 41 of file bmws_regservices.cpp.

Referenced by ShowRegistrationDialog().

int iHash

Definition at line 44 of file bmws_regservices.cpp.

Referenced by ShowRegistrationDialog().

CHlinkWindowMgr* pHlinkMgr

Definition at line 46 of file bmws_regservices.cpp.

Referenced by CRegDlgInfo(), RegistrationProc(), ShowRegistrationDialog(), and ~CRegDlgInfo().

CTSTR* plpszProduct

Definition at line 42 of file bmws_regservices.cpp.

Referenced by RegistrationProc(), and ShowRegistrationDialog().

CTSTR* plpszURL

Definition at line 43 of file bmws_regservices.cpp.

Referenced by HlinkClicked(), RegistrationProc(), and ShowRegistrationDialog().

The documentation for this class was generated from the following file:
  • bmws_regservices.cpp
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CRegDlgInfo Member List

This is the complete list of members for CRegDlgInfo, including all inherited members.
bValid | CRegDlgInfo |
color | CRegDlgInfo |
CRegDlgInfo() | CRegDlgInfo |
hDlg | CRegDlgInfo |
hKeyProduct | CRegDlgInfo |
HlinkClicked(DWORD dwID) | CRegDlgInfo | [virtual]
iHash | CRegDlgInfo |
pHlinkMgr | CRegDlgInfo |
plpszProduct | CRegDlgInfo |
plpszURL | CRegDlgInfo |
~CRegDlgInfo() | CRegDlgInfo | [virtual]
Generated on Wed May 8 12:39:55 2002 for Solitaire Pack by doxygen 1.2.15


CScriptFn Class Reference

#include <bmws_scriptfn.h>

List of all members.

Public Methods

CScriptFn (DISPID dispid, UINT uidName)
STDMETHOD (QueryInterface)(REFIID riid
STDMETHOD_ (ULONG, AddRef)()
STDMETHOD_ (ULONG, Release)()
STDMETHOD (GetIDsOfNames)(REFIID riid
STDMETHOD (GetTypeInfo)(unsigned int itinfo
STDMETHOD (GetTypeInfoCount)(unsigned int FAR *pctinfo)
STDMETHOD (Invoke)(DISPID dispid

Static Public Methods

void | Create (IDispatchEx *pDispEx, IDispatch *pImplementor, DISPID dispid, UINT uidName)
void | CreateArray (IDispatchEx *pDispEx, IDispatch *pImplementor, UINT uidBase, UINT cItems)

Public Attributes

LPVOID * | ppvObject
OLECHAR FAR *FAR * | rgszNames
OLECHAR FAR *FAR unsigned int | cNames
OLECHAR FAR *FAR unsigned
int LCID 		lcid
OLECHAR FAR *FAR unsigned
int LCID DISPID FAR * 		rgdispid
LCID | lcid
LCID ITypeInfo FAR *FAR * | pptinfo
REFIID | riid
REFIID LCID | lcid
REFIID LCID WORD | wFlags
REFIID LCID WORD DISPPARAMS
FAR * 		pdispparams
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR * 		pvarResult
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR * 		pexecinfo
REFIID LCID WORD DISPPARAMS
FAR VARIANT FAR EXCEPINFO
FAR unsigned int FAR * 		puArgErr

Protected Attributes

CPtr< IDispatch,&IID_IDispatch > | m_pImplementor
DWORD | m_dwRefCount
DISPID | m_dispid
UINT | m_uidName

Constructor & Destructor Documentation

CScriptFn | ( | DISPID | dispid,
 |  | UINT | uidName
 | ) |

Definition at line 37 of file bmws_scriptfn.cpp.

References m_dispid, m_dwRefCount, m_uidName, and ODS.

Referenced by Create().

00038 {
00039    ODS("CScriptFn constructor");
00040    m_dispid = dispid;
00041    m_uidName = uidName;
00042    m_dwRefCount = 0;
00043 #ifdef BMWS_TRACKMEMALLOC
00044    m_scTotalCreated++;
00045 #endif
00046 }

Member Function Documentation

void Create | ( | IDispatchEx * | pDispEx,
 |  | IDispatch * | pImplementor,
 |  | DISPID | dispid,
 |  | UINT | uidName
 | ) | [static]

Definition at line 157 of file bmws_scriptfn.cpp.

References _ASSERT, CHECKHRCOM, CScriptFn(), ENSUREALLOC, m_pImplementor, m_uidName, and SAFERELEASE.

Referenced by CreateArray().

00159 {
00160    _ASSERT(pDispEx);
00161    _ASSERT(pImplementor);
00162
00163    CScriptFn *pFn = new CScriptFn(dispid, uidName);
00164    ENSUREALLOC(pFn);
00165    pFn->AddRef();
00166
00167    pFn->m_pImplementor = pImplementor;
00168    DISPID d;
00169    CHECKHRCOM(pDispEx->GetDispID(CBSTR(pFn->m_uidName), fdexNameEnsure, &d));
00170
00171    VARIANT vHandler;
00172    vHandler.vt = VT_DISPATCH;
00173    vHandler.pdispVal = (LPDISPATCH)pFn;
00174
00175    DISPPARAMS dp;
00176    DISPID dispidParam = DISPID_PROPERTYPUT;
00177    dp.cArgs = 1;
00178    dp.cNamedArgs = 1;
00179    dp.rgdispidNamedArgs = &dispidParam;
00180    dp.rgvarg = &vHandler;
00181
00182    try
00183    {
00184       CHECKHRCOM(pDispEx->InvokeEx(d, GetUserDefaultLCID(), DISPATCH_PROPERTYPUT, &dp, NULL,
00185          NULL, NULL));
00186    }
00187    catch(CExcep *pE)
00188    {
00189       SAFERELEASE(pFn);
00190       throw pE;
00191    }
00192
00193    SAFERELEASE(pFn);
00194 }

void CreateArray | ( | IDispatchEx * | pDispEx,
 |  | IDispatch * | pImplementor,
 |  | UINT | uidBase,
 |  | UINT | cItems
 | ) | [static]

Definition at line 213 of file bmws_scriptfn.cpp.

References Create().

00215 {
00216    for(UINT i = uidBase; i < uidBase + cItems; i++)
00217    {
00218       Create(pDispEx, pImplementor, (DISPID)i, i);
00219    }
00220 }

STDMETHOD ( Invoke )

STDMETHOD ( GetTypeInfoCount )

STDMETHOD ( GetTypeInfo )

STDMETHOD ( GetIDsOfNames )

STDMETHOD ( QueryInterface )

STDMETHOD_ | ( | ULONG | ,
 |  | Release |
 | ) |

STDMETHOD_ | ( | ULONG | ,
 |  | AddRef |
 | ) |

Member Data Documentation

OLECHAR FAR* FAR unsigned int cNames

Definition at line 57 of file bmws_scriptfn.h.

REFIID LCID lcid

Definition at line 61 of file bmws_scriptfn.h.

LCID lcid

Definition at line 59 of file bmws_scriptfn.h.

OLECHAR FAR* FAR unsigned int LCID lcid

Definition at line 57 of file bmws_scriptfn.h.

DISPID m_dispid [protected]

Definition at line 78 of file bmws_scriptfn.h.

Referenced by CScriptFn().

DWORD m_dwRefCount [protected]

Definition at line 77 of file bmws_scriptfn.h.

Referenced by CScriptFn().

CPtr<IDispatch, &IID_IDispatch> m_pImplementor [protected]

Definition at line 76 of file bmws_scriptfn.h.

Referenced by Create().

UINT m_uidName [protected]

Definition at line 79 of file bmws_scriptfn.h.

Referenced by Create(), and CScriptFn().

REFIID LCID WORD DISPPARAMS FAR* pdispparams

Definition at line 61 of file bmws_scriptfn.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR* pexecinfo

Definition at line 61 of file bmws_scriptfn.h.

LCID ITypeInfo FAR* FAR* pptinfo

Definition at line 59 of file bmws_scriptfn.h.

LPVOID* ppvObject

Definition at line 52 of file bmws_scriptfn.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR EXCEPINFO FAR unsigned int FAR* puArgErr

Definition at line 61 of file bmws_scriptfn.h.

REFIID LCID WORD DISPPARAMS FAR VARIANT FAR* pvarResult

Definition at line 61 of file bmws_scriptfn.h.

OLECHAR FAR* FAR unsigned int LCID DISPID FAR* rgdispid

Definition at line 57 of file bmws_scriptfn.h.

OLECHAR FAR* FAR* rgszNames

Definition at line 57 of file bmws_scriptfn.h.

REFIID riid

Definition at line 61 of file bmws_scriptfn.h.

REFIID LCID WORD wFlags

Definition at line 61 of file bmws_scriptfn.h.

The documentation for this class was generated from the following files:
  • bmws_scriptfn.h
  • bmws_scriptfn.cpp
Generated on Wed May 8 12:39:56 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CScriptFn Member List

This is the complete list of members for CScriptFn, including all inherited members.
cNames | CScriptFn |
Create(IDispatchEx *pDispEx, IDispatch *pImplementor, DISPID dispid, UINT uidName) | CScriptFn | [static]
CreateArray(IDispatchEx *pDispEx, IDispatch *pImplementor, UINT uidBase, UINT cItems) | CScriptFn | [static]
CScriptFn(DISPID dispid, UINT uidName) | CScriptFn |
lcid | CScriptFn |
lcid | CScriptFn |
lcid | CScriptFn |
m_dispid | CScriptFn | [protected]
m_dwRefCount | CScriptFn | [protected]
m_pImplementor | CScriptFn | [protected]
m_uidName | CScriptFn | [protected]
pdispparams | CScriptFn |
pexecinfo | CScriptFn |
pptinfo | CScriptFn |
ppvObject | CScriptFn |
puArgErr | CScriptFn |
pvarResult | CScriptFn |
rgdispid | CScriptFn |
rgszNames | CScriptFn |
riid | CScriptFn |
STDMETHOD(QueryInterface)(REFIID riid | CScriptFn |
STDMETHOD(GetIDsOfNames)(REFIID riid | CScriptFn |
STDMETHOD(GetTypeInfo)(unsigned int itinfo | CScriptFn |
STDMETHOD(GetTypeInfoCount)(unsigned int FAR *pctinfo) | CScriptFn |
STDMETHOD(Invoke)(DISPID dispid | CScriptFn |
STDMETHOD_(ULONG, AddRef)() | CScriptFn |
STDMETHOD_(ULONG, Release)() | CScriptFn |
wFlags | CScriptFn |
Generated on Wed May 8 12:39:56 2002 for Solitaire Pack by doxygen 1.2.15


CShellDataObj Class Reference

#include <bmws_shelldataobj.h>

Inheritance diagram for CShellDataObj:

CRefCount List of all members.

Public Methods

CShellDataObj (IDataObject *pDataObj)
virtual | ~CShellDataObj ()
UINT | GetNumFiles ()
CTSTR | GetFileExt (UINT iFile)
CTSTR | GetFileName (UINT iFile)
void | GetFileNameArray (CTSTRArray &alpszFiles)

Protected Attributes

STGMEDIUM | m_medium

Constructor & Destructor Documentation

CShellDataObj ( IDataObject * pDataObj )

Definition at line 25 of file bmws_shelldataobj.cpp.

References m_medium.

00026 {
00027    FORMATETC fmte = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
00028    pDataObj->GetData(&fmte, &m_medium);
00029 }

~CShellDataObj ( ) [virtual]

Definition at line 37 of file bmws_shelldataobj.cpp.

References m_medium.

00038 {
00039    ReleaseStgMedium(&m_medium);
00040 }

Member Function Documentation

CTSTR GetFileExt ( UINT iFile )

Definition at line 72 of file bmws_shelldataobj.cpp.

References m_medium.

00073 {
00074    if(m_medium.hGlobal)
00075    {
00076       CTSTR lpsz(TRUE, MAX_PATH);
00077       DragQueryFile((HDROP)m_medium.hGlobal, iFile, lpsz, MAX_PATH);
00078       LPTSTR lpszExtension = PathFindExtension(lpsz);
00079       if(lpszExtension)
00080          return CTSTR(lpszExtension+1);
00081    }
00082    return CTSTR();
00083 }

CTSTR GetFileName ( UINT iFile )

Definition at line 97 of file bmws_shelldataobj.cpp.

References m_medium.

00098 {
00099    if(m_medium.hGlobal)
00100    {
00101       CTSTR lpszFile(TRUE, MAX_PATH);
00102       DragQueryFile((HDROP)m_medium.hGlobal, iFile, lpszFile, MAX_PATH);
00103       return lpszFile;
00104    }
00105    return CTSTR();
00106 }

void GetFileNameArray ( CTSTRArray & alpszFiles )

Definition at line 121 of file bmws_shelldataobj.cpp.

References m_medium, CArray< CTSTR, CTSTR & >::RemoveAll(), and CArray< CTSTR, CTSTR & >::SetSize().

00122 {
00123    if(!m_medium.hGlobal)
00124       return;
00125    alpszFiles.RemoveAll();
00126    UINT cFiles = DragQueryFile((HDROP)m_medium.hGlobal, (UINT)-1, NULL, 0);
00127    alpszFiles.SetSize(cFiles);
00128    for(UINT i = 0; i < cFiles; i++)
00129    {
00130       alpszFiles[i].Alloc(MAX_PATH);
00131       DragQueryFile((HDROP)m_medium.hGlobal, i, alpszFiles[i], MAX_PATH);
00132    }
00133 }

UINT GetNumFiles ( )

Definition at line 53 of file bmws_shelldataobj.cpp.

References m_medium.

00054 {
00055    if(m_medium.hGlobal)
00056       return DragQueryFile((HDROP)m_medium.hGlobal, (UINT)-1, NULL, 0);
00057    return 0;
00058 }

Member Data Documentation

STGMEDIUM m_medium [protected]

Definition at line 38 of file bmws_shelldataobj.h.

Referenced by CShellDataObj(), GetFileExt(), GetFileName(), GetFileNameArray(), GetNumFiles(), and ~CShellDataObj().

The documentation for this class was generated from the following files:
  • bmws_shelldataobj.h
  • bmws_shelldataobj.cpp
Generated on Wed May 8 12:39:56 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CShellDataObj Member List

This is the complete list of members for CShellDataObj, including all inherited members.
CRefCount() | CRefCount | [inline]
CShellDataObj(IDataObject *pDataObj) | CShellDataObj |
downcount() | CRefCount | [inline]
GetFileExt(UINT iFile) | CShellDataObj |
GetFileName(UINT iFile) | CShellDataObj |
GetFileNameArray(CTSTRArray &alpszFiles) | CShellDataObj |
GetNumFiles() | CShellDataObj |
m_medium | CShellDataObj | [protected]
upcount() | CRefCount | [inline]
~CRefCount() | CRefCount | [inline, virtual]
~CShellDataObj() | CShellDataObj | [virtual]
Generated on Wed May 8 12:39:56 2002 for Solitaire Pack by doxygen 1.2.15


CSolpackApp Class Reference

#include <SolpackApp.h>

Inheritance diagram for CSolpackApp:

IMsgProcessor List of all members.

Public Methods

CSolpackApp ()
virtual | ~CSolpackApp ()
int | Run (HINSTANCE hInst, LPSTR lpCmdLine, int nCmdShow)
BOOL | CreateMainWindow (CSplashWindow *pSplash, int nCmdShow)
void | ProcessMessage (LPMSG lpMsg)
void | EmptyMessageQueue (BOOL bCheckQuit)

Protected Methods

void | Register (BOOL bCheckNewVer, BOOL bCheckExtras)
void | Unregister ()

Protected Attributes

CMainWindow * m_pMainWindow

Constructor & Destructor Documentation

CSolpackApp ( )

Definition at line 60 of file SolpackApp.cpp.

References BMWSMemInit(), g_bExited, g_hWnd, and m_pMainWindow.

00061 {
00062    #ifdef BMWS_TRACKMEMALLOC
00063       BMWSMemInit();
00064    #endif
00065
00066    // Initialize member variables
00067    m_pMainWindow = NULL;
00068    g_hWnd = NULL;
00069    g_bExited = FALSE;
00070 }

~CSolpackApp ( ) [virtual]

Definition at line 78 of file SolpackApp.cpp.

References BMWSMemUninit().

00079 {
00080    // Track the number of Action objects created, just for fun
00081    #ifdef BMWS_TRACKMEMALLOC
00082       TCHAR szBuf[256];
00083       wsprintf(szBuf, TEXT("\nActions:\n  Allocated:  \t%d\n  Freed:      \t%d\n  Difference: \t%d\n  Maximum:    \t%d\n\n"),
00084          CAction::m_scTotalCreated, CAction::m_scTotalDeleted, CAction::m_scTotalCreated -
00085          CAction::m_scTotalDeleted, CAction::m_scMax);
00086       OutputDebugString(szBuf);
00087
00088       BMWSMemUninit();
00089    #endif
00090 }

Member Function Documentation

BOOL CreateMainWindow | ( | CSplashWindow * | pSplash,
 |  | int | nCmdShow
 | ) |

Definition at line 287 of file SolpackApp.cpp.

References CMainWindow::Create(), ENSUREALLOC, m_pMainWindow, and CMainWindow::Register().

Referenced by Run().

00288 {
00289    CWaitCursor wait; // Could take a while
00290
00291    // Do actual creation and display of main window
00292    m_pMainWindow = new CMainWindow((IMsgProcessor*)this);
00293    ENSUREALLOC(m_pMainWindow);
00294    m_pMainWindow->Register();
00295    if(!m_pMainWindow->Create(pSplash, nCmdShow))
00296       return FALSE;
00297
00298    return TRUE;
00299 }

void EmptyMessageQueue ( BOOL bCheckQuit ) [virtual]

Implements IMsgProcessor.

Definition at line 336 of file SolpackApp.cpp.

References g_bExited, and ProcessMessage().

00337 {
00338    MSG msg;
00339    while(PeekMessage(&msg, NULL,  0, 0, PM_REMOVE))
00340       ProcessMessage(&msg);
00341    if(bCheckQuit && g_bExited)
00342       throw new CQuitExcep;
00343 }

void ProcessMessage ( LPMSG lpMsg ) [virtual]

Implements IMsgProcessor.

Definition at line 313 of file SolpackApp.cpp.

References m_pMainWindow, and CMainWindow::PreprocessMessage().

Referenced by EmptyMessageQueue(), and Run().

00314 {
00315    // Let the main window have a crack at it first
00316    if(!m_pMainWindow->PreprocessMessage(lpMsg))
00317    {
00318       TranslateMessage(lpMsg);
00319       DispatchMessage(lpMsg);
00320    }
00321 }

void Register | ( | BOOL | bCheckNewVer,
 |  | BOOL | bCheckExtras
 | ) | [protected]

Definition at line 359 of file SolpackApp.cpp.

References CATID_SolpackGameLibs, CHECKHRCOM, CUINTArray, g_hInst, GetProductKey(), IDS_CATDESC, IDS_REG_EVENTSTITLE, IDS_REG_NOTIFYEXTRAS, IDS_REG_NOTIFYUPDATE, IDS_SOUNDFILE_SHUFFLE, CBSTR::Len(), LIBID_SolpackLib, CBSTR::m_bstr, RegisterTLB(), CUserPrefs::s_auidDisplays, CUserPrefs::s_auidSounds, SAFERELEASE, CCPSounds::Save(), CArray< CTSTR, CTSTR & >::SetAt(), SetRegDWORDValue(), CArray< CTSTR, CTSTR & >::SetSize(), and SOLPACK_LCID.

Referenced by Run().

00360 {
00361    // Register type library
00362    CHECKHRCOM(RegisterTLB(LIBID_SolpackLib, 1, 0));
00363
00364    // Register the Solpack Game Libraries component category
00365    ICatRegister *pcr = NULL;
00366    try
00367    {
00368       // Create and use the component category manager
00369       CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00370          IID_ICatRegister, (LPVOID*)&pcr));
00371
00372       CATEGORYINFO ci;
00373       ci.catid = CATID_SolpackGameLibs;
00374       ci.lcid = SOLPACK_LCID;
00375
00376       CBSTR bstrDesc(IDS_CATDESC);
00377       CopyMemory(&ci.szDescription, bstrDesc.m_bstr, sizeof(WCHAR) * min(bstrDesc.Len() + 1, 127));
00378
00379       CHECKHRCOM(pcr->RegisterCategories(1, &ci));
00380       SAFERELEASE(pcr);
00381    }
00382    catch(CExcep *pE)
00383    {
00384       SAFERELEASE(pcr);
00385       throw pE;
00386    }
00387
00388    // Default sound files are in the path with Solpack.exe
00389    CTSTR lpszFile(TRUE, MAX_PATH);
00390    GetModuleFileName(g_hInst, lpszFile, MAX_PATH);
00391    CTSTRArray alpszDefs;
00392    alpszDefs.SetSize(4);
00393
00394    // Load each default sound file name
00395    for(int i = 0; i < 4; i++)
00396    {
00397       PathRemoveFileSpec(lpszFile);
00398       PathAppend(lpszFile, CTSTR(IDS_SOUNDFILE_SHUFFLE+i));
00399       alpszDefs.SetAt(i, lpszFile);
00400    }
00401
00402    // Create a Control Panel Sounds Manager to set up the default sounds
00403    PathRemoveFileSpec(lpszFile);
00404    CCPSounds cps(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(CUserPrefs::s_auidSounds, 4),
00405       CUINTArray(CUserPrefs::s_auidDisplays, 4), lpszFile, &alpszDefs, TRUE);
00406    cps.Save();
00407
00408    // Set initial update notification preferences
00409    CKey hKeyProduct;
00410    if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00411    {
00412       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, (DWORD)bCheckNewVer);
00413       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, (DWORD)bCheckExtras);
00414    }
00415 }

int Run | ( | HINSTANCE | hInst,
 |  | LPSTR | lpCmdLine,
 |  | int | nCmdShow
 | ) |

Definition at line 108 of file SolpackApp.cpp.

References ARRAYSIZE, CHECKHRCOM, CreateMainWindow(), ENSUREALLOC, g_bExited, g_bFatalExit, g_hInst, g_hInstLC, g_pTypeLib, g_szAppTitle, GetProductKey(), GetRegisteredName(), IDS_BMWS_ERROR_OLE, IDS_BMWS_REMEDY_RESTART, IDS_ERR_LCNOTFOUND, IDS_SPLASHCOPYRIGHT, IDS_SPLASHVERSION, InitErrorHandler(), LIBID_SolpackLib, CHWND::m_hWnd, m_pMainWindow, ProcessMessage(), Register(), RegisterTLB(), SAFEDELETE, SAFERELEASE, SOLPACK_HASHVALUE, SPKREG_NONE, SPKREG_REGISTER, SPKREG_UNREGISTER, THROW, and Unregister().

Referenced by WinMain().

00109 {
00110    // Set the global out-of-memory exception object
00111    COOMExcep e;
00112    g_pOOMExcep = &e;
00113
00114    int iReturn = -1;
00115    g_hInst = hInst;  // Store application instance handle
00116
00117    // Load the localized resource module
00118    CLib libLC(TEXT("SolpckLC.DLL"));
00119    g_hInstLC = libLC;
00120    if(!g_hInstLC)
00121    {
00122       // Couldn't load the module
00123       TCHAR szError[128];
00124       LoadString(g_hInst, IDS_ERR_LCNOTFOUND, szError, ARRAYSIZE(szError));
00125       MessageBox(GetFocus(), szError, NULL, MB_ICONHAND | MB_OK);
00126       return -1;
00127    }
00128
00129    // Load strings used by the error handling mechanism
00130    InitErrorHandler();
00131
00132    // Load the application title string
00133    LoadString(g_hInstLC, IDS_APP_TITLE, g_szAppTitle, ARRAYSIZE(g_szAppTitle));
00134
00135    // Parse command-line parameters
00136    if(__argc > 1)
00137    {
00138       // Valid command-line parameters: (begin with - or / character)
00139       //    register    - called during installation
00140       //    unregister  - called during uninstallation
00141       //    newver      - called during installation; says check for new versions on startup
00142       //    extras      - called during installation; says check for extra versions on startup
00143
00144       BOOL bInitCOM = FALSE;
00145       try
00146       {
00147          // Initialize COM
00148          CHECKHRCOM(CoInitialize(NULL));
00149          bInitCOM = TRUE;
00150
00151          DWORD dwRegister = SPKREG_NONE;
00152          BOOL bCheckNewVer = FALSE;
00153          BOOL bCheckExtras = FALSE;
00154
00155          // Go through command line parameters, one by one.
00156          for(int i = 1; i < __argc; i++)
00157          {
00158             LPSTR pszParam = __argv[i];
00159             BOOL bLast = ((i + 1) == __argc);
00160             if(pszParam[0] == '-' || pszParam[0] == '/')
00161             {
00162                ++pszParam;
00163                if(lstrcmpiA(pszParam, "register") == 0)
00164                   dwRegister = SPKREG_REGISTER;
00165                else if(lstrcmpiA(pszParam, "unregister") == 0)
00166                   dwRegister = SPKREG_UNREGISTER;
00167                else if(lstrcmpiA(pszParam, "newver") == 0)
00168                   bCheckNewVer = TRUE;
00169                else if(lstrcmpiA(pszParam, "extras") == 0)
00170                   bCheckExtras = TRUE;
00171             }
00172          }
00173
00174          // Handle register or unregister
00175          if(dwRegister == SPKREG_REGISTER)
00176             Register(bCheckNewVer, bCheckExtras);
00177          else if(dwRegister == SPKREG_UNREGISTER)
00178             Unregister();
00179
00180          CoUninitialize();
00181          return 0;
00182       }
00183       catch(CExcep *pE)
00184       {
00185          pE->Report();
00186          pE->Delete();
00187       }
00188
00189       if(bInitCOM)
00190          CoUninitialize();
00191       return -1;
00192    }
00193
00194    BOOL bContinue = TRUE;
00195    BOOL bSplashOpen = FALSE;
00196    BOOL bOLEOK = FALSE;
00197    CPointer<CSplashWindow> pSplash;
00198
00199    try
00200    {
00201       // See if program is registered
00202       {
00203          CKey hKey;
00204          GetProductKey(hKey, FALSE);
00205          g_lpszUserName = GetRegisteredName(hKey, CTSTR(IDS_APP_TITLE), SOLPACK_HASHVALUE);
00206       }
00207
00208       // Create splash window. Does not fail if it could not be displayed.
00209       pSplash = new CSplashWindow(g_lpszUserName, CTSTR(IDS_SPLASHVERSION),
00210          CTSTR(IDS_SPLASHCOPYRIGHT));
00211       ENSUREALLOC(pSplash);
00212       if(pSplash->Register())
00213          bSplashOpen = pSplash->Create();
00214       if(bSplashOpen)
00215       {
00216          pSplash->ShowWindow(SW_SHOW);
00217          UpdateWindow(pSplash->m_hWnd);
00218       }
00219
00220       // Initialize OLE
00221       bOLEOK = SUCCEEDED(OleInitialize(NULL));
00222       if(!bOLEOK)
00223          THROW(new CExcepEx(IDS_BMWS_ERROR_OLE, IDS_BMWS_REMEDY_RESTART), CExcepEx*);
00224
00225       CHECKHRCOM(RegisterTLB(LIBID_SolpackLib, 1, 0));
00226       CHECKHRCOM(LoadRegTypeLib(LIBID_SolpackLib, 1, 0, 0x00, &g_pTypeLib));
00227
00228       // Create the main window object
00229       bContinue = CreateMainWindow(pSplash, nCmdShow);
00230    }
00231    catch(CExcep *pE)
00232    {
00233       pE->Report();
00234       pE->Delete();
00235       bContinue = FALSE;
00236    }
00237
00238    // We don't need splash screen any more. It will go away when main window deletes it.
00239    pSplash = NULL;
00240
00241    // If everything is okay so far, do the message loop.
00242    if(bContinue)
00243    {
00244       MSG msg;
00245       int i = GetMessage(&msg, NULL, 0, 0);
00246       while(i != 0 && i != -1)
00247       {
00248          // If we've quit for some reason, shut down
00249          if((g_bFatalExit || g_bExited) && m_pMainWindow->m_hWnd)
00250          {
00251             DestroyWindow(m_pMainWindow->m_hWnd);
00252             break;
00253          }
00254
00255          // Otherwise process the message
00256          ProcessMessage(&msg);
00257          i = GetMessage(&msg, NULL, 0, 0);
00258       }
00259       iReturn = (g_bFatalExit ? -1 : msg.wParam);
00260    }
00261
00262    // Delete objects
00263    SAFEDELETE(m_pMainWindow);
00264    g_lpszUserName = NULL;
00265    SAFERELEASE(g_pTypeLib);
00266
00267    // Uninitialize OLE
00268    if(bOLEOK)
00269       OleUninitialize();
00270
00271    return iReturn;
00272 }

void Unregister ( ) [protected]

Definition at line 428 of file SolpackApp.cpp.

References CATID_SolpackGameLibs, CHECKHRCOM, CUINTArray, IDS_REG_EVENTSTITLE, LIBID_SolpackLib, CUserPrefs::s_auidDisplays, CUserPrefs::s_auidSounds, SAFERELEASE, and UnregisterTLB().

Referenced by Run().

00429 {
00430    // Unregister the Solpack type library
00431    UnregisterTLB(LIBID_SolpackLib, 1, 0);
00432
00433    // Unregister the Solpack Game Libraries component category
00434    ICatRegister *pcr = NULL;
00435    try
00436    {
00437       // Create and use the component category manager
00438       CHECKHRCOM(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
00439          IID_ICatRegister, (LPVOID*)&pcr));
00440
00441       CATID IDs[1];
00442       IDs[0] = CATID_SolpackGameLibs;
00443       CHECKHRCOM(pcr->UnRegisterCategories(1, IDs));
00444       SAFERELEASE(pcr);
00445    }
00446    catch(CExcep *pE)
00447    {
00448       SAFERELEASE(pcr);
00449       throw pE;
00450    }
00451
00452    // Create a Control Panel Sounds Manager to remove sounds
00453    CCPSounds(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(CUserPrefs::s_auidSounds, 4),
00454       CUINTArray(CUserPrefs::s_auidDisplays, 4), CTSTR(), NULL, FALSE);
00455
00456    // Remove registry settings
00457    CKey     hKeySoftware;
00458    LONG     lResult;
00459    DWORD    dwDisp;
00460    lResult = RegCreateKeyEx(HKEY_CURRENT_USER, CTSTR(IDS_REG_SOFTWARE), 0, NULL,
00461       REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKeySoftware, &dwDisp);
00462    if(lResult == NOERROR)
00463    {
00464       CKey hKeyCompany;
00465       CTSTR lpszCompany(IDS_COMPANY);
00466       lResult = RegCreateKeyEx(hKeySoftware, lpszCompany, 0, NULL, REG_OPTION_NON_VOLATILE,
00467          KEY_ALL_ACCESS, NULL, &hKeyCompany, &dwDisp);
00468       if(lResult == NOERROR)
00469          SHDeleteKey(hKeyCompany, CTSTR(IDS_APP_TITLE));
00470       hKeyCompany = NULL;
00471       SHDeleteEmptyKey(hKeySoftware, lpszCompany);
00472    }
00473 }

Member Data Documentation

CMainWindow* m_pMainWindow [protected]

Definition at line 49 of file SolpackApp.h.

Referenced by CreateMainWindow(), CSolpackApp(), ProcessMessage(), and Run().

The documentation for this class was generated from the following files:
  • SolpackApp.h
  • SolpackApp.cpp
Generated on Wed May 8 12:39:57 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CSolpackApp Member List

This is the complete list of members for CSolpackApp, including all inherited members.
CreateMainWindow(CSplashWindow *pSplash, int nCmdShow) | CSolpackApp |
CSolpackApp() | CSolpackApp |
EmptyMessageQueue(BOOL bCheckQuit) | CSolpackApp | [virtual]
m_pMainWindow | CSolpackApp | [protected]
ProcessMessage(LPMSG lpMsg) | CSolpackApp | [virtual]
Register(BOOL bCheckNewVer, BOOL bCheckExtras) | CSolpackApp | [protected]
Run(HINSTANCE hInst, LPSTR lpCmdLine, int nCmdShow) | CSolpackApp |
Unregister() | CSolpackApp | [protected]
~CSolpackApp() | CSolpackApp | [virtual]
Generated on Wed May 8 12:39:57 2002 for Solitaire Pack by doxygen 1.2.15


CSplashWindow Class Reference

#include <bmws_splashscreen.h>

Inheritance diagram for CSplashWindow:

CHWND CRefCount List of all members.

Public Methods

CSplashWindow (CTSTR &lpszRegMsg, CTSTR &lpszVersion, CTSTR &lpszCopyright, BOOL bIncludeReg=TRUE, COLORREF colorText=RGB(0, 0, 0))
virtual | ~CSplashWindow ()
BOOL | Register ()
BOOL | Create ()

Static Public Methods

LRESULT CALLBACK | SplashWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Attributes

HBITMAP | m_hbmSplash
HFONT | m_hfontUser
CTSTR m_lpszRegMsg
CTSTR m_lpszVersion
CTSTR m_lpszCopyright
COLORREF | m_colorText

Constructor & Destructor Documentation

CSplashWindow | ( | CTSTR & | lpszRegMsg,
 |  | CTSTR & | lpszVersion,
 |  | CTSTR & | lpszCopyright,
 |  | BOOL | bIncludeReg = TRUE,
 |  | COLORREF | colorText = RGB(0, 0, 0)
 | ) |

Definition at line 62 of file bmws_splashscreen.cpp.

References CTSTR::Alloc(), CTSTR::Assign(), IDS_BMWS_SPLASH_REGMSG, IDS_BMWS_SPLASH_UNREGMSG, m_colorText, m_hbmSplash, m_hfontUser, m_lpszCopyright, m_lpszRegMsg, and m_lpszVersion.

00064 {
00065    if(bIncludeReg)
00066    {
00067       if(lpszRegMsg)
00068       {
00069          CTSTR lpszRegFormatter(IDS_BMWS_SPLASH_REGMSG);
00070          m_lpszRegMsg.Alloc(lstrlen(lpszRegFormatter) + lstrlen(lpszRegMsg) + 1);
00071          wsprintf(m_lpszRegMsg, lpszRegFormatter, lpszRegMsg);
00072       } else
00073          m_lpszRegMsg.Assign(IDS_BMWS_SPLASH_UNREGMSG);
00074    }
00075    m_lpszVersion = lpszVersion;
00076    m_lpszCopyright = lpszCopyright;
00077    m_colorText = colorText;
00078    m_hbmSplash = NULL;
00079    m_hfontUser = NULL;
00080 }

~CSplashWindow ( ) [virtual]

Definition at line 90 of file bmws_splashscreen.cpp.

References m_hbmSplash, and m_hfontUser.

00091 {
00092    if(m_hbmSplash)
00093       DeleteObject(m_hbmSplash);
00094 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00095    if(m_hfontUser)
00096       DeleteObject(m_hfontUser);
00097 #endif
00098 }

Member Function Documentation

BOOL Create ( )

Definition at line 111 of file bmws_splashscreen.cpp.

References CHWND::CreateWindowEx(), g_hInst, g_hInstLC, IDB_SPLASH, IDS_SPLASHCLASSNAME, and m_hbmSplash.

00112 {
00113    m_hbmSplash = (HBITMAP)LoadImage(g_hInstLC, MAKEINTRESOURCE(IDB_SPLASH), IMAGE_BITMAP, 0, 0,
00114       LR_DEFAULTCOLOR);
00115    if(!m_hbmSplash)
00116       return FALSE;
00117
00118    BITMAP bm;
00119    GetObject((HGDIOBJ)m_hbmSplash, sizeof(BITMAP), &bm);
00120
00121    TCHAR szWindowClass[64];
00122    LoadString(g_hInst, IDS_SPLASHCLASSNAME, szWindowClass, sizeof(szWindowClass));
00123
00124    CreateWindowEx(0, szWindowClass, NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth,
00125       bm.bmHeight, NULL, NULL, (LPVOID)this);
00126    return TRUE;
00127 }

BOOL Register ( )

Reimplemented from CHWND.

Definition at line 140 of file bmws_splashscreen.cpp.

References g_hInst, IDS_SPLASHCLASSNAME, and SplashWndProc().

00141 {
00142    TCHAR szWindowClass[64];
00143    LoadString(g_hInst, IDS_SPLASHCLASSNAME, szWindowClass, sizeof(szWindowClass));
00144
00145    WNDCLASS wc;
00146
00147    wc.style          = CS_HREDRAW | CS_VREDRAW;
00148    wc.lpfnWndProc    = (WNDPROC)SplashWndProc;
00149    wc.cbClsExtra     = 0;
00150    wc.cbWndExtra     = 0;
00151    wc.hInstance      = g_hInst;
00152    wc.hIcon          = NULL;
00153    wc.hCursor        = LoadCursor(NULL, IDC_WAIT);
00154    wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
00155    wc.lpszMenuName   = NULL;
00156    wc.lpszClassName  = szWindowClass;
00157
00158    return RegisterClass(&wc);
00159 }

LRESULT CALLBACK SplashWndProc | ( | HWND | hWnd,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 178 of file bmws_splashscreen.cpp.

References CHWND::CenterWindow(), g_hInst, IDS_BMWS_SPLASH_FONT, m_colorText, m_hbmSplash, m_hfontUser, CHWND::m_hWnd, m_lpszCopyright, m_lpszRegMsg, m_lpszVersion, and SPLASH_FONTSIZE.

Referenced by Register().

00179 {
00180    CSplashWindow *pThis = (CSplashWindow*)GetWindowLong(hWnd, GWL_USERDATA);
00181
00182    switch(uMsg)
00183    {
00184       case WM_CLOSE:
00185          return 0;
00186
00187       case WM_NCCREATE:
00188       {
00189          LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
00190          pThis = (CSplashWindow*)(lpcs->lpCreateParams);
00191          SetWindowLong(hWnd, GWL_USERDATA, (LONG)pThis);
00192          pThis->m_hWnd = hWnd;
00193       } break;
00194
00195       case WM_CREATE:
00196       {
00197 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00198          HDC hdc = GetDC(hWnd);
00199          TCHAR szFaceName[LF_FACESIZE];
00200          LoadString(g_hInst, IDS_BMWS_SPLASH_FONT, szFaceName, LF_FACESIZE);
00201          pThis->m_hfontUser = CreateFont(-MulDiv(SPLASH_FONTSIZE, GetDeviceCaps(hdc, LOGPIXELSY),
00202             72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, szFaceName);
00203          ReleaseDC(hWnd, hdc);
00204 #endif
00205
00206          CenterWindow(hWnd);
00207       } return 0;
00208
00209       case WM_PAINT:
00210       {
00211          PAINTSTRUCT ps;
00212          HDC hdc = BeginPaint(hWnd, &ps);
00213
00214          BITMAP bm;
00215          GetObject((HGDIOBJ)pThis->m_hbmSplash, sizeof(BITMAP), &bm);
00216
00217          HDC hdcMem = CreateCompatibleDC(hdc);
00218          HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, pThis->m_hbmSplash);
00219
00220          BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
00221
00222 #ifndef BMWS_SPLASHSCREEN_SIMPLE
00223          HFONT hfontOld = (HFONT)SelectObject(hdc, pThis->m_hfontUser);
00224
00225          int iPrevBkMode = SetBkMode(hdc, TRANSPARENT);
00226          COLORREF colorOld = SetTextColor(hdc, pThis->m_colorText);
00227
00228          SIZE s;
00229          RECT rc;
00230
00231          GetTextExtentPoint32(hdc, pThis->m_lpszCopyright, lstrlen(pThis->m_lpszCopyright), &s);
00232          SetRect(&rc, 326, 312 - s.cy, 489, 312);
00233          DrawText(hdc, pThis->m_lpszCopyright, -1, &rc, DT_CENTER);
00234
00235          GetTextExtentPoint32(hdc, pThis->m_lpszVersion, lstrlen(pThis->m_lpszVersion), &s);
00236          rc.bottom = rc.top - 3;
00237          rc.top = rc.bottom - s.cy;
00238          DrawText(hdc, pThis->m_lpszVersion, -1, &rc, DT_CENTER);
00239
00240          if(pThis->m_lpszRegMsg)
00241          {
00242             RECT rcNew;
00243             SetRect(&rcNew, 0, 0, 0, 0);
00244             DrawText(hdc, pThis->m_lpszRegMsg, -1, &rcNew, DT_CENTER | DT_CALCRECT);
00245             rc.bottom = rc.top - 9;
00246             rc.top = rc.bottom - rcNew.bottom;
00247             DrawText(hdc, pThis->m_lpszRegMsg, -1, &rc, DT_CENTER);
00248          }
00249
00250          SetBkMode(hdc, iPrevBkMode);
00251          SetTextColor(hdc, colorOld);
00252
00253          SelectObject(hdc, hfontOld);
00254 #endif
00255
00256          SelectObject(hdcMem, hbmOld);
00257          DeleteDC(hdcMem);
00258          EndPaint(hWnd, &ps);
00259       } return 0;
00260    }
00261
00262    return DefWindowProc(hWnd, uMsg, wParam, lParam);
00263 }

Member Data Documentation

COLORREF m_colorText [protected]

Definition at line 52 of file bmws_splashscreen.h.

Referenced by CSplashWindow(), and SplashWndProc().

HBITMAP m_hbmSplash [protected]

Definition at line 46 of file bmws_splashscreen.h.

Referenced by Create(), CSplashWindow(), SplashWndProc(), and ~CSplashWindow().

HFONT m_hfontUser [protected]

Definition at line 48 of file bmws_splashscreen.h.

Referenced by CSplashWindow(), SplashWndProc(), and ~CSplashWindow().

CTSTR m_lpszCopyright [protected]

Definition at line 51 of file bmws_splashscreen.h.

Referenced by CSplashWindow(), and SplashWndProc().

CTSTR m_lpszRegMsg [protected]

Definition at line 49 of file bmws_splashscreen.h.

Referenced by CSplashWindow(), and SplashWndProc().

CTSTR m_lpszVersion [protected]

Definition at line 50 of file bmws_splashscreen.h.

Referenced by CSplashWindow(), and SplashWndProc().

The documentation for this class was generated from the following files:
  • bmws_splashscreen.h
  • bmws_splashscreen.cpp
Generated on Wed May 8 12:39:57 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CSplashWindow Member List

This is the complete list of members for CSplashWindow, including all inherited members.
CenterWindow(HWND hWnd) | CHWND | [static]
CHWND() | CHWND | [inline]
Create() | CSplashWindow |
CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam) | CHWND |
CRefCount() | CRefCount | [inline]
CSplashWindow(CTSTR &lpszRegMsg, CTSTR &lpszVersion, CTSTR &lpszCopyright, BOOL bIncludeReg=TRUE, COLORREF colorText=RGB(0, 0, 0)) | CSplashWindow |
downcount() | CRefCount | [inline]
m_colorText | CSplashWindow | [protected]
m_hbmSplash | CSplashWindow | [protected]
m_hfontUser | CSplashWindow | [protected]
m_hWnd | CHWND |
m_lpszClassName | CHWND | [protected]
m_lpszCopyright | CSplashWindow | [protected]
m_lpszRegMsg | CSplashWindow | [protected]
m_lpszVersion | CSplashWindow | [protected]
operator HWND() const | CHWND | [inline]
Register() | CSplashWindow |
RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL) | CHWND | [static]
SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) | CHWND | [inline]
ShowWindow(int nCmdShow) | CHWND | [inline]
SplashWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) | CSplashWindow | [static]
upcount() | CRefCount | [inline]
~CHWND() | CHWND | [inline, virtual]
~CRefCount() | CRefCount | [inline, virtual]
~CSplashWindow() | CSplashWindow | [virtual]
Generated on Wed May 8 12:39:57 2002 for Solitaire Pack by doxygen 1.2.15


CStatusBar Class Reference

#include <StatusBar.h>

Inheritance diagram for CStatusBar:

CHWND CRefCount List of all members.

Public Methods

CStatusBar ()
virtual | ~CStatusBar ()
BOOL | Create (HWND hwndParent)
void | SetScore (long lScore)
void | SetStatusText (CTSTR &lpszStatus)
void | SetProgress (int iProgress)
void | SetHelpText (UINT uidText)
void | CancelHelpText ()

Protected Attributes

CHWND * m_pProgressWnd
CTSTR m_lpszScoreHolder
BOOL | m_bShowingHelp

Constructor & Destructor Documentation

CStatusBar ( )

Definition at line 32 of file StatusBar.cpp.

References m_bShowingHelp, and m_pProgressWnd.

00033 {
00034    // Set initial values for member variables
00035    m_pProgressWnd = NULL;
00036    m_bShowingHelp = FALSE;
00037 }

~CStatusBar ( ) [virtual]

Definition at line 45 of file StatusBar.cpp.

References m_pProgressWnd, and SAFEDELETE.

00046 {
00047    SAFEDELETE(m_pProgressWnd);
00048 }

Member Function Documentation

void CancelHelpText ( )

Definition at line 188 of file StatusBar.cpp.

References m_bShowingHelp, m_pProgressWnd, CHWND::SendMessage(), and CHWND::ShowWindow().

00189 {
00190    if(m_bShowingHelp)
00191    {
00192       // Restore status bar to normal mode and display progress bar
00193       SendMessage(SB_SIMPLE, (WPARAM)FALSE, 0);
00194       m_pProgressWnd->ShowWindow(SW_SHOWNA);
00195       m_bShowingHelp = FALSE;
00196       return;
00197    }
00198 }

BOOL Create ( HWND hwndParent )

Definition at line 63 of file StatusBar.cpp.

References CTSTR::Assign(), CHWND::CHWND(), CHWND::CreateWindowEx(), ENSUREALLOC, IDS_STATUS_SCORE, CHWND::m_hWnd, m_lpszScoreHolder, m_pProgressWnd, and CHWND::SendMessage().

00064 {
00065    // Load the score formatter
00066    m_lpszScoreHolder.Assign(IDS_STATUS_SCORE);
00067
00068    // Create the window itself
00069    CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0,
00070       hwndParent, NULL, (LPVOID)this);
00071
00072    // Divide the status bar
00073    int aiWidths[2];
00074    aiWidths[0] = 100;
00075    aiWidths[1] = -1;
00076    SendMessage(SB_SETPARTS, 2, (LPARAM)(LPINT)aiWidths);
00077
00078    // Create and set up the embedded progress bar (first pane of status bar)
00079    m_pProgressWnd = new CHWND();
00080    ENSUREALLOC(m_pProgressWnd);
00081
00082    m_pProgressWnd->CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | PBS_SMOOTH | WS_VISIBLE,
00083       3, 3, 94, 14, m_hWnd, NULL, NULL);
00084    SetWindowLong(*m_pProgressWnd, GWL_EXSTYLE, GetWindowLong(*m_pProgressWnd, GWL_EXSTYLE) &
00085       ~WS_EX_STATICEDGE);
00086
00087    m_pProgressWnd->SendMessage(PBM_SETRANGE, 0, MAKELPARAM(0, 32768));
00088    m_pProgressWnd->SendMessage(PBM_SETPOS, (WPARAM)0, 0);
00089
00090    return TRUE;
00091 }

void SetHelpText ( UINT uidText )

Definition at line 162 of file StatusBar.cpp.

References m_bShowingHelp, m_pProgressWnd, CHWND::SendMessage(), and CHWND::ShowWindow().

00163 {
00164    if(!m_bShowingHelp)
00165    {
00166       // We're not yet showing help, so put scroll bar in simple mode
00167       m_pProgressWnd->ShowWindow(SW_HIDE);
00168       SendMessage(SB_SIMPLE, (WPARAM)TRUE, 0);
00169       m_bShowingHelp = TRUE;
00170    }
00171
00172    // Load the string, if uidText is not -1. Set the text.
00173    SendMessage(SB_SETTEXT, (WPARAM)(SB_SIMPLEID | SBT_NOBORDERS),
00174       (LPARAM)(uidText == (UINT)-1 ? NULL : (LPTSTR)(CTSTR(uidText))));
00175 }

void SetProgress ( int iProgress )

Definition at line 142 of file StatusBar.cpp.

References m_pProgressWnd, and CHWND::SendMessage().

00143 {
00144    if(iProgress > 32768)
00145       iProgress = 32768;
00146    m_pProgressWnd->SendMessage(PBM_SETPOS, (WPARAM)iProgress, 0);
00147 }

void SetScore ( long lScore )

Definition at line 105 of file StatusBar.cpp.

References m_lpszScoreHolder, and CHWND::SendMessage().

00106 {
00107    // Format the score display string and display the text in the second pane
00108    SendMessage(SB_SETTEXT, (WPARAM)1,
00109       (LPARAM)(LPTSTR)(CTSTR().Format(m_lpszScoreHolder, lScore)));
00110 }

void SetStatusText ( CTSTR & lpszStatus )

Definition at line 124 of file StatusBar.cpp.

References CHWND::SendMessage().

00125 {
00126    SendMessage(SB_SETTEXT, (WPARAM)1, (LPARAM)(LPTSTR)lpszStatus);
00127 }

Member Data Documentation

BOOL m_bShowingHelp [protected]

Definition at line 47 of file StatusBar.h.

Referenced by CancelHelpText(), CStatusBar(), and SetHelpText().

CTSTR m_lpszScoreHolder [protected]

Definition at line 46 of file StatusBar.h.

Referenced by Create(), and SetScore().

CHWND* m_pProgressWnd [protected]

Definition at line 45 of file StatusBar.h.

Referenced by CancelHelpText(), Create(), CStatusBar(), SetHelpText(), SetProgress(), and ~CStatusBar().

The documentation for this class was generated from the following files:
  • StatusBar.h
  • StatusBar.cpp
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CStatusBar Member List

This is the complete list of members for CStatusBar, including all inherited members.
CancelHelpText() | CStatusBar |
CenterWindow(HWND hWnd) | CHWND | [static]
CHWND() | CHWND | [inline]
Create(HWND hwndParent) | CStatusBar |
CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, LPVOID lpParam) | CHWND |
CRefCount() | CRefCount | [inline]
CStatusBar() | CStatusBar |
downcount() | CRefCount | [inline]
m_bShowingHelp | CStatusBar | [protected]
m_hWnd | CHWND |
m_lpszClassName | CHWND | [protected]
m_lpszScoreHolder | CStatusBar | [protected]
m_pProgressWnd | CStatusBar | [protected]
operator HWND() const | CHWND | [inline]
Register() | CHWND | [inline]
RegisterWindowClass(LPTSTR lpszClassName, UINT uiStyle, WNDPROC fnWndProc, LPTSTR lpszIcon, HBRUSH hbrBackground, LPTSTR lpszMenu, HCURSOR hCursor=NULL) | CHWND | [static]
SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) | CHWND | [inline]
SetHelpText(UINT uidText) | CStatusBar |
SetProgress(int iProgress) | CStatusBar |
SetScore(long lScore) | CStatusBar |
SetStatusText(CTSTR &lpszStatus) | CStatusBar |
ShowWindow(int nCmdShow) | CHWND | [inline]
upcount() | CRefCount | [inline]
~CHWND() | CHWND | [inline, virtual]
~CRefCount() | CRefCount | [inline, virtual]
~CStatusBar() | CStatusBar | [virtual]
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


CTechSupportDlg Class Reference

#include <bmws_techsupport.h>

Inheritance diagram for CTechSupportDlg:

CDlg IEventSinkSite List of all members.

Public Methods

CTechSupportDlg ()
virtual | ~CTechSupportDlg ()
INT_PTR | DlgProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT | EventSink (LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)

Protected Attributes

CBrowserContainer * m_pBrowserContainer
CWebBrowser2Ptr m_spBrowser
CHTMLHelper * m_pHH
BOOL | m_bNavigated

Constructor & Destructor Documentation

CTechSupportDlg ( )

virtual ~CTechSupportDlg ( ) [virtual]

Member Function Documentation

INT_PTR DlgProc | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CDlg.

HRESULT EventSink | ( | LPARAM | lParam,
 |  | DISPID | dispid,
 |  | DISPPARAMS FAR * | pdispparams
 | ) | [virtual]

Implements IEventSinkSite.

Member Data Documentation

BOOL m_bNavigated [protected]

Definition at line 42 of file bmws_techsupport.h.

CBrowserContainer* m_pBrowserContainer [protected]

Definition at line 39 of file bmws_techsupport.h.

CHTMLHelper* m_pHH [protected]

Definition at line 41 of file bmws_techsupport.h.

CWebBrowser2Ptr m_spBrowser [protected]

Definition at line 40 of file bmws_techsupport.h.

The documentation for this class was generated from the following file:
  • bmws_techsupport.h
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CTechSupportDlg Member List

This is the complete list of members for CTechSupportDlg, including all inherited members.
BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CDlg | [static]
CDlg(UINT uidDlg) | CDlg |
CTechSupportDlg() | CTechSupportDlg |
DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) | CTechSupportDlg | [virtual]
EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams) | CTechSupportDlg | [virtual]
m_bNavigated | CTechSupportDlg | [protected]
m_hwndDlg | CDlg | [protected]
m_pBrowserContainer | CTechSupportDlg | [protected]
m_pHH | CTechSupportDlg | [protected]
m_spBrowser | CTechSupportDlg | [protected]
m_uidDlg | CDlg | [protected]
Run(HWND hWndParent) | CDlg |
~CDlg() | CDlg | [inline, virtual]
~CTechSupportDlg() | CTechSupportDlg | [virtual]
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


CTSTR Class Reference

#include <bmws_string.h>

List of all members.

Public Methods

CTSTR ()
CTSTR (UINT uID)
CTSTR (UINT uID, UINT cch, BOOL)
CTSTR (LPTSTR lpsz, BOOL bAssign=FALSE)
CTSTR (BSTR bstr)
CTSTR (const CTSTR &bmwslocal)
CTSTR (BOOL, UINT cch)
~CTSTR ()
operator LPTSTR () const
LPTSTR * | Addr ()
int | Len ()
const CTSTR & | operator= (const CTSTR &lpszSrc)
const CTSTR & | operator= (const BSTR bstr)
void | Assign (LPSTR lpsz)
void | AssignW (LPWSTR lpwsz, int iLen=-1)
void | Assign (BSTR bstr)
void | Assign (UINT uID, UINT cch=128)
void | Alloc (UINT cch)
BOOL | Equals (LPTSTR lpsz, int iLen)
void | CopyString (LPTSTR lpsz, int iLen=-1)
CTSTR & | Format (LPTSTR lpszFormatter, LPTSTR lpszInsert)
CTSTR & | Format (LPTSTR lpszFormatter, int iInsert)

Public Attributes

LPTSTR | m_lpsz

Constructor & Destructor Documentation

CTSTR ( )

Definition at line 35 of file bmws_string.cpp.

References m_lpsz.

00036 {
00037    m_lpsz = NULL;
00038 }

CTSTR ( UINT uID )

Definition at line 65 of file bmws_string.cpp.

References Assign(), and m_lpsz.

00066 {
00067    m_lpsz = NULL;
00068    Assign(uID);
00069 }

CTSTR | ( | UINT | uID,
 |  | UINT | cch,
 |  | BOOL |
 | ) |

Definition at line 81 of file bmws_string.cpp.

References Assign(), and m_lpsz.

00082 {
00083    m_lpsz = NULL;
00084    Assign(uID, cch);
00085 }

CTSTR | ( | LPTSTR | lpsz,
 |  | BOOL | bAssign = FALSE
 | ) |

Definition at line 98 of file bmws_string.cpp.

References CopyString(), and m_lpsz.

00099 {
00100    m_lpsz = NULL;
00101    if(bAssign)
00102       m_lpsz = lpsz;
00103    else
00104       CopyString(lpsz);
00105 }

CTSTR ( BSTR bstr )

Definition at line 118 of file bmws_string.cpp.

References Assign(), and m_lpsz.

00119 {
00120    m_lpsz = NULL;
00121    Assign(bstr);
00122 }

CTSTR ( const CTSTR & bmwslocal )

Definition at line 49 of file bmws_string.cpp.

References CopyString(), and m_lpsz.

00050 {
00051    m_lpsz = NULL;
00052    if(bmwslocal.m_lpsz)
00053       CopyString(bmwslocal);
00054 }

CTSTR | ( | BOOL | ,
 |  | UINT | cch
 | ) |

Definition at line 135 of file bmws_string.cpp.

References Alloc(), and m_lpsz.

00136 {
00137    m_lpsz = NULL;
00138    Alloc(cch);
00139 }

~CTSTR ( )

Definition at line 167 of file bmws_string.cpp.

References m_lpsz, and SAFEFREEMEMORY.

00168 {
00169    SAFEFREEMEMORY(m_lpsz);
00170 }

Member Function Documentation

LPTSTR* Addr ( ) [inline]

Definition at line 75 of file bmws_string.h.

References m_lpsz.

00076    {
00077       return &m_lpsz;
00078    }

void Alloc ( UINT cch )

Definition at line 330 of file bmws_string.cpp.

References ENSUREALLOC, m_lpsz, SAFEALLOC, and SAFEFREEMEMORY.

Referenced by CCompoundXMLDocument::AddFile(), Assign(), AssignW(), CHelpMgr::CHelpMgr(), CopyString(), CCPSoundsDlg::CPSoundsProc(), CSplashWindow::CSplashWindow(), CTSTR(), Format(), GetRegisteredName(), GetRegStringValue(), MultiOFN(), and CMainWindow::PresentUpdate().

00331 {
00332    SAFEFREEMEMORY(m_lpsz);
00333    m_lpsz = SAFEALLOC(cch);
00334    ENSUREALLOC(m_lpsz);
00335    ZeroMemory(m_lpsz, cch * sizeof(TCHAR));
00336 }

void Assign | ( | UINT | uID,
 |  | UINT | cch = 128
 | ) |

Definition at line 269 of file bmws_string.cpp.

References ENSUREALLOC, ERROR_ERRORINS_INT, g_hInst, g_hInstLC, IDS_BMWS_REMEDY_RESTART, IDS_BMWS_STRING_RESNOTFOUND, m_lpsz, SAFEALLOC, SAFEFREEMEMORY, and THROW.

00270 {
00271    SAFEFREEMEMORY(m_lpsz);
00272
00273    LPTSTR lpszBuf = NULL;
00274    int nLen;
00275    int nSize = cch - 128;
00276    do
00277    {
00278       SAFEFREEMEMORY(lpszBuf);
00279       nSize += 128;
00280       lpszBuf = SAFEALLOC(nSize);
00281       ENSUREALLOC(lpszBuf);
00282       nLen = LoadString(uID > 10000 ? g_hInstLC : g_hInst, uID, lpszBuf, nSize);
00283    } while (nSize - nLen <= 2);
00284    if(nLen == 0)
00285    {
00286       SAFEFREEMEMORY(lpszBuf);
00287       THROW(new CExcepEx(IDS_BMWS_STRING_RESNOTFOUND, IDS_BMWS_REMEDY_RESTART, uID, 0,
00288          ERROR_ERRORINS_INT), CExcepEx*);
00289    }
00290    m_lpsz = lpszBuf;
00291 }

void Assign ( BSTR bstr )

Definition at line 243 of file bmws_string.cpp.

References AssignW(), m_lpsz, and SAFEFREEMEMORY.

00244 {
00245    if(!bstr)
00246    {
00247       SAFEFREEMEMORY(m_lpsz);
00248       return;
00249    }
00250    int iLen = SysStringLen(bstr) + 1;
00251    AssignW(bstr, iLen);
00252 }

void Assign ( LPSTR lpsz )

Definition at line 184 of file bmws_string.cpp.

References Alloc(), CopyString(), m_lpsz, and SAFEFREEMEMORY.

Referenced by CCompoundXMLDocument::AddFile(), CAppearanceDlg::CAppearanceDlg(), CCPSounds::CCPSounds(), CCPSoundsDlg::CCPSoundsDlg(), CHelpMgr::CHelpMgr(), CHTMLEnable::CHTMLEnable(), CCPSoundsDlg::CPSoundsProc(), CStatusBar::Create(), CSplashWindow::CSplashWindow(), CTSTR(), CUpdateDlg::CUpdateDlg(), CAboutDlg::DlgProc(), CPile::DoAction(), CHTMLEnable::EnableHelper(), GetRegDWORDValue(), GetRegStringValue(), CEngine::InitEngine(), MultiOFN(), OfnGetFilter(), operator=(), CAppearanceDlg::OptionsAppearanceProc(), CMainWindow::PresentUpdate(), CMainWindow::Register(), CHelpPane::Register(), SetRegDWORDValue(), SetRegStringValue(), SingleOFN(), and CPile::UndoAction().

00185 {
00186    SAFEFREEMEMORY(m_lpsz);
00187
00188    if(lpsz)
00189    {
00190       #ifdef UNICODE
00191          int iLen = lstrlenA(lpsz) + 1;
00192          Alloc(iLen);
00193          MultiByteToWideChar(CP_ACP, 0, lpsz, -1, m_lpsz, iLen);
00194          m_lpsz[iLen-1] = 0;
00195       #else
00196          CopyString(lpsz);
00197       #endif
00198    }
00199 }

void AssignW | ( | LPWSTR | lpwsz,
 |  | int | iLen = -1
 | ) |

Definition at line 214 of file bmws_string.cpp.

References Alloc(), CopyString(), m_lpsz, and SAFEFREEMEMORY.

Referenced by Assign(), and GUIDToString().

00215 {
00216    SAFEFREEMEMORY(m_lpsz);
00217
00218 #ifdef UNICODE
00219    CopyString(lpwsz, iLen);
00220 #else
00221    if(iLen == -1)
00222       iLen = lstrlenW(lpwsz) + 1;
00223    Alloc(iLen);
00224    WideCharToMultiByte(CP_ACP, 0, lpwsz, -1, m_lpsz, iLen, NULL, NULL);
00225    m_lpsz[iLen-1] = 0;
00226 #endif
00227 }

void CopyString | ( | LPTSTR | lpsz,
 |  | int | iLen = -1
 | ) |

Definition at line 411 of file bmws_string.cpp.

References Alloc(), m_lpsz, and SAFEFREEMEMORY.

Referenced by Assign(), AssignW(), CTSTR(), and operator=().

00412 {
00413    SAFEFREEMEMORY(m_lpsz);
00414    if(lpsz)
00415    {
00416       if(iLen == -1)
00417          iLen = lstrlen(lpsz) + 1;
00418       Alloc(iLen);
00419       lstrcpyn(m_lpsz, lpsz, iLen);
00420    }
00421 }

BOOL Equals | ( | LPTSTR | lpsz,
 |  | int | iLen
 | ) |

Definition at line 390 of file bmws_string.cpp.

References m_lpsz.

00391 {
00392    BOOL bReturn = FALSE;
00393    CTSTR lpszCopy(TRUE, iLen);
00394    lstrcpyn(lpszCopy, lpsz, iLen);
00395    return (lstrcmp(m_lpsz, lpszCopy.m_lpsz) == 0);
00396 }

CTSTR & Format | ( | LPTSTR | lpszFormatter,
 |  | int | iInsert
 | ) |

Definition at line 458 of file bmws_string.cpp.

References _ASSERT, Alloc(), and m_lpsz.

00459 {
00460    _ASSERT(lpszFormatter);
00461    Alloc(lstrlen(lpszFormatter) + 16);
00462    wsprintf(m_lpsz, lpszFormatter, iInsert);
00463    return *this;
00464 }

CTSTR & Format | ( | LPTSTR | lpszFormatter,
 |  | LPTSTR | lpszInsert
 | ) |

Definition at line 436 of file bmws_string.cpp.

References _ASSERT, Alloc(), and m_lpsz.

Referenced by CAboutDlg::DlgProc(), CCard::InitCard(), and CPile::UpdateTooltip().

00437 {
00438    _ASSERT(lpszFormatter);
00439    _ASSERT(lpszInsert);
00440    Alloc(lstrlen(lpszFormatter) + lstrlen(lpszInsert));
00441    wsprintf(m_lpsz, lpszFormatter, lpszInsert);
00442    return *this;
00443 }

int Len ( ) [inline]

Definition at line 90 of file bmws_string.h.

References m_lpsz.

Referenced by CreateResURL(), CAppearanceDlg::DoChooseColor(), CHTMLEnable::EnableHelper(), CGameMenu::FillGameInfo(), CMainWindow::GameSelected(), CGameMenuItem::Init(), CMainWindow::OnCommand(), CAppearanceDlg::OptionsAppearanceProc(), RegisterComponent(), CHTMLChooseColor::SetColor(), UnregisterComponent(), CUserPrefs::UpdateAppearance(), and CPile::UpdateTooltip().

00091    {
00092       return (m_lpsz ? lstrlen(m_lpsz) : 0);
00093    }

operator LPTSTR ( ) const [inline]

Definition at line 60 of file bmws_string.h.

References m_lpsz.

00061    {
00062       return m_lpsz;
00063    }

const CTSTR & operator= ( const BSTR bstr )

Definition at line 369 of file bmws_string.cpp.

References Assign().

00370 {
00371    Assign(bstr);
00372    return *this;
00373 }

const CTSTR & operator= ( const CTSTR & lpszSrc )

Definition at line 349 of file bmws_string.cpp.

References CopyString(), and m_lpsz.

00350 {
00351    if(m_lpsz != lpszSrc.m_lpsz)
00352       CopyString(lpszSrc.m_lpsz);
00353    return *this;
00354 }

Member Data Documentation

LPTSTR m_lpsz

Definition at line 125 of file bmws_string.h.

Referenced by Addr(), Alloc(), Assign(), AssignW(), CBSTR::CBSTR(), ChooseColorEx(), CopyString(), CTSTR(), CUpdateDlg::CUpdateDlg(), Equals(), CHTMLEdit::EventHandler(), Format(), Len(), OfnGetFilter(), operator LPTSTR(), operator=(), CPile::UpdateTooltip(), and ~CTSTR().

The documentation for this class was generated from the following files:
  • bmws_string.h
  • bmws_string.cpp
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CTSTR Member List

This is the complete list of members for CTSTR, including all inherited members.
Addr() | CTSTR | [inline]
Alloc(UINT cch) | CTSTR |
Assign(LPSTR lpsz) | CTSTR |
Assign(BSTR bstr) | CTSTR |
Assign(UINT uID, UINT cch=128) | CTSTR |
AssignW(LPWSTR lpwsz, int iLen=-1) | CTSTR |
CopyString(LPTSTR lpsz, int iLen=-1) | CTSTR |
CTSTR() | CTSTR |
CTSTR(UINT uID) | CTSTR |
CTSTR(UINT uID, UINT cch, BOOL) | CTSTR |
CTSTR(LPTSTR lpsz, BOOL bAssign=FALSE) | CTSTR |
CTSTR(BSTR bstr) | CTSTR |
CTSTR(const CTSTR &bmwslocal) | CTSTR |
CTSTR(BOOL, UINT cch) | CTSTR |
Equals(LPTSTR lpsz, int iLen) | CTSTR |
Format(LPTSTR lpszFormatter, LPTSTR lpszInsert) | CTSTR |
Format(LPTSTR lpszFormatter, int iInsert) | CTSTR |
Len() | CTSTR | [inline]
m_lpsz | CTSTR |
operator LPTSTR() const | CTSTR | [inline]
operator=(const CTSTR &lpszSrc) | CTSTR |
operator=(const BSTR bstr) | CTSTR |
~CTSTR() | CTSTR |
Generated on Wed May 8 12:39:58 2002 for Solitaire Pack by doxygen 1.2.15


CTurn Class Reference

#include <Turn.h>

List of all members.

Public Methods

CTurn ()
virtual | ~CTurn ()
void | AddAction (CAction *pAction)
void | Undo ()
void | Redo ()

Public Attributes

CTurn * | m_pNext
CTurn * | m_pPrev

Protected Attributes

CAction * m_pFirst
CAction * m_pLast

Constructor & Destructor Documentation

CTurn ( )

Definition at line 23 of file Turn.cpp.

References m_pFirst, m_pLast, m_pNext, m_pPrev, and ODS.

00024 {
00025    // Set initial values of member variables
00026    m_pNext = NULL;
00027    m_pPrev = NULL;
00028    m_pFirst = NULL;
00029    m_pLast = NULL;
00030    ODS("CTurn constructor");
00031 }

~CTurn ( ) [virtual]

Definition at line 39 of file Turn.cpp.

References m_pFirst, CAction::m_pNext, ODS, and SAFEDELETE.

00040 {
00041    // Clear all stored actions
00042    CAction *pTemp = m_pFirst;
00043    while(m_pFirst)
00044    {
00045       pTemp = m_pFirst->m_pNext;
00046       SAFEDELETE(m_pFirst);
00047       m_pFirst = pTemp;
00048    }
00049    ODS("CTurn destructor");
00050 }

Member Function Documentation

void AddAction ( CAction * pAction )

Definition at line 64 of file Turn.cpp.

References m_pFirst, m_pLast, CAction::m_pNext, CAction::m_pPrev, and ODS.

Referenced by CUndoMgr::RecordAction().

00065 {
00066    ODS("CTurn::AddAction");
00067    if(!m_pFirst)
00068    {
00069       // Create first action
00070       m_pFirst = pAction;
00071       m_pLast = pAction;
00072    } else
00073    {
00074       // Add action to end of turn
00075       m_pLast->m_pNext = pAction;
00076       pAction->m_pPrev = m_pLast;
00077       m_pLast = pAction;
00078    }
00079 }

void Redo ( )

Definition at line 114 of file Turn.cpp.

References m_pFirst, CAction::m_pNext, and CAction::Redo().

Referenced by CUndoMgr::Redo().

00115 {
00116    // Redo each action in the turn, starting with the first
00117    CAction *pTemp = m_pFirst;
00118    while(pTemp)
00119    {
00120       pTemp->Redo();
00121       pTemp = pTemp->m_pNext;
00122    }
00123 }

void Undo ( )

Definition at line 92 of file Turn.cpp.

References m_pLast, CAction::m_pPrev, and CAction::Undo().

Referenced by CUndoMgr::Undo().

00093 {
00094    // Undo each action in the turn, starting at the end
00095    CAction *pTemp = m_pLast;
00096    while(pTemp)
00097    {
00098       pTemp->Undo();
00099       pTemp = pTemp->m_pPrev;
00100    }
00101 }

Member Data Documentation

CAction* m_pFirst [protected]

Definition at line 47 of file Turn.h.

Referenced by AddAction(), CTurn(), Redo(), and ~CTurn().

CAction* m_pLast [protected]

Definition at line 48 of file Turn.h.

Referenced by AddAction(), CTurn(), and Undo().

CTurn* m_pNext

Definition at line 43 of file Turn.h.

Referenced by CUndoMgr::CanRedo(), CUndoMgr::Clear(), CTurn(), CUndoMgr::PushNewTurn(), and CUndoMgr::Redo().

CTurn* m_pPrev

Definition at line 44 of file Turn.h.

Referenced by CUndoMgr::CanUndo(), CTurn(), CUndoMgr::PushNewTurn(), and CUndoMgr::Undo().

The documentation for this class was generated from the following files:
  • Turn.h
  • Turn.cpp
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CTurn Member List

This is the complete list of members for CTurn, including all inherited members.
AddAction(CAction *pAction) | CTurn |
CTurn() | CTurn |
m_pFirst | CTurn | [protected]
m_pLast | CTurn | [protected]
m_pNext | CTurn |
m_pPrev | CTurn |
Redo() | CTurn |
Undo() | CTurn |
~CTurn() | CTurn | [virtual]
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


CUndoMgr Class Reference

#include <UndoMgr.h>

List of all members.

Public Methods

CUndoMgr ()
virtual | ~CUndoMgr ()
void | Undo ()
void | Redo ()
void | Init ()
void | PushNewTurn ()
CAction * | RecordAction (IActionSite *pSite, DWORD dwType, DWORD dwData)
CAction * | RecordAction (CAction *pAction)
void | Clear (CTurn *pTurn)
void | ClearWorkingTurn ()
BOOL | SetCanRecord (BOOL bCanRecord)
BOOL | CanUndo ()
BOOL | CanRedo ()

Protected Attributes

BOOL | m_bDirty
CTurn * m_pFirst
CTurn * m_pMostRecent
CTurn * m_pCurrent
BOOL | m_bCanRecord

Constructor & Destructor Documentation

CUndoMgr ( )

Definition at line 23 of file UndoMgr.cpp.

References m_bCanRecord, m_bDirty, m_pCurrent, m_pFirst, m_pMostRecent, and ODS.

00024 {
00025    // Set initial values of member variables
00026    m_bDirty = FALSE;
00027    m_pFirst = NULL;
00028    m_pMostRecent = NULL;
00029    m_pCurrent = NULL;
00030    m_bCanRecord = FALSE;
00031    ODS("CUndoMgr constructor");
00032 }

~CUndoMgr ( ) [virtual]

Definition at line 40 of file UndoMgr.cpp.

References Clear(), m_pFirst, and ODS.

00041 {
00042    // Clear all stored turns
00043    Clear(m_pFirst);
00044    ODS("CUndoMgr destructor");
00045 }

Member Function Documentation

BOOL CanRedo ( )

Definition at line 318 of file UndoMgr.cpp.

References m_pMostRecent, and CTurn::m_pNext.

Referenced by CMainWindow::MainWndProc(), Redo(), and CEngine::TryCommand().

00319 {
00320    return (m_pMostRecent && m_pMostRecent->m_pNext);
00321 }

BOOL CanUndo ( )

Definition at line 302 of file UndoMgr.cpp.

References m_pMostRecent, and CTurn::m_pPrev.

Referenced by CMainWindow::MainWndProc(), CEngine::TryCommand(), and Undo().

00303 {
00304    return (m_pMostRecent && m_pMostRecent->m_pPrev);
00305 }

void Clear ( CTurn * pTurn )

Definition at line 225 of file UndoMgr.cpp.

References m_pCurrent, m_pFirst, m_pMostRecent, CTurn::m_pNext, SAFEDELETE, and SetCanRecord().

Referenced by CEngine::CleanupGame(), PushNewTurn(), CEngine::StopPlayGame(), and ~CUndoMgr().

00226 {
00227    if(pTurn)
00228    {
00229       // Clear the turn and all successors
00230       CTurn *pTemp = NULL;
00231       while(pTurn)
00232       {
00233          pTemp = pTurn->m_pNext;
00234          SAFEDELETE(pTurn);
00235          pTurn = pTemp;
00236       }
00237    } else
00238    {
00239       // After clearing the undo manager, cannot record until Init is called
00240       SetCanRecord(FALSE);
00241
00242       // Clear all nodes
00243       if(m_pFirst)
00244       {
00245          Clear(m_pFirst);
00246          m_pFirst = NULL;
00247          m_pMostRecent = NULL;
00248       }
00249       SAFEDELETE(m_pCurrent);
00250    }
00251 }

void ClearWorkingTurn ( )

Definition at line 264 of file UndoMgr.cpp.

References ENSUREALLOC, m_pCurrent, and SAFEDELETE.

Referenced by Redo(), and Undo().

00265 {
00266    // Create a new working turn
00267    SAFEDELETE(m_pCurrent);
00268    m_pCurrent = new CTurn();
00269    ENSUREALLOC(m_pCurrent);
00270 }

void Init ( )

Definition at line 115 of file UndoMgr.cpp.

References ENSUREALLOC, m_bDirty, m_pCurrent, m_pFirst, m_pMostRecent, and SetCanRecord().

Referenced by CEngine::DealGame().

00116 {
00117    // Create the first turn and the current (working) turn
00118    m_bDirty = FALSE;
00119    m_pFirst = new CTurn();
00120    ENSUREALLOC(m_pFirst);
00121    m_pMostRecent = m_pFirst;
00122    m_pCurrent = new CTurn();
00123    ENSUREALLOC(m_pCurrent);
00124    SetCanRecord(TRUE);
00125 }

void PushNewTurn ( )

Definition at line 138 of file UndoMgr.cpp.

References Clear(), ENSUREALLOC, m_bDirty, m_pCurrent, m_pMostRecent, CTurn::m_pNext, CTurn::m_pPrev, and ODS.

Referenced by CEngine::SetState().

00139 {
00140    // Only push a new turn on the stack if actions have been recorded to the
00141    // current turn
00142    if(m_bDirty)
00143    {
00144       ODS("----- Push New Turn ----------------------------------------------");
00145       if(m_pMostRecent)
00146       {
00147          if(m_pMostRecent->m_pNext)
00148             Clear(m_pMostRecent->m_pNext);
00149          m_pMostRecent->m_pNext = m_pCurrent;
00150          m_pCurrent->m_pPrev = m_pMostRecent;
00151       }
00152       m_pMostRecent = m_pCurrent;
00153
00154       // Create a new working turn
00155       m_pCurrent = new CTurn();
00156       ENSUREALLOC(m_pCurrent);
00157       m_bDirty = FALSE;
00158    }
00159 }

CAction * RecordAction ( CAction * pAction )

Definition at line 197 of file UndoMgr.cpp.

References CTurn::AddAction(), m_bCanRecord, m_bDirty, m_pCurrent, CAction::Redo(), and SAFEDELETE.

00198 {
00199    // Perform the action
00200    pAction->Redo();
00201    if(m_bCanRecord && m_pCurrent)
00202    {
00203       // Add the action to the current turn
00204       m_bDirty = TRUE;
00205       m_pCurrent->AddAction(pAction);
00206    } else
00207       // Delete the action if we're not recording it
00208       SAFEDELETE(pAction);
00209
00210    return pAction;
00211 }

CAction * RecordAction | ( | IActionSite * | pSite,
 |  | DWORD | dwType,
 |  | DWORD | dwData
 | ) |

Definition at line 176 of file UndoMgr.cpp.

References ENSUREALLOC.

00177 {
00178    // Create a new generic action object with the specified type and data
00179    CAction *pAction = new CAction(pSite, dwType, dwData);
00180    ENSUREALLOC(pAction);
00181
00182    return RecordAction(pAction);
00183 }

void Redo ( )

Definition at line 87 of file UndoMgr.cpp.

References CanRedo(), ClearWorkingTurn(), m_pMostRecent, CTurn::m_pNext, ODS, CTurn::Redo(), and SetCanRecord().

Referenced by CEngine::TryCommand().

00088 {
00089    ODS("CUndoMgr::Redo");
00090    if(!CanRedo())
00091       return;
00092
00093    // While redoing, we don't record any actions
00094    BOOL bOld = SetCanRecord(FALSE);
00095
00096    // Redo the next turn and step forward in the list
00097    m_pMostRecent->m_pNext->Redo();
00098    m_pMostRecent = m_pMostRecent->m_pNext;
00099
00100    ClearWorkingTurn();
00101    SetCanRecord(bOld);
00102 }

BOOL SetCanRecord ( BOOL bCanRecord )

Definition at line 284 of file UndoMgr.cpp.

References m_bCanRecord.

Referenced by Clear(), Init(), CEngine::RecalcLayout(), Redo(), and Undo().

00285 {
00286    BOOL bReturn = m_bCanRecord;
00287    m_bCanRecord = bCanRecord;
00288    return bReturn;
00289 }

void Undo ( )

Definition at line 58 of file UndoMgr.cpp.

References CanUndo(), ClearWorkingTurn(), m_pMostRecent, CTurn::m_pPrev, ODS, SetCanRecord(), and CTurn::Undo().

Referenced by CEngine::TryCommand().

00059 {
00060    ODS("CUndoMgr::Undo");
00061    if(!CanUndo())
00062       return;
00063
00064    // While undoing, we don't record any actions
00065    BOOL bOld = SetCanRecord(FALSE);
00066
00067    ClearWorkingTurn();
00068
00069    // Undo the most recent turn and step back in the list
00070    m_pMostRecent->Undo();
00071    m_pMostRecent = m_pMostRecent->m_pPrev;
00072
00073    SetCanRecord(bOld);
00074 }

Member Data Documentation

BOOL m_bCanRecord [protected]

Definition at line 58 of file UndoMgr.h.

Referenced by CUndoMgr(), RecordAction(), and SetCanRecord().

BOOL m_bDirty [protected]

Definition at line 54 of file UndoMgr.h.

Referenced by CUndoMgr(), Init(), PushNewTurn(), and RecordAction().

CTurn* m_pCurrent [protected]

Definition at line 57 of file UndoMgr.h.

Referenced by Clear(), ClearWorkingTurn(), CUndoMgr(), Init(), PushNewTurn(), and RecordAction().

CTurn* m_pFirst [protected]

Definition at line 55 of file UndoMgr.h.

Referenced by Clear(), CUndoMgr(), Init(), and ~CUndoMgr().

CTurn* m_pMostRecent [protected]

Definition at line 56 of file UndoMgr.h.

Referenced by CanRedo(), CanUndo(), Clear(), CUndoMgr(), Init(), PushNewTurn(), Redo(), and Undo().

The documentation for this class was generated from the following files:
  • UndoMgr.h
  • UndoMgr.cpp
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CUndoMgr Member List

This is the complete list of members for CUndoMgr, including all inherited members.
CanRedo() | CUndoMgr |
CanUndo() | CUndoMgr |
Clear(CTurn *pTurn) | CUndoMgr |
ClearWorkingTurn() | CUndoMgr |
CUndoMgr() | CUndoMgr |
Init() | CUndoMgr |
m_bCanRecord | CUndoMgr | [protected]
m_bDirty | CUndoMgr | [protected]
m_pCurrent | CUndoMgr | [protected]
m_pFirst | CUndoMgr | [protected]
m_pMostRecent | CUndoMgr | [protected]
PushNewTurn() | CUndoMgr |
RecordAction(IActionSite *pSite, DWORD dwType, DWORD dwData) | CUndoMgr |
RecordAction(CAction *pAction) | CUndoMgr |
Redo() | CUndoMgr |
SetCanRecord(BOOL bCanRecord) | CUndoMgr |
Undo() | CUndoMgr |
~CUndoMgr() | CUndoMgr | [virtual]
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


CUnkBase Class Reference

#include <bmws_unkbase.h>

Inheritance diagram for CUnkBase:

INDUnknown CBrowserContainer List of all members.

Public Methods

CUnkBase ()
virtual | ~CUnkBase ()
STDMETHOD (NDQueryInterface)(REFIID riid
STDMETHOD_ (ULONG, NDAddRef)()
STDMETHOD_ (ULONG, NDRelease)()

Public Attributes

LPVOID * | ppvObject

Protected Methods

LPUNKNOWN | GetOuterUnknown () const

Private Attributes

DWORD | m_cRef

Constructor & Destructor Documentation

CUnkBase ( )

Definition at line 40 of file bmws_unkbase.cpp.

References g_cActiveComponents, and m_cRef.

00041 {
00042    m_cRef = 0;
00043    g_cActiveComponents++;
00044 #ifdef BMWS_TRACKMEMALLOC
00045    m_scTotalCreated++;
00046 #endif
00047 }

~CUnkBase ( ) [virtual]

Definition at line 55 of file bmws_unkbase.cpp.

References g_cActiveComponents.

00056 {
00057    g_cActiveComponents--;
00058 #ifdef BMWS_TRACKMEMALLOC
00059    m_scTotalDeleted++;
00060 #endif
00061 }

Member Function Documentation

LPUNKNOWN GetOuterUnknown ( ) const [inline, protected]

Definition at line 73 of file bmws_unkbase.h.

00074    {
00075       return (LPUNKNOWN)((INDUnknown*)this);
00076    }

STDMETHOD ( NDQueryInterface )

Implements INDUnknown.

Reimplemented in CBrowserContainer.

STDMETHOD_ | ( | ULONG | ,
 |  | NDRelease |
 | ) |

Implements INDUnknown.

STDMETHOD_ | ( | ULONG | ,
 |  | NDAddRef |
 | ) |

Implements INDUnknown.

Member Data Documentation

DWORD m_cRef [private]

Definition at line 80 of file bmws_unkbase.h.

Referenced by CUnkBase().

LPVOID* ppvObject

Reimplemented in CBrowserContainer.

Definition at line 51 of file bmws_unkbase.h.

The documentation for this class was generated from the following files:
  • bmws_unkbase.h
  • bmws_unkbase.cpp
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CUnkBase Member List

This is the complete list of members for CUnkBase, including all inherited members.
CUnkBase() | CUnkBase |
GetOuterUnknown() const | CUnkBase | [inline, protected]
m_cRef | CUnkBase | [private]
ppvObject | CUnkBase |
PURE | INDUnknown |
STDMETHOD(NDQueryInterface)(REFIID riid | CUnkBase |
STDMETHOD_(ULONG, NDAddRef)() | CUnkBase |
STDMETHOD_(ULONG, NDRelease)() | CUnkBase |
~CUnkBase() | CUnkBase | [virtual]
Generated on Wed May 8 12:39:59 2002 for Solitaire Pack by doxygen 1.2.15


CUpdateDlg Class Reference

#include <bmws_updatedlg.h>

Inheritance diagram for CUpdateDlg:

CDlg List of all members.

Public Methods

CUpdateDlg (IUpdateDlgSite *pSite, UINT uidURL, CTSTR &lpszText, COLORREF color)
INT_PTR | DlgProc (UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Attributes

CHlinkWindowMgrPtr m_pHlinkWndMgr
IUpdateDlgSite * m_pSite
CTSTR m_lpszURL
CTSTR m_lpszText
COLORREF | m_color

Constructor & Destructor Documentation

CUpdateDlg | ( | IUpdateDlgSite * | pSite,
 |  | UINT | uidURL,
 |  | CTSTR & | lpszText,
 |  | COLORREF | color
 | ) |

Definition at line 57 of file bmws_updatedlg.cpp.

References CTSTR::Assign(), IDD_BMWS_UPDATEDLG, IDS_BMWS_UPDATEDLG_POPUPFILE, m_color, CTSTR::m_lpsz, m_lpszText, m_lpszURL, m_pHlinkWndMgr, and m_pSite.

00057                                                                                           :
00058                        CDlg(IDD_BMWS_UPDATEDLG)
00059 {
00060    m_lpszText.Assign(lpszText);
00061    for(int k = 0; m_lpszText.m_lpsz[k] != '\0'; k++)
00062       if(m_lpszText.m_lpsz[k] == '|' && m_lpszText.m_lpsz[k+1] == '|')
00063       {
00064          m_lpszText.m_lpsz[k] = '\r';
00065          m_lpszText.m_lpsz[k+1] = '\n';
00066       }
00067 #ifdef BMWS_CONTEXTHELP
00068    m_lpszPopupFile.Assign(IDS_BMWS_UPDATEDLG_POPUPFILE);
00069 #endif
00070    m_pHlinkWndMgr = NULL;
00071    m_pSite = pSite;
00072    m_lpszURL.Assign(uidURL);
00073    m_color = color;
00074 }

Member Function Documentation

INT_PTR DlgProc | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements CDlg.

Definition at line 90 of file bmws_updatedlg.cpp.

References CHWND::CenterWindow(), CHelpMgr::DialogCSHelp(), g_szAppTitle, IUpdateDlgSite::GetCheckUpdate(), HLINK_PPM_RETURNDIRECT, HLINK_PPM_RETURNNORMAL, IDC_BMWS_UPDATEDLG_AVAILBOX, IDC_BMWS_UPDATEDLG_CHECKEXTRAS, IDC_BMWS_UPDATEDLG_CHECKNEWVER, IDC_BMWS_UPDATEDLG_URL, m_color, CDlg::m_hwndDlg, m_lpszText, m_lpszURL, m_pHlinkWndMgr, m_pSite, and IUpdateDlgSite::SetCheckUpdate().

00091 {
00092    LRESULT lResult;
00093    if(m_pHlinkWndMgr)
00094    {
00095       DWORD dwReturn = m_pHlinkWndMgr->PreprocessMsg(m_hwndDlg, uMsg, wParam, lParam, &lResult);
00096       if(dwReturn == HLINK_PPM_RETURNDIRECT)
00097          return lResult;
00098       if(dwReturn == HLINK_PPM_RETURNNORMAL)
00099       {
00100          SetWindowLong(m_hwndDlg, DWL_MSGRESULT, lResult);
00101          return TRUE;
00102       }
00103    }
00104    switch(uMsg)
00105    {
00106       case WM_INITDIALOG:
00107       {
00108          SetWindowText(m_hwndDlg, g_szAppTitle);
00109          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_URL, m_lpszURL);
00110          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_AVAILBOX, m_lpszText);
00111
00112          BOOL bVer;
00113          BOOL bExtras;
00114          CTSTR lpszCheckVer(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER);
00115          CTSTR lpszCheckExtras(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS);
00116          m_pSite->GetCheckUpdate(&bVer, &bExtras, lpszCheckVer, lpszCheckExtras);
00117          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER, lpszCheckVer);
00118          SendDlgItemMessage(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER, BM_SETCHECK,
00119             bVer ? BST_CHECKED : BST_UNCHECKED, 0);
00120
00121 #ifdef BMWS_UPDATEDLG_NOEXTRAS
00122          ShowWindow(GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS), SW_HIDE);
00123 #else
00124          SetDlgItemText(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS, lpszCheckExtras);
00125          SendDlgItemMessage(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS, BM_SETCHECK,
00126             bExtras ? BST_CHECKED : BST_UNCHECKED, 0);
00127 #endif
00128
00129          m_pHlinkWndMgr = new CHlinkWindowMgr(1, m_color);
00130          m_pHlinkWndMgr->AddWnd(GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_URL), m_lpszURL);
00131          CHWND::CenterWindow(m_hwndDlg);
00132       } return TRUE;
00133
00134       case WM_CTLCOLORSTATIC:
00135          if(HWND(lParam) == GetDlgItem(m_hwndDlg, IDC_BMWS_UPDATEDLG_AVAILBOX))
00136             return (BOOL)GetSysColorBrush(COLOR_WINDOW);
00137          break;
00138
00139       case WM_COMMAND:
00140          if(LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
00141          {
00142             if(LOWORD(wParam) == IDOK)
00143                m_pSite->SetCheckUpdate(
00144                   (IsDlgButtonChecked(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKNEWVER) == BST_CHECKED),
00145                   (IsDlgButtonChecked(m_hwndDlg, IDC_BMWS_UPDATEDLG_CHECKEXTRAS) == BST_CHECKED));
00146             EndDialog(m_hwndDlg, LOWORD(wParam));
00147             return TRUE;
00148          }
00149          break;
00150
00151 #ifdef BMWS_CONTEXTHELP
00152       case WM_HELP:
00153       case WM_CONTEXTMENU:
00154          g_pHelp->DialogCSHelp(m_hwndDlg, uMsg, wParam, lParam, m_lpszPopupFile, s_adwPopupHelp);
00155          break;
00156 #endif
00157
00158    }
00159    return FALSE;
00160 }

Member Data Documentation

COLORREF m_color [protected]

Definition at line 60 of file bmws_updatedlg.h.

Referenced by CUpdateDlg(), and DlgProc().

CTSTR m_lpszText [protected]

Definition at line 59 of file bmws_updatedlg.h.

Referenced by CUpdateDlg(), and DlgProc().

CTSTR m_lpszURL [protected]

Definition at line 58 of file bmws_updatedlg.h.

Referenced by CUpdateDlg(), and DlgProc().

CHlinkWindowMgrPtr m_pHlinkWndMgr [protected]

Definition at line 56 of file bmws_updatedlg.h.

Referenced by CUpdateDlg(), and DlgProc().

IUpdateDlgSite* m_pSite [protected]

Definition at line 57 of file bmws_updatedlg.h.

Referenced by CUpdateDlg(), and DlgProc().

The documentation for this class was generated from the following files:
  • bmws_updatedlg.h
  • bmws_updatedlg.cpp
Generated on Wed May 8 12:40:00 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CUpdateDlg Member List

This is the complete list of members for CUpdateDlg, including all inherited members.
BMWSDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CDlg | [static]
CDlg(UINT uidDlg) | CDlg |
CUpdateDlg(IUpdateDlgSite *pSite, UINT uidURL, CTSTR &lpszText, COLORREF color) | CUpdateDlg |
DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) | CUpdateDlg | [virtual]
m_color | CUpdateDlg | [protected]
m_hwndDlg | CDlg | [protected]
m_lpszText | CUpdateDlg | [protected]
m_lpszURL | CUpdateDlg | [protected]
m_pHlinkWndMgr | CUpdateDlg | [protected]
m_pSite | CUpdateDlg | [protected]
m_uidDlg | CDlg | [protected]
Run(HWND hWndParent) | CDlg |
~CDlg() | CDlg | [inline, virtual]
Generated on Wed May 8 12:40:00 2002 for Solitaire Pack by doxygen 1.2.15


CUpdateInfo Class Reference

#include <bmws_update.h>

Inheritance diagram for CUpdateInfo:

IXMLDocumentSite List of all members.

Public Methods

void | XMLDone (CXMLDocument *pDoc)

Public Attributes

IUpdateSite * pSite
BOOL | bVer
BOOL | bExtra

Member Function Documentation

void XMLDone ( CXMLDocument * pDoc ) [virtual]

Implements IXMLDocumentSite.

Definition at line 37 of file bmws_update.cpp.

References g_bUpdateDone, GetProductKey(), GetRegDWORDValue(), CXMLDocument::GetRootElement(), IDS_BMWS_UPDATE_EXTRAATTR, IDS_BMWS_UPDATE_EXTRAVERATTR, IDS_BMWS_UPDATE_REG_EXTRAVER, IDS_BMWS_UPDATE_VERATTR, pSite, SetRegDWORDValue(), and IUpdateSite::UpdateDone().

00038 {
00039    CXMLElementPtr pRootEl;
00040    try
00041    {
00042       pRootEl = pDoc->GetRootElement();
00043       BOOL bOK = TRUE;
00044       CBSTR bstrExtra;
00045       double dAvailVersion = -1;
00046       if(bVer)
00047          dAvailVersion = pRootEl->GetR8Attr(IDS_BMWS_UPDATE_VERATTR, -1.0, TRUE);
00048       if(bExtra)
00049       {
00050          CKey hKeyProduct;
00051          if(SUCCEEDED(GetProductKey(hKeyProduct, TRUE)))
00052          {
00053             DWORD dwCurExtraVer = 0;
00054             GetRegDWORDValue(hKeyProduct, IDS_BMWS_UPDATE_REG_EXTRAVER, &dwCurExtraVer);
00055
00056             UINT uExtraVer = pRootEl->GetUINTAttr(IDS_BMWS_UPDATE_EXTRAVERATTR, 0, TRUE);
00057             if(uExtraVer > dwCurExtraVer)
00058             {
00059                SetRegDWORDValue(hKeyProduct, IDS_BMWS_UPDATE_REG_EXTRAVER, uExtraVer);
00060                bstrExtra = pRootEl->GetStrAttr(IDS_BMWS_UPDATE_EXTRAATTR, CBSTR(), TRUE);
00061             }
00062          }
00063       }
00064       pSite->UpdateDone(dAvailVersion, bstrExtra);
00065    }
00066    catch(CExcepEx *pE)
00067    {
00068       pE->Delete();
00069    }
00070    catch(CExcep *pE)
00071    {
00072       pE->Report();
00073       pE->Delete();
00074    }
00075
00076    pRootEl = NULL;
00077    if(g_bUpdateDone)
00078    {
00079       delete pDoc;
00080       g_pUpdateDoc = NULL;
00081       g_bUpdateDone = FALSE;
00082    }
00083    else
00084       g_bUpdateDone = TRUE;
00085    delete this;
00086 }

Member Data Documentation

BOOL bExtra

Definition at line 47 of file bmws_update.h.

Referenced by CheckForUpdate().

BOOL bVer

Definition at line 46 of file bmws_update.h.

Referenced by CheckForUpdate().

IUpdateSite* pSite

Definition at line 45 of file bmws_update.h.

Referenced by CheckForUpdate(), and XMLDone().

The documentation for this class was generated from the following files:
  • bmws_update.h
  • bmws_update.cpp
Generated on Wed May 8 12:40:00 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CUpdateInfo Member List

This is the complete list of members for CUpdateInfo, including all inherited members.
bExtra | CUpdateInfo |
bVer | CUpdateInfo |
pSite | CUpdateInfo |
XMLDone(CXMLDocument *pDoc) | CUpdateInfo | [virtual]
Generated on Wed May 8 12:40:00 2002 for Solitaire Pack by doxygen 1.2.15


CUserPrefs Class Reference

#include <UserPrefs.h>

List of all members.

Public Methods

CUserPrefs ()
virtual | ~CUserPrefs ()
void | SetSite (IUserPrefsSite *pSite)
void | ReadRegistry ()
void | WriteRegistry (DWORD dwFlags)
void | UpdateAppearance (DWORD dwFlags)
void | DoOptions (HWND hwndParent)

Static Public Methods

INT_PTR CALLBACK | OptionsGeneralProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)

Public Attributes

BOOL | m_bStatusBar
BOOL | m_bHelpPane
int | m_cyHelpPane
BOOL | m_bAnimWon
BOOL | m_bAnimCards
BOOL | m_bTooltips
BOOL | m_bCheckVer
BOOL | m_bCheckExtras
CTSTR m_lpszBkgImg
COLORREF | m_colorBkg
COLORREF | m_colorText
CCPSounds * m_pCPSounds

Static Public Attributes

UINT | s_auidSounds []
UINT | s_auidDisplays []

Protected Attributes

IUserPrefsSite * m_pSite

Constructor & Destructor Documentation

CUserPrefs ( )

Definition at line 410 of file UserPrefs.cpp.

References CY_HELPPANE_DEFAULT, DEFAULTBKCOLOR, DEFAULTTEXTCOLOR, m_bAnimCards, m_bAnimWon, m_bCheckExtras, m_bCheckVer, m_bHelpPane, m_bStatusBar, m_bTooltips, m_colorBkg, m_colorText, m_cyHelpPane, m_pCPSounds, and m_pSite.

00411 {
00412    // Set default settings
00413    m_pSite = NULL;
00414    m_bCheckVer = FALSE;
00415    m_bCheckExtras = FALSE;
00416    m_bStatusBar = TRUE;
00417    m_bTooltips = TRUE;
00418    m_bAnimWon = TRUE;
00419    m_bAnimCards = TRUE;
00420    m_bHelpPane = FALSE;
00421    m_cyHelpPane = CY_HELPPANE_DEFAULT;
00422    m_colorBkg = DEFAULTBKCOLOR;
00423    m_colorText = DEFAULTTEXTCOLOR;
00424    m_pCPSounds = NULL;
00425 }

~CUserPrefs ( ) [virtual]

Definition at line 433 of file UserPrefs.cpp.

References m_pCPSounds, and SAFEDELETE.

00434 {
00435    SAFEDELETE(m_pCPSounds);
00436 }

Member Function Documentation

void DoOptions ( HWND hwndParent )

Definition at line 641 of file UserPrefs.cpp.

References CCPSounds::CleanupPropPage(), CCPSounds::FillPropPage(), g_hInstLC, IDD_OPTIONS_APPEARANCE, IDD_OPTIONS_GENERAL, IDS_OPTIONSDLGTITLE, m_pCPSounds, CAppearanceDlg::OptionsAppearanceProc(), OptionsGeneralProc(), and THROW.

Referenced by CMainWindow::OnCommand().

00642 {
00643    PROPSHEETPAGE psp[3];
00644    PROPSHEETHEADER psh;
00645
00646    // Fill in the first property page
00647    psp[0].dwSize = sizeof(PROPSHEETPAGE);
00648    psp[0].dwFlags = 0;
00649    psp[0].hInstance = g_hInstLC;
00650    psp[0].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS_GENERAL);
00651    psp[0].pfnDlgProc = OptionsGeneralProc;
00652    psp[0].lParam = (LPARAM)this;
00653
00654    // Fill in APPPROCDATA structure for appearance page
00655    CAppearanceDlg apd(this);
00656
00657    // Fill in the second property page
00658    psp[1].dwSize = sizeof(PROPSHEETPAGE);
00659    psp[1].dwFlags = 0;
00660    psp[1].hInstance = g_hInstLC;
00661    psp[1].pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS_APPEARANCE);
00662    psp[1].pfnDlgProc = CAppearanceDlg::OptionsAppearanceProc;
00663    psp[1].lParam = (LPARAM)&apd;
00664
00665    // Let the CPSounds component fill in the second page
00666    m_pCPSounds->FillPropPage(&psp[2]);
00667
00668    // Set property sheet structure members
00669    psh.dwSize = sizeof(PROPSHEETHEADER);
00670    psh.dwFlags = PSH_PROPSHEETPAGE;
00671    psh.hwndParent = hwndParent;
00672    psh.hInstance = g_hInstLC;
00673    psh.ppsp = (LPCPROPSHEETPAGE)&psp;
00674    psh.pszCaption = MAKEINTRESOURCE(IDS_OPTIONSDLGTITLE);
00675    psh.nPages = 3;
00676    psh.nStartPage = 0;
00677
00678    // Display property sheet
00679    int i = PropertySheet(&psh);
00680
00681    m_pCPSounds->CleanupPropPage(&psp[2]);
00682
00683    if(i == -1)
00684       THROW(new CWinExcep(GetLastError()), CWinExcep*);
00685 }

INT_PTR CALLBACK OptionsGeneralProc | ( | HWND | hwndDlg,
 |  | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [static]

Definition at line 703 of file UserPrefs.cpp.

References GETCHK, IDC_OPTGENERAL_ANIMATEWON, IDC_OPTGENERAL_ANIMCARDS, IDC_OPTGENERAL_CHECKEXTRAS, IDC_OPTGENERAL_CHECKNEWVER, IDC_OPTGENERAL_STATUSBAR, IDC_OPTGENERAL_TOOLTIPS, m_bAnimCards, m_bAnimWon, m_bCheckExtras, m_bCheckVer, m_bStatusBar, m_bTooltips, m_pSite, IUserPrefsSite::OptionStatusBar(), IUserPrefsSite::OptionTooltips(), SETCHK, SETTING_GENERAL, SETTING_NOTIFY, and WriteRegistry().

Referenced by DoOptions().

00705 {
00706    CUserPrefs *pThis = (CUserPrefs*)GetWindowLong(hwndDlg, GWL_USERDATA);
00707
00708    try   // Windows-called code
00709    {
00710       switch(uMsg)
00711       {
00712          // Called when the dialog box is created
00713          case WM_INITDIALOG:
00714             pThis = (CUserPrefs*)((LPPROPSHEETPAGE)lParam)->lParam;
00715             SetWindowLong(hwndDlg, GWL_USERDATA, (LONG)pThis);
00716             return TRUE;
00717
00718          // Called when a check box is clicked
00719          case WM_COMMAND:
00720             if(HIWORD(wParam) == BN_CLICKED)
00721             {
00722                // Enable the Apply button
00723                ::SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
00724             }
00725             break;
00726
00727          // Called when a common control event takes place
00728          case WM_NOTIFY:
00729             switch(((LPNMHDR)lParam)->code)
00730             {
00731                // The property sheet is being activated
00732                case PSN_SETACTIVE:
00733                   // Set check boxes
00734                   SETCHK(IDC_OPTGENERAL_STATUSBAR, pThis->m_bStatusBar);
00735                   SETCHK(IDC_OPTGENERAL_TOOLTIPS, pThis->m_bTooltips);
00736                   SETCHK(IDC_OPTGENERAL_ANIMCARDS, pThis->m_bAnimCards);
00737                   SETCHK(IDC_OPTGENERAL_ANIMATEWON, pThis->m_bAnimWon);
00738                   SETCHK(IDC_OPTGENERAL_CHECKNEWVER, pThis->m_bCheckVer);
00739                   SETCHK(IDC_OPTGENERAL_CHECKEXTRAS, pThis->m_bCheckExtras);
00740                   return 0;
00741
00742                // The property sheet is being deactivated
00743                case PSN_KILLACTIVE:
00744                {
00745                   SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE);
00746                } return TRUE;
00747
00748                // The Apply or OK button has been clicked
00749                case PSN_APPLY:
00750                {
00751                   BOOL bNew = GETCHK(IDC_OPTGENERAL_STATUSBAR);
00752                   if(bNew != pThis->m_bStatusBar)
00753                      pThis->m_pSite->OptionStatusBar(bNew);
00754                   bNew = GETCHK(IDC_OPTGENERAL_TOOLTIPS);
00755                   if(bNew != pThis->m_bTooltips)
00756                      pThis->m_pSite->OptionTooltips(bNew);
00757                   pThis->m_bAnimCards = GETCHK(IDC_OPTGENERAL_ANIMCARDS);
00758                   pThis->m_bAnimWon = GETCHK(IDC_OPTGENERAL_ANIMATEWON);
00759                   pThis->m_bCheckVer = GETCHK(IDC_OPTGENERAL_CHECKNEWVER);
00760                   pThis->m_bCheckExtras = GETCHK(IDC_OPTGENERAL_CHECKEXTRAS);
00761                   pThis->WriteRegistry(SETTING_GENERAL | SETTING_NOTIFY);
00762                } break;
00763             }
00764             return TRUE;
00765
00766          case WM_HELP:
00767          case WM_CONTEXTMENU:
00768 //          g_pHelp->DialogCSHelp(hwndDlg, uMsg, wParam, lParam, CTSTR(),
00769 //             pThis->s_adwOptionsPopupHelp);
00770             break;
00771       }
00772    }
00773    catch(CExcep *pE)
00774    {
00775       pE->Report();
00776       pE->Delete();
00777       EndDialog(hwndDlg, IDCANCEL);
00778    }
00779    return FALSE;
00780 }

void ReadRegistry ( )

Definition at line 474 of file UserPrefs.cpp.

References ChooseColorReadReg(), CY_HELPPANE_DEFAULT, CY_HELPPANE_MIN, GetProductKey(), GetRegDWORDValue(), GetRegStringValue(), IDS_REG_ANIMCARDS, IDS_REG_ANIMWON, IDS_REG_BGCOLOR, IDS_REG_BGIMG, IDS_REG_CUSTCOLORS, IDS_REG_HELPPANE, IDS_REG_HELPPANEHEIGHT, IDS_REG_NOTIFYEXTRAS, IDS_REG_NOTIFYUPDATE, IDS_REG_STATUSBAR, IDS_REG_TEXTCOLOR, m_bAnimCards, m_bAnimWon, m_bCheckExtras, m_bCheckVer, m_bHelpPane, m_bStatusBar, m_colorBkg, m_colorText, m_cyHelpPane, and m_lpszBkgImg.

Referenced by CMainWindow::Create().

00475 {
00476    // Retrieve the registry key for storing user-specific settings
00477    CKey hKeyProduct;
00478    if(FAILED(GetProductKey(hKeyProduct, TRUE)))
00479       return;
00480
00481    DWORD dwTemp = 0;
00482
00483    // Load general settings
00484    m_bAnimWon = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_ANIMWON, &dwTemp)) ?
00485       (dwTemp == 1) : TRUE;
00486    m_bAnimCards = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_ANIMCARDS, &dwTemp)) ?
00487       (dwTemp == 1) : TRUE;
00488    m_bStatusBar = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_STATUSBAR, &dwTemp)) ?
00489       (dwTemp == 1) : TRUE;
00490    m_bHelpPane = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANE, &dwTemp)) ?
00491       (dwTemp == 1) : FALSE;
00492    GetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANEHEIGHT, &dwTemp);
00493    if((int)dwTemp == 0)
00494       m_cyHelpPane = CY_HELPPANE_DEFAULT;
00495    else if((int)dwTemp < CY_HELPPANE_MIN)
00496       m_cyHelpPane = CY_HELPPANE_MIN;
00497    else
00498       m_cyHelpPane = (int)dwTemp;
00499
00500    // Load update notification settings
00501    m_bCheckVer = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, &dwTemp)) ?
00502       (dwTemp == 1) : TRUE;
00503    m_bCheckExtras = SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, &dwTemp)) ?
00504       (dwTemp == 1) : TRUE;
00505
00506    // Load appearance settings
00507    m_lpszBkgImg = GetRegStringValue(hKeyProduct, IDS_REG_BGIMG);
00508    if(SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_BGCOLOR, &dwTemp)))
00509       m_colorBkg = dwTemp;
00510    if(SUCCEEDED(GetRegDWORDValue(hKeyProduct, IDS_REG_TEXTCOLOR, &dwTemp)))
00511       m_colorText = dwTemp;
00512
00513    // Load custom colors for choose color common dialog box
00514    ChooseColorReadReg(hKeyProduct, IDS_REG_CUSTCOLORS);
00515 }

void SetSite ( IUserPrefsSite * pSite )

Definition at line 449 of file UserPrefs.cpp.

References _ASSERT, CUINTArray, ENSUREALLOC, IDS_REG_EVENTSTITLE, m_pCPSounds, m_pSite, s_auidDisplays, and s_auidSounds.

Referenced by CMainWindow::CMainWindow().

00450 {
00451    _ASSERT(pSite);
00452    m_pSite = pSite;
00453
00454    // Create Control Panel sounds component
00455    CTSTR lpszTemp(TRUE, MAX_PATH);
00456    GetModuleFileName(NULL, lpszTemp, MAX_PATH);
00457    PathRemoveFileSpec(lpszTemp);
00458    m_pCPSounds = new CCPSounds(IDS_REG_EVENTSTITLE, IDS_APP_TITLE, CUINTArray(s_auidSounds, 4),
00459       CUINTArray(s_auidDisplays, 4), lpszTemp);
00460    ENSUREALLOC(m_pCPSounds);
00461 }

void UpdateAppearance ( DWORD dwFlags )

Definition at line 577 of file UserPrefs.cpp.

References CHECKHRCOM, IUserPrefsSite::GetHH(), CHTMLHelper::GetNamedEl(), IDS_EL_BODY, IDS_HEXCOLORHOLDER, IDS_IMGHOLDER, IDS_SEL_PILEBASECLASS, IDS_STYLE_COLOR, IDS_STYLE_PILEBASEFILTER, CTSTR::Len(), m_colorBkg, m_colorText, m_lpszBkgImg, m_pSite, UA_BKCOLOR, UA_BKIMG, and UA_TEXTCOLOR.

Referenced by CMainWindow::HTMLComplete(), and CAppearanceDlg::OptionsAppearanceProc().

00578 {
00579    CHTMLHelper *pHH = m_pSite->GetHH();
00580    if(!pHH)
00581       return;
00582
00583    // Retrieve the body element's style object
00584    CHTMLElementPtr spBody(TRUE, pHH->GetNamedEl(IDS_EL_BODY, IID_IHTMLElement));
00585    CHTMLStylePtr spStyle;
00586    CHECKHRCOM(spBody->get_style(&spStyle));
00587
00588    if((dwFlags & UA_BKCOLOR) || (dwFlags & UA_TEXTCOLOR))
00589    {
00590       // Some color setting is to be updated
00591       CTSTR lpszHex(IDS_HEXCOLORHOLDER);
00592       CTSTR lpszColor(TRUE, 24);
00593
00594       if(dwFlags & UA_BKCOLOR)
00595       {
00596          // Set background color
00597          wsprintf(lpszColor, lpszHex, GetRValue(m_colorBkg), GetGValue(m_colorBkg),
00598             GetBValue(m_colorBkg));
00599          CHECKHRCOM(spStyle->put_backgroundColor(CVariant(CBSTR(lpszColor))));
00600       }
00601
00602       if(dwFlags & UA_TEXTCOLOR)
00603       {
00604          // Set text color
00605          wsprintf(lpszColor, lpszHex, GetRValue(m_colorText), GetGValue(m_colorText),
00606             GetBValue(m_colorText));
00607          CHECKHRCOM(spStyle->put_color(CVariant(CBSTR(lpszColor))));
00608
00609          // Set link color to be the same as text color
00610          pHH->SetHlinkColor(m_colorText, IDS_STYLE_COLOR);
00611
00612          // Set pile base image filter, so images are in text color
00613          CTSTR lpszFilterHolder(IDS_STYLE_PILEBASEFILTER);
00614          CTSTR lpszFilter(TRUE, lpszFilterHolder.Len() + 16);
00615          wsprintf(lpszFilter, lpszFilterHolder, GetRValue(m_colorText), GetGValue(m_colorText),
00616             GetBValue(m_colorText));
00617          pHH->AddStyle(CBSTR(IDS_SEL_PILEBASECLASS), CBSTR(lpszFilter));
00618       }
00619    }
00620
00621    if(dwFlags & UA_BKIMG)
00622    {
00623       // Set background image
00624       CHECKHRCOM(spStyle->put_backgroundImage(m_lpszBkgImg ? CBSTR().Format(CTSTR(IDS_IMGHOLDER),
00625          m_lpszBkgImg) : CBSTR()));
00626    }
00627 }

void WriteRegistry ( DWORD dwFlags )

Definition at line 529 of file UserPrefs.cpp.

References ChooseColorWriteReg(), GetProductKey(), IDS_REG_ANIMCARDS, IDS_REG_ANIMWON, IDS_REG_BGCOLOR, IDS_REG_BGIMG, IDS_REG_CUSTCOLORS, IDS_REG_HELPPANE, IDS_REG_HELPPANEHEIGHT, IDS_REG_NOTIFYEXTRAS, IDS_REG_NOTIFYUPDATE, IDS_REG_STATUSBAR, IDS_REG_TEXTCOLOR, m_bAnimCards, m_bAnimWon, m_bCheckExtras, m_bCheckVer, m_bHelpPane, m_bStatusBar, m_colorBkg, m_colorText, m_cyHelpPane, m_lpszBkgImg, SetRegDWORDValue(), SetRegStringValue(), SETTING_APPEARANCE, SETTING_GENERAL, and SETTING_NOTIFY.

Referenced by CMainWindow::DoHelpPane(), CMainWindow::OnDestroy(), CAppearanceDlg::OptionsAppearanceProc(), OptionsGeneralProc(), and CMainWindow::SetCheckUpdate().

00530 {
00531    // Retrieve the registry key for storing user-specific settings
00532    CKey hKeyProduct;
00533    if(FAILED(GetProductKey(hKeyProduct, TRUE)))
00534       return;
00535
00536    if(dwFlags & SETTING_GENERAL)
00537    {
00538       // Save general settings
00539       SetRegDWORDValue(hKeyProduct, IDS_REG_ANIMWON, (DWORD)m_bAnimWon);
00540       SetRegDWORDValue(hKeyProduct, IDS_REG_ANIMCARDS, (DWORD)m_bAnimCards);
00541       SetRegDWORDValue(hKeyProduct, IDS_REG_STATUSBAR, (DWORD)m_bStatusBar);
00542       SetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANE, (DWORD)m_bHelpPane);
00543       SetRegDWORDValue(hKeyProduct, IDS_REG_HELPPANEHEIGHT, (DWORD)m_cyHelpPane);
00544    }
00545
00546    if(dwFlags & SETTING_NOTIFY)
00547    {
00548       // Save update notification settings
00549       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYUPDATE, (DWORD)m_bCheckVer);
00550       SetRegDWORDValue(hKeyProduct, IDS_REG_NOTIFYEXTRAS, (DWORD)m_bCheckExtras);
00551    }
00552
00553    if(dwFlags & SETTING_APPEARANCE)
00554    {
00555       // Save appearance settings
00556       SetRegStringValue(hKeyProduct, IDS_REG_BGIMG, m_lpszBkgImg);
00557       SetRegDWORDValue(hKeyProduct, IDS_REG_BGCOLOR, (DWORD)m_colorBkg);
00558       SetRegDWORDValue(hKeyProduct, IDS_REG_TEXTCOLOR, (DWORD)m_colorText);
00559
00560       // Save custom colors for choose color common dialog box
00561       ChooseColorWriteReg(hKeyProduct, IDS_REG_CUSTCOLORS);
00562    }
00563 }

Member Data Documentation

BOOL m_bAnimCards

Definition at line 89 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::GetAnim(), OptionsGeneralProc(), ReadRegistry(), and WriteRegistry().

BOOL m_bAnimWon

Definition at line 88 of file UserPrefs.h.

Referenced by CUserPrefs(), OptionsGeneralProc(), ReadRegistry(), and WriteRegistry().

BOOL m_bCheckExtras

Definition at line 94 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::GetCheckUpdate(), CMainWindow::OnCreate(), OptionsGeneralProc(), ReadRegistry(), CMainWindow::SetCheckUpdate(), and WriteRegistry().

BOOL m_bCheckVer

Definition at line 93 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::GetCheckUpdate(), CMainWindow::OnCreate(), OptionsGeneralProc(), ReadRegistry(), CMainWindow::SetCheckUpdate(), and WriteRegistry().

BOOL m_bHelpPane

Definition at line 86 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::DoHelpPane(), CMainWindow::OnCommand(), CMainWindow::OnCreate(), ReadRegistry(), and WriteRegistry().

BOOL m_bStatusBar

Definition at line 85 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::OnCreate(), OptionsGeneralProc(), CMainWindow::OptionStatusBar(), ReadRegistry(), and WriteRegistry().

BOOL m_bTooltips

Definition at line 90 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::GetShowTooltips(), OptionsGeneralProc(), and CMainWindow::OptionTooltips().

COLORREF m_colorBkg

Definition at line 98 of file UserPrefs.h.

Referenced by CAppearanceDlg::CAppearanceDlg(), CUserPrefs(), CAppearanceDlg::OptionsAppearanceProc(), ReadRegistry(), UpdateAppearance(), and WriteRegistry().

COLORREF m_colorText

Definition at line 99 of file UserPrefs.h.

Referenced by CAppearanceDlg::CAppearanceDlg(), CUserPrefs(), CAppearanceDlg::OptionsAppearanceProc(), ReadRegistry(), UpdateAppearance(), and WriteRegistry().

int m_cyHelpPane

Definition at line 87 of file UserPrefs.h.

Referenced by CUserPrefs(), CMainWindow::MainWndProc(), CMainWindow::OnSize(), ReadRegistry(), and WriteRegistry().

CTSTR m_lpszBkgImg

Definition at line 97 of file UserPrefs.h.

Referenced by CAppearanceDlg::CAppearanceDlg(), CAppearanceDlg::OptionsAppearanceProc(), ReadRegistry(), UpdateAppearance(), and WriteRegistry().

CCPSounds* m_pCPSounds

Definition at line 102 of file UserPrefs.h.

Referenced by CUserPrefs(), DoOptions(), CMainWindow::PlayCPSound(), SetSite(), and ~CUserPrefs().

IUserPrefsSite* m_pSite [protected]

Definition at line 107 of file UserPrefs.h.

Referenced by CUserPrefs(), OptionsGeneralProc(), SetSite(), and UpdateAppearance().

UINT s_auidDisplays [static]

Initial value:

 { IDS_SOUND_SHUFFLE, IDS_SOUND_FLIP, IDS_SOUND_DROP,
   IDS_SOUND_WON }

Definition at line 61 of file UserPrefs.cpp.

Referenced by CSolpackApp::Register(), SetSite(), and CSolpackApp::Unregister().

UINT s_auidSounds [static]

Initial value:

 { IDS_REG_SOUND_SHUFFLE, IDS_REG_SOUND_FLIP,
   IDS_REG_SOUND_DROP, IDS_REG_SOUND_WON }

Definition at line 59 of file UserPrefs.cpp.

Referenced by CSolpackApp::Register(), SetSite(), and CSolpackApp::Unregister().

The documentation for this class was generated from the following files:
  • UserPrefs.h
  • UserPrefs.cpp
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CUserPrefs Member List

This is the complete list of members for CUserPrefs, including all inherited members.
CUserPrefs() | CUserPrefs |
DoOptions(HWND hwndParent) | CUserPrefs |
m_bAnimCards | CUserPrefs |
m_bAnimWon | CUserPrefs |
m_bCheckExtras | CUserPrefs |
m_bCheckVer | CUserPrefs |
m_bHelpPane | CUserPrefs |
m_bStatusBar | CUserPrefs |
m_bTooltips | CUserPrefs |
m_colorBkg | CUserPrefs |
m_colorText | CUserPrefs |
m_cyHelpPane | CUserPrefs |
m_lpszBkgImg | CUserPrefs |
m_pCPSounds | CUserPrefs |
m_pSite | CUserPrefs | [protected]
OptionsGeneralProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | CUserPrefs | [static]
ReadRegistry() | CUserPrefs |
s_auidDisplays | CUserPrefs | [static]
s_auidSounds | CUserPrefs | [static]
SetSite(IUserPrefsSite *pSite) | CUserPrefs |
UpdateAppearance(DWORD dwFlags) | CUserPrefs |
WriteRegistry(DWORD dwFlags) | CUserPrefs |
~CUserPrefs() | CUserPrefs | [virtual]
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


CVariant Class Reference

#include <bmws_variant.h>

List of all members.

Public Methods

CVariant ()
CVariant (long lValue)
CVariant (BSTR bstr)
~CVariant ()

Constructor & Destructor Documentation

CVariant ( ) [inline]

Definition at line 30 of file bmws_variant.h.

00031    {
00032       VariantInit(this);
00033    }

CVariant ( long lValue ) [inline]

Definition at line 44 of file bmws_variant.h.

00045    {
00046       VariantInit(this);
00047       vt = VT_I4;
00048       lVal = lValue;
00049    }

CVariant ( BSTR bstr ) [inline]

Definition at line 60 of file bmws_variant.h.

00061    {
00062       VariantInit(this);
00063       vt = VT_BSTR;
00064       bstrVal = bstr;
00065    }

~CVariant ( ) [inline]

Definition at line 73 of file bmws_variant.h.

00074    {
00075       VariantClear(this);
00076    }

The documentation for this class was generated from the following file:
  • bmws_variant.h
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CVariant Member List

This is the complete list of members for CVariant, including all inherited members.
CVariant() | CVariant | [inline]
CVariant(long lValue) | CVariant | [inline]
CVariant(BSTR bstr) | CVariant | [inline]
~CVariant() | CVariant | [inline]
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


CWaitCursor Class Reference

#include <bmws_waitcursor.h>

List of all members.

Public Methods

CWaitCursor ()
~CWaitCursor ()

Static Protected Methods

void | DoWaitCursor (int nCode)

Static Protected Attributes

HCURSOR | s_hcurWait = LoadCursor(NULL, IDC_WAIT)
HCURSOR | s_hcurPrev = NULL
int | s_nWaitCursorCount = 0

Constructor & Destructor Documentation

CWaitCursor ( ) [inline]

Definition at line 32 of file bmws_waitcursor.h.

References DoWaitCursor().

00033    {
00034       DoWaitCursor(1);
00035    }

~CWaitCursor ( ) [inline]

Definition at line 43 of file bmws_waitcursor.h.

References DoWaitCursor().

00044    {
00045       DoWaitCursor(-1);
00046    }

Member Function Documentation

void DoWaitCursor ( int nCode ) [static, protected]

Definition at line 35 of file bmws_waitcursor.cpp.

References s_hcurPrev, s_hcurWait, and s_nWaitCursorCount.

Referenced by CWaitCursor(), and ~CWaitCursor().

00036 {
00037    s_nWaitCursorCount += nCode;
00038    if(s_nWaitCursorCount > 0)
00039    {
00040       HCURSOR hcurPrev = SetCursor(s_hcurWait);
00041       if((nCode > 0) && (s_nWaitCursorCount == 1))
00042          s_hcurPrev = hcurPrev;
00043    } else
00044    {
00045       s_nWaitCursorCount = 0;
00046       SetCursor(s_hcurPrev);
00047    }
00048 }

Member Data Documentation

HCURSOR s_hcurPrev = NULL [static, protected]

Definition at line 18 of file bmws_waitcursor.cpp.

Referenced by DoWaitCursor().

HCURSOR s_hcurWait = LoadCursor(NULL, IDC_WAIT) [static, protected]

Definition at line 19 of file bmws_waitcursor.cpp.

Referenced by DoWaitCursor().

int s_nWaitCursorCount = 0 [static, protected]

Definition at line 20 of file bmws_waitcursor.cpp.

Referenced by DoWaitCursor().

The documentation for this class was generated from the following files:
  • bmws_waitcursor.h
  • bmws_waitcursor.cpp
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CWaitCursor Member List

This is the complete list of members for CWaitCursor, including all inherited members.
CWaitCursor() | CWaitCursor | [inline]
DoWaitCursor(int nCode) | CWaitCursor | [protected, static]
s_hcurPrev | CWaitCursor | [protected, static]
s_hcurWait | CWaitCursor | [protected, static]
s_nWaitCursorCount | CWaitCursor | [protected, static]
~CWaitCursor() | CWaitCursor | [inline]
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


CWinExcep Class Reference

#include <bmws_error.h>

Inheritance diagram for CWinExcep:

CExcepEx CExcep List of all members.

Public Methods

CWinExcep (DWORD dwError, UINT uidRemedy=IDS_BMWS_REMEDY_RESTART, BOOL bClose=TRUE)

Constructor & Destructor Documentation

CWinExcep | ( | DWORD | dwError,
 |  | UINT | uidRemedy = IDS_BMWS_REMEDY_RESTART,
 |  | BOOL | bClose = TRUE
 | ) | [inline]

Definition at line 387 of file bmws_error.h.

References ERROR_ERRORINS_LPTSTR, ERROR_NOCLOSE, IDS_BMWS_ERROR_SYSTEMHOLDER, IDS_BMWS_REMEDY_RESTART, CExcepEx::m_dwFlags, CExcepEx::m_uidError, CExcepEx::m_uidErrorIns, CExcepEx::m_uidRemedy, CExcepEx::m_uidRemedyIns, and SetErrorInserts().

00388    {
00389       LPVOID lpMsgBuf;
00390       FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
00391          FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
00392       m_uidError = IDS_BMWS_ERROR_SYSTEMHOLDER;
00393       m_uidRemedy = uidRemedy;
00394       m_uidErrorIns = (UINT_PTR)lpMsgBuf;
00395       m_uidRemedyIns = 0;
00396       m_dwFlags = ERROR_ERRORINS_LPTSTR | (!bClose ? ERROR_NOCLOSE : 0);
00397       SetErrorInserts((LPTSTR)lpMsgBuf, NULL);
00398       LocalFree(lpMsgBuf);
00399    }

The documentation for this class was generated from the following file:
  • bmws_error.h
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CWinExcep Member List

This is the complete list of members for CWinExcep, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
CExcepEx() | CExcepEx | [inline]
CExcepEx(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0) | CExcepEx | [inline]
CWinExcep(DWORD dwError, UINT uidRemedy=IDS_BMWS_REMEDY_RESTART, BOOL bClose=TRUE) | CWinExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
m_dwFlags | CExcepEx |
m_uidError | CExcepEx |
m_uidErrorIns | CExcepEx |
m_uidRemedy | CExcepEx |
m_uidRemedyIns | CExcepEx |
Report() | CExcepEx | [inline, virtual]
Generated on Wed May 8 12:40:01 2002 for Solitaire Pack by doxygen 1.2.15


CXMLDocument Class Reference

#include <bmws_xml.h>

Inheritance diagram for CXMLDocument:

CRefCount IEventHandlerSite CCompoundXMLDocument List of all members.

Public Methods

CXMLDocument ()
virtual | ~CXMLDocument ()
void | InitXMLDocument (IXMLDocumentSite *pSite)
void | Abort ()
HRESULT | LoadFromFile (CBSTR &bstrFile, BOOL bAsync=TRUE)
HRESULT | SaveToFile (CBSTR &bstrFile)
CXMLElement * | CreateRootElement (UINT uidTagName)
CXMLElement * GetRootElement ()
BOOL | IsValidXML ()
CBSTR GetFileName ()
void | EventHandler (DWORD dwEventID, LPARAM lParam)

Protected Attributes

CPtr< IXMLDOMDocument,&IID_IXMLDOMDocument > | m_spDoc
BOOL | m_bPutHandler
CBSTR m_bstrFile
IXMLDocumentSite * m_pSite
CHandle m_hFile
BOOL | m_bValidLoaded

Constructor & Destructor Documentation

CXMLDocument ( )

Definition at line 762 of file bmws_xml.cpp.

References CHandle::Assign(), m_bPutHandler, m_bValidLoaded, m_hFile, and m_pSite.

00763 {
00764    m_pSite = NULL;
00765    m_bValidLoaded = FALSE;
00766    m_bPutHandler = FALSE;
00767 #ifndef BMWS_XML_MINIMAL
00768    m_hFile.Assign(INVALID_HANDLE_VALUE, CloseHandle);
00769 #endif
00770 }

~CXMLDocument ( ) [virtual]

Definition at line 778 of file bmws_xml.cpp.

References m_spDoc.

00779 {
00780    if(m_bPutHandler)
00781    {
00782       VARIANT vHandler;
00783       vHandler.vt = VT_NULL;
00784       m_spDoc->put_onreadystatechange(vHandler);
00785    }
00786 }

Member Function Documentation

void Abort ( )

Definition at line 943 of file bmws_xml.cpp.

References CHECKHRCOM, m_spDoc, RETHROWCOM, and XMLINTERNALEXCEP.

Referenced by LoadFromFile().

00944 {
00945    try
00946    {
00947       CHECKHRCOM(m_spDoc->abort());
00948    }
00949    catch(CCOMExcep *pE)
00950    {
00951       RETHROWCOM(pE);
00952       XMLINTERNALEXCEP(20010);
00953    }
00954 }

CXMLElement * CreateRootElement ( UINT uidTagName )

Definition at line 970 of file bmws_xml.cpp.

References CHECKHRCOM, ENSUREALLOC, IDS_BMWS_XML_PI_DATA, IDS_BMWS_XML_PI_TARGET, m_bValidLoaded, m_spDoc, RETHROWCOM, and XMLINTERNALEXCEP.

00971 {
00972    CXMLElement *pReturn = NULL;
00973
00974    try
00975    {
00976       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spNewEl;
00977       CHECKHRCOM(m_spDoc->createElement(CBSTR(uidTagName), &spNewEl));
00978       CHECKHRCOM(m_spDoc->putref_documentElement(spNewEl));
00979
00980       pReturn = new CXMLElement(spNewEl);
00981       ENSUREALLOC(pReturn);
00982
00983       CPtr<IXMLDOMProcessingInstruction, &IID_IXMLDOMProcessingInstruction> spPI;
00984       CHECKHRCOM(m_spDoc->createProcessingInstruction(CBSTR(IDS_BMWS_XML_PI_TARGET),
00985          CBSTR(IDS_BMWS_XML_PI_DATA), &spPI));
00986       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNodeDoc(m_spDoc);
00987       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNodePI(spPI);
00988       CPtr<IDispatch, &IID_IDispatch> spDispNewEl(spNewEl);
00989       VARIANT v;
00990       VariantInit(&v);
00991       v.vt = VT_DISPATCH;
00992       v.pdispVal = spDispNewEl;
00993       CHECKHRCOM(spNodeDoc->insertBefore(spNodePI, v, NULL));
00994       m_bValidLoaded = TRUE;
00995    }
00996    catch(CCOMExcep *pE)
00997    {
00998       RETHROWCOM(pE);
00999       XMLINTERNALEXCEP(20011);
01000    }
01001
01002    return pReturn;
01003 }

void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [virtual]

Implements IEventHandlerSite.

Definition at line 1092 of file bmws_xml.cpp.

References CHandle::Assign(), CHECKHRCOM, m_bstrFile, m_bValidLoaded, m_hFile, m_pSite, m_spDoc, and IXMLDocumentSite::XMLDone().

Referenced by LoadFromFile().

01093 {
01094    try   // Windows-called code
01095    {
01096       m_bValidLoaded = FALSE;
01097       long lReadyState;
01098       if(SUCCEEDED(m_spDoc->get_readyState(&lReadyState)) && (lReadyState == READYSTATE_COMPLETE))
01099       {
01100          CPtr<IXMLDOMParseError, &IID_IXMLDOMParseError> spXMLError;
01101          LONG lErrorCode = E_FAIL;
01102          CHECKHRCOM(m_spDoc->get_parseError(&spXMLError));
01103          CHECKHRCOM(spXMLError->get_errorCode(&lErrorCode));
01104          if(lErrorCode == 0)
01105             m_bValidLoaded = TRUE;
01106
01107 #ifndef BMWS_XML_MINIMAL
01108          m_hFile.Assign(CreateFile(CTSTR(m_bstrFile), GENERIC_READ, FILE_SHARE_READ, NULL,
01109             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
01110 #endif
01111
01112          if(m_pSite)
01113             m_pSite->XMLDone(this);
01114       }
01115    }
01116    catch(CExcep *pE)
01117    {
01118       pE->Report();
01119       pE->Delete();
01120    }
01121 }

CBSTR GetFileName ( )

Definition at line 1054 of file bmws_xml.cpp.

References m_bstrFile.

01055 {
01056    return m_bstrFile;
01057 }

CXMLElement * GetRootElement ( )

Definition at line 1018 of file bmws_xml.cpp.

References CHECKHRCOM, ENSUREALLOC, IDS_BMWS_REMEDY_CONTACTBMWS, IDS_BMWS_XML_E_GETROOTEL, m_bValidLoaded, m_spDoc, RETHROWCOM, and THROW.

Referenced by CCompoundXMLDocument::AddFile(), CUpdateInfo::XMLDone(), and CCompoundXMLDocument::XMLDone().

01019 {
01020    if(!m_bValidLoaded)
01021       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETROOTEL, IDS_BMWS_REMEDY_CONTACTBMWS), CXMLExcep*);
01022
01023    CXMLElement *pReturn = NULL;
01024    try
01025    {
01026       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spEl;
01027       CHECKHRCOM(m_spDoc->get_documentElement(&spEl));
01028       pReturn = new CXMLElement(spEl);
01029       ENSUREALLOC(pReturn);
01030    }
01031    catch(CCOMExcep *pE)
01032    {
01033       RETHROWCOM(pE);
01034       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETROOTEL, IDS_BMWS_REMEDY_CONTACTBMWS), CXMLExcep*);
01035    }
01036
01037    return pReturn;
01038 }

void InitXMLDocument ( IXMLDocumentSite * pSite )

Definition at line 801 of file bmws_xml.cpp.

References CHECKHRCOM, IDS_BMWS_XML_E_MSXMLCREATE, m_pSite, m_spDoc, RETHROWCOM, and THROW.

Referenced by CCompoundXMLDocument::CCompoundXMLDocument(), and CheckForUpdate().

00802 {
00803    m_pSite = pSite;
00804    try
00805    {
00806       CHECKHRCOM(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
00807          IID_IXMLDOMDocument, (LPVOID*)&m_spDoc));
00808    }
00809    catch(CCOMExcep *pE)
00810    {
00811       RETHROWCOM(pE);
00812       THROW(new CXMLExcep(IDS_BMWS_XML_E_MSXMLCREATE, IDS_BMWS_REMEDY_IE), CXMLExcep*);
00813    }
00814 }

BOOL IsValidXML ( )

Definition at line 1072 of file bmws_xml.cpp.

References m_bValidLoaded.

01073 {
01074    return m_bValidLoaded;
01075 }

HRESULT LoadFromFile | ( | CBSTR & | bstrFile,
 |  | BOOL | bAsync = TRUE
 | ) |

Definition at line 829 of file bmws_xml.cpp.

References _ASSERT, Abort(), CHECKFOROOM, CHECKHRCOM, CHandle::Close(), ENSUREALLOC, EventHandler(), IDS_BMWS_XML_E_MSXMLCREATE, m_bPutHandler, m_bstrFile, m_bValidLoaded, m_hFile, m_spDoc, RETHROWCOM, and THROW.

Referenced by CheckForUpdate().

00830 {
00831    _ASSERT(bstrFile);
00832
00833    Abort();
00834
00835 #ifndef BMWS_XML_MINIMAL
00836    m_hFile.Close();
00837 #endif
00838
00839    m_bstrFile = bstrFile;
00840
00841    VARIANT_BOOL vb;
00842    HRESULT hr;
00843    VARIANT vURL;
00844
00845    m_bValidLoaded = FALSE;
00846
00847    if(m_bPutHandler)
00848    {
00849       VARIANT vHandler;
00850       vHandler.vt = VT_NULL;
00851       m_spDoc->put_onreadystatechange(vHandler);
00852    }
00853
00854    CEventHandler *pHandler = NULL;
00855    if(bAsync)
00856    {
00857       pHandler = new CEventHandler((IEventHandlerSite*)this, 0, 0);
00858       ENSUREALLOC(pHandler);
00859    }
00860
00861    try
00862    {
00863       if(bAsync)
00864       {
00865          CVariant vHandler;
00866          vHandler.vt = VT_DISPATCH;
00867          pHandler->QueryInterface(IID_IDispatch, (LPVOID*)&vHandler.pdispVal);
00868          CHECKHRCOM(m_spDoc->put_onreadystatechange(vHandler));
00869          m_bPutHandler = TRUE;
00870       }
00871
00872       CHECKHRCOM(m_spDoc->put_async(bAsync ? VARIANT_TRUE : VARIANT_FALSE));
00873
00874       vURL.vt = VT_BSTR;
00875       V_BSTR(&vURL) = m_bstrFile;
00876       hr = m_spDoc->load(vURL, &vb);
00877       CHECKFOROOM(hr);
00878       if(FAILED(hr))
00879          return hr;
00880       if(!bAsync)
00881       {
00882          EventHandler(0, 0);
00883       }
00884    }
00885    catch(CCOMExcep *pE)
00886    {
00887       RETHROWCOM(pE);
00888       THROW(new CXMLExcep(IDS_BMWS_XML_E_MSXMLCREATE, IDS_BMWS_REMEDY_IE), CXMLExcep*);
00889    }
00890
00891    return S_OK;
00892 }

HRESULT SaveToFile ( CBSTR & bstrFile )

Definition at line 909 of file bmws_xml.cpp.

References _ASSERT, CHandle::Assign(), CHECKFOROOM, CHandle::Close(), m_bstrFile, m_bValidLoaded, m_hFile, and m_spDoc.

00910 {
00911    CBSTR theFile = bstrFile;
00912    if(!theFile)
00913       theFile = m_bstrFile;
00914    _ASSERT(theFile);
00915    _ASSERT(m_bValidLoaded);
00916
00917    VARIANT vURL;
00918    vURL.vt = VT_BSTR;
00919    vURL.bstrVal = theFile;
00920
00921    m_hFile.Close();
00922    HRESULT hr = m_spDoc->save(vURL);
00923    CHECKFOROOM(hr);
00924    m_bstrFile = theFile;
00925    m_hFile.Assign(CreateFile(CTSTR(m_bstrFile), GENERIC_READ, FILE_SHARE_READ, NULL,
00926       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
00927    return hr;
00928 }

Member Data Documentation

BOOL m_bPutHandler [protected]

Definition at line 197 of file bmws_xml.h.

Referenced by CXMLDocument(), and LoadFromFile().

CBSTR m_bstrFile [protected]

Definition at line 198 of file bmws_xml.h.

Referenced by EventHandler(), GetFileName(), LoadFromFile(), and SaveToFile().

BOOL m_bValidLoaded [protected]

Definition at line 203 of file bmws_xml.h.

Referenced by CreateRootElement(), CXMLDocument(), EventHandler(), GetRootElement(), IsValidXML(), LoadFromFile(), and SaveToFile().

CHandle m_hFile [protected]

Definition at line 201 of file bmws_xml.h.

Referenced by CXMLDocument(), EventHandler(), LoadFromFile(), and SaveToFile().

IXMLDocumentSite* m_pSite [protected]

Definition at line 199 of file bmws_xml.h.

Referenced by CXMLDocument(), EventHandler(), and InitXMLDocument().

CPtr<IXMLDOMDocument, &IID_IXMLDOMDocument> m_spDoc [protected]

Definition at line 196 of file bmws_xml.h.

Referenced by Abort(), CreateRootElement(), EventHandler(), GetRootElement(), InitXMLDocument(), LoadFromFile(), SaveToFile(), and ~CXMLDocument().

The documentation for this class was generated from the following files:
  • bmws_xml.h
  • bmws_xml.cpp
Generated on Wed May 8 12:40:02 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CXMLDocument Member List

This is the complete list of members for CXMLDocument, including all inherited members.
Abort() | CXMLDocument |
CreateRootElement(UINT uidTagName) | CXMLDocument |
CRefCount() | CRefCount | [inline]
CXMLDocument() | CXMLDocument |
downcount() | CRefCount | [inline]
EventHandler(DWORD dwEventID, LPARAM lParam) | CXMLDocument | [virtual]
GetFileName() | CXMLDocument |
GetRootElement() | CXMLDocument |
InitXMLDocument(IXMLDocumentSite *pSite) | CXMLDocument |
IsValidXML() | CXMLDocument |
LoadFromFile(CBSTR &bstrFile, BOOL bAsync=TRUE) | CXMLDocument |
m_bPutHandler | CXMLDocument | [protected]
m_bstrFile | CXMLDocument | [protected]
m_bValidLoaded | CXMLDocument | [protected]
m_hFile | CXMLDocument | [protected]
m_pSite | CXMLDocument | [protected]
m_spDoc | CXMLDocument | [protected]
SaveToFile(CBSTR &bstrFile) | CXMLDocument |
upcount() | CRefCount | [inline]
~CRefCount() | CRefCount | [inline, virtual]
~CXMLDocument() | CXMLDocument | [virtual]
Generated on Wed May 8 12:40:02 2002 for Solitaire Pack by doxygen 1.2.15


CXMLElement Class Reference

#include <bmws_xml.h>

Inheritance diagram for CXMLElement:

CRefCount List of all members.

Public Methods

CXMLElement (IXMLDOMElement *pEl)
BOOL | GetAttr (UINT uidAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist=FALSE)
CBSTR | GetStrAttr (UINT uidAttr, CBSTR &bstrDefValue, BOOL bFailNoExist=FALSE)
long | GetI4Attr (UINT uidAttr, long lDefValue, BOOL bFailNoExist=FALSE)
double | GetR8Attr (UINT uidAttr, double dDefValue, BOOL bFailNoExist=FALSE)
UINT | GetUINTAttr (UINT uidAttr, UINT uiDefValue, BOOL bFailNoExist=FALSE)
long | NumChildOf (UINT uidTagName)
CXMLElement * | ChildOf (UINT uidTagName, long lIndex, DWORD dwNotFound=CHILDOF_FAILIFNOTFOUND)
void | SetStrAttr (UINT uidAttr, CBSTR &bstrValue)
void | SetVTAttr (UINT uidAttr, LPVOID pvValue, VARTYPE vt)
CXMLElement * | AddChild (UINT uidTagName, long lNewIndex)
void | DeleteChild (UINT uidTagName, long lIndex)
void | DeleteAttr (UINT uidAttr)
CBSTR | GetText (CBSTR &bstrDefValue, BOOL bFailNoExist=FALSE)
void | SetText (CBSTR &bstrText)
CBSTR GetTagName ()
BOOL | IsTag (UINT uidTagName)
BOOL | AltGetAttr (BSTR bstrAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist=FALSE)
long | AltNumChildOf (BSTR bstrTagName)
CXMLElement * | AltChildOf (BSTR bstrTagName, long lIndex, DWORD dwNotFound=CHILDOF_FAILIFNOTFOUND)
CXMLElement * | AltAddChild (BSTR bstrTagName, long lNewIndex)
void | AltSetVTAttr (BSTR bstrAttr, LPVOID pvValue, VARTYPE vt)

Private Attributes

CPtr< IXMLDOMElement,&IID_IXMLDOMElement > | m_spEl
CPtr< IXMLDOMNode,&IID_IXMLDOMNode > | m_spNode

Constructor & Destructor Documentation

CXMLElement ( IXMLDOMElement * pEl )

Definition at line 42 of file bmws_xml.cpp.

References CPtr< IXMLDOMNode,&IID_IXMLDOMNode >::Assign(), m_spEl, and m_spNode.

Referenced by AltAddChild(), and AltChildOf().

00043 {
00044    m_spEl = pEl;
00045    m_spNode.Assign(pEl);
00046 }

Member Function Documentation

CXMLElement * AddChild | ( | UINT | uidTagName,
 |  | long | lNewIndex
 | ) |

Definition at line 276 of file bmws_xml.cpp.

References AltAddChild().

00277 {
00278    return AltAddChild(CBSTR(uidTagName), lNewIndex);
00279 }

CXMLElement * AltAddChild | ( | BSTR | bstrTagName,
 |  | long | lNewIndex
 | ) |

Definition at line 637 of file bmws_xml.cpp.

References AltChildOf(), CHECKHRCOM, CHILDOF_NULLIFNOTFOUND, CXMLElement(), ENSUREALLOC, m_spEl, m_spNode, RETHROWCOM, and XMLINTERNALEXCEP.

Referenced by AddChild(), and AltChildOf().

00638 {
00639    CXMLElement *pNewEl = NULL;
00640
00641    try
00642    {
00643       CPtr<IXMLDOMDocument, &IID_IXMLDOMDocument> spDoc;
00644       CHECKHRCOM(m_spEl->get_ownerDocument(&spDoc));
00645       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spNewEl;
00646       CHECKHRCOM(spDoc->createElement(bstrTagName, &spNewEl));
00647       CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spNewNode = spNewEl;
00648
00649       if(lNewIndex == -1)
00650       {
00651          CHECKHRCOM(m_spNode->appendChild(spNewNode, NULL));
00652       } else
00653       {
00654          CXMLElementPtr pBeforeEl(AltChildOf(bstrTagName, lNewIndex, CHILDOF_NULLIFNOTFOUND));
00655          if(pBeforeEl)
00656          {
00657             CPtr<IDispatch, &IID_IDispatch> spBeforeDisp(pBeforeEl->m_spNode);
00658             VARIANT v;
00659             VariantInit(&v);
00660             v.vt = VT_DISPATCH;
00661             v.pdispVal = spBeforeDisp;
00662             CHECKHRCOM(m_spNode->insertBefore(spNewNode, v, NULL));
00663          } else
00664             CHECKHRCOM(m_spNode->appendChild(spNewNode, NULL));
00665       }
00666       pNewEl = new CXMLElement(spNewEl);
00667       ENSUREALLOC(pNewEl);
00668    }
00669    catch(CCOMExcep *pE)
00670    {
00671       RETHROWCOM(pE);
00672       XMLINTERNALEXCEP(20004);
00673    }
00674
00675    return pNewEl;
00676 }

CXMLElement * AltChildOf | ( | BSTR | bstrTagName,
 |  | long | lIndex,
 |  | DWORD | dwNotFound = CHILDOF_FAILIFNOTFOUND
 | ) |

Definition at line 594 of file bmws_xml.cpp.

References AltAddChild(), CHILDOF_CREATEIFNOTFOUND, CHILDOF_FAILIFNOTFOUND, CXMLElement(), ENSUREALLOC, IDS_BMWS_XML_XSLINDEX, m_spNode, and XMLINTERNALEXCEP.

Referenced by AltAddChild(), and ChildOf().

00595 {
00596    CXMLElement *pReturn = NULL;
00597
00598    CTSTR lpszTag(bstrTagName);
00599    CTSTR lpszFormatter(IDS_BMWS_XML_XSLINDEX);
00600    CTSTR lpszFinal(TRUE, lstrlen(lpszFormatter) + lstrlen(lpszTag) + 5);
00601    wsprintf(lpszFinal, lpszFormatter, lpszTag, lIndex);
00602
00603    CPtr<IXMLDOMNode, &IID_IXMLDOMNode> spSubNode;
00604    HRESULT hr = m_spNode->selectSingleNode(CBSTR(lpszFinal), &spSubNode);
00605    if(hr == S_OK)
00606    {
00607       CPtr<IXMLDOMElement, &IID_IXMLDOMElement> spSubEl(spSubNode);
00608       pReturn = new CXMLElement(spSubEl);
00609       ENSUREALLOC(pReturn);
00610       hr = S_OK;
00611    } else if(hr == S_FALSE)
00612    {
00613       if(dwNotFound == CHILDOF_CREATEIFNOTFOUND)
00614          pReturn = AltAddChild(bstrTagName, lIndex);
00615       else if(dwNotFound == CHILDOF_FAILIFNOTFOUND)
00616          XMLINTERNALEXCEP(20012);
00617    } else
00618       XMLINTERNALEXCEP(20002);
00619
00620    return pReturn;
00621 }

BOOL AltGetAttr | ( | BSTR | bstrAttr,
 |  | VARIANT * | pvarValue,
 |  | VARTYPE | vt,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 514 of file bmws_xml.cpp.

References _ASSERT, CHECKHRCOM, ERROR_ERRORINS_LPTSTR, IDS_BMWS_REMEDY_RESTART, IDS_BMWS_XML_E_GETATTR, m_spEl, RETHROWCOM, and THROW.

Referenced by GetAttr().

00515 {
00516    _ASSERT(pvarValue);
00517    VariantInit(pvarValue);
00518    try
00519    {
00520       HRESULT hr = m_spEl->getAttribute(bstrAttr, pvarValue);
00521       CHECKHRCOM(hr);
00522       if(hr == S_OK)
00523       {
00524          if(vt != VT_EMPTY)
00525             CHECKHRCOM(VariantChangeType(pvarValue, pvarValue, 0, vt));
00526          return TRUE;
00527       }
00528    }
00529    catch(CCOMExcep *pCE)
00530    {
00531       VariantClear(pvarValue);
00532       RETHROWCOM(pCE);
00533    }
00534    catch(CExcep *pE)
00535    {
00536       VariantClear(pvarValue);
00537       throw pE;
00538    }
00539    VariantClear(pvarValue);
00540    if(bFailNoExist)
00541       THROW(new CXMLExcep(IDS_BMWS_XML_E_GETATTR, IDS_BMWS_REMEDY_RESTART,
00542          (UINT_PTR)(LPTSTR)CTSTR(bstrAttr), 0, ERROR_ERRORINS_LPTSTR), CXMLExcep*);
00543    return FALSE;
00544 }

long AltNumChildOf ( BSTR bstrTagName )

Definition at line 560 of file bmws_xml.cpp.

References _ASSERT, CHECKHRCOM, m_spNode, RETHROWCOM, and XMLINTERNALEXCEP.

Referenced by NumChildOf().

00561 {
00562    _ASSERT(bstrTagName);
00563    long lNumChildren = 0;
00564    try
00565    {
00566       CPtr<IXMLDOMNodeList, &IID_IXMLDOMNodeList> spNodeList;
00567       CHECKHRCOM(m_spNode->selectNodes(bstrTagName, &spNodeList));
00568       CHECKHRCOM(spNodeList->get_length(&lNumChildren));
00569    }
00570    catch(CCOMExcep *pE)
00571    {
00572       RETHROWCOM(pE);
00573       XMLINTERNALEXCEP(20001);
00574    }
00575
00576    return lNumChildren;
00577 }

void AltSetVTAttr | ( | BSTR | bstrAttr,
 |  | LPVOID | pvValue,
 |  | VARTYPE | vt
 | ) |

Definition at line 692 of file bmws_xml.cpp.

References _ASSERT, CHECKHRCOM, m_spEl, RETHROWCOM, and XMLINTERNALEXCEP.

Referenced by SetVTAttr().

00693 {
00694    CVariant v;
00695    if(vt != VT_EMPTY)
00696    {
00697       v.vt = vt;
00698       switch(vt)
00699       {
00700          case VT_UINT:
00701             v.uintVal = *((UINT*)pvValue);
00702             break;
00703          case VT_I4:
00704             v.lVal = *((long*)pvValue);
00705             break;
00706          case VT_R8:
00707             v.dblVal = *((double*)pvValue);
00708             break;
00709          default:
00710             _ASSERT(FALSE);
00711       }
00712    } else
00713       VariantCopy(&v, (VARIANT*)pvValue);
00714
00715    try
00716    {
00717       if(vt != VT_EMPTY)
00718          CHECKHRCOM(VariantChangeType(&v, &v, 0, VT_BSTR));
00719       CHECKHRCOM(m_spEl->setAttribute(bstrAttr, v));
00720    }
00721    catch(CCOMExcep *pE)
00722    {
00723       RETHROWCOM(pE);
00724       XMLINTERNALEXCEP(20007);
00725    }
00726 }

CXMLElement * ChildOf | ( | UINT | uidTagName,
 |  | long | lIndex,
 |  | DWORD | dwNotFound = CHILDOF_FAILIFNOTFOUND
 | ) |

Definition at line 208 of file bmws_xml.cpp.

References AltChildOf().

Referenced by DeleteChild().

00209 {
00210    return AltChildOf(CBSTR(uidTagName), lIndex, dwNotFound);
00211 }

void DeleteAttr ( UINT uidAttr )

Definition at line 324 of file bmws_xml.cpp.

References CHECKHRCOM, m_spEl, RETHROWCOM, and XMLINTERNALEXCEP.

00325 {
00326    try
00327    {
00328       CHECKHRCOM(m_spEl->removeAttribute(CBSTR(uidAttr)));
00329    }
00330    catch(CCOMExcep *pE)
00331    {
00332       RETHROWCOM(pE);
00333       XMLINTERNALEXCEP(20006);
00334    }
00335 }

void DeleteChild | ( | UINT | uidTagName,
 |  | long | lIndex
 | ) |

Definition at line 295 of file bmws_xml.cpp.

References CHECKHRCOM, ChildOf(), CHILDOF_NULLIFNOTFOUND, m_spNode, RETHROWCOM, and XMLINTERNALEXCEP.

00296 {
00297    try
00298    {
00299       CXMLElementPtr pEl = ChildOf(uidTagName, lIndex, CHILDOF_NULLIFNOTFOUND);
00300       if(pEl)
00301       {
00302          CHECKHRCOM(m_spNode->removeChild(pEl->m_spNode, NULL));
00303       }
00304    }
00305    catch(CCOMExcep *pE)
00306    {
00307       RETHROWCOM(pE);
00308       XMLINTERNALEXCEP(20005);
00309    }
00310 }

BOOL GetAttr | ( | UINT | uidAttr,
 |  | VARIANT * | pvarValue,
 |  | VARTYPE | vt,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 66 of file bmws_xml.cpp.

References AltGetAttr().

Referenced by GetI4Attr(), GetR8Attr(), GetStrAttr(), and GetUINTAttr().

00067 {
00068    return AltGetAttr(CBSTR(uidAttr), pvarValue, vt, bFailNoExist);
00069 }

long GetI4Attr | ( | UINT | uidAttr,
 |  | long | lDefValue,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 114 of file bmws_xml.cpp.

References GetAttr().

00115 {
00116    long lReturn = lDefValue;
00117    CVariant v;
00118    if(GetAttr(uidAttr, &v, VT_I4, bFailNoExist))
00119       lReturn = v.lVal;
00120    return lReturn;
00121 }

double GetR8Attr | ( | UINT | uidAttr,
 |  | double | dDefValue,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 139 of file bmws_xml.cpp.

References GetAttr().

00140 {
00141    double dReturn = dDefValue;
00142    CVariant v;
00143    if(GetAttr(uidAttr, &v, VT_R8, bFailNoExist))
00144       dReturn = v.dblVal;
00145    return dReturn;
00146 }

CBSTR GetStrAttr | ( | UINT | uidAttr,
 |  | CBSTR & | bstrDefValue,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 87 of file bmws_xml.cpp.

References GetAttr().

00088 {
00089    CVariant v;
00090    if(GetAttr(uidAttr, &v, VT_BSTR, bFailNoExist))
00091    {
00092       CBSTR bstrReturn(v.bstrVal);
00093       return bstrReturn;
00094    }
00095    return bstrDefValue;
00096 }

CBSTR GetTagName ( )

Definition at line 461 of file bmws_xml.cpp.

References CBSTR::Addr(), CHECKHRCOM, m_spEl, RETHROWCOM, and XMLINTERNALEXCEP.

Referenced by IsTag().

00462 {
00463    CBSTR bstrReturn;
00464    try
00465    {
00466       CHECKHRCOM(m_spEl->get_tagName(bstrReturn.Addr()));
00467    }
00468    catch(CCOMExcep *pE)
00469    {
00470       RETHROWCOM(pE);
00471       XMLINTERNALEXCEP(20009);
00472    }
00473    return bstrReturn;
00474 }

CBSTR GetText | ( | CBSTR & | bstrDefValue,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 348 of file bmws_xml.cpp.

References CBSTR::Addr(), CHECKHRCOM, IDS_BMWS_REMEDY_RESTART, IDS_BMWS_XML_E_GETTEXT, m_spNode, RETHROWCOM, and THROW.

00349 {
00350    CBSTR bstrReturn;
00351    try
00352    {
00353       CHECKHRCOM(m_spNode->get_text(bstrReturn.Addr()));
00354    }
00355    catch(CCOMExcep *pE)
00356    {
00357       RETHROWCOM(pE);
00358       bstrReturn = bstrDefValue;
00359       if(bFailNoExist)
00360          THROW(new CXMLExcep(IDS_BMWS_XML_E_GETTEXT, IDS_BMWS_REMEDY_RESTART), CXMLExcep*);
00361    }
00362    return bstrReturn;
00363 }

UINT GetUINTAttr | ( | UINT | uidAttr,
 |  | UINT | uiDefValue,
 |  | BOOL | bFailNoExist = FALSE
 | ) |

Definition at line 164 of file bmws_xml.cpp.

References GetAttr().

00165 {
00166    UINT uiReturn = uiDefValue;
00167    CVariant v;
00168    if(GetAttr(uidAttr, &v, VT_UINT, bFailNoExist))
00169       uiReturn = v.uintVal;
00170    VariantClear(&v);
00171    return uiReturn;
00172 }

BOOL IsTag ( UINT uidTagName )

Definition at line 488 of file bmws_xml.cpp.

References CBSTR::Equals(), and GetTagName().

00489 {
00490    CBSTR bstrCurTag = GetTagName();
00491    return bstrCurTag.Equals(CBSTR(uidTagName));
00492 }

long NumChildOf ( UINT uidTagName )

Definition at line 188 of file bmws_xml.cpp.

References AltNumChildOf().

00189 {
00190    return AltNumChildOf(CBSTR(uidTagName));
00191 }

void SetStrAttr | ( | UINT | uidAttr,
 |  | CBSTR & | bstrValue
 | ) |

Definition at line 227 of file bmws_xml.cpp.

References CHECKHRCOM, m_spEl, RETHROWCOM, and XMLINTERNALEXCEP.

00228 {
00229    CVariant v;
00230    v.vt = VT_BSTR;
00231    v.bstrVal = SysAllocStringLen(bstrValue, SysStringLen(bstrValue));
00232    try
00233    {
00234       CHECKHRCOM(m_spEl->setAttribute(CBSTR(uidAttr), v));
00235    }
00236    catch(CCOMExcep *pE)
00237    {
00238       RETHROWCOM(pE);
00239       XMLINTERNALEXCEP(20003);
00240    }
00241 }

void SetText ( CBSTR & bstrText )

Definition at line 377 of file bmws_xml.cpp.

References _ASSERT, CHECKHRCOM, m_spNode, RETHROWCOM, and XMLINTERNALEXCEP.

00378 {
00379    _ASSERT(bstrText);
00380
00381    try
00382    {
00383       CHECKHRCOM(m_spNode->put_text(bstrText));
00384    }
00385    catch(CCOMExcep *pE)
00386    {
00387       RETHROWCOM(pE);
00388       XMLINTERNALEXCEP(20008);
00389    }
00390 }

void SetVTAttr | ( | UINT | uidAttr,
 |  | LPVOID | pvValue,
 |  | VARTYPE | vt
 | ) |

Definition at line 257 of file bmws_xml.cpp.

References AltSetVTAttr().

00258 {
00259    AltSetVTAttr(CBSTR(uidAttr), pvValue, vt);
00260 }

Member Data Documentation

CPtr<IXMLDOMElement, &IID_IXMLDOMElement> m_spEl [private]

Definition at line 130 of file bmws_xml.h.

Referenced by AltAddChild(), AltGetAttr(), AltSetVTAttr(), CXMLElement(), DeleteAttr(), GetTagName(), and SetStrAttr().

CPtr<IXMLDOMNode, &IID_IXMLDOMNode> m_spNode [private]

Definition at line 131 of file bmws_xml.h.

Referenced by AltAddChild(), AltChildOf(), AltNumChildOf(), CXMLElement(), DeleteChild(), GetText(), and SetText().

The documentation for this class was generated from the following files:
  • bmws_xml.h
  • bmws_xml.cpp
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CXMLElement Member List

This is the complete list of members for CXMLElement, including all inherited members.
AddChild(UINT uidTagName, long lNewIndex) | CXMLElement |
AltAddChild(BSTR bstrTagName, long lNewIndex) | CXMLElement |
AltChildOf(BSTR bstrTagName, long lIndex, DWORD dwNotFound=CHILDOF_FAILIFNOTFOUND) | CXMLElement |
AltGetAttr(BSTR bstrAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist=FALSE) | CXMLElement |
AltNumChildOf(BSTR bstrTagName) | CXMLElement |
AltSetVTAttr(BSTR bstrAttr, LPVOID pvValue, VARTYPE vt) | CXMLElement |
ChildOf(UINT uidTagName, long lIndex, DWORD dwNotFound=CHILDOF_FAILIFNOTFOUND) | CXMLElement |
CRefCount() | CRefCount | [inline]
CXMLElement(IXMLDOMElement *pEl) | CXMLElement |
DeleteAttr(UINT uidAttr) | CXMLElement |
DeleteChild(UINT uidTagName, long lIndex) | CXMLElement |
downcount() | CRefCount | [inline]
GetAttr(UINT uidAttr, VARIANT *pvarValue, VARTYPE vt, BOOL bFailNoExist=FALSE) | CXMLElement |
GetI4Attr(UINT uidAttr, long lDefValue, BOOL bFailNoExist=FALSE) | CXMLElement |
GetR8Attr(UINT uidAttr, double dDefValue, BOOL bFailNoExist=FALSE) | CXMLElement |
GetStrAttr(UINT uidAttr, CBSTR &bstrDefValue, BOOL bFailNoExist=FALSE) | CXMLElement |
GetTagName() | CXMLElement |
GetText(CBSTR &bstrDefValue, BOOL bFailNoExist=FALSE) | CXMLElement |
GetUINTAttr(UINT uidAttr, UINT uiDefValue, BOOL bFailNoExist=FALSE) | CXMLElement |
IsTag(UINT uidTagName) | CXMLElement |
m_spEl | CXMLElement | [private]
m_spNode | CXMLElement | [private]
NumChildOf(UINT uidTagName) | CXMLElement |
SetStrAttr(UINT uidAttr, CBSTR &bstrValue) | CXMLElement |
SetText(CBSTR &bstrText) | CXMLElement |
SetVTAttr(UINT uidAttr, LPVOID pvValue, VARTYPE vt) | CXMLElement |
upcount() | CRefCount | [inline]
~CRefCount() | CRefCount | [inline, virtual]
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


CXMLExcep Class Reference

#include <bmws_xml.h>

Inheritance diagram for CXMLExcep:

CExcepEx CExcep List of all members.

Public Methods

CXMLExcep (UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0)

Constructor & Destructor Documentation

CXMLExcep | ( | UINT | uidError,
 |  | UINT | uidRemedy,
 |  | UINT_PTR | uidErrorIns = 0,
 |  | UINT_PTR | uidRemedyIns = 0,
 |  | DWORD | dwFlags = 0
 | ) | [inline]

Definition at line 68 of file bmws_xml.h.

00069                          : CExcepEx(uidError, uidRemedy, uidErrorIns, uidRemedyIns, dwFlags)
00070    {
00071    }

The documentation for this class was generated from the following file:
  • bmws_xml.h
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


Member List

CXMLExcep Member List

This is the complete list of members for CXMLExcep, including all inherited members.
CExcep(int code, BOOL bDelete=TRUE) | CExcep | [inline]
CExcepEx() | CExcepEx | [inline]
CExcepEx(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0) | CExcepEx | [inline]
CXMLExcep(UINT uidError, UINT uidRemedy, UINT_PTR uidErrorIns=0, UINT_PTR uidRemedyIns=0, DWORD dwFlags=0) | CXMLExcep | [inline]
Delete() | CExcep | [inline]
m_bDelete | CExcep |
m_code | CExcep |
m_dwFlags | CExcepEx |
m_uidError | CExcepEx |
m_uidErrorIns | CExcepEx |
m_uidRemedy | CExcepEx |
m_uidRemedyIns | CExcepEx |
Report() | CExcepEx | [inline, virtual]
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


IActionSite Class Reference

#include <Action.h>

Inheritance diagram for IActionSite:

CCard CEngine CGameData CPile CDeck CFragment List of all members.

Public Methods

virtual void | DoAction (CAction *pAction)=0
virtual void | UndoAction (CAction *pAction)=0

Member Function Documentation

virtual void DoAction ( CAction * pAction ) [pure virtual]

Implemented in CCard, CEngine, CFragment, CGameData, and CPile.

Referenced by CAction::Redo().

virtual void UndoAction ( CAction * pAction ) [pure virtual]

Implemented in CCard, CEngine, CFragment, CGameData, and CPile.

Referenced by CAction::Undo().

The documentation for this class was generated from the following file:
  • Action.h
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IActionSite Member List

This is the complete list of members for IActionSite, including all inherited members.
DoAction(CAction *pAction)=0 | IActionSite | [pure virtual]
UndoAction(CAction *pAction)=0 | IActionSite | [pure virtual]
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


ICardPileSite Class Reference

#include <Card.h>

Inheritance diagram for ICardPileSite:

CPile CDeck CFragment List of all members.

Public Methods

virtual HRESULT | GetPileInterface (ISolpackPile **pp)=0
virtual void | SetCardIndex (CCard *pCard, long lOldIndex, long *plNewIndex)=0
virtual void | PileSetElCapture ()=0
virtual void | PileReleaseElCapture ()=0

Member Function Documentation

virtual HRESULT GetPileInterface ( ISolpackPile ** pp ) [pure virtual]

Implemented in CPile.

virtual void PileReleaseElCapture ( ) [pure virtual]

Implemented in CPile.

Referenced by CCard::ReleaseElCapture().

virtual void PileSetElCapture ( ) [pure virtual]

Implemented in CPile.

Referenced by CCard::SetElCapture().

virtual void SetCardIndex | ( | CCard * | pCard,
 |  | long | lOldIndex,
 |  | long * | plNewIndex
 | ) | [pure virtual]

Implemented in CPile.

Referenced by CCard::DoAction(), and CCard::UndoAction().

The documentation for this class was generated from the following file:
  • Card.h
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ICardPileSite Member List

This is the complete list of members for ICardPileSite, including all inherited members.
GetPileInterface(ISolpackPile **pp)=0 | ICardPileSite | [pure virtual]
PileReleaseElCapture()=0 | ICardPileSite | [pure virtual]
PileSetElCapture()=0 | ICardPileSite | [pure virtual]
SetCardIndex(CCard *pCard, long lOldIndex, long *plNewIndex)=0 | ICardPileSite | [pure virtual]
Generated on Wed May 8 12:40:03 2002 for Solitaire Pack by doxygen 1.2.15


ICardSite Class Reference

#include <Card.h>

Inheritance diagram for ICardSite:

CEngine List of all members.

Public Methods

virtual CTSTR & | GetFaceDownImg ()=0
virtual void | CardFlipped ()=0

Member Function Documentation

virtual void CardFlipped ( ) [pure virtual]

Implemented in CEngine.

virtual CTSTR& GetFaceDownImg ( ) [pure virtual]

Implemented in CEngine.

Referenced by CCard::UpdateImg().

The documentation for this class was generated from the following file:
  • Card.h
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ICardSite Member List

This is the complete list of members for ICardSite, including all inherited members.
CardFlipped()=0 | ICardSite | [pure virtual]
GetFaceDownImg()=0 | ICardSite | [pure virtual]
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


ICompoundXMLDocumentSite Class Reference

#include <bmws_compound_xml.h>

Inheritance diagram for ICompoundXMLDocumentSite:

IXMLDocumentSite List of all members.

Public Methods

virtual BOOL | SpewCallback (long lIndex, CTSTR &lpszFileName, CTSTR &lpszData, LPTSTR lpszContents)=0
virtual BOOL | DelCallback (long lIndex, CTSTR &lpszFileName, CTSTR &lpszData)=0

Member Function Documentation

virtual BOOL DelCallback | ( | long | lIndex,
 |  | CTSTR & | lpszFileName,
 |  | CTSTR & | lpszData
 | ) | [pure virtual]

Referenced by CCompoundXMLDocument::CleanupFiles().

virtual BOOL SpewCallback | ( | long | lIndex,
 |  | CTSTR & | lpszFileName,
 |  | CTSTR & | lpszData,
 |  | LPTSTR | lpszContents
 | ) | [pure virtual]

Referenced by CCompoundXMLDocument::SpewFile().

The documentation for this class was generated from the following file:
  • bmws_compound_xml.h
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ICompoundXMLDocumentSite Member List

This is the complete list of members for ICompoundXMLDocumentSite, including all inherited members.
DelCallback(long lIndex, CTSTR &lpszFileName, CTSTR &lpszData)=0 | ICompoundXMLDocumentSite | [pure virtual]
SpewCallback(long lIndex, CTSTR &lpszFileName, CTSTR &lpszData, LPTSTR lpszContents)=0 | ICompoundXMLDocumentSite | [pure virtual]
XMLDone(CXMLDocument *pDoc)=0 | IXMLDocumentSite | [pure virtual]
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


IEngineObjSite Class Reference

#include <EngineObj.h>

Inheritance diagram for IEngineObjSite:

CEngine List of all members.

Public Methods

virtual BOOL | MouseDown (CEngineObj *pObj, long lCurButton)=0
virtual void | MouseMove ()=0
virtual BOOL | MouseUp (BOOL bOverEl, long lButton)=0
virtual void | CancelMouseEvent ()=0
virtual CUndoMgr * | EngGetUndoMgr ()=0

Member Function Documentation

virtual void CancelMouseEvent ( ) [pure virtual]

Implemented in CEngine.

Referenced by CEngineObj::EventHandler().

virtual CUndoMgr* EngGetUndoMgr ( ) [pure virtual]

Implemented in CEngine.

virtual BOOL MouseDown | ( | CEngineObj * | pObj,
 |  | long | lCurButton
 | ) | [pure virtual]

Implemented in CEngine.

Referenced by CEngineObj::EventHandler().

virtual void MouseMove ( ) [pure virtual]

Implemented in CEngine.

Referenced by CEngineObj::EventHandler().

virtual BOOL MouseUp | ( | BOOL | bOverEl,
 |  | long | lButton
 | ) | [pure virtual]

Implemented in CEngine.

Referenced by CEngineObj::EventHandler().

The documentation for this class was generated from the following file:
  • EngineObj.h
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IEngineObjSite Member List

This is the complete list of members for IEngineObjSite, including all inherited members.
CancelMouseEvent()=0 | IEngineObjSite | [pure virtual]
EngGetUndoMgr()=0 | IEngineObjSite | [pure virtual]
MouseDown(CEngineObj *pObj, long lCurButton)=0 | IEngineObjSite | [pure virtual]
MouseMove()=0 | IEngineObjSite | [pure virtual]
MouseUp(BOOL bOverEl, long lButton)=0 | IEngineObjSite | [pure virtual]
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


IEngineSite Class Reference

#include <Engine.h>

Inheritance diagram for IEngineSite:

CMainWindow List of all members.

Public Methods

virtual void | SetScore (long lScore)=0
virtual BOOL | GetShowTooltips ()=0
virtual BOOL | GetAnim ()=0
virtual void | PlayCPSound (UINT uIndex)=0
virtual void | PostMsg (UINT uMsg, WPARAM wParam, LPARAM lParam)=0

Member Function Documentation

virtual BOOL GetAnim ( ) [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::GetAnim().

virtual BOOL GetShowTooltips ( ) [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::GetShowTooltips().

virtual void PlayCPSound ( UINT uIndex ) [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::PlayCPSound().

virtual void PostMsg | ( | UINT | uMsg,
 |  | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::SetState().

virtual void SetScore ( long lScore ) [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::DoAction(), CEngine::PlayGame(), and CEngine::UndoAction().

The documentation for this class was generated from the following file:
  • Engine.h
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IEngineSite Member List

This is the complete list of members for IEngineSite, including all inherited members.
GetAnim()=0 | IEngineSite | [pure virtual]
GetShowTooltips()=0 | IEngineSite | [pure virtual]
PlayCPSound(UINT uIndex)=0 | IEngineSite | [pure virtual]
PostMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)=0 | IEngineSite | [pure virtual]
SetScore(long lScore)=0 | IEngineSite | [pure virtual]
Generated on Wed May 8 12:40:04 2002 for Solitaire Pack by doxygen 1.2.15


IEventHandlerSite Class Reference

#include <bmws_eventhandler.h>

Inheritance diagram for IEventHandlerSite:

CEngine CEngineObj CGameCommandMgr CGameMenu CGameMenuItem CHTMLControl CHTMLLink CXMLDocument List of all members.

Public Methods

virtual void EventHandler (DWORD dwEventID, LPARAM lParam)=0

Member Function Documentation

virtual void EventHandler | ( | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Implemented in CHTMLChk, CHTMLChooseColor, CHTMLControl, CHTMLEdit, CHTMLLink, CHTMLRadioGroup, CHTMLSelect, CXMLDocument, CEngine, CEngineObj, CGameCommandMgr, CGameMenu, and CGameMenuItem.

The documentation for this class was generated from the following file:
  • bmws_eventhandler.h
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IEventHandlerSite Member List

This is the complete list of members for IEventHandlerSite, including all inherited members.
EventHandler(DWORD dwEventID, LPARAM lParam)=0 IEventHandlerSite [pure virtual]
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


IEventSinkSite Class Reference

#include <bmws_eventsink.h>

Inheritance diagram for IEventSinkSite:

C3DShatter CHelpPane CMainWindow CTechSupportDlg List of all members.

Public Methods

virtual HRESULT EventSink (LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)=0

Member Function Documentation

virtual HRESULT EventSink | ( | LPARAM | lParam,
 |  | DISPID | dispid,
 |  | DISPPARAMS FAR * | pdispparams
 | ) | [pure virtual]

Implemented in C3DShatter, CTechSupportDlg, CHelpPane, and CMainWindow.

The documentation for this class was generated from the following file:
  • bmws_eventsink.h
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IEventSinkSite Member List

This is the complete list of members for IEventSinkSite, including all inherited members.
EventSink(LPARAM lParam, DISPID dispid, DISPPARAMS FAR *pdispparams)=0 IEventSinkSite [pure virtual]
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


IFragmentSite Class Reference

#include <Fragment.h>

Inheritance diagram for IFragmentSite:

CEngine List of all members.

Public Methods

virtual void AnimStateChange (BOOL bAnim)=0

Member Function Documentation

virtual void AnimStateChange ( BOOL bAnim ) [pure virtual]

Implemented in CEngine.

Referenced by CFragment::Animate().

The documentation for this class was generated from the following file:
  • Fragment.h
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IFragmentSite Member List

This is the complete list of members for IFragmentSite, including all inherited members.
AnimStateChange(BOOL bAnim)=0 IFragmentSite [pure virtual]
Generated on Wed May 8 12:40:05 2002 for Solitaire Pack by doxygen 1.2.15


IGameCommandMgrSite Class Reference

#include <GameCommandMgr.h>

Inheritance diagram for IGameCommandMgrSite:

CEngine List of all members.

Public Methods

virtual void HandleCommand (long lID)=0

Member Function Documentation

virtual void HandleCommand ( long lID ) [pure virtual]

Implemented in CEngine.

Referenced by CGameCommandMgr::EventHandler().

The documentation for this class was generated from the following file:
  • GameCommandMgr.h
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IGameCommandMgrSite Member List

This is the complete list of members for IGameCommandMgrSite, including all inherited members.
HandleCommand(long lID)=0 IGameCommandMgrSite [pure virtual]
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


IGameMenuItemSite Class Reference

#include <GameMenuItem.h>

Inheritance diagram for IGameMenuItemSite:

CGameMenu List of all members.

Public Methods

virtual void | ItemClicked (CGameMenuItem *pItem, int iLibIndex, int iGameIndex)=0
virtual void | ItemDblClicked (CGameMenuItem *pItem, int iLibIndex, int iGameIndex)=0

Member Function Documentation

virtual void ItemClicked | ( | CGameMenuItem * | pItem,
 |  | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [pure virtual]

Implemented in CGameMenu.

Referenced by CGameMenuItem::EventHandler().

virtual void ItemDblClicked | ( | CGameMenuItem * | pItem,
 |  | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [pure virtual]

Implemented in CGameMenu.

Referenced by CGameMenuItem::EventHandler().

The documentation for this class was generated from the following file:
  • GameMenuItem.h
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IGameMenuItemSite Member List

This is the complete list of members for IGameMenuItemSite, including all inherited members.
ItemClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex)=0 | IGameMenuItemSite | [pure virtual]
ItemDblClicked(CGameMenuItem *pItem, int iLibIndex, int iGameIndex)=0 | IGameMenuItemSite | [pure virtual]
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


IGameMenuSite Class Reference

#include <GameMenu.h>

Inheritance diagram for IGameMenuSite:

CMainWindow List of all members.

Public Methods

virtual void | GameSelected (int iLibIndex, int iGameIndex)=0
virtual void | ToggleShowRules ()=0
virtual void | ActiveGameChanged ()=0

Member Function Documentation

virtual void ActiveGameChanged ( ) [pure virtual]

Implemented in CMainWindow.

Referenced by CGameMenu::ItemClicked(), and CGameMenu::Refresh().

virtual void GameSelected | ( | int | iLibIndex,
 |  | int | iGameIndex
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CGameMenu::EventHandler(), and CGameMenu::ItemDblClicked().

virtual void ToggleShowRules ( ) [pure virtual]

Implemented in CMainWindow.

Referenced by CGameMenu::EventHandler().

The documentation for this class was generated from the following file:
  • GameMenu.h
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IGameMenuSite Member List

This is the complete list of members for IGameMenuSite, including all inherited members.
ActiveGameChanged()=0 | IGameMenuSite | [pure virtual]
GameSelected(int iLibIndex, int iGameIndex)=0 | IGameMenuSite | [pure virtual]
ToggleShowRules()=0 | IGameMenuSite | [pure virtual]
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


IHlinkWindowSite Class Reference

#include <bmws_hlink.h>

Inheritance diagram for IHlinkWindowSite:

CRegDlgInfo List of all members.

Public Methods

virtual void HlinkClicked (DWORD dwID)=0

Member Function Documentation

virtual void HlinkClicked ( DWORD dwID ) [pure virtual]

Implemented in CRegDlgInfo.

Referenced by CHlinkWindow::Execute().

The documentation for this class was generated from the following file:
  • bmws_hlink.h
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IHlinkWindowSite Member List

This is the complete list of members for IHlinkWindowSite, including all inherited members.
HlinkClicked(DWORD dwID)=0 IHlinkWindowSite [pure virtual]
Generated on Wed May 8 12:40:06 2002 for Solitaire Pack by doxygen 1.2.15


IHTMLChooseColorSite Class Reference

#include <bmws_htmlchoosecolor.h>

List of all members.

Public Methods

virtual HWND GetColorInfo (CHTMLChooseColor *pControl, UINT uID, LPARAM lParam, CTSTR &lpszTitle)=0

Member Function Documentation

virtual HWND GetColorInfo | ( | CHTMLChooseColor * | pControl,
 |  | UINT | uID,
 |  | LPARAM | lParam,
 |  | CTSTR & | lpszTitle
 | ) | [pure virtual]

Referenced by CHTMLChooseColor::EventHandler().

The documentation for this class was generated from the following file:
  • bmws_htmlchoosecolor.h
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IHTMLChooseColorSite Member List

This is the complete list of members for IHTMLChooseColorSite, including all inherited members.
GetColorInfo(CHTMLChooseColor *pControl, UINT uID, LPARAM lParam, CTSTR &lpszTitle)=0 IHTMLChooseColorSite [pure virtual]
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


IHTMLControlSite Class Reference

#include <bmws_htmlcontrol.h>

Inheritance diagram for IHTMLControlSite:

CHTMLRadioGroup List of all members.

Public Methods

virtual void ControlChanged (CHTMLControl *pControl, UINT uID, LPARAM lParam)=0

Member Function Documentation

virtual void ControlChanged | ( | CHTMLControl * | pControl,
 |  | UINT | uID,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Implemented in CHTMLRadioGroup.

Referenced by CHTMLRadioGroup::ControlChanged(), CHTMLSelect::EventHandler(), CHTMLEdit::EventHandler(), CHTMLChooseColor::EventHandler(), and CHTMLChk::EventHandler().

The documentation for this class was generated from the following file:
  • bmws_htmlcontrol.h
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IHTMLControlSite Member List

This is the complete list of members for IHTMLControlSite, including all inherited members.
ControlChanged(CHTMLControl *pControl, UINT uID, LPARAM lParam)=0 IHTMLControlSite [pure virtual]
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


IHTMLEnableSite Class Reference

#include <bmws_htmlenable.h>

List of all members.

Public Methods

virtual void | PreDisable (CHTMLEnable *pEnable, CHTMLElementPtr &spEl)=0
virtual void | PostEnable (CHTMLEnable *pEnable, CHTMLElementPtr &spEl)=0

Member Function Documentation

virtual void PostEnable | ( | CHTMLEnable * | pEnable,
 |  | CHTMLElementPtr & | spEl
 | ) | [pure virtual]

Referenced by CHTMLEnable::EnableHelper().

virtual void PreDisable | ( | CHTMLEnable * | pEnable,
 |  | CHTMLElementPtr & | spEl
 | ) | [pure virtual]

Referenced by CHTMLEnable::EnableHelper().

The documentation for this class was generated from the following file:
  • bmws_htmlenable.h
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IHTMLEnableSite Member List

This is the complete list of members for IHTMLEnableSite, including all inherited members.
PostEnable(CHTMLEnable *pEnable, CHTMLElementPtr &spEl)=0 | IHTMLEnableSite | [pure virtual]
PreDisable(CHTMLEnable *pEnable, CHTMLElementPtr &spEl)=0 | IHTMLEnableSite | [pure virtual]
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


IHTMLLinkSite Class Reference

#include <bmws_htmllink.h>

List of all members.

Public Methods

virtual void LinkClicked (CHTMLLink *pLink, DWORD dwEventID, LPARAM lParam)=0

Member Function Documentation

virtual void LinkClicked | ( | CHTMLLink * | pLink,
 |  | DWORD | dwEventID,
 |  | LPARAM | lParam
 | ) | [pure virtual]

Referenced by CHTMLLink::EventHandler().

The documentation for this class was generated from the following file:
  • bmws_htmllink.h
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IHTMLLinkSite Member List

This is the complete list of members for IHTMLLinkSite, including all inherited members.
LinkClicked(CHTMLLink *pLink, DWORD dwEventID, LPARAM lParam)=0 IHTMLLinkSite [pure virtual]
Generated on Wed May 8 12:40:07 2002 for Solitaire Pack by doxygen 1.2.15


IMsgProcessor Class Reference

#include <ProcessMsg.h>

Inheritance diagram for IMsgProcessor:

CSolpackApp List of all members.

Public Methods

virtual void | ProcessMessage (LPMSG lpMsg)=0
virtual void | EmptyMessageQueue (BOOL bCheckQuit)=0

Member Function Documentation

virtual void EmptyMessageQueue ( BOOL bCheckQuit ) [pure virtual]

Implemented in CSolpackApp.

Referenced by CFragment::Animate(), CFragment::FragToPile(), CDeck::InitDeck(), CFragment::PileToFrag(), and CGameMenu::Refresh().

virtual void ProcessMessage ( LPMSG lpMsg ) [pure virtual]

Implemented in CSolpackApp.

The documentation for this class was generated from the following file:
  • ProcessMsg.h
Generated on Wed May 8 12:40:08 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IMsgProcessor Member List

This is the complete list of members for IMsgProcessor, including all inherited members.
EmptyMessageQueue(BOOL bCheckQuit)=0 | IMsgProcessor | [pure virtual]
ProcessMessage(LPMSG lpMsg)=0 | IMsgProcessor | [pure virtual]
Generated on Wed May 8 12:40:08 2002 for Solitaire Pack by doxygen 1.2.15


INDUnknown Interface Reference

#include <bmws_unkbase.h>

Inheritance diagram for INDUnknown:

CUnkBase CBrowserContainer List of all members.

Public Methods

STDMETHOD (NDQueryInterface)(REFIID riid
STDMETHOD_ (ULONG, NDAddRef)() PURE
STDMETHOD_ (ULONG, NDRelease)() PURE

Public Attributes

LPVOID *ppvObject PURE

Member Function Documentation

STDMETHOD ( NDQueryInterface )

Implemented in CBrowserContainer, and CUnkBase.

STDMETHOD_ | ( | ULONG | ,
 |  | NDRelease |
 | ) |

Implemented in CUnkBase, and CUnkBase.

STDMETHOD_ | ( | ULONG | ,
 |  | NDAddRef |
 | ) |

Implemented in CUnkBase, and CUnkBase.

Member Data Documentation

LPVOID* ppvObject PURE

Definition at line 32 of file bmws_unkbase.h.

The documentation for this interface was generated from the following file:
  • bmws_unkbase.h
Generated on Wed May 8 12:40:08 2002 for Solitaire Pack by doxygen 1.2.15


Member List

INDUnknown Member List

This is the complete list of members for INDUnknown, including all inherited members.
PURE | INDUnknown
STDMETHOD(NDQueryInterface)(REFIID riid | INDUnknown
STDMETHOD_(ULONG, NDAddRef)() PURE | INDUnknown
STDMETHOD_(ULONG, NDRelease)() PURE | INDUnknown
Generated on Wed May 8 12:40:08 2002 for Solitaire Pack by doxygen 1.2.15


INDUnknownAndDispatch Interface Reference

#include <bmws_dispbase.h>

Inheritance diagram for INDUnknownAndDispatch:

CDispBase CCard CEngine CGameBase CGameData CGameInfo CGameLib CPile CGameLaBelleLucie CGameSpider CDeck CFragment List of all members.

Public Methods

STDMETHOD (NDQueryInterface)(REFIID riid
STDMETHOD_ (ULONG, NDAddRef)() PURE
STDMETHOD_ (ULONG, NDRelease)() PURE
STDMETHOD (NDGetTypeInfoCount)(UINT *pctinfo) PURE
STDMETHOD (NDGetTypeInfo)(UINT uIInfo
STDMETHOD (NDGetIDsOfNames)(REFIID riid
STDMETHOD (NDInvoke)(DISPID dispIdMember

Public Attributes

LPVOID *ppvObject | PURE
LCID | lcid
LCID ITypeInfo **ppTInfo | PURE
LPOLESTR * | rgszNames
LPOLESTR UINT | cNames
LPOLESTR UINT LCID | lcid
LPOLESTR UINT LCID DISPID
*rgDispId 		PURE
REFIID | riid
REFIID LCID | lcid
REFIID LCID WORD | wFlags
REFIID LCID WORD DISPPARAMS * | pDispParams
REFIID LCID WORD DISPPARAMS
VARIANT * 		pVarResult
REFIID LCID WORD DISPPARAMS
VARIANT EXCEPINFO * 		pExcepInfo
REFIID LCID WORD DISPPARAMS
VARIANT EXCEPINFO UINT *puArgErr 		PURE

Member Function Documentation

STDMETHOD ( NDInvoke )

Implemented in CDispBase, CDispBase, CDispBase, CDispBase, CDispBase, CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetIDsOfNames )

Implemented in CDispBase, CDispBase, CDispBase, CDispBase, CDispBase, CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetTypeInfo )

Implemented in CDispBase, CDispBase, CDispBase, CDispBase, CDispBase, CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDGetTypeInfoCount )

Implemented in CDispBase, CDispBase, CDispBase, CDispBase, CDispBase, CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD ( NDQueryInterface )

Implemented in CDispBase, CDispBase, CDispBase, CDispBase, CDispBase, CCard, CEngine, CGameData, CPile, CGameBase, CGameInfo, and CGameLib.

STDMETHOD_ | ( | ULONG | ,
 |  | NDRelease |
 | ) |

Implemented in CDispBase, and CDispBase.

STDMETHOD_ | ( | ULONG | ,
 |  | NDAddRef |
 | ) |

Implemented in CDispBase, and CDispBase.

Member Data Documentation

LPOLESTR UINT cNames

Implemented in CDispBase.

Definition at line 38 of file bmws_dispbase.h.

REFIID LCID lcid

Implemented in CDispBase, CDispBase, and CDispBase.

Definition at line 40 of file bmws_dispbase.h.

LPOLESTR UINT LCID lcid

Implemented in CDispBase, CDispBase, and CDispBase.

Definition at line 38 of file bmws_dispbase.h.

LCID lcid

Implemented in CDispBase, CDispBase, and CDispBase.

Definition at line 37 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS* pDispParams

Implemented in CDispBase.

Definition at line 40 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT EXCEPINFO* pExcepInfo

Implemented in CDispBase.

Definition at line 40 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT EXCEPINFO UINT* puArgErr PURE

Definition at line 40 of file bmws_dispbase.h.

LPOLESTR UINT LCID DISPID* rgDispId PURE

Definition at line 38 of file bmws_dispbase.h.

LCID ITypeInfo** ppTInfo PURE

Definition at line 37 of file bmws_dispbase.h.

LPVOID* ppvObject PURE

Definition at line 32 of file bmws_dispbase.h.

REFIID LCID WORD DISPPARAMS VARIANT* pVarResult

Implemented in CDispBase.

Definition at line 40 of file bmws_dispbase.h.

LPOLESTR* rgszNames

Implemented in CDispBase.

Definition at line 38 of file bmws_dispbase.h.

REFIID riid

Implemented in CDispBase.

Definition at line 40 of file bmws_dispbase.h.

REFIID LCID WORD wFlags

Implemented in CDispBase.

Definition at line 40 of file bmws_dispbase.h.

The documentation for this interface was generated from the following file:
  • bmws_dispbase.h
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


Member List

INDUnknownAndDispatch Member List

This is the complete list of members for INDUnknownAndDispatch, including all inherited members.
cNames | INDUnknownAndDispatch
lcid | INDUnknownAndDispatch
lcid | INDUnknownAndDispatch
lcid | INDUnknownAndDispatch
pDispParams | INDUnknownAndDispatch
pExcepInfo | INDUnknownAndDispatch
PURE | INDUnknownAndDispatch
PURE | INDUnknownAndDispatch
PURE | INDUnknownAndDispatch
PURE | INDUnknownAndDispatch
pVarResult | INDUnknownAndDispatch
rgszNames | INDUnknownAndDispatch
riid | INDUnknownAndDispatch
STDMETHOD(NDQueryInterface)(REFIID riid | INDUnknownAndDispatch
STDMETHOD(NDGetTypeInfoCount)(UINT *pctinfo) PURE | INDUnknownAndDispatch
STDMETHOD(NDGetTypeInfo)(UINT uIInfo | INDUnknownAndDispatch
STDMETHOD(NDGetIDsOfNames)(REFIID riid | INDUnknownAndDispatch
STDMETHOD(NDInvoke)(DISPID dispIdMember | INDUnknownAndDispatch
STDMETHOD_(ULONG, NDAddRef)() PURE | INDUnknownAndDispatch
STDMETHOD_(ULONG, NDRelease)() PURE | INDUnknownAndDispatch
wFlags | INDUnknownAndDispatch
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


IPileSite Class Reference

#include <Pile.h>

Inheritance diagram for IPileSite:

CEngine List of all members.

Public Methods

virtual BOOL | GetShowTooltips ()=0
virtual BOOL | GetAnim ()=0
virtual void | PlayCPSound (UINT uIndex)=0

Member Function Documentation

virtual BOOL GetAnim ( ) [pure virtual]

Implemented in CEngine.

Referenced by CFragment::FragToPile(), and CFragment::PileToFrag().

virtual BOOL GetShowTooltips ( ) [pure virtual]

Implemented in CEngine.

Referenced by CPile::UpdateTooltip().

virtual void PlayCPSound ( UINT uIndex ) [pure virtual]

Implemented in CEngine.

The documentation for this class was generated from the following file:
  • Pile.h
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IPileSite Member List

This is the complete list of members for IPileSite, including all inherited members.
GetAnim()=0 | IPileSite | [pure virtual]
GetShowTooltips()=0 | IPileSite | [pure virtual]
PlayCPSound(UINT uIndex)=0 | IPileSite | [pure virtual]
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackApp interface Reference

ISolpackApp Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | CardWidth ([out, retval] long *p)
HRESULT | CardHeight ([out, retval] long *p)
HRESULT | Score ([out, retval] long *p)
HRESULT | Score ([in] long v)
HRESULT | WindowWidth ([out, retval] long *p)
HRESULT | WindowHeight ([out, retval] long *p)
HRESULT | SpacingX ([out, retval] long *p)
HRESULT | SpacingY ([out, retval] long *p)
HRESULT | Fragment ([out, retval] ISolpackFragment **pp)
HRESULT | CreatePile ([in] long lType,[out, retval] ISolpackPile **ppPile)
HRESULT | CreateGameData ([out, retval] ISolpackGameData **ppGameData)
HRESULT | AddGameCommand ([in] long lID,[in] BSTR bstrText,[in] BSTR bstrHelpText)
HRESULT | EnableGameCommand ([in] long lID,[in] VARIANT_BOOL bEnable)
HRESULT | GameWon ()

Member Function Documentation

HRESULT AddGameCommand | ( | [in] long | lID,
 |  | [in] BSTR | bstrText,
 |  | [in] BSTR | bstrHelpText
 | ) |

HRESULT CardHeight ( [out, retval] long * p )

HRESULT CardWidth ( [out, retval] long * p )

HRESULT CreateGameData ( [out, retval] ISolpackGameData ** ppGameData )

HRESULT CreatePile | ( | [in] long | lType,
 |  | [out, retval] ISolpackPile ** | ppPile
 | ) |

HRESULT EnableGameCommand | ( | [in] long | lID,
 |  | [in] VARIANT_BOOL | bEnable
 | ) |

HRESULT Fragment ( [out, retval] ISolpackFragment ** pp )

HRESULT GameWon ( )

HRESULT Score ( [in] long v )

HRESULT Score ( [out, retval] long * p )

HRESULT SpacingX ( [out, retval] long * p )

HRESULT SpacingY ( [out, retval] long * p )

HRESULT WindowHeight ( [out, retval] long * p )

HRESULT WindowWidth ( [out, retval] long * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackApp Member List

This is the complete list of members for ISolpackApp, including all inherited members.
AddGameCommand([in] long lID,[in] BSTR bstrText,[in] BSTR bstrHelpText) | ISolpackApp
CardHeight([out, retval] long *p) | ISolpackApp
CardWidth([out, retval] long *p) | ISolpackApp
CreateGameData([out, retval] ISolpackGameData **ppGameData) | ISolpackApp
CreatePile([in] long lType,[out, retval] ISolpackPile **ppPile) | ISolpackApp
EnableGameCommand([in] long lID,[in] VARIANT_BOOL bEnable) | ISolpackApp
Fragment([out, retval] ISolpackFragment **pp) | ISolpackApp
GameWon() | ISolpackApp
Score([out, retval] long *p) | ISolpackApp
Score([in] long v) | ISolpackApp
SpacingX([out, retval] long *p) | ISolpackApp
SpacingY([out, retval] long *p) | ISolpackApp
WindowHeight([out, retval] long *p) | ISolpackApp
WindowWidth([out, retval] long *p) | ISolpackApp
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackApp Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackAppVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackAppVtbl __RPC_FAR* lpVtbl

Definition at line 1813 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackApp Member List

This is the complete list of members for ISolpackApp, including all inherited members.
lpVtbl ISolpackApp
Generated on Wed May 8 12:40:10 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackAppVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackApp __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackApp __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackApp __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_CardWidth)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_CardHeight)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Score)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_Score)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_WindowWidth)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_WindowHeight)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_SpacingX)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_SpacingY)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Fragment)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *CreatePile)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *CreateGameData)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *AddGameCommand)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *EnableGameCommand)(ISolpackApp __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GameWon)(ISolpackApp __RPC_FAR *This)

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
long | v
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
ISolpackFragment __RPC_FAR
*__RPC_FAR * 		pp
long | lType
long ISolpackPile __RPC_FAR
*__RPC_FAR * 		ppPile
ISolpackGameData __RPC_FAR
*__RPC_FAR * 		ppGameData
long | lID
long BSTR | bstrText
long BSTR BSTR | bstrHelpText
long VARIANT_BOOL | bEnable

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GameWon )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * EnableGameCommand )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * AddGameCommand )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * CreateGameData )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * CreatePile )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Fragment )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_SpacingY )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_SpacingX )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_WindowHeight )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_WindowWidth )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_Score )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Score )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_CardHeight )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_CardWidth )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

long VARIANT_BOOL bEnable

Definition at line 1802 of file Solpack.h.

long BSTR BSTR bstrHelpText

Definition at line 1796 of file Solpack.h.

long BSTR bstrText

Definition at line 1796 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 1732 of file Solpack.h.

DISPID dispIdMember

Definition at line 1740 of file Solpack.h.

UINT iTInfo

Definition at line 1726 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 1740 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 1732 of file Solpack.h.

UINT LCID lcid

Definition at line 1726 of file Solpack.h.

long lID

Definition at line 1802 of file Solpack.h.

long lType

Definition at line 1787 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1779 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1775 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1771 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1767 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1759 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1755 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1751 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 1722 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 1740 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 1740 of file Solpack.h.

ISolpackFragment __RPC_FAR* __RPC_FAR* pp

Definition at line 1783 of file Solpack.h.

ISolpackGameData __RPC_FAR* __RPC_FAR* ppGameData

Definition at line 1792 of file Solpack.h.

long ISolpackPile __RPC_FAR* __RPC_FAR* ppPile

Definition at line 1787 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 1726 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 1711 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 1740 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 1740 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 1732 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 1732 of file Solpack.h.

DISPID REFIID riid

Definition at line 1740 of file Solpack.h.

REFIID riid

Definition at line 1732 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 1711 of file Solpack.h.

long v

Definition at line 1763 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 1740 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:11 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackAppVtbl Member List

This is the complete list of members for ISolpackAppVtbl, including all inherited members.
bEnable | ISolpackAppVtbl
bstrHelpText | ISolpackAppVtbl
bstrText | ISolpackAppVtbl
cNames | ISolpackAppVtbl
dispIdMember | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_CardWidth)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_CardHeight)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Score)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Score)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_WindowWidth)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_WindowHeight)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_SpacingX)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_SpacingY)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Fragment)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *CreatePile)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *CreateGameData)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AddGameCommand)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *EnableGameCommand)(ISolpackApp __RPC_FAR *This | ISolpackAppVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GameWon)(ISolpackApp __RPC_FAR *This) | ISolpackAppVtbl
iTInfo | ISolpackAppVtbl
lcid | ISolpackAppVtbl
lcid | ISolpackAppVtbl
lcid | ISolpackAppVtbl
lID | ISolpackAppVtbl
lType | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
p | ISolpackAppVtbl
pctinfo | ISolpackAppVtbl
pDispParams | ISolpackAppVtbl
pExcepInfo | ISolpackAppVtbl
pp | ISolpackAppVtbl
ppGameData | ISolpackAppVtbl
ppPile | ISolpackAppVtbl
ppTInfo | ISolpackAppVtbl
ppvObject | ISolpackAppVtbl
puArgErr | ISolpackAppVtbl
pVarResult | ISolpackAppVtbl
rgDispId | ISolpackAppVtbl
rgszNames | ISolpackAppVtbl
riid | ISolpackAppVtbl
riid | ISolpackAppVtbl
riid | ISolpackAppVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackApp __RPC_FAR *This) | ISolpackAppVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackApp __RPC_FAR *This) | ISolpackAppVtbl
v | ISolpackAppVtbl
wFlags | ISolpackAppVtbl
Generated on Wed May 8 12:40:11 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackCard interface Reference

ISolpackCard Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | ID ([out, retval] long *p)
HRESULT | Rank ([out, retval] long *p)
HRESULT | Suit ([out, retval] long *p)
HRESULT | CanDrag ([out, retval] VARIANT_BOOL *pbCanDrag)
HRESULT | CanDrag ([in] VARIANT_BOOL bCanDrag)
HRESULT | FaceUp ([out, retval] VARIANT_BOOL *pbFaceUp)
HRESULT | FaceUp ([in] VARIANT_BOOL bFaceUp)
HRESULT | Pile ([out, retval] ISolpackPile **pp)
HRESULT | Index ([out, retval] long *p)
HRESULT | Index ([in] long v)

Member Function Documentation

HRESULT CanDrag ( [in] VARIANT_BOOL bCanDrag )

HRESULT CanDrag ( [out, retval] VARIANT_BOOL * pbCanDrag )

HRESULT FaceUp ( [in] VARIANT_BOOL bFaceUp )

HRESULT FaceUp ( [out, retval] VARIANT_BOOL * pbFaceUp )

HRESULT ID ( [out, retval] long * p )

HRESULT Index ( [in] long v )

HRESULT Index ( [out, retval] long * p )

HRESULT Pile ( [out, retval] ISolpackPile ** pp )

HRESULT Rank ( [out, retval] long * p )

HRESULT Suit ( [out, retval] long * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackCard Member List

This is the complete list of members for ISolpackCard, including all inherited members.
CanDrag([out, retval] VARIANT_BOOL *pbCanDrag) | ISolpackCard
CanDrag([in] VARIANT_BOOL bCanDrag) | ISolpackCard
FaceUp([out, retval] VARIANT_BOOL *pbFaceUp) | ISolpackCard
FaceUp([in] VARIANT_BOOL bFaceUp) | ISolpackCard
ID([out, retval] long *p) | ISolpackCard
Index([out, retval] long *p) | ISolpackCard
Index([in] long v) | ISolpackCard
Pile([out, retval] ISolpackPile **pp) | ISolpackCard
Rank([out, retval] long *p) | ISolpackCard
Suit([out, retval] long *p) | ISolpackCard
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackCard Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackCardVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackCardVtbl __RPC_FAR* lpVtbl

Definition at line 1119 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:11 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackCard Member List

This is the complete list of members for ISolpackCard, including all inherited members.
lpVtbl ISolpackCard
Generated on Wed May 8 12:40:11 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackCardVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackCard __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackCard __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackCard __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_ID)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Rank)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Suit)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_CanDrag)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_CanDrag)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_FaceUp)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_FaceUp)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Pile)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Index)(ISolpackCard __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_Index)(ISolpackCard __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
VARIANT_BOOL __RPC_FAR * | pbCanDrag
VARIANT_BOOL | bCanDrag
VARIANT_BOOL __RPC_FAR * | pbFaceUp
VARIANT_BOOL | bFaceUp
ISolpackPile __RPC_FAR *__RPC_FAR * | pp
long __RPC_FAR * | p
long | v

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_Index )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Index )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Pile )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_FaceUp )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_FaceUp )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_CanDrag )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_CanDrag )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Suit )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Rank )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_ID )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

VARIANT_BOOL bCanDrag

Definition at line 1092 of file Solpack.h.

VARIANT_BOOL bFaceUp

Definition at line 1100 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 1057 of file Solpack.h.

DISPID dispIdMember

Definition at line 1065 of file Solpack.h.

UINT iTInfo

Definition at line 1051 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 1065 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 1057 of file Solpack.h.

UINT LCID lcid

Definition at line 1051 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1108 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1084 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1080 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1076 of file Solpack.h.

VARIANT_BOOL __RPC_FAR* pbCanDrag

Definition at line 1088 of file Solpack.h.

VARIANT_BOOL __RPC_FAR* pbFaceUp

Definition at line 1096 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 1047 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 1065 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 1065 of file Solpack.h.

ISolpackPile __RPC_FAR* __RPC_FAR* pp

Definition at line 1104 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 1051 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 1036 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 1065 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 1065 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 1057 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 1057 of file Solpack.h.

DISPID REFIID riid

Definition at line 1065 of file Solpack.h.

REFIID riid

Definition at line 1057 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 1036 of file Solpack.h.

long v

Definition at line 1112 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 1065 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:12 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackCardVtbl Member List

This is the complete list of members for ISolpackCardVtbl, including all inherited members.
bCanDrag | ISolpackCardVtbl
bFaceUp | ISolpackCardVtbl
cNames | ISolpackCardVtbl
dispIdMember | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_ID)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Rank)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Suit)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_CanDrag)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_CanDrag)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_FaceUp)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_FaceUp)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Pile)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Index)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Index)(ISolpackCard __RPC_FAR *This | ISolpackCardVtbl
iTInfo | ISolpackCardVtbl
lcid | ISolpackCardVtbl
lcid | ISolpackCardVtbl
lcid | ISolpackCardVtbl
p | ISolpackCardVtbl
p | ISolpackCardVtbl
p | ISolpackCardVtbl
p | ISolpackCardVtbl
pbCanDrag | ISolpackCardVtbl
pbFaceUp | ISolpackCardVtbl
pctinfo | ISolpackCardVtbl
pDispParams | ISolpackCardVtbl
pExcepInfo | ISolpackCardVtbl
pp | ISolpackCardVtbl
ppTInfo | ISolpackCardVtbl
ppvObject | ISolpackCardVtbl
puArgErr | ISolpackCardVtbl
pVarResult | ISolpackCardVtbl
rgDispId | ISolpackCardVtbl
rgszNames | ISolpackCardVtbl
riid | ISolpackCardVtbl
riid | ISolpackCardVtbl
riid | ISolpackCardVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackCard __RPC_FAR *This) | ISolpackCardVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackCard __RPC_FAR *This) | ISolpackCardVtbl
v | ISolpackCardVtbl
wFlags | ISolpackCardVtbl
Generated on Wed May 8 12:40:12 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackFragment Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackFragmentVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackFragmentVtbl __RPC_FAR* lpVtbl

Definition at line 851 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:12 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackFragment Member List

This is the complete list of members for ISolpackFragment, including all inherited members.
lpVtbl ISolpackFragment
Generated on Wed May 8 12:40:13 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackFragment interface Reference

ISolpackFragment Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | AddToFragment ([in] IDispatch *pObj)
HRESULT | MoveToPile ([in] ISolpackPile *pDest,[in] long lIndex,[in] VARIANT_BOOL bAnimate,[in] VARIANT_BOOL bToggleFace)

Member Function Documentation

HRESULT AddToFragment ( [in] IDispatch * pObj )

HRESULT MoveToPile | ( | [in] ISolpackPile * | pDest,
 |  | [in] long | lIndex,
 |  | [in] VARIANT_BOOL | bAnimate,
 |  | [in] VARIANT_BOOL | bToggleFace
 | ) |

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackFragment Member List

This is the complete list of members for ISolpackFragment, including all inherited members.
AddToFragment([in] IDispatch *pObj) | ISolpackFragment
MoveToPile([in] ISolpackPile *pDest,[in] long lIndex,[in] VARIANT_BOOL bAnimate,[in] VARIANT_BOOL bToggleFace) | ISolpackFragment
Generated on Wed May 8 12:40:24 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackFragmentVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackFragment __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackFragment __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackFragment __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Type)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_X)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_X)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Y)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_Y)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Width)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Height)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_NumCards)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_BaseType)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_BaseType)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Shuffle)(ISolpackFragment __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetCard)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *WidthWith)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *HeightWith)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *AddToFragment)(ISolpackFragment __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *MoveToPile)(ISolpackFragment __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
long __RPC_FAR * | p
long __RPC_FAR * | p
long | v
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
BSTR __RPC_FAR * | pbstrText
BSTR | bstrText
VARIANT_BOOL __RPC_FAR * | pbShow
VARIANT_BOOL | bShowNum
long __RPC_FAR * | p
long | lIndex
long ISolpackCard __RPC_FAR
*__RPC_FAR * 		ppCard
long | lNumCards
long long __RPC_FAR * | plWidth
long long __RPC_FAR * | plHeight
IDispatch __RPC_FAR * | pObj
ISolpackPile __RPC_FAR * | pDest
ISolpackPile __RPC_FAR long | lIndex
ISolpackPile __RPC_FAR long
VARIANT_BOOL 		bAnimate
ISolpackPile __RPC_FAR long
VARIANT_BOOL VARIANT_BOOL 		bToggleFace

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * MoveToPile )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * AddToFragment )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * HeightWith )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * WidthWith )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetCard )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Shuffle )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_BaseType )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_BaseType )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_ShowNumCardsTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_ShowNumCardsTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_CommentTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_CommentTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_NumCards )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Height )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Width )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_Y )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Y )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_X )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_X )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Type )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

ISolpackPile __RPC_FAR long VARIANT_BOOL bAnimate

Definition at line 841 of file Solpack.h.

VARIANT_BOOL bShowNum

Definition at line 807 of file Solpack.h.

BSTR bstrText

Definition at line 799 of file Solpack.h.

ISolpackPile __RPC_FAR long VARIANT_BOOL VARIANT_BOOL bToggleFace

Definition at line 841 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 744 of file Solpack.h.

DISPID dispIdMember

Definition at line 752 of file Solpack.h.

UINT iTInfo

Definition at line 738 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 752 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 744 of file Solpack.h.

UINT LCID lcid

Definition at line 738 of file Solpack.h.

ISolpackPile __RPC_FAR long lIndex

Definition at line 841 of file Solpack.h.

long lIndex

Definition at line 822 of file Solpack.h.

long lNumCards

Definition at line 832 of file Solpack.h.

long __RPC_FAR* p

Definition at line 811 of file Solpack.h.

long __RPC_FAR* p

Definition at line 791 of file Solpack.h.

long __RPC_FAR* p

Definition at line 787 of file Solpack.h.

long __RPC_FAR* p

Definition at line 783 of file Solpack.h.

long __RPC_FAR* p

Definition at line 775 of file Solpack.h.

long __RPC_FAR* p

Definition at line 767 of file Solpack.h.

long __RPC_FAR* p

Definition at line 763 of file Solpack.h.

VARIANT_BOOL __RPC_FAR* pbShow

Definition at line 803 of file Solpack.h.

BSTR __RPC_FAR* pbstrText

Definition at line 795 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 734 of file Solpack.h.

ISolpackPile __RPC_FAR* pDest

Definition at line 841 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 752 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 752 of file Solpack.h.

long long __RPC_FAR* plHeight

Definition at line 832 of file Solpack.h.

long long __RPC_FAR* plWidth

Definition at line 827 of file Solpack.h.

IDispatch __RPC_FAR* pObj

Definition at line 837 of file Solpack.h.

long ISolpackCard __RPC_FAR* __RPC_FAR* ppCard

Definition at line 822 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 738 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 723 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 752 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 752 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 744 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 744 of file Solpack.h.

DISPID REFIID riid

Definition at line 752 of file Solpack.h.

REFIID riid

Definition at line 744 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 723 of file Solpack.h.

long v

Definition at line 815 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 752 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:14 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackFragmentVtbl Member List

This is the complete list of members for ISolpackFragmentVtbl, including all inherited members.
bAnimate | ISolpackFragmentVtbl
bShowNum | ISolpackFragmentVtbl
bstrText | ISolpackFragmentVtbl
bToggleFace | ISolpackFragmentVtbl
cNames | ISolpackFragmentVtbl
dispIdMember | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Type)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_X)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_X)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Y)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Y)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Width)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Height)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_NumCards)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_BaseType)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_BaseType)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Shuffle)(ISolpackFragment __RPC_FAR *This) | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetCard)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *WidthWith)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *HeightWith)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AddToFragment)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *MoveToPile)(ISolpackFragment __RPC_FAR *This | ISolpackFragmentVtbl
iTInfo | ISolpackFragmentVtbl
lcid | ISolpackFragmentVtbl
lcid | ISolpackFragmentVtbl
lcid | ISolpackFragmentVtbl
lIndex | ISolpackFragmentVtbl
lIndex | ISolpackFragmentVtbl
lNumCards | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
p | ISolpackFragmentVtbl
pbShow | ISolpackFragmentVtbl
pbstrText | ISolpackFragmentVtbl
pctinfo | ISolpackFragmentVtbl
pDest | ISolpackFragmentVtbl
pDispParams | ISolpackFragmentVtbl
pExcepInfo | ISolpackFragmentVtbl
plHeight | ISolpackFragmentVtbl
plWidth | ISolpackFragmentVtbl
pObj | ISolpackFragmentVtbl
ppCard | ISolpackFragmentVtbl
ppTInfo | ISolpackFragmentVtbl
ppvObject | ISolpackFragmentVtbl
puArgErr | ISolpackFragmentVtbl
pVarResult | ISolpackFragmentVtbl
rgDispId | ISolpackFragmentVtbl
rgszNames | ISolpackFragmentVtbl
riid | ISolpackFragmentVtbl
riid | ISolpackFragmentVtbl
riid | ISolpackFragmentVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackFragment __RPC_FAR *This) | ISolpackFragmentVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackFragment __RPC_FAR *This) | ISolpackFragmentVtbl
v | ISolpackFragmentVtbl
wFlags | ISolpackFragmentVtbl
Generated on Wed May 8 12:40:14 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackGame interface Reference

ISolpackGame Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | Info ([out, retval] ISolpackGameInfo **ppInfo)
HRESULT | Initialize ([in] ISolpackApp *pApp)
HRESULT | Uninitialize ()
HRESULT | Deal ()
HRESULT | AutoPlay ()
HRESULT | AutoPlayCard ([in] ISolpackCard *pCard)
HRESULT | HandleCommand ([in] long lID)
HRESULT | PileClicked ([in] ISolpackPile *pPile,[in] ISolpackCard *pCard)
HRESULT | SetupFragment ([in] ISolpackPile *pPileSrc,[in] ISolpackCard *pCardSrc,[in] ISolpackFragment *pFrag)
HRESULT | DropFragment ([in] ISolpackFragment *pFrag,[in] ISolpackPile *pDest,[out, retval] VARIANT_BOOL *pbValid)
HRESULT | CancelMove ()
HRESULT | RecalcLayout ()

Member Function Documentation

HRESULT AutoPlay ( )

HRESULT AutoPlayCard ( [in] ISolpackCard * pCard )

HRESULT CancelMove ( )

HRESULT Deal ( )

HRESULT DropFragment | ( | [in] ISolpackFragment * | pFrag,
 |  | [in] ISolpackPile * | pDest,
 |  | [out, retval] VARIANT_BOOL * | pbValid
 | ) |

HRESULT HandleCommand ( [in] long lID )

HRESULT Info ( [out, retval] ISolpackGameInfo ** ppInfo )

HRESULT Initialize ( [in] ISolpackApp * pApp )

HRESULT PileClicked | ( | [in] ISolpackPile * | pPile,
 |  | [in] ISolpackCard * | pCard
 | ) |

HRESULT RecalcLayout ( )

HRESULT SetupFragment | ( | [in] ISolpackPile * | pPileSrc,
 |  | [in] ISolpackCard * | pCardSrc,
 |  | [in] ISolpackFragment * | pFrag
 | ) |

HRESULT Uninitialize ( )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGame Member List

This is the complete list of members for ISolpackGame, including all inherited members.
AutoPlay() | ISolpackGame
AutoPlayCard([in] ISolpackCard *pCard) | ISolpackGame
CancelMove() | ISolpackGame
Deal() | ISolpackGame
DropFragment([in] ISolpackFragment *pFrag,[in] ISolpackPile *pDest,[out, retval] VARIANT_BOOL *pbValid) | ISolpackGame
HandleCommand([in] long lID) | ISolpackGame
Info([out, retval] ISolpackGameInfo **ppInfo) | ISolpackGame
Initialize([in] ISolpackApp *pApp) | ISolpackGame
PileClicked([in] ISolpackPile *pPile,[in] ISolpackCard *pCard) | ISolpackGame
RecalcLayout() | ISolpackGame
SetupFragment([in] ISolpackPile *pPileSrc,[in] ISolpackCard *pCardSrc,[in] ISolpackFragment *pFrag) | ISolpackGame
Uninitialize() | ISolpackGame
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGame Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackGameVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackGameVtbl __RPC_FAR* lpVtbl

Definition at line 2220 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:14 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGame Member List

This is the complete list of members for ISolpackGame, including all inherited members.
lpVtbl ISolpackGame
Generated on Wed May 8 12:40:14 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameData Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackGameDataVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackGameDataVtbl __RPC_FAR* lpVtbl

Definition at line 1569 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameData Member List

This is the complete list of members for ISolpackGameData, including all inherited members.
lpVtbl ISolpackGameData
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackGameData interface Reference

ISolpackGameData Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | Data ([out, retval] VARIANT *p)
HRESULT | Data ([in] VARIANT v)

Member Function Documentation

HRESULT Data ( [in] VARIANT v )

HRESULT Data ( [out, retval] VARIANT * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameData Member List

This is the complete list of members for ISolpackGameData, including all inherited members.
Data([out, retval] VARIANT *p) | ISolpackGameData
Data([in] VARIANT v) | ISolpackGameData
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameDataVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameData __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameData __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameData __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameData __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameData __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameData __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameData __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Data)(ISolpackGameData __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_Data)(ISolpackGameData __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
VARIANT __RPC_FAR * | p
VARIANT | v

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_Data )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Data )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 1539 of file Solpack.h.

DISPID dispIdMember

Definition at line 1547 of file Solpack.h.

UINT iTInfo

Definition at line 1533 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 1547 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 1539 of file Solpack.h.

UINT LCID lcid

Definition at line 1533 of file Solpack.h.

VARIANT __RPC_FAR* p

Definition at line 1558 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 1529 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 1547 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 1547 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 1533 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 1518 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 1547 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 1547 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 1539 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 1539 of file Solpack.h.

DISPID REFIID riid

Definition at line 1547 of file Solpack.h.

REFIID riid

Definition at line 1539 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 1518 of file Solpack.h.

VARIANT v

Definition at line 1562 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 1547 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameDataVtbl Member List

This is the complete list of members for ISolpackGameDataVtbl, including all inherited members.
cNames | ISolpackGameDataVtbl
dispIdMember | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Data)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Data)(ISolpackGameData __RPC_FAR *This | ISolpackGameDataVtbl
iTInfo | ISolpackGameDataVtbl
lcid | ISolpackGameDataVtbl
lcid | ISolpackGameDataVtbl
lcid | ISolpackGameDataVtbl
p | ISolpackGameDataVtbl
pctinfo | ISolpackGameDataVtbl
pDispParams | ISolpackGameDataVtbl
pExcepInfo | ISolpackGameDataVtbl
ppTInfo | ISolpackGameDataVtbl
ppvObject | ISolpackGameDataVtbl
puArgErr | ISolpackGameDataVtbl
pVarResult | ISolpackGameDataVtbl
rgDispId | ISolpackGameDataVtbl
rgszNames | ISolpackGameDataVtbl
riid | ISolpackGameDataVtbl
riid | ISolpackGameDataVtbl
riid | ISolpackGameDataVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameData __RPC_FAR *This) | ISolpackGameDataVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameData __RPC_FAR *This) | ISolpackGameDataVtbl
v | ISolpackGameDataVtbl
wFlags | ISolpackGameDataVtbl
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameInfo Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackGameInfoVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackGameInfoVtbl __RPC_FAR* lpVtbl

Definition at line 1400 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameInfo Member List

This is the complete list of members for ISolpackGameInfo, including all inherited members.
lpVtbl ISolpackGameInfo
Generated on Wed May 8 12:40:16 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackGameInfo interface Reference

ISolpackGameInfo Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | Title ([out, retval] BSTR *p)
HRESULT | Rules ([out, retval] BSTR *p)
HRESULT | Difficulty ([out, retval] long *p)

Member Function Documentation

HRESULT Difficulty ( [out, retval] long * p )

HRESULT Rules ( [out, retval] BSTR * p )

HRESULT Title ( [out, retval] BSTR * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameInfo Member List

This is the complete list of members for ISolpackGameInfo, including all inherited members.
Difficulty([out, retval] long *p) | ISolpackGameInfo
Rules([out, retval] BSTR *p) | ISolpackGameInfo
Title([out, retval] BSTR *p) | ISolpackGameInfo
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameInfoVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameInfo __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameInfo __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameInfo __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Title)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Rules)(ISolpackGameInfo __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Difficulty)(ISolpackGameInfo __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
BSTR __RPC_FAR * | p
BSTR __RPC_FAR * | p
long __RPC_FAR * | p

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Difficulty )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Rules )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Title )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 1366 of file Solpack.h.

DISPID dispIdMember

Definition at line 1374 of file Solpack.h.

UINT iTInfo

Definition at line 1360 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 1374 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 1366 of file Solpack.h.

UINT LCID lcid

Definition at line 1360 of file Solpack.h.

long __RPC_FAR* p

Definition at line 1393 of file Solpack.h.

BSTR __RPC_FAR* p

Definition at line 1389 of file Solpack.h.

BSTR __RPC_FAR* p

Definition at line 1385 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 1356 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 1374 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 1374 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 1360 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 1345 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 1374 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 1374 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 1366 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 1366 of file Solpack.h.

DISPID REFIID riid

Definition at line 1374 of file Solpack.h.

REFIID riid

Definition at line 1366 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 1345 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 1374 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameInfoVtbl Member List

This is the complete list of members for ISolpackGameInfoVtbl, including all inherited members.
cNames | ISolpackGameInfoVtbl
dispIdMember | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Title)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Rules)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Difficulty)(ISolpackGameInfo __RPC_FAR *This | ISolpackGameInfoVtbl
iTInfo | ISolpackGameInfoVtbl
lcid | ISolpackGameInfoVtbl
lcid | ISolpackGameInfoVtbl
lcid | ISolpackGameInfoVtbl
p | ISolpackGameInfoVtbl
p | ISolpackGameInfoVtbl
p | ISolpackGameInfoVtbl
pctinfo | ISolpackGameInfoVtbl
pDispParams | ISolpackGameInfoVtbl
pExcepInfo | ISolpackGameInfoVtbl
ppTInfo | ISolpackGameInfoVtbl
ppvObject | ISolpackGameInfoVtbl
puArgErr | ISolpackGameInfoVtbl
pVarResult | ISolpackGameInfoVtbl
rgDispId | ISolpackGameInfoVtbl
rgszNames | ISolpackGameInfoVtbl
riid | ISolpackGameInfoVtbl
riid | ISolpackGameInfoVtbl
riid | ISolpackGameInfoVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameInfo __RPC_FAR *This) | ISolpackGameInfoVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameInfo __RPC_FAR *This) | ISolpackGameInfoVtbl
wFlags | ISolpackGameInfoVtbl
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameLib Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackGameLibVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackGameLibVtbl __RPC_FAR* lpVtbl

Definition at line 2556 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameLib Member List

This is the complete list of members for ISolpackGameLib, including all inherited members.
lpVtbl ISolpackGameLib
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackGameLib interface Reference

ISolpackGameLib Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | Author ([out, retval] BSTR *p)
HRESULT | Email ([out, retval] BSTR *p)
HRESULT | WebSite ([out, retval] BSTR *p)
HRESULT | NumGames ([out, retval] long *p)
HRESULT | GetGame ([in] long lIndex,[out, retval] ISolpackGame **ppGame)
HRESULT | GetGameInfo ([in] long lIndex,[out, retval] ISolpackGameInfo **ppGameInfo)

Member Function Documentation

HRESULT Author ( [out, retval] BSTR * p )

HRESULT Email ( [out, retval] BSTR * p )

HRESULT GetGame | ( | [in] long | lIndex,
 |  | [out, retval] ISolpackGame ** | ppGame
 | ) |

HRESULT GetGameInfo | ( | [in] long | lIndex,
 |  | [out, retval] ISolpackGameInfo ** | ppGameInfo
 | ) |

HRESULT NumGames ( [out, retval] long * p )

HRESULT WebSite ( [out, retval] BSTR * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameLib Member List

This is the complete list of members for ISolpackGameLib, including all inherited members.
Author([out, retval] BSTR *p) | ISolpackGameLib
Email([out, retval] BSTR *p) | ISolpackGameLib
GetGame([in] long lIndex,[out, retval] ISolpackGame **ppGame) | ISolpackGameLib
GetGameInfo([in] long lIndex,[out, retval] ISolpackGameInfo **ppGameInfo) | ISolpackGameLib
NumGames([out, retval] long *p) | ISolpackGameLib
WebSite([out, retval] BSTR *p) | ISolpackGameLib
Generated on Wed May 8 12:40:25 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameLibVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameLib __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameLib __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameLib __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Author)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Email)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_WebSite)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_NumGames)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetGame)(ISolpackGameLib __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetGameInfo)(ISolpackGameLib __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
BSTR __RPC_FAR * | p
BSTR __RPC_FAR * | p
BSTR __RPC_FAR * | p
long __RPC_FAR * | p
long | lIndex
long ISolpackGame __RPC_FAR
*__RPC_FAR * 		ppGame
long ISolpackGameInfo __RPC_FAR
*__RPC_FAR * 		ppGameInfo

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetGameInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetGame )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_NumGames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_WebSite )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Email )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Author )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 2508 of file Solpack.h.

DISPID dispIdMember

Definition at line 2516 of file Solpack.h.

UINT iTInfo

Definition at line 2502 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 2516 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 2508 of file Solpack.h.

UINT LCID lcid

Definition at line 2502 of file Solpack.h.

long lIndex

Definition at line 2548 of file Solpack.h.

long __RPC_FAR* p

Definition at line 2539 of file Solpack.h.

BSTR __RPC_FAR* p

Definition at line 2535 of file Solpack.h.

BSTR __RPC_FAR* p

Definition at line 2531 of file Solpack.h.

BSTR __RPC_FAR* p

Definition at line 2527 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 2498 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 2516 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 2516 of file Solpack.h.

long ISolpackGame __RPC_FAR* __RPC_FAR* ppGame

Definition at line 2543 of file Solpack.h.

long ISolpackGameInfo __RPC_FAR* __RPC_FAR* ppGameInfo

Definition at line 2548 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 2502 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 2487 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 2516 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 2516 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 2508 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 2508 of file Solpack.h.

DISPID REFIID riid

Definition at line 2516 of file Solpack.h.

REFIID riid

Definition at line 2508 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 2487 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 2516 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameLibVtbl Member List

This is the complete list of members for ISolpackGameLibVtbl, including all inherited members.
cNames | ISolpackGameLibVtbl
dispIdMember | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Author)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Email)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_WebSite)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_NumGames)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetGame)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetGameInfo)(ISolpackGameLib __RPC_FAR *This | ISolpackGameLibVtbl
iTInfo | ISolpackGameLibVtbl
lcid | ISolpackGameLibVtbl
lcid | ISolpackGameLibVtbl
lcid | ISolpackGameLibVtbl
lIndex | ISolpackGameLibVtbl
p | ISolpackGameLibVtbl
p | ISolpackGameLibVtbl
p | ISolpackGameLibVtbl
p | ISolpackGameLibVtbl
pctinfo | ISolpackGameLibVtbl
pDispParams | ISolpackGameLibVtbl
pExcepInfo | ISolpackGameLibVtbl
ppGame | ISolpackGameLibVtbl
ppGameInfo | ISolpackGameLibVtbl
ppTInfo | ISolpackGameLibVtbl
ppvObject | ISolpackGameLibVtbl
puArgErr | ISolpackGameLibVtbl
pVarResult | ISolpackGameLibVtbl
rgDispId | ISolpackGameLibVtbl
rgszNames | ISolpackGameLibVtbl
riid | ISolpackGameLibVtbl
riid | ISolpackGameLibVtbl
riid | ISolpackGameLibVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGameLib __RPC_FAR *This) | ISolpackGameLibVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGameLib __RPC_FAR *This) | ISolpackGameLibVtbl
wFlags | ISolpackGameLibVtbl
Generated on Wed May 8 12:40:17 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackGameVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGame __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGame __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGame __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Info)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Initialize)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Uninitialize)(ISolpackGame __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Deal)(ISolpackGame __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *AutoPlay)(ISolpackGame __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *AutoPlayCard)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *HandleCommand)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *PileClicked)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *SetupFragment)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *DropFragment)(ISolpackGame __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *CancelMove)(ISolpackGame __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *RecalcLayout)(ISolpackGame __RPC_FAR *This)

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
ISolpackGameInfo __RPC_FAR
*__RPC_FAR * 		ppInfo
ISolpackApp __RPC_FAR * | pApp
ISolpackCard __RPC_FAR * | pCard
long | lID
ISolpackPile __RPC_FAR * | pPile
ISolpackPile __RPC_FAR ISolpackCard
__RPC_FAR * 		pCard
ISolpackPile __RPC_FAR * | pPileSrc
ISolpackPile __RPC_FAR ISolpackCard
__RPC_FAR * 		pCardSrc
ISolpackPile __RPC_FAR ISolpackCard
__RPC_FAR ISolpackFragment
__RPC_FAR * 		pFrag
ISolpackFragment __RPC_FAR * | pFrag
ISolpackFragment __RPC_FAR
ISolpackPile __RPC_FAR * 		pDest
ISolpackFragment __RPC_FAR
ISolpackPile __RPC_FAR VARIANT_BOOL
__RPC_FAR * 		pbValid

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * RecalcLayout )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * CancelMove )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * DropFragment )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * SetupFragment )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * PileClicked )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * HandleCommand )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * AutoPlayCard )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * AutoPlay )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Deal )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Uninitialize )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Initialize )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Info )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 2150 of file Solpack.h.

DISPID dispIdMember

Definition at line 2158 of file Solpack.h.

UINT iTInfo

Definition at line 2144 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 2158 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 2150 of file Solpack.h.

UINT LCID lcid

Definition at line 2144 of file Solpack.h.

long lID

Definition at line 2190 of file Solpack.h.

ISolpackApp __RPC_FAR* pApp

Definition at line 2173 of file Solpack.h.

ISolpackFragment __RPC_FAR ISolpackPile __RPC_FAR VARIANT_BOOL __RPC_FAR* pbValid

Definition at line 2205 of file Solpack.h.

ISolpackPile __RPC_FAR ISolpackCard __RPC_FAR* pCard

Definition at line 2194 of file Solpack.h.

ISolpackCard __RPC_FAR* pCard

Definition at line 2186 of file Solpack.h.

ISolpackPile __RPC_FAR ISolpackCard __RPC_FAR* pCardSrc

Definition at line 2199 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 2140 of file Solpack.h.

ISolpackFragment __RPC_FAR ISolpackPile __RPC_FAR* pDest

Definition at line 2205 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 2158 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 2158 of file Solpack.h.

ISolpackFragment __RPC_FAR* pFrag

Definition at line 2205 of file Solpack.h.

ISolpackPile __RPC_FAR ISolpackCard __RPC_FAR ISolpackFragment __RPC_FAR* pFrag

Definition at line 2199 of file Solpack.h.

ISolpackPile __RPC_FAR* pPile

Definition at line 2194 of file Solpack.h.

ISolpackPile __RPC_FAR* pPileSrc

Definition at line 2199 of file Solpack.h.

ISolpackGameInfo __RPC_FAR* __RPC_FAR* ppInfo

Definition at line 2169 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 2144 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 2129 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 2158 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 2158 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 2150 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 2150 of file Solpack.h.

DISPID REFIID riid

Definition at line 2158 of file Solpack.h.

REFIID riid

Definition at line 2150 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 2129 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 2158 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:18 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackGameVtbl Member List

This is the complete list of members for ISolpackGameVtbl, including all inherited members.
cNames | ISolpackGameVtbl
dispIdMember | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Info)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Initialize)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Uninitialize)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Deal)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AutoPlay)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *AutoPlayCard)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *HandleCommand)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *PileClicked)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *SetupFragment)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *DropFragment)(ISolpackGame __RPC_FAR *This | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *CancelMove)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *RecalcLayout)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
iTInfo | ISolpackGameVtbl
lcid | ISolpackGameVtbl
lcid | ISolpackGameVtbl
lcid | ISolpackGameVtbl
lID | ISolpackGameVtbl
pApp | ISolpackGameVtbl
pbValid | ISolpackGameVtbl
pCard | ISolpackGameVtbl
pCard | ISolpackGameVtbl
pCardSrc | ISolpackGameVtbl
pctinfo | ISolpackGameVtbl
pDest | ISolpackGameVtbl
pDispParams | ISolpackGameVtbl
pExcepInfo | ISolpackGameVtbl
pFrag | ISolpackGameVtbl
pFrag | ISolpackGameVtbl
pPile | ISolpackGameVtbl
pPileSrc | ISolpackGameVtbl
ppInfo | ISolpackGameVtbl
ppTInfo | ISolpackGameVtbl
ppvObject | ISolpackGameVtbl
puArgErr | ISolpackGameVtbl
pVarResult | ISolpackGameVtbl
rgDispId | ISolpackGameVtbl
rgszNames | ISolpackGameVtbl
riid | ISolpackGameVtbl
riid | ISolpackGameVtbl
riid | ISolpackGameVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackGame __RPC_FAR *This) | ISolpackGameVtbl
wFlags | ISolpackGameVtbl
Generated on Wed May 8 12:40:18 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackPile Interface Reference

#include <Solpack.h>

List of all members.

Public Attributes

CONST_VTBL struct ISolpackPileVtbl
__RPC_FAR * 		lpVtbl

Member Data Documentation

CONST_VTBL struct ISolpackPileVtbl __RPC_FAR* lpVtbl

Definition at line 375 of file Solpack.h.

The documentation for this interface was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:18 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackPile Member List

This is the complete list of members for ISolpackPile, including all inherited members.
lpVtbl ISolpackPile
Generated on Wed May 8 12:40:18 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib::ISolpackPile interface Reference

ISolpackPile Interface Reference

import "Solpack.idl";

List of all members.

Public Methods

HRESULT | Type ([out, retval] long *p)
HRESULT | X ([out, retval] long *p)
HRESULT | X ([in] long v)
HRESULT | Y ([out, retval] long *p)
HRESULT | Y ([in] long v)
HRESULT | Width ([out, retval] long *p)
HRESULT | Height ([out, retval] long *p)
HRESULT | NumCards ([out, retval] long *p)
HRESULT | CommentTooltip ([out, retval] BSTR *pbstrText)
HRESULT | CommentTooltip ([in] BSTR bstrText)
HRESULT | ShowNumCardsTooltip ([out, retval] VARIANT_BOOL *pbShow)
HRESULT | ShowNumCardsTooltip ([in] VARIANT_BOOL bShowNum)
HRESULT | BaseType ([out, retval] long *p)
HRESULT | BaseType ([in] long v)
HRESULT | Shuffle ()
HRESULT | GetCard ([in] long lIndex,[out, retval] ISolpackCard **ppCard)
HRESULT | WidthWith ([in] long lNumCards,[out, retval] long *plWidth)
HRESULT | HeightWith ([in] long lNumCards,[out, retval] long *plHeight)

Member Function Documentation

HRESULT BaseType ( [in] long v )

HRESULT BaseType ( [out, retval] long * p )

HRESULT CommentTooltip ( [in] BSTR bstrText )

HRESULT CommentTooltip ( [out, retval] BSTR * pbstrText )

HRESULT GetCard | ( | [in] long | lIndex,
 |  | [out, retval] ISolpackCard ** | ppCard
 | ) |

HRESULT Height ( [out, retval] long * p )

HRESULT HeightWith | ( | [in] long | lNumCards,
 |  | [out, retval] long * | plHeight
 | ) |

HRESULT NumCards ( [out, retval] long * p )

HRESULT ShowNumCardsTooltip ( [in] VARIANT_BOOL bShowNum )

HRESULT ShowNumCardsTooltip ( [out, retval] VARIANT_BOOL * pbShow )

HRESULT Shuffle ( )

HRESULT Type ( [out, retval] long * p )

HRESULT Width ( [out, retval] long * p )

HRESULT WidthWith | ( | [in] long | lNumCards,
 |  | [out, retval] long * | plWidth
 | ) |

HRESULT X ( [in] long v )

HRESULT X ( [out, retval] long * p )

HRESULT Y ( [in] long v )

HRESULT Y ( [out, retval] long * p )

The documentation for this interface was generated from the following file:
  • Solpack.idl
Generated on Wed May 8 12:40:26 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackPile Member List

This is the complete list of members for ISolpackPile, including all inherited members.
BaseType([out, retval] long *p) | ISolpackPile
BaseType([in] long v) | ISolpackPile
CommentTooltip([out, retval] BSTR *pbstrText) | ISolpackPile
CommentTooltip([in] BSTR bstrText) | ISolpackPile
GetCard([in] long lIndex,[out, retval] ISolpackCard **ppCard) | ISolpackPile
Height([out, retval] long *p) | ISolpackPile
HeightWith([in] long lNumCards,[out, retval] long *plHeight) | ISolpackPile
NumCards([out, retval] long *p) | ISolpackPile
ShowNumCardsTooltip([out, retval] VARIANT_BOOL *pbShow) | ISolpackPile
ShowNumCardsTooltip([in] VARIANT_BOOL bShowNum) | ISolpackPile
Shuffle() | ISolpackPile
Type([out, retval] long *p) | ISolpackPile
Width([out, retval] long *p) | ISolpackPile
WidthWith([in] long lNumCards,[out, retval] long *plWidth) | ISolpackPile
X([out, retval] long *p) | ISolpackPile
X([in] long v) | ISolpackPile
Y([out, retval] long *p) | ISolpackPile
Y([in] long v) | ISolpackPile
Generated on Wed May 8 12:40:26 2002 for Solitaire Pack by doxygen 1.2.15


ISolpackPileVtbl Struct Reference

#include <Solpack.h>

List of all members.

Public Methods

BEGIN_INTERFACE | HRESULT (STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackPile __RPC_FAR *This
ULONG (STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackPile __RPC_FAR *This)
ULONG (STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackPile __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Type)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_X)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_X)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Y)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_Y)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Width)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_Height)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_NumCards)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *get_BaseType)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *put_BaseType)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *Shuffle)(ISolpackPile __RPC_FAR *This)
HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetCard)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *WidthWith)(ISolpackPile __RPC_FAR *This
HRESULT (STDMETHODCALLTYPE __RPC_FAR *HeightWith)(ISolpackPile __RPC_FAR *This

Public Attributes

BEGIN_INTERFACE REFIID | riid
BEGIN_INTERFACE REFIID void
__RPC_FAR *__RPC_FAR * 		ppvObject
UINT __RPC_FAR * | pctinfo
UINT | iTInfo
UINT LCID | lcid
UINT LCID ITypeInfo __RPC_FAR
*__RPC_FAR * 		ppTInfo
REFIID | riid
REFIID LPOLESTR __RPC_FAR * | rgszNames
REFIID LPOLESTR __RPC_FAR UINT | cNames
REFIID LPOLESTR __RPC_FAR
UINT LCID 		lcid
REFIID LPOLESTR __RPC_FAR
UINT LCID DISPID __RPC_FAR * 		rgDispId
DISPID | dispIdMember
DISPID REFIID | riid
DISPID REFIID LCID | lcid
DISPID REFIID LCID WORD | wFlags
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR * 		pDispParams
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR * 		pVarResult
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR * 		pExcepInfo
DISPID REFIID LCID WORD DISPPARAMS
__RPC_FAR VARIANT __RPC_FAR
EXCEPINFO __RPC_FAR UINT __RPC_FAR * 		puArgErr
long __RPC_FAR * | p
long __RPC_FAR * | p
long | v
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
long __RPC_FAR * | p
BSTR __RPC_FAR * | pbstrText
BSTR | bstrText
VARIANT_BOOL __RPC_FAR * | pbShow
VARIANT_BOOL | bShowNum
long __RPC_FAR * | p
long | lIndex
long ISolpackCard __RPC_FAR
*__RPC_FAR * 		ppCard
long | lNumCards
long long __RPC_FAR * | plWidth
long long __RPC_FAR * | plHeight

Member Function Documentation

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * HeightWith )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * WidthWith )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetCard )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Shuffle )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_BaseType )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_BaseType )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_ShowNumCardsTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_ShowNumCardsTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_CommentTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_CommentTooltip )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_NumCards )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Height )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Width )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_Y )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Y )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * put_X )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_X )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * get_Type )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * Invoke )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetIDsOfNames )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfo )

HRESULT ( STDMETHODCALLTYPE __RPC_FAR * GetTypeInfoCount )

BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE __RPC_FAR * QueryInterface )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * Release )

ULONG ( STDMETHODCALLTYPE __RPC_FAR * AddRef )

Member Data Documentation

VARIANT_BOOL bShowNum

Definition at line 342 of file Solpack.h.

BSTR bstrText

Definition at line 334 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT cNames

Definition at line 279 of file Solpack.h.

DISPID dispIdMember

Definition at line 287 of file Solpack.h.

UINT iTInfo

Definition at line 273 of file Solpack.h.

DISPID REFIID LCID lcid

Definition at line 287 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID lcid

Definition at line 279 of file Solpack.h.

UINT LCID lcid

Definition at line 273 of file Solpack.h.

long lIndex

Definition at line 357 of file Solpack.h.

long lNumCards

Definition at line 367 of file Solpack.h.

long __RPC_FAR* p

Definition at line 346 of file Solpack.h.

long __RPC_FAR* p

Definition at line 326 of file Solpack.h.

long __RPC_FAR* p

Definition at line 322 of file Solpack.h.

long __RPC_FAR* p

Definition at line 318 of file Solpack.h.

long __RPC_FAR* p

Definition at line 310 of file Solpack.h.

long __RPC_FAR* p

Definition at line 302 of file Solpack.h.

long __RPC_FAR* p

Definition at line 298 of file Solpack.h.

VARIANT_BOOL __RPC_FAR* pbShow

Definition at line 338 of file Solpack.h.

BSTR __RPC_FAR* pbstrText

Definition at line 330 of file Solpack.h.

UINT __RPC_FAR* pctinfo

Definition at line 269 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR* pDispParams

Definition at line 287 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR* pExcepInfo

Definition at line 287 of file Solpack.h.

long long __RPC_FAR* plHeight

Definition at line 367 of file Solpack.h.

long long __RPC_FAR* plWidth

Definition at line 362 of file Solpack.h.

long ISolpackCard __RPC_FAR* __RPC_FAR* ppCard

Definition at line 357 of file Solpack.h.

UINT LCID ITypeInfo __RPC_FAR* __RPC_FAR* ppTInfo

Definition at line 273 of file Solpack.h.

BEGIN_INTERFACE REFIID void __RPC_FAR* __RPC_FAR* ppvObject

Definition at line 258 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR EXCEPINFO __RPC_FAR UINT __RPC_FAR* puArgErr

Definition at line 287 of file Solpack.h.

DISPID REFIID LCID WORD DISPPARAMS __RPC_FAR VARIANT __RPC_FAR* pVarResult

Definition at line 287 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR UINT LCID DISPID __RPC_FAR* rgDispId

Definition at line 279 of file Solpack.h.

REFIID LPOLESTR __RPC_FAR* rgszNames

Definition at line 279 of file Solpack.h.

DISPID REFIID riid

Definition at line 287 of file Solpack.h.

REFIID riid

Definition at line 279 of file Solpack.h.

BEGIN_INTERFACE REFIID riid

Definition at line 258 of file Solpack.h.

long v

Definition at line 350 of file Solpack.h.

DISPID REFIID LCID WORD wFlags

Definition at line 287 of file Solpack.h.

The documentation for this struct was generated from the following file:
  • Solpack.h
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


Member List

ISolpackPileVtbl Member List

This is the complete list of members for ISolpackPileVtbl, including all inherited members.
bShowNum | ISolpackPileVtbl
bstrText | ISolpackPileVtbl
cNames | ISolpackPileVtbl
dispIdMember | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *QueryInterface)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Invoke)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Type)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_X)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_X)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Y)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_Y)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Width)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_Height)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_NumCards)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_CommentTooltip)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_CommentTooltip)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_ShowNumCardsTooltip)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_ShowNumCardsTooltip)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *get_BaseType)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *put_BaseType)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *Shuffle)(ISolpackPile __RPC_FAR *This) | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *GetCard)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *WidthWith)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
HRESULT(STDMETHODCALLTYPE __RPC_FAR *HeightWith)(ISolpackPile __RPC_FAR *This | ISolpackPileVtbl
iTInfo | ISolpackPileVtbl
lcid | ISolpackPileVtbl
lcid | ISolpackPileVtbl
lcid | ISolpackPileVtbl
lIndex | ISolpackPileVtbl
lNumCards | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
p | ISolpackPileVtbl
pbShow | ISolpackPileVtbl
pbstrText | ISolpackPileVtbl
pctinfo | ISolpackPileVtbl
pDispParams | ISolpackPileVtbl
pExcepInfo | ISolpackPileVtbl
plHeight | ISolpackPileVtbl
plWidth | ISolpackPileVtbl
ppCard | ISolpackPileVtbl
ppTInfo | ISolpackPileVtbl
ppvObject | ISolpackPileVtbl
puArgErr | ISolpackPileVtbl
pVarResult | ISolpackPileVtbl
rgDispId | ISolpackPileVtbl
rgszNames | ISolpackPileVtbl
riid | ISolpackPileVtbl
riid | ISolpackPileVtbl
riid | ISolpackPileVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *AddRef)(ISolpackPile __RPC_FAR *This) | ISolpackPileVtbl
ULONG(STDMETHODCALLTYPE __RPC_FAR *Release)(ISolpackPile __RPC_FAR *This) | ISolpackPileVtbl
v | ISolpackPileVtbl
wFlags | ISolpackPileVtbl
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


IStatusBarMgr Class Reference

#include <StatusBarMgr.h>

Inheritance diagram for IStatusBarMgr:

CMainWindow List of all members.

Public Methods

virtual void | SBSetText (CTSTR &lpszStatus)=0
virtual void | SBUpdateTasks (int cAdd, int cCompleted)=0

Member Function Documentation

virtual void SBSetText ( CTSTR & lpszStatus ) [pure virtual]

Implemented in CMainWindow.

Referenced by CEngine::InitEngine(), CEngine::PlayGame(), and CGameMenu::Refresh().

virtual void SBUpdateTasks | ( | int | cAdd,
 |  | int | cCompleted
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CDeck::InitDeck(), and CGameMenu::Refresh().

The documentation for this class was generated from the following file:
  • StatusBarMgr.h
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IStatusBarMgr Member List

This is the complete list of members for IStatusBarMgr, including all inherited members.
SBSetText(CTSTR &lpszStatus)=0 | IStatusBarMgr | [pure virtual]
SBUpdateTasks(int cAdd, int cCompleted)=0 | IStatusBarMgr | [pure virtual]
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


IUndoMgrOwner Class Reference

#include <UndoMgr.h>

Inheritance diagram for IUndoMgrOwner:

CEngine List of all members.

Public Methods

virtual CUndoMgr * GetUndoMgr ()=0

Member Function Documentation

virtual CUndoMgr* GetUndoMgr ( ) [pure virtual]

Implemented in CEngine.

The documentation for this class was generated from the following file:
  • UndoMgr.h
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IUndoMgrOwner Member List

This is the complete list of members for IUndoMgrOwner, including all inherited members.
GetUndoMgr()=0 IUndoMgrOwner [pure virtual]
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


IUpdateDlgSite Class Reference

#include <bmws_updatedlg.h>

Inheritance diagram for IUpdateDlgSite:

CMainWindow List of all members.

Public Methods

virtual void | GetCheckUpdate (BOOL *pbNewVer, BOOL *pbExtras, CTSTR &lpszNewVerText, CTSTR &lpszExtrasText)=0
virtual void | SetCheckUpdate (BOOL bNewVer, BOOL bExtras)=0

Member Function Documentation

virtual void GetCheckUpdate | ( | BOOL * | pbNewVer,
 |  | BOOL * | pbExtras,
 |  | CTSTR & | lpszNewVerText,
 |  | CTSTR & | lpszExtrasText
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CUpdateDlg::DlgProc().

virtual void SetCheckUpdate | ( | BOOL | bNewVer,
 |  | BOOL | bExtras
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CUpdateDlg::DlgProc().

The documentation for this class was generated from the following file:
  • bmws_updatedlg.h
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IUpdateDlgSite Member List

This is the complete list of members for IUpdateDlgSite, including all inherited members.
GetCheckUpdate(BOOL *pbNewVer, BOOL *pbExtras, CTSTR &lpszNewVerText, CTSTR &lpszExtrasText)=0 | IUpdateDlgSite | [pure virtual]
SetCheckUpdate(BOOL bNewVer, BOOL bExtras)=0 | IUpdateDlgSite | [pure virtual]
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


IUpdateSite Class Reference

#include <bmws_update.h>

Inheritance diagram for IUpdateSite:

CMainWindow List of all members.

Public Methods

virtual void UpdateDone (double dAvailVersion, CBSTR &bstrExtra)=0

Member Function Documentation

virtual void UpdateDone | ( | double | dAvailVersion,
 |  | CBSTR & | bstrExtra
 | ) | [pure virtual]

Implemented in CMainWindow.

Referenced by CUpdateInfo::XMLDone().

The documentation for this class was generated from the following file:
  • bmws_update.h
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IUpdateSite Member List

This is the complete list of members for IUpdateSite, including all inherited members.
UpdateDone(double dAvailVersion, CBSTR &bstrExtra)=0 IUpdateSite [pure virtual]
Generated on Wed May 8 12:40:20 2002 for Solitaire Pack by doxygen 1.2.15


IUserPrefsSite Class Reference

#include <UserPrefs.h>

Inheritance diagram for IUserPrefsSite:

CMainWindow List of all members.

Public Methods

virtual void | OptionStatusBar (BOOL bShow)=0
virtual void | OptionTooltips (BOOL bShow)=0
virtual CHTMLHelper * | GetHH ()=0

Member Function Documentation

virtual CHTMLHelper* GetHH ( ) [pure virtual]

Implemented in CMainWindow.

Referenced by CUserPrefs::UpdateAppearance().

virtual void OptionStatusBar ( BOOL bShow ) [pure virtual]

Implemented in CMainWindow.

Referenced by CUserPrefs::OptionsGeneralProc().

virtual void OptionTooltips ( BOOL bShow ) [pure virtual]

Implemented in CMainWindow.

Referenced by CUserPrefs::OptionsGeneralProc().

The documentation for this class was generated from the following file:
  • UserPrefs.h
Generated on Wed May 8 12:40:21 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IUserPrefsSite Member List

This is the complete list of members for IUserPrefsSite, including all inherited members.
GetHH()=0 | IUserPrefsSite | [pure virtual]
OptionStatusBar(BOOL bShow)=0 | IUserPrefsSite | [pure virtual]
OptionTooltips(BOOL bShow)=0 | IUserPrefsSite | [pure virtual]
Generated on Wed May 8 12:40:21 2002 for Solitaire Pack by doxygen 1.2.15


IXMLDocumentSite Class Reference

#include <bmws_xml.h>

Inheritance diagram for IXMLDocumentSite:

CCompoundXMLDocument CUpdateInfo ICompoundXMLDocumentSite List of all members.

Public Methods

virtual void XMLDone (CXMLDocument *pDoc)=0

Member Function Documentation

virtual void XMLDone ( CXMLDocument * pDoc ) [pure virtual]

Implemented in CCompoundXMLDocument, and CUpdateInfo.

Referenced by CXMLDocument::EventHandler(), and CCompoundXMLDocument::XMLDone().

The documentation for this class was generated from the following file:
  • bmws_xml.h
Generated on Wed May 8 12:40:21 2002 for Solitaire Pack by doxygen 1.2.15


Member List

IXMLDocumentSite Member List

This is the complete list of members for IXMLDocumentSite, including all inherited members.
XMLDone(CXMLDocument *pDoc)=0 IXMLDocumentSite [pure virtual]
Generated on Wed May 8 12:40:21 2002 for Solitaire Pack by doxygen 1.2.15


tagDPAIR Struct Reference

List of all members.

Public Attributes

double | x
double | y

Member Data Documentation

double x

Definition at line 44 of file Fragment.cpp.

double y

Definition at line 45 of file Fragment.cpp.

The documentation for this struct was generated from the following file:
  • Fragment.cpp
Generated on Wed May 8 12:40:22 2002 for Solitaire Pack by doxygen 1.2.15


Member List

tagDPAIR Member List

This is the complete list of members for tagDPAIR, including all inherited members.
x | tagDPAIR
y | tagDPAIR
Generated on Wed May 8 12:40:22 2002 for Solitaire Pack by doxygen 1.2.15


Compound Member Index

Solitaire Pack Compound Members

a | b | c | d | e | f | g | h | i | l | m | n | o | p | r | s | t | u | v | w | x | y | ~

Here is a list of all class members with links to the class documentation for each member:

- a -

  • Abort() : CXMLDocument
  • ActiveGameChanged() : CMainWindow, IGameMenuSite
  • Add() : CHTMLSelect, CArray
  • AddAction() : CTurn
  • AddCard() : CFragmentAction
  • AddChild() : CXMLElement
  • AddDeck() : CEngine
  • AddFile() : CCPSoundsDlg, CCompoundXMLDocument
  • AddGameCommand() : ISolpackApp, CGameCommandMgr
  • AddPile() : CFragmentAction
  • Addr() : CBSTR, CTSTR
  • AddToFragment() : ISolpackFragment
  • AddWnd() : CHlinkWindowMgr
  • AdjustAfterSuccess() : CGameSpider
  • AdjustSrcPile() : CGameLaBelleLucie
  • Alloc() : CTSTR
  • AltAddChild() : CXMLElement
  • AltChildOf() : CXMLElement
  • AltGetAttr() : CXMLElement
  • AltNumChildOf() : CXMLElement
  • AltSetVTAttr() : CXMLElement
  • Animate() : CFragment
  • AnimStateChange() : IFragmentSite, CEngine
  • Append() : CArray
  • Assign() : CBSTR, CTSTR, CPtr, CPidl, CHandle
  • AssignW() : CBSTR, CTSTR
  • Author() : ISolpackGameLib
  • AutoPlay() : ISolpackGame
  • AutoPlayCard() : ISolpackGame

- b -
  • bAnimate : ISolpackFragmentVtbl, CFragment
  • BarWndProc() : CHelpPane
  • BaseType() : ISolpackPile
  • bCanDrag : ISolpackCardVtbl
  • bEnable : ISolpackAppVtbl, CEngine
  • bExtra : CUpdateInfo
  • bFaceUp : ISolpackCardVtbl
  • BMWSDlgProc() : CDlg
  • bShowNum : ISolpackFragmentVtbl, ISolpackPileVtbl
  • bstrHelpText : ISolpackAppVtbl, CEngine
  • bstrText : ISolpackAppVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEngine
  • bToggleFace : ISolpackFragmentVtbl, CFragment
  • bValid : CRegDlgInfo
  • bVer : CUpdateInfo

- c -
  • c : _IID
  • C3DShatter() : C3DShatter
  • CAboutDlg() : CAboutDlg
  • CAction() : CAction
  • CancelAdditions() : CFragment
  • CancelDrag() : CEngine
  • CancelEvent() : CHTMLHelper
  • CancelHelpText() : CStatusBar
  • CancelMouseEvent() : IEngineObjSite, CEngine
  • CancelMove() : ISolpackGame
  • CancelResize() : CHelpPane
  • CanDrag() : ISolpackCard
  • CanRedo() : CUndoMgr
  • CanUndo() : CUndoMgr
  • CanUnloadNow() : CFactory
  • CAppearanceDlg() : CAppearanceDlg
  • CardFlipped() : CEngine, ICardSite
  • CardHeight() : ISolpackApp
  • CardWidth() : ISolpackApp
  • CArray() : CArray
  • CBrowserContainer() : CBrowserContainer
  • CBSTR() : CBSTR
  • CCard : CCard, CCardIndexAction
  • CCardIndexAction() : CCardIndexAction
  • CCOMExcep() : CCOMExcep
  • CCompoundXMLDocument() : CCompoundXMLDocument
  • CCPSounds : CCPSounds, CCPSoundsDlg
  • CCPSoundsDlg : CCPSoundsDlg, CCPSounds
  • CDeck() : CDeck
  • CDispBase() : CDispBase
  • CDlg() : CDlg
  • CEngine() : CEngine
  • CEngineObj() : CEngineObj
  • CenterWindow() : CHWND
  • CEventHandler() : CEventHandler
  • CEventSink() : CEventSink
  • CExcep() : CExcep
  • CExcepEx() : CExcepEx
  • CFactory() : CFactory
  • CFragment : CFragment, CFragmentAction
  • CFragmentAction() : CFragmentAction
  • CGameBase() : CGameBase
  • CGameCommand() : CGameCommand
  • CGameCommandMgr() : CGameCommandMgr
  • CGameData : CGameData, CGameDataAction
  • CGameDataAction() : CGameDataAction
  • CGameInfo() : CGameInfo
  • CGameLaBelleLucie() : CGameLaBelleLucie
  • CGameLib() : CGameLib
  • CGameMenu() : CGameMenu
  • CGameMenuItem() : CGameMenuItem
  • CGameSpider() : CGameSpider
  • CHandle() : CHandle
  • Changed() : CHTMLSelect, CHTMLRadioGroup, CHTMLEdit, CHTMLControl, CHTMLChooseColor, CHTMLChk
  • CheckPile() : CGameSpider
  • CheckRecalcNeeded() : CMainWindow
  • CHelpMgr() : CHelpMgr
  • CHelpPane() : CHelpPane
  • ChildOf() : CXMLElement
  • CHlinkWindow() : CHlinkWindow
  • CHlinkWindowMgr() : CHlinkWindowMgr
  • CHTMLChk() : CHTMLChk
  • CHTMLChooseColor() : CHTMLChooseColor
  • CHTMLControl() : CHTMLControl
  • CHTMLEdit() : CHTMLEdit
  • CHTMLEnable() : CHTMLEnable
  • CHTMLHelper() : CHTMLHelper
  • CHTMLLink() : CHTMLLink
  • CHTMLRadioGroup() : CHTMLRadioGroup
  • CHTMLSelect() : CHTMLSelect
  • CHTMLStatic() : CHTMLStatic
  • CHWND() : CHWND
  • CKey() : CKey
  • Cleanup() : CHTMLLink
  • CleanupFiles() : CCompoundXMLDocument
  • CleanupGame() : CEngine
  • CleanupPropPage() : CCPSounds
  • Clear() : CUndoMgr, CGameCommandMgr
  • ClearCards() : CPile
  • ClearSrc() : CFragmentAddCard, CFragmentAddPile, CFragmentAdd
  • ClearTransferred() : CPile
  • ClearWorkingTurn() : CUndoMgr
  • CLib() : CLib
  • CLibMgr() : CLibMgr
  • CLimitSingleInstance() : CLimitSingleInstance
  • Close() : CHandle
  • CMainWindow() : CMainWindow
  • cNames : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch
  • color : CRegDlgInfo
  • CommentTooltip() : ISolpackPile
  • CommonSetup() : CHlinkWindow
  • ControlChanged() : CHTMLRadioGroup, IHTMLControlSite
  • COOMExcep() : COOMExcep
  • Copy() : CArray
  • CopyString() : CBSTR, CTSTR
  • CPidl() : CPidl
  • CPile : CPile, CPileCommentAction, CPileShuffleAction
  • CPileCommentAction() : CPileCommentAction
  • CPileShuffleAction() : CPileShuffleAction
  • CPointer() : CPointer
  • CPSoundsProc() : CCPSoundsDlg
  • CPtr() : CPtr
  • CPtrArray() : CPtrArray
  • CQuitExcep() : CQuitExcep
  • Create() : CGameSpider, CGameLaBelleLucie, CStatusBar, CMainWindow, CHelpPane, CSplashWindow, CScriptFn
  • CreateArray() : CScriptFn
  • CreateDeck() : CGameBase
  • CreateElement() : CHTMLHelper
  • CreateGame() : CGameInfo
  • CreateGameData() : ISolpackApp
  • CreateInstance : CGameLib, CFactoryData
  • CreateMainWindow() : CSolpackApp
  • CreatePile() : ISolpackApp
  • CreateRootElement() : CXMLDocument
  • CreateWindowEx() : CHWND
  • CRefCount() : CRefCount
  • CRegDlgInfo() : CRegDlgInfo
  • CScriptFn() : CScriptFn
  • CShellDataObj() : CShellDataObj
  • CSolpackApp() : CSolpackApp
  • CSplashWindow() : CSplashWindow
  • CStatusBar() : CStatusBar
  • CTechSupportDlg() : CTechSupportDlg
  • CTSTR() : CTSTR
  • CTurn() : CTurn
  • CUndoMgr() : CUndoMgr
  • CUnkBase() : CUnkBase
  • CUpdateDlg() : CUpdateDlg
  • CUserPrefs : CUserPrefs, CAppearanceDlg
  • CVariant() : CVariant
  • CWaitCursor() : CWaitCursor
  • CWinExcep() : CWinExcep
  • CXMLDocument() : CXMLDocument
  • CXMLElement() : CXMLElement
  • CXMLExcep() : CXMLExcep

- d -
  • Data() : ISolpackGameData
  • Deal() : ISolpackGame
  • DealCard() : CGameSpider
  • DealGame() : CEngine
  • DealRound() : CGameLaBelleLucie
  • DECLARE_IUNKNOWN : CBrowserContainer
  • DECLARE_IUNKNOWN_AND_IDISPATCH : CGameLib, CGameInfo, CGameBase, CPile, CGameData, CFragment, CEngine, CCard
  • DelCallback() : ICompoundXMLDocumentSite
  • Delete() : CExcep
  • DeleteAttr() : CXMLElement
  • DeleteChild() : CXMLElement
  • Detach() : CBSTR
  • DialogCSHelp() : CHelpMgr
  • Difficulty() : ISolpackGameInfo
  • Disconnect() : CEventSink
  • dispIdMember : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl
  • DlgProc() : CAboutDlg, CUpdateDlg, CTechSupportDlg, CDlg
  • DoAction() : CPile, CGameData, CFragment, CEngine, CCard, IActionSite
  • DoAnimation() : C3DShatter
  • DoBkImgChk() : CAppearanceDlg
  • DoChooseColor() : CAppearanceDlg
  • DoesCardFollow() : CGameSpider
  • DoHelpPane() : CMainWindow
  • DoOptions() : CUserPrefs
  • DoPreReceive() : CFragmentAddCard, CFragmentAddPile, CFragmentAdd
  • DoReceive() : CFragmentAddCard, CFragmentAddPile, CFragmentAdd
  • DoWaitCursor() : CWaitCursor
  • downcount() : CRefCount
  • DropFragment() : ISolpackGame
  • dw : CBrowserContainer
  • dwWhichMoniker : CBrowserContainer

- e -
  • ElementAt() : CArray
  • Email() : ISolpackGameLib
  • EmptyMessageQueue() : CSolpackApp, IMsgProcessor
  • Enable() : CGameCommand, CHTMLStatic, CHTMLLink, CHTMLEnable
  • EnableGameCommand() : ISolpackApp, CGameCommandMgr
  • EnableHelper() : CHTMLEnable
  • EndAnimation() : C3DShatter
  • EngGetUndoMgr() : IEngineObjSite, CEngine
  • Equals() : CBSTR, CTSTR
  • EventHandler() : CGameMenuItem, CGameMenu, CGameCommandMgr, CEngineObj, CEngine, CXMLDocument, CHTMLSelect, CHTMLRadioGroup, CHTMLLink, CHTMLEdit, CHTMLControl, CHTMLChooseColor, CHTMLChk, IEventHandlerSite
  • EventSink() : CMainWindow, CHelpPane, CTechSupportDlg, IEventSinkSite, C3DShatter
  • Execute() : CHlinkWindow

- f -
  • FaceUp() : ISolpackCard
  • FileExists() : CCompoundXMLDocument
  • FillDropDown() : CCPSoundsDlg
  • FillGameInfo() : CGameMenu
  • FillPropPage() : CCPSounds
  • FocusElement() : CHTMLHelper
  • FocusElementEx() : CHTMLHelper
  • Format() : CBSTR, CTSTR
  • Fragment() : ISolpackApp
  • FragToPile() : CFragment
  • fRameWindow : CBrowserContainer
  • Free() : CPidl

- g -
  • GameSelected() : CMainWindow, IGameMenuSite
  • GameWon() : ISolpackApp
  • GetActiveGame() : CGameMenu
  • GetActiveLib() : CGameMenu
  • GetAnim() : IPileSite, CMainWindow, CEngine, IEngineSite
  • GetAt() : CArray
  • GetAttr() : CXMLElement
  • GetCard() : ISolpackPile
  • GetCardFromData() : CGameBase
  • GetCardSpot() : CPile
  • GetCheck() : CHTMLChk
  • GetChecked() : CHTMLRadioGroup
  • GetCheckUpdate() : CMainWindow, IUpdateDlgSite
  • GetClassObject() : CFactory
  • GetColor() : CHTMLChooseColor
  • GetColorInfo() : IHTMLChooseColorSite
  • GetCommandIndex() : CGameCommandMgr
  • GetConnectionPoint() : CEventSink
  • GetData() : CArray
  • GetDispatch() : CDispBase
  • GetEl() : CHTMLHelper, CHTMLEnable, CHTMLControl
  • GetElement() : CCard
  • GetElText() : CHTMLHelper
  • GetElTextWithEl() : CHTMLHelper
  • GetEvent() : CHTMLHelper
  • GetFaceDownImg() : CEngine, ICardSite
  • GetFileExt() : CShellDataObj
  • GetFileIndex() : CCompoundXMLDocument
  • GetFileName() : CXMLDocument, CShellDataObj, CCompoundXMLDocument
  • GetFileNameArray() : CShellDataObj
  • GetGame() : ISolpackGameLib, CLibMgr
  • GetGameInfo() : ISolpackGameLib, CLibMgr
  • GetHH() : IUserPrefsSite, CMainWindow
  • GetI4Attr() : CXMLElement
  • GetIndex() : CCard
  • GetLib() : CLibMgr
  • GetLongFromData() : CGameBase
  • GetMetrics() : CGameBase
  • GetNamedEl() : CHTMLHelper
  • GetNumberedEl() : CHTMLHelper
  • GetNumCards() : CPile
  • GetNumFiles() : CShellDataObj, CCompoundXMLDocument
  • GetNumGames() : CLibMgr
  • GetNumLibs() : CLibMgr
  • GetOuterUnknown() : CUnkBase, CDispBase
  • GetPile() : CCard
  • GetPileInterface() : CPile, ICardPileSite
  • GetPileRgn() : CFragment
  • GetPosition() : CCard
  • GetR8Attr() : CXMLElement
  • GetRootElement() : CXMLDocument
  • GetRuleStyle() : CHTMLHelper
  • GetSelected() : CHTMLSelect
  • GetShowTooltips() : IPileSite, CMainWindow, CEngine, IEngineSite
  • GetSize() : CArray
  • GetSizeWith() : CPile
  • GetStrAttr() : CXMLElement
  • GetStyle() : CHTMLHelper
  • GetStyleSheet() : CHTMLHelper
  • GetTagName() : CXMLElement
  • GetText() : CXMLElement
  • GetType() : CEngineObj
  • GetUINTAttr() : CXMLElement
  • GetUndoMgr() : IUndoMgrOwner, CEngine
  • GetWindow() : CHlinkWindow

- h -
  • HandleCommand() : ISolpackGame, IGameCommandMgrSite, CEngine
  • HandlePileClicked() : CEngine
  • HandleTryDrop() : CEngine
  • hDlg : CRegDlgInfo
  • Height() : ISolpackPile
  • HeightWith() : ISolpackPile
  • hKeyProduct : CRegDlgInfo
  • HlinkClicked() : CRegDlgInfo, IHlinkWindowSite
  • HRESULT() : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl
  • HTMLComplete() : CMainWindow, CHelpPane

- i -
  • ID() : ISolpackCard
  • iHash : CRegDlgInfo
  • IncrScore() : CGameBase
  • Index() : ISolpackCard
  • Info() : ISolpackGame
  • Init() : CUndoMgr, CGameMenuItem, CGameMenu, CGameCommandMgr, CGameCommand, CDispBase, CBrowserContainer
  • InitCard() : CCard
  • InitDeck() : CDeck
  • InitEngine() : CEngine
  • InitEngineObj() : CEngineObj
  • InitFragment() : CFragment
  • InitGame() : CGameBase
  • InitGameData() : CGameData
  • InitGameInfo() : CGameInfo
  • InitGameLib() : CGameLib
  • Initialize() : ISolpackGame
  • InitPile() : CPile
  • InitXMLDocument() : CXMLDocument
  • InsertAt() : CArray
  • InternalAutoPlayCard() : CGameLaBelleLucie
  • IsAnimating() : C3DShatter
  • IsCardPlayable() : CGameLaBelleLucie
  • IsCBValid() : CCPSoundsDlg
  • IsLocked() : CFactory
  • IsTag() : CXMLElement
  • IsValidCompoundXML() : CCompoundXMLDocument
  • IsValidXML() : CXMLDocument
  • ItemClicked() : IGameMenuItemSite, CGameMenu
  • ItemDblClicked() : IGameMenuItemSite, CGameMenu
  • iTInfo : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl

- l -
  • lcid : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch
  • lDifficulty : tagGAMEDATA
  • Len() : CBSTR, CTSTR
  • lID : ISolpackGameVtbl, ISolpackAppVtbl
  • lIndex : ISolpackGameLibVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CFragment
  • LinkClicked() : IHTMLLinkSite
  • lNumCards : ISolpackFragmentVtbl, ISolpackPileVtbl
  • LoadFromFile() : CXMLDocument
  • lpFrameInfo : CBrowserContainer
  • lprcClipRect : CBrowserContainer
  • lprcPosRect : CBrowserContainer
  • lpVtbl : ISolpackGameLib, ISolpackGame, ISolpackApp, ISolpackGameData, ISolpackGameInfo, ISolpackCard, ISolpackFragment, ISolpackPile
  • lType : ISolpackAppVtbl

- m -
  • m_abFilesSpewed : CCompoundXMLDocument
  • m_abTransferred : CPile
  • m_aHlinks : CHlinkWindowMgr
  • m_alpszDDFiles : CCPSoundsDlg
  • m_alpszDiff : CGameMenu
  • m_alpszDisplays : CCPSounds
  • m_alpszFileNames : CCompoundXMLDocument
  • m_alpszImgs : CGameMenu
  • m_alpszSoundFiles : CCPSounds
  • m_alpszTempFiles : CCPSoundsDlg
  • m_apAdditions : CFragmentAction
  • m_apBottomCards : CGameSpider
  • m_apCards : CPile
  • m_apCardsNew : CPileShuffleAction
  • m_apCardsOld : CPileShuffleAction
  • m_apCommands : CGameCommandMgr
  • m_apControls : CHTMLRadioGroup
  • m_apDeckCards : CDeck
  • m_apDecks : CEngine
  • m_apFoundations : CGameSpider, CGameLaBelleLucie
  • m_apGameInfo : CGameLib
  • m_apInputEls : CHTMLRadioGroup
  • m_apItems : CGameMenu
  • m_apLibs : CLibMgr
  • m_apPiles : CGameSpider, CGameLaBelleLucie, CEngine
  • m_apSources : CFragment
  • m_apTopCards : CGameSpider, CGameLaBelleLucie
  • m_auidSounds : CCPSounds
  • m_bActive : CGameMenu
  • m_bAnimate : CFragmentAction
  • m_bAnimating : C3DShatter
  • m_bAnimCards : CUserPrefs
  • m_bAnimWon : CUserPrefs
  • m_bCancelAnim : CFragment
  • m_bCanDrag : CCard
  • m_bCanRecord : CUndoMgr
  • m_bCheckExtras : CUserPrefs
  • m_bCheckVer : CUserPrefs
  • m_bCompoundValid : CCompoundXMLDocument
  • m_bConnected : CEventSink
  • m_bDelete : CExcep
  • m_bDirty : CUndoMgr
  • m_bEditChanged : CCPSoundsDlg
  • m_bEnabled : CGameCommand, CHTMLEnable
  • m_bFaceUp : CCard
  • m_bHelpPane : CUserPrefs
  • m_bInPlaceActive : CBrowserContainer
  • m_bkColor : CAppearanceDlg
  • m_bMovedOnce : CFragmentAction
  • m_bNavigated : CMainWindow, CTechSupportDlg
  • m_bNoBorder : CBrowserContainer
  • m_bNumber : CHTMLEdit
  • m_bOpened : CHelpMgr
  • m_bOrig : CHTMLChk
  • m_bPaneSizing : CMainWindow
  • m_bParamIsUnk : CHTMLLink, CHTMLControl
  • m_bPlaying : CGameBase
  • m_bPresentUpdate : CMainWindow
  • m_bPutHandler : CXMLDocument
  • m_bReenable : CCPSoundsDlg
  • m_bRelease : CPtrArray
  • m_bResizing : CHelpPane
  • m_bScroll : CBrowserContainer
  • m_bShowingHelp : CStatusBar
  • m_bShowNumCards : CPile
  • m_bSizing : CMainWindow
  • m_bStatusBar : CUserPrefs
  • m_bstr : CBSTR
  • m_bstrBeforeEnd : CHTMLHelper
  • m_bstrExtras : CMainWindow
  • m_bstrFile : CXMLDocument
  • m_bstrGame : CHelpPane
  • m_bstrHelpText : CGameCommand
  • m_bstrInstr : CHelpPane
  • m_bstrOrig : CHTMLEdit
  • m_bstrText : CGameCommand
  • m_bstrTitle : CGameInfo
  • m_bTextArea : CHTMLEdit
  • m_bToggleFace : CFragmentAction
  • m_bTooltips : CUserPrefs
  • m_bUsingMasterDeck : CEngine
  • m_bValidated : CCPSoundsDlg
  • m_bValidLoaded : CXMLDocument
  • m_cCards : CFragmentAddPile, CFragmentAction
  • m_cCardsDealing : CGameLaBelleLucie
  • m_cFiles : CCompoundXMLDocument
  • m_cGames : CLibMgr
  • m_code : CExcep
  • m_color : CUpdateDlg, CHTMLChooseColor, CHlinkWindowMgr
  • m_colorBkg : CUserPrefs
  • m_colorOrig : CHTMLChooseColor
  • m_colorText : CUserPrefs, CSplashWindow
  • m_cRef : CUnkBase, CDispBase, CFactory
  • m_cRefs : CRefCount
  • m_cTasks : CMainWindow
  • m_cTasksDone : CMainWindow
  • m_cWnds : CHlinkWindowMgr
  • m_cyHelpPane : CUserPrefs
  • m_cyHelpPaneSize : CMainWindow
  • m_dAvailVersion : CMainWindow
  • m_dispid : CScriptFn
  • m_dwChanged : CAppearanceDlg
  • m_dwCookie : CEventSink
  • m_dwData : CAction
  • m_dwEngObjType : CEngineObj
  • m_dwEventID : CHTMLLink, CEventHandler
  • m_dwFlags : CExcepEx
  • m_dwID : CHlinkWindow
  • m_dwLastError : CLimitSingleInstance
  • m_dwMouseState : CEngine
  • m_dwRefCount : CScriptFn, CEventSink, CEventHandler
  • m_dwState : CMainWindow, CEngine
  • m_dwType : CAction
  • m_gameCommandMgr : CEngine
  • m_gameMenu : CMainWindow
  • m_h : CHandle
  • m_hAccelTable : CMainWindow
  • m_hbmPlay : CCPSoundsDlg
  • m_hbmSplash : CSplashWindow
  • m_hbmStop : CCPSoundsDlg
  • m_hbrBk : CAppearanceDlg
  • m_hbrText : CAppearanceDlg
  • m_hCur : CHlinkWindowMgr
  • m_hDlg : CCPSoundsDlg
  • m_hFile : CXMLDocument
  • m_hFont : CHelpPane, CHlinkWindow
  • m_hfontUser : CSplashWindow
  • m_hIcon : CAboutDlg
  • m_hKey : CKey
  • m_hModule : CLib
  • m_hMutex : CLimitSingleInstance
  • m_hr : CCOMExcep
  • m_hRgn : CPile
  • m_hWnd : CHWND, CHlinkWindow, CBrowserContainer
  • m_hwndDlg : CAppearanceDlg, CDlg
  • m_iActiveGameIndex : CGameMenu
  • m_iActiveLibIndex : CGameMenu
  • m_iGameIndex : CGameMenuItem
  • m_iIndex : CHTMLRadioGroup
  • m_iLibIndex : CGameMenuItem
  • m_iRecentIndex : CHTMLRadioGroup
  • m_iSelected : CCPSoundsDlg
  • m_lBaseType : CPile
  • m_lButton : CEngine
  • m_lCardHeight : CGameBase
  • m_lCardWidth : CGameBase
  • m_lDeactivateParam : CEngine
  • m_lDestIndex : CCardIndexAction
  • m_lDifficulty : CGameInfo
  • m_lHeight : CPile
  • m_libMgr : CMainWindow
  • m_lID : CGameCommand, CCard
  • m_lIndex : CFragmentAction, CCard
  • m_lIndexDest : CFragmentAdd
  • m_lIndexSrc : CFragmentAddCard
  • m_lOrig : CHTMLSelect
  • m_lParam : CHTMLLink, CHTMLControl, CEventSink, CEventHandler
  • m_lpsz : CTSTR
  • m_lpszBase : CCPSounds
  • m_lpszBkgImg : CUserPrefs
  • m_lpszBkImg : CAppearanceDlg
  • m_lpszCBTemp : CCPSoundsDlg
  • m_lpszClassName : CHWND
  • m_lpszCopyright : CSplashWindow
  • m_lpszCurFolder : CCPSoundsDlg
  • m_lpszDefPath : CCPSounds
  • m_lpszDefPopupFile : CHelpMgr
  • m_lpszExtraAttrs : CHTMLEnable
  • m_lpszFaceDownImg : CEngine
  • m_lpszFileName : CHelpMgr
  • m_lpszImgFile : CCard
  • m_lpszNew : CPileCommentAction
  • m_lpszOld : CPileCommentAction
  • m_lpszPaneClass : CHelpPane
  • m_lpszPopupFile : CCPSoundsDlg
  • m_lpszPopupHolder : CHelpMgr
  • m_lpszRegMsg : CSplashWindow
  • m_lpszScoreHolder : CStatusBar
  • m_lpszSpewPath : CCompoundXMLDocument
  • m_lpszText : CUpdateDlg, CHTMLEnable, CHlinkWindow
  • m_lpszTooltip : CPile
  • m_lpszUrl : CHlinkWindow
  • m_lpszURL : CUpdateDlg
  • m_lpszVersion : CSplashWindow
  • m_lScore : CEngine
  • m_lSpacingX : CGameBase
  • m_lSpacingY : CGameBase
  • m_lSrcIndex : CCardIndexAction
  • m_lType : CPile
  • m_lWidth : CPile
  • m_lWindowHeight : CGameBase
  • m_lWindowWidth : CGameBase
  • m_lX : CPile, CCard
  • m_lY : CPile, CCard
  • m_mciDevID : CCPSoundsDlg
  • m_medium : CShellDataObj
  • m_nCmdShow : CMainWindow
  • m_nGrowBy : CArray
  • m_nMaxSize : CArray
  • m_nSize : CArray
  • m_p : CPointer
  • m_pBrowserContainer : CMainWindow, CHelpPane, CTechSupportDlg
  • m_pCardSrc : CFragmentAddCard, CEngine
  • m_pCCSite : CHTMLChooseColor
  • m_pCLSID : CFactoryData
  • m_pCompoundSite : CCompoundXMLDocument
  • m_pCPSounds : CUserPrefs, CCPSoundsDlg
  • m_pCurAction : CFragment
  • m_pCurrent : CUndoMgr
  • m_pData : CArray
  • m_pDAVCEvent : C3DShatter
  • m_pEngine : CMainWindow
  • m_pEngObjSite : CEngineObj
  • m_pEvent : CBrowserContainer
  • m_pFactoryData : CFactory
  • m_pFilesEl : CCompoundXMLDocument
  • m_pFirst : CUndoMgr, CTurn
  • m_pfnClose : CHandle
  • m_pfnCreate : CGameInfo
  • m_pFragment : CEngine
  • m_pFragSite : CFragment
  • m_pGameInfo : CGameBase
  • m_pHelpPane : CMainWindow
  • m_pHH : CMainWindow, CHelpPane, CGameMenuItem, CGameMenu, CGameCommandMgr, CEngineObj, CEngine, CTechSupportDlg, CHTMLEnable, CHTMLControl, C3DShatter
  • m_pHlinkWndMgr : CAboutDlg, CUpdateDlg
  • m_pI : CPtr
  • m_pidl : CPidl
  • m_piid : CEventSink
  • m_pImplementor : CScriptFn
  • m_pInvokeDispatch : CDispBase
  • m_pLast : CTurn
  • m_pLIBID : CFactoryData
  • m_pLibMgr : CGameMenu, CEngine
  • m_pLinkSite : CHTMLLink
  • m_pMainWindow : CSolpackApp
  • m_pMostRecent : CUndoMgr
  • m_pMsgProcessor : CMainWindow, CFragment, CEngine
  • m_pNext : CTurn, CAction
  • m_pNumPilesGone : CGameSpider
  • m_pNumRounds : CGameLaBelleLucie
  • m_pPane : CHelpPane
  • m_pPileDest : CFragmentAction
  • m_pPileSite : CCard
  • m_pPileSrc : CFragmentAdd, CEngine
  • m_pPrefs : CAppearanceDlg
  • m_pPrev : CTurn, CAction
  • m_pProgressWnd : CStatusBar
  • m_pRebar : CHelpPane
  • m_pSB : CMainWindow
  • m_pSBMgr : CGameMenu, CEngine
  • m_pShatter : CEngine
  • m_pSite : CUserPrefs, CPile, CGameMenuItem, CGameMenu, CGameCommandMgr, CEngine, CCard, CAction, CXMLDocument, CUpdateDlg, CHTMLEnable, CHTMLControl, CHlinkWindow, CEventSink, CEventHandler
  • m_pSplash : CMainWindow
  • m_ptDrag : CEngine
  • m_pTypeInfo : CDispBase
  • m_pUndoMgrOwner : CGameData
  • m_pXTB : CHelpPane
  • m_rcSizeBefore : CMainWindow
  • m_rect : CBrowserContainer
  • m_spApp : CGameBase
  • m_spBrowser : CMainWindow, CHelpPane, CTechSupportDlg
  • m_spCell : CGameCommand
  • m_spDAVC : C3DShatter
  • m_spDeck : CGameBase
  • m_spDeck2 : CGameSpider
  • m_spDoc : CXMLDocument
  • m_spDoc3 : CHTMLHelper
  • m_spDragSrc : CGameBase
  • m_spEl : CGameMenuItem, CGameCommand, CEngineObj, CXMLElement, CHTMLEnable, CHTMLControl
  • m_spElParent : CHTMLEnable
  • m_spGame : CEngine
  • m_spImgElBase : CPile
  • m_spInputEl : CHTMLChk
  • m_spioo : CBrowserContainer
  • m_spipo : CBrowserContainer
  • m_spNode : CXMLElement
  • m_spSelectEl : CHTMLSelect
  • m_spStock : CGameSpider
  • m_spStyle : CEngineObj
  • m_spUnkSource : CEventSink
  • m_spWindow2 : CHTMLHelper
  • m_textColor : CAppearanceDlg
  • m_uDeactivateMsg : CEngine
  • m_uGameID : CGameInfo, CGameBase
  • m_uID : CHTMLControl
  • m_uidDAVC : C3DShatter
  • m_uidDlg : CDlg
  • m_uidElement : C3DShatter
  • m_uidError : CExcepEx
  • m_uidErrorIns : CExcepEx
  • m_uidFirst : CHTMLRadioGroup
  • m_uidFormatter : CHTMLStatic
  • m_uidHolder : CHTMLChooseColor
  • m_uidName : CScriptFn
  • m_uidRemedy : CExcepEx
  • m_uidRemedyIns : CExcepEx
  • m_undoMgr : CEngine
  • m_userPrefs : CMainWindow
  • m_var : CGameData
  • m_varNew : CGameDataAction
  • m_varOld : CGameDataAction
  • m_wDeactivateParam : CEngine
  • m_wTypeLibVerMajor : CFactoryData
  • m_wTypeLibVerMinor : CFactoryData
  • MainWndProc() : CMainWindow
  • MouseDown() : IEngineObjSite, CEngine
  • MouseMove() : IEngineObjSite, CEngine
  • MouseUp() : IEngineObjSite, CEngine
  • MoveBy() : CFragment
  • MoveToPile() : ISolpackFragment

- n -
  • nCmdID : CBrowserContainer
  • NumCards() : ISolpackPile
  • NumChildOf() : CXMLElement
  • NumGames() : ISolpackGameLib

- o -
  • ObjectsEqual() : CGameBase
  • OnCommand() : CMainWindow
  • OnCreate() : CMainWindow, CHelpPane
  • OnCreatePane() : CHelpPane
  • OnDestroy() : CMainWindow
  • OnDestroyPane() : CHelpPane
  • OnMenuSelect() : CMainWindow
  • OnNotify() : CHelpPane
  • OnSize() : CMainWindow, CHelpPane
  • OnSizePane() : CHelpPane
  • OnTreeIndex() : CCPSoundsDlg
  • operator &() : CPtr, CPidl, CKey
  • operator *() : CPtr, CPointer
  • operator BOOL() : CPtr, CPointer, CKey
  • operator BSTR() : CBSTR
  • operator HANDLE() : CHandle
  • operator HINSTANCE() : CLib
  • operator HKEY() : CKey
  • operator HWND() : CHWND
  • operator LPITEMIDLIST() : CPidl
  • operator LPTSTR() : CTSTR
  • operator T *() : CPtr, CPointer
  • operator!() : CPtr, CPointer, CKey
  • operator->() : CPtr, CPointer
  • operator=() : CBSTR, CTSTR, CPtr, CPointer, CKey
  • operator[]() : CArray
  • OptionsAppearanceProc() : CAppearanceDlg
  • OptionsGeneralProc() : CUserPrefs
  • OptionStatusBar() : IUserPrefsSite, CMainWindow
  • OptionTooltips() : IUserPrefsSite, CMainWindow

- p -
  • p : ISolpackGameLibVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl
  • pActiveObject : CBrowserContainer
  • Paint() : CHlinkWindow
  • PaneWndProc() : CHelpPane
  • pApp : ISolpackGameVtbl
  • pbCanDrag : ISolpackCardVtbl
  • pbFaceUp : ISolpackCardVtbl
  • pbShow : ISolpackFragmentVtbl, ISolpackPileVtbl
  • pbstrText : ISolpackFragmentVtbl, ISolpackPileVtbl
  • pbValid : CGameSpider, CGameLaBelleLucie, CGameBase, ISolpackGameVtbl
  • pCard : CGameSpider, CGameBase, ISolpackGameVtbl
  • pCardSrc : CGameSpider, CGameLaBelleLucie, CGameBase, ISolpackGameVtbl
  • pchURLIn : CBrowserContainer
  • pcmdtReserved : CBrowserContainer
  • pCommandTarget : CBrowserContainer
  • pctinfo : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl
  • pDest : ISolpackGameVtbl, ISolpackFragmentVtbl
  • pDispParams : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEventSink, CDispBase, INDUnknownAndDispatch
  • pdispparams : CScriptFn, CEventHandler
  • pdispReserved : CBrowserContainer
  • pDoc : CBrowserContainer
  • pExcepInfo : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEventSink, CDispBase, INDUnknownAndDispatch
  • pexecinfo : CScriptFn, CEventHandler
  • pfnCreate : tagGAMEDATA
  • pFrag : CGameSpider, CGameLaBelleLucie, CGameBase, ISolpackGameVtbl
  • pFrame : CBrowserContainer
  • pguidCmdGroup : CBrowserContainer
  • pHlinkMgr : CRegDlgInfo
  • Pile() : ISolpackCard
  • PileClicked() : ISolpackGame
  • PileReleaseElCapture() : CPile, ICardPileSite
  • PileSetElCapture() : CPile, ICardPileSite
  • PileToFrag() : CFragment
  • Play() : CCPSounds
  • PlayCPSound() : IPileSite, CMainWindow, CEngine, IEngineSite
  • PlayGame() : CEngine
  • plHeight : ISolpackFragmentVtbl, ISolpackPileVtbl, CPile
  • plpszProduct : CRegDlgInfo
  • plpszURL : CRegDlgInfo
  • plWidth : ISolpackFragmentVtbl, ISolpackPileVtbl, CPile
  • pObj : ISolpackFragmentVtbl
  • PostEnable() : IHTMLEnableSite
  • PostMsg() : CMainWindow, IEngineSite
  • pp : ISolpackAppVtbl, ISolpackCardVtbl
  • ppCard : ISolpackFragmentVtbl, ISolpackPileVtbl, CPile
  • ppchURLOut : CBrowserContainer
  • ppDoc : CBrowserContainer
  • ppDORet : CBrowserContainer
  • ppDropTarget : CBrowserContainer
  • ppGame : CGameLib, ISolpackGameLibVtbl
  • ppGameData : ISolpackAppVtbl
  • ppGameInfo : CGameLib, ISolpackGameLibVtbl
  • pPile : ISolpackGameVtbl
  • pPileDest : CGameSpider, CGameLaBelleLucie, CGameBase
  • pPileSrc : ISolpackGameVtbl
  • ppInfo : ISolpackGameVtbl
  • ppmk : CBrowserContainer
  • ppPile : ISolpackAppVtbl, CEngine
  • ppt : CBrowserContainer
  • pptinfo : CScriptFn, CEventHandler
  • ppTInfo : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEventSink, CDispBase
  • ppvObject : CGameLib, CGameInfo, CGameBase, ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CPile, CGameData, CEngine, CCard, CUnkBase, CScriptFn, CEventSink, CEventHandler, CDispBase, CFactory, CBrowserContainer
  • PreDisable() : IHTMLEnableSite
  • PreprocessMessage() : CMainWindow
  • PreprocessMsg() : CHlinkWindowMgr
  • PreReceiveCards() : CPile
  • PresentUpdate() : CMainWindow
  • ProcessMessage() : CSolpackApp, IMsgProcessor
  • pSite : CUpdateInfo
  • PtInPile() : CPile
  • puArgErr : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase
  • pUIWindow : CBrowserContainer
  • PURE : INDUnknown, INDUnknownAndDispatch
  • PushNewTurn() : CUndoMgr
  • PutCardInData() : CGameBase
  • PutLongInData() : CGameBase
  • pVarResult : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEventSink, CDispBase, INDUnknownAndDispatch
  • pvarResult : CScriptFn, CEventHandler

- r -
  • Rank() : ISolpackCard
  • ReadRegistry() : CUserPrefs
  • RecalcLayout() : ISolpackGame, CEngine
  • ReceiveCards() : CPile
  • ReclaimCards() : CDeck
  • RecordAction() : CUndoMgr
  • Redo() : CUndoMgr, CTurn, CAction
  • Refresh() : CLibMgr, CGameMenu
  • Register() : CSolpackApp, CMainWindow, CHelpPane, CHWND, CSplashWindow
  • RegisterAll() : CFactory
  • RegisterWindowClass() : CHWND
  • RegLibrary() : CLibMgr
  • Release() : CPtr
  • ReleaseElCapture() : CPile, CEngineObj, CCard
  • ReleaseLink() : CGameCommand
  • Remove() : CHTMLSelect
  • RemoveAll() : CArray
  • RemoveAt() : CPtrArray, CArray
  • RemoveFile() : CCompoundXMLDocument
  • RemoveRegMenuItem() : CMainWindow
  • Replace() : CHTMLSelect
  • Report() : CQuitExcep, CCOMExcep, COOMExcep, CExcepEx, CExcep
  • ResetChanged() : CHTMLSelect, CHTMLRadioGroup, CHTMLEdit, CHTMLControl, CHTMLChooseColor, CHTMLChk
  • rgdispid : CScriptFn, CEventHandler
  • rgDispId : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CEventSink, CDispBase
  • RgnInPile() : CPile
  • rgszNames : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch
  • riid : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch, CFactory
  • Rules() : ISolpackGameInfo
  • Run() : CSolpackApp, CDlg

- s -
  • s1 : _IID
  • s2 : _IID
  • s_aGameData : CGameLib
  • s_auidDisplays : CUserPrefs
  • s_auidSounds : CUserPrefs
  • s_bRegistered : CMainWindow, CHelpPane
  • s_cServerLocks : CFactory
  • s_hcurPrev : CWaitCursor
  • s_hcurWait : CWaitCursor
  • s_nWaitCursorCount : CWaitCursor
  • Save() : CCPSounds
  • SaveToFile() : CXMLDocument
  • SBSetText() : IStatusBarMgr, CMainWindow
  • SBUpdateTasks() : IStatusBarMgr, CMainWindow
  • Score() : ISolpackApp
  • ScoreCard() : CGameLaBelleLucie
  • SendMessage() : CHWND
  • SetAt() : CPtrArray, CArray
  • SetAtGrow() : CArray
  • SetCancelAnim() : CFragment
  • SetCanRecord() : CUndoMgr
  • SetCardIndex() : CPile, ICardPileSite
  • SetCheck() : CHTMLChk
  • SetChecked() : CHTMLRadioGroup
  • SetCheckUpdate() : CMainWindow, IUpdateDlgSite
  • SetColor() : CHTMLChooseColor
  • SetDestAndIndex() : CFragmentAddCard, CFragmentAddPile, CFragmentAdd
  • SetElCapture() : CPile, CEngineObj, CCard
  • SetElText() : CHTMLHelper
  • SetElTextWithEl() : CHTMLHelper
  • SetEventHandlers() : CEngineObj
  • SetFocus() : CBrowserContainer
  • SetGame() : CHelpPane
  • SetHelpText() : CStatusBar
  • SetIndex() : CCard
  • SetInstr() : CHelpPane
  • SetLocation() : CBrowserContainer
  • SetMouseState() : CEngine
  • SetParamIsUnk() : CHTMLControl
  • SetPile() : CCard
  • SetPosition() : CCard
  • SetProgress() : CStatusBar
  • SetRelease() : CPtrArray
  • SetScore() : CStatusBar, CMainWindow, IEngineSite
  • SetSelected() : CHTMLSelect
  • SetSite() : CUserPrefs
  • SetSize() : CArray
  • SetSound() : CCPSoundsDlg
  • SetState() : CEngine
  • SetStatusText() : CStatusBar
  • SetStrAttr() : CXMLElement
  • SetText() : CXMLElement
  • Setup() : CFragmentAddCard, CFragmentAddPile, CFragmentAdd
  • SetupFragment() : ISolpackGame
  • SetVisible() : CBrowserContainer
  • SetVTAttr() : CXMLElement
  • Show() : CGameMenu
  • ShowElement() : CHTMLHelper
  • ShowElementEx() : CHTMLHelper
  • ShowHelp() : CHelpMgr
  • ShowHideEngine() : CMainWindow
  • ShowHideGameMenu() : CMainWindow
  • ShowNumCardsTooltip() : ISolpackPile
  • ShowPopup() : CHelpMgr
  • ShowWindow() : CHWND
  • Shuffle() : ISolpackPile
  • SpacingX() : ISolpackApp
  • SpacingY() : ISolpackApp
  • SpewCallback() : ICompoundXMLDocumentSite
  • SpewFile() : CCompoundXMLDocument
  • SpewFiles() : CCompoundXMLDocument
  • SplashWndProc() : CSplashWindow
  • STDMETHOD() : CGameSpider, CGameLib, CGameLaBelleLucie, CGameInfo, CGameBase, CPile, CGameData, CFragment, CEngine, CCard, CUnkBase, INDUnknown, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch, CFactory, CBrowserContainer
  • STDMETHOD_() : CUnkBase, INDUnknown, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch, CFactory
  • StopPlayGame() : CEngine
  • Suit() : ISolpackCard

- t -
  • TestPrevInstance() : CLimitSingleInstance
  • Title() : ISolpackGameInfo
  • ToggleFace() : CCard
  • ToggleShowRules() : CMainWindow, IGameMenuSite
  • TooltipPrefChanged() : CPile
  • TransferCards() : CPile
  • TranslateKey() : CBrowserContainer
  • TryAddPile() : CFragment
  • TryCommand() : CEngine
  • TryUpdateColor() : CAppearanceDlg
  • Type() : ISolpackPile

- u -
  • uidDescHolder : CFactoryData
  • uidDescRoot : CFactoryData
  • uidProgIDHolder : CFactoryData
  • uidProgIDRoot : CFactoryData
  • uidProgIDVIHolder : CFactoryData
  • uidStrBase : CFactoryData
  • ULONG() : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl
  • Undo() : CUndoMgr, CTurn, CAction
  • UndoAction() : CPile, CGameData, CFragment, CEngine, CCard, IActionSite
  • Uninit() : CGameMenu, CGameCommandMgr, CEngine, CBrowserContainer
  • Uninitialize() : ISolpackGame
  • Unregister() : CSolpackApp
  • UnregisterAll() : CFactory
  • upcount() : CRefCount
  • UpdateAppearance() : CUserPrefs
  • UpdateBaseImg() : CPile
  • UpdateColors() : CHelpPane
  • UpdateDims() : CPile
  • UpdateDone() : CMainWindow, IUpdateSite
  • UpdateFont() : CHelpPane
  • UpdateImg() : CCard
  • UpdateInstr() : CMainWindow
  • UpdateLayout() : CGameSpider, CGameLaBelleLucie, CGameBase, CPile
  • UpdatePilePositions() : CGameLaBelleLucie
  • UpdateTooltip() : CPile
  • UpdateTooltips() : CEngine

- v -
  • v : ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl

- w -
  • WebSite() : ISolpackGameLib
  • wFlags : ISolpackGameLibVtbl, ISolpackGameVtbl, ISolpackAppVtbl, ISolpackGameDataVtbl, ISolpackGameInfoVtbl, ISolpackCardVtbl, ISolpackFragmentVtbl, ISolpackPileVtbl, CScriptFn, CEventSink, CEventHandler, CDispBase, INDUnknownAndDispatch
  • Width() : ISolpackPile
  • WidthWith() : ISolpackPile
  • WindowHeight() : ISolpackApp
  • WindowWidth() : ISolpackApp
  • WriteRegistry() : CUserPrefs

- x -
  • X() : ISolpackPile
  • x : _IID, tagDPAIR
  • XMLDone() : IXMLDocumentSite, CUpdateInfo, CCompoundXMLDocument

- y -
  • Y() : ISolpackPile
  • y : tagDPAIR

- ~ -
  • ~C3DShatter() : C3DShatter
  • ~CAboutDlg() : CAboutDlg
  • ~CAction() : CAction
  • ~CAppearanceDlg() : CAppearanceDlg
  • ~CArray() : CArray
  • ~CBSTR() : CBSTR
  • ~CCard() : CCard
  • ~CCardIndexAction() : CCardIndexAction
  • ~CCompoundXMLDocument() : CCompoundXMLDocument
  • ~CCPSoundsDlg() : CCPSoundsDlg
  • ~CDeck() : CDeck
  • ~CDispBase() : CDispBase
  • ~CDlg() : CDlg
  • ~CEngine() : CEngine
  • ~CEngineObj() : CEngineObj
  • ~CFragment() : CFragment
  • ~CFragmentAction() : CFragmentAction
  • ~CGameBase() : CGameBase
  • ~CGameCommand() : CGameCommand
  • ~CGameCommandMgr() : CGameCommandMgr
  • ~CGameData() : CGameData
  • ~CGameDataAction() : CGameDataAction
  • ~CGameInfo() : CGameInfo
  • ~CGameLaBelleLucie() : CGameLaBelleLucie
  • ~CGameLib() : CGameLib
  • ~CGameMenu() : CGameMenu
  • ~CGameMenuItem() : CGameMenuItem
  • ~CGameSpider() : CGameSpider
  • ~CHandle() : CHandle
  • ~CHelpMgr() : CHelpMgr
  • ~CHelpPane() : CHelpPane
  • ~CHlinkWindow() : CHlinkWindow
  • ~CHlinkWindowMgr() : CHlinkWindowMgr
  • ~CHTMLChk() : CHTMLChk
  • ~CHTMLChooseColor() : CHTMLChooseColor
  • ~CHTMLControl() : CHTMLControl
  • ~CHTMLEdit() : CHTMLEdit
  • ~CHTMLEnable() : CHTMLEnable
  • ~CHTMLLink() : CHTMLLink
  • ~CHTMLSelect() : CHTMLSelect
  • ~CHTMLStatic() : CHTMLStatic
  • ~CHWND() : CHWND
  • ~CKey() : CKey
  • ~CLib() : CLib
  • ~CLibMgr() : CLibMgr
  • ~CMainWindow() : CMainWindow
  • ~CPidl() : CPidl
  • ~CPile() : CPile
  • ~CPileCommentAction() : CPileCommentAction
  • ~CPileShuffleAction() : CPileShuffleAction
  • ~CPointer() : CPointer
  • ~CPtr() : CPtr
  • ~CPtrArray() : CPtrArray
  • ~CRefCount() : CRefCount
  • ~CRegDlgInfo() : CRegDlgInfo
  • ~CShellDataObj() : CShellDataObj
  • ~CSolpackApp() : CSolpackApp
  • ~CSplashWindow() : CSplashWindow
  • ~CStatusBar() : CStatusBar
  • ~CTechSupportDlg() : CTechSupportDlg
  • ~CTSTR() : CTSTR
  • ~CTurn() : CTurn
  • ~CUndoMgr() : CUndoMgr
  • ~CUnkBase() : CUnkBase
  • ~CUserPrefs() : CUserPrefs
  • ~CVariant() : CVariant
  • ~CWaitCursor() : CWaitCursor
  • ~CXMLDocument() : CXMLDocument
Generated on Wed May 8 12:39:29 2002 for Solitaire Pack by doxygen 1.2.15


SolpackLib Namespace Reference

Compounds

interface | ISolpackApp
interface | ISolpackCard
interface | ISolpackFragment
interface | ISolpackGame
interface | ISolpackGameData
interface | ISolpackGameInfo
interface | ISolpackGameLib
interface | ISolpackPile

Typedefs

typedef enum SolpackLib::tagSOLPACKRANK | SOLPACKRANK
typedef enum SolpackLib::tagSOLPACKSUIT | SOLPACKSUIT
typedef enum SolpackLib::tagSOLPACKDIFFICULTY | SOLPACKDIFFICULTY
typedef enum SolpackLib::tagSOLPACKPILETYPE | SOLPACKPILETYPE
typedef enum SolpackLib::tagSOLPACKBASETYPE | SOLPACKBASETYPE

Enumerations

enum tagSOLPACKRANK {
RANK_ACE = 1, RANK_2 = 2, RANK_3 = 3, RANK_4 = 4,
RANK_5 = 5, RANK_6 = 6, RANK_7 = 7, RANK_8 = 8,
RANK_9 = 9, RANK_10 = 10, RANK_JACK = 11, RANK_QUEEN = 12,
RANK_KING = 13
}
enum | tagSOLPACKSUIT { SUIT_CLUB = 1, SUIT_DIAMOND = 2, SUIT_HEART = 3, SUIT_SPADE = 4 }
enum | tagSOLPACKDIFFICULTY
enum tagSOLPACKPILETYPE {
deck, position, PILE_DECK = 1, single,
cards, PILE_STACK = 2, cards, PILE_TABLEAURIGHT = 3,
cards, PILE_TABLEAUDOWN = 4, single, PILE_TALON = 5,
cards, PILE_TALON3 = 6, cards, PILE_FRAGMENT = 7
}
enum tagSOLPACKBASETYPE {
BASE_NONE = 0, frame, BASE_FRAME = 1, BASE_FOUNDATION = 2,
circle, BASE_REDEAL = 3, X, BASE_NOREDEAL = 4
}

Functions

importlib ("stdole32.tlb")

Typedef Documentation

typedef enum SolpackLib::tagSOLPACKBASETYPE SOLPACKBASETYPE

typedef enum SolpackLib::tagSOLPACKDIFFICULTY SOLPACKDIFFICULTY

typedef enum SolpackLib::tagSOLPACKPILETYPE SOLPACKPILETYPE

typedef enum SolpackLib::tagSOLPACKRANK SOLPACKRANK

typedef enum SolpackLib::tagSOLPACKSUIT SOLPACKSUIT

Enumeration Type Documentation

enum tagSOLPACKBASETYPE

Enumeration values:
BASE_NONE
frame
BASE_FRAME
BASE_FOUNDATION
circle
BASE_REDEAL
X
BASE_NOREDEAL

Definition at line 149 of file Solpack.idl.

00150 {
00151    [helpstring("No base image is shown.")]
00152    BASE_NONE         = 0,
00153
00154    [helpstring("A simple frame, commonly used for tableau piles.")]
00155    BASE_FRAME        = 1,
00156
00157    [helpstring("A dot-filled frame commonly used for foundations.")]
00158    BASE_FOUNDATION   = 2,
00159
00160    [helpstring("A frame with a circle, commonly used to represent a pile that can be cycled through again.")]
00161    BASE_REDEAL       = 3,
00162
00163    [helpstring("A frame with an X, commonly used to represent a pile that cannot be cycled through again.")]
00164    BASE_NOREDEAL     = 4
00165
00166 } SOLPACKBASETYPE;

enum tagSOLPACKDIFFICULTY

Definition at line 93 of file Solpack.idl.

00094 {
00095    [helpstring("The game is typically won at least one out of three times.")]
00096    DIFFICULTY_EASY   = 1,
00097
00098    [helpstring("The game is typically won once every four to ten times.")]
00099    DIFFICULTY_MEDIUM = 2,
00100
00101    [helpstring("The game is typically won less than once for every ten times.")]
00102    DIFFICULTY_HARD   = 3
00103
00104 } SOLPACKDIFFICULTY;

enum tagSOLPACKPILETYPE

Enumeration values:
deck
position
PILE_DECK
single
cards
PILE_STACK
cards
PILE_TABLEAURIGHT
cards
PILE_TABLEAUDOWN
single
PILE_TALON
cards
PILE_TALON3
cards
PILE_FRAGMENT

Definition at line 115 of file Solpack.idl.

00116 {
00117    [helpstring("The pile is a deck, created initially with 52 card objects. All cards are positioned at position (0,0).")]
00118    PILE_DECK         = 1,
00119
00120    [helpstring("A single, squared-up stack of cards, where every 8th card is offset to present a 3D stack look.")]
00121    PILE_STACK        = 2,
00122
00123    [helpstring("A spread pile of cards, in which all are visible. The spread is horizontal; the right-most card is on top.")]
00124    PILE_TABLEAURIGHT = 3,
00125
00126    [helpstring("A spread pile of cards, in which all are visible. The spread is vertical; the bottom-most card is on top.")]
00127    PILE_TABLEAUDOWN  = 4,
00128
00129    [helpstring("A single, squared-up stack of cards as turned up from a stack.")]
00130    PILE_TALON        = 5,
00131
00132    [helpstring("A stack of cards, as turned up three at a time from a stack.")]
00133    PILE_TALON3       = 6,
00134
00135    [helpstring("A fragment of cards, with no specific layout.")]
00136    PILE_FRAGMENT     = 7
00137
00138 } SOLPACKPILETYPE;

enum tagSOLPACKRANK

Enumeration values:
RANK_ACE
RANK_2
RANK_3
RANK_4
RANK_5
RANK_6
RANK_7
RANK_8
RANK_9
RANK_10
RANK_JACK
RANK_QUEEN
RANK_KING

Definition at line 50 of file Solpack.idl.

00051 {
00052    RANK_ACE    = 1,
00053    RANK_2      = 2,
00054    RANK_3      = 3,
00055    RANK_4      = 4,
00056    RANK_5      = 5,
00057    RANK_6      = 6,
00058    RANK_7      = 7,
00059    RANK_8      = 8,
00060    RANK_9      = 9,
00061    RANK_10     = 10,
00062    RANK_JACK   = 11,
00063    RANK_QUEEN  = 12,
00064    RANK_KING   = 13
00065 } SOLPACKRANK;

enum tagSOLPACKSUIT

Enumeration values:
SUIT_CLUB
SUIT_DIAMOND
SUIT_HEART
SUIT_SPADE

Definition at line 76 of file Solpack.idl.

00077 {
00078    SUIT_CLUB      = 1,
00079    SUIT_DIAMOND   = 2,
00080    SUIT_HEART     = 3,
00081    SUIT_SPADE     = 4
00082 } SOLPACKSUIT;

Function Documentation

importlib ( "stdole32.tlb" )

Generated on Wed May 8 12:40:23 2002 for Solitaire Pack by doxygen 1.2.15


SPGamesLib Namespace Reference

Functions

importlib ("..\Release\solpack.tlb")

Function Documentation

importlib ( "..\Release\solpack.tlb" )

Generated on Wed May 8 12:40:26 2002 for Solitaire Pack by doxygen 1.2.15


File Member Index

Solitaire Pack File Members

_ | a | b | c | d | e | f | g | h | i | l | m | n | o | p | r | s | t | u | w | x

Here is a list of all file members with links to the files they belong to:

- _ -

  • __MIDL_itf_Solpack_0000_v0_0_c_ifspec : Solpack.h
  • __MIDL_itf_Solpack_0000_v0_0_s_ifspec : Solpack.h
  • __MIDL_itf_SPGames_0000_v0_0_c_ifspec : SPGames.h
  • __MIDL_itf_SPGames_0000_v0_0_s_ifspec : SPGames.h
  • __REQUIRED_RPCNDR_H_VERSION__ : SPGames.h, Solpack.h
  • _ASSERT : bmws_common.h
  • _WIN32_IE : SPGames/StdAfx.h, Solpack/StdAfx.h

- a -
  • ACTION_BASETYPE : Pile.cpp
  • ACTION_CANDRAG : Card.cpp
  • ACTION_COMMENT : Pile.cpp
  • ACTION_DISABLECMD : Engine.cpp
  • ACTION_ENABLECMD : Engine.cpp
  • ACTION_FACEUP : Card.cpp
  • ACTION_FRAGMENT : Fragment.cpp
  • ACTION_INDEX : Card.cpp
  • ACTION_PILEX : Pile.cpp
  • ACTION_PILEY : Pile.cpp
  • ACTION_SCORE : Engine.cpp
  • ACTION_SHOWNUMCARDS : Pile.cpp
  • ACTION_SHUFFLE : Pile.cpp
  • AFX_ABOUTDLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_ : AboutDlg.h
  • AFX_ACTION_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Action.h
  • AFX_BMWS_3DSHATTER_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_3dshatter.h
  • AFX_BMWS_ARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_array.h
  • AFX_BMWS_BASE64_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_base64.h
  • AFX_BMWS_BOOLARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_boolarray.h
  • AFX_BMWS_BROWSERCONTAINER_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_ : bmws_browsercontainer.h
  • AFX_BMWS_CHOOSECOLOR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_choosecolor.h
  • AFX_BMWS_CLEARDIR_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_cleardir.h
  • AFX_BMWS_COMMON_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_common.h
  • AFX_BMWS_COMPOUND_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_compound_xml.h
  • AFX_BMWS_COMSERVER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_comserver.h
  • AFX_BMWS_CPSOUNDS_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_cpsounds.h
  • AFX_BMWS_DISPBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_ : bmws_dispbase.h
  • AFX_BMWS_DLG_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_ : bmws_dlg.h
  • AFX_BMWS_DWORDARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_dwordarray.h
  • AFX_BMWS_ERROR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_error.h
  • AFX_BMWS_EVENTHANDLER_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_eventhandler.h
  • AFX_BMWS_EVENTSINK_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_eventsink.h
  • AFX_BMWS_HANDLE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_handle.h
  • AFX_BMWS_HLINK_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_ : bmws_hlink.h
  • AFX_BMWS_KEY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_key.h
  • AFX_BMWS_LIB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_lib.h
  • AFX_BMWS_LIMITSINGLEINSTANCE_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_limitsingleinstance.h
  • AFX_BMWS_MULTIOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_multiofn.h
  • AFX_BMWS_OFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_ofn.h
  • AFX_BMWS_PIDL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_pidl.h
  • AFX_BMWS_POINTER_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_pointer.h
  • AFX_BMWS_PTR_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_ptr.h
  • AFX_BMWS_REGISTRY_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_registry.h
  • AFX_BMWS_REGSERVICES_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_regservices.h
  • AFX_BMWS_RESURL_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_resurl.h
  • AFX_BMWS_SCRIPTFN_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_scriptfn.h
  • AFX_BMWS_SINGLEOFN_H__A9408652_147E_11D4_82FF_4491FCC00000__INCLUDED_ : bmws_singleofn.h
  • AFX_BMWS_SPLASHWINDOW_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_ : bmws_splashscreen.h
  • AFX_BMWS_STRING_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_string.h
  • AFX_BMWS_STRINGARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_stringarray.h
  • AFX_BMWS_TLB_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_tlb.h
  • AFX_BMWS_TRACKMEMALLOC_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_trackmemalloc.h
  • AFX_BMWS_UINTARRAY_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_uintarray.h
  • AFX_BMWS_UNKBASE_H__753CFFC0_5B20_11D4_82FF_0020780D1875__INCLUDED_ : bmws_unkbase.h
  • AFX_BMWS_VARIANT_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : bmws_variant.h
  • AFX_BMWS_WAITCURSOR_H__A291080B_C857_11D3_82FD_4481FCC00000__INCLUDED_ : bmws_waitcursor.h
  • AFX_BMWS_WINDOW_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_window.h
  • AFX_BMWS_XML_H__3CDDF722_1835_11D4_82FF_44A1FCC00000__INCLUDED_ : bmws_xml.h
  • AFX_CARD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Card.h
  • AFX_CPSOUNDSIDS_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : CPSoundsIDs.h
  • AFX_DECK_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Deck.h
  • AFX_ENGINE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Engine.h
  • AFX_ENGINEOBJ_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : EngineObj.h
  • AFX_FRAGMENT_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Fragment.h
  • AFX_FRAGMENTADD_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : FragmentAdd.h
  • AFX_GAMEBASE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameBase.h
  • AFX_GAMECOMMANDMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : GameCommandMgr.h
  • AFX_GAMEDATA_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : GameData.h
  • AFX_GAMEIDS_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameIDs.h
  • AFX_GAMEINFO_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameInfo.h
  • AFX_GAMELIB_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameLib.h
  • AFX_GAMEMENU_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : GameMenu.h
  • AFX_GAMEMENUITEM_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : GameMenuItem.h
  • AFX_GAMESPIDER_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameSpider.h
  • AFX_HELPPANE_H__60FA5C63_084E_11D6_8301_0020780D1875__INCLUDED_ : HelpPane.h
  • AFX_LABELLELUCIE_H__85C0DAE2_CF11_11D5_8301_0020780D1875__INCLUDED_ : GameLaBelleLucie.h
  • AFX_LIBMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : LibMgr.h
  • AFX_MAINWINDOW_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_ : MainWindow.h
  • AFX_PILE_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Pile.h
  • AFX_PROCESSMSG_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : ProcessMsg.h
  • AFX_SOLPACKAPP_H__70E0AC02_D442_11D5_8301_0020780D1875__INCLUDED_ : SolpackApp.h
  • AFX_SOLPACKARRAYS_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_ : SolpackArrays.h
  • AFX_SOLPACKDID_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_ : solpackdid.h
  • AFX_SOLPACKINCL_H__81856162_A12D_11D5_8301_0020780D1875__INCLUDED_ : SolpackIncl.h
  • AFX_SOLPACKINTERNAL_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : SolpackInternal.h
  • AFX_STATUSBAR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : StatusBar.h
  • AFX_STATUSBARMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : StatusBarMgr.h
  • AFX_STDAFX_H__1F7F8C70_CF00_11D5_8301_0020780D1875__INCLUDED_ : SPGames/StdAfx.h
  • AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ : Solpack/StdAfx.h
  • AFX_TURN_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : Turn.h
  • AFX_UNDOMGR_H__9137B6C3_CFDC_11D5_8301_0020780D1875__INCLUDED_ : UndoMgr.h
  • AFX_USERPREFS_H__A6E2FB60_0844_11d6_8301_0020780D1875__INCLUDED_ : UserPrefs.h
  • ANIM_3DSHATTER_NODAVC : bmws_3dshatter.h
  • ANIM_3DSHATTER_NOTRANSFORM : bmws_3dshatter.h
  • ANIM_3DSHATTER_OK : bmws_3dshatter.h
  • ANIM_3DSHATTER_OTHER : bmws_3dshatter.h
  • ARRAYSIZE : bmws_common.h

- b -
  • Base64ToBinary() : bmws_base64.h, bmws_base64.cpp
  • BASE_FOUNDATION : Solpack.h
  • BASE_FRAME : Solpack.h
  • BASE_NONE : Solpack.h
  • BASE_NOREDEAL : Solpack.h
  • BASE_REDEAL : Solpack.h
  • BCINTERNALERR : bmws_browsercontainer.cpp
  • BinaryToBase64() : bmws_base64.h, bmws_base64.cpp
  • BMWS_APP_VER : SPGames/StdAfx.h, Solpack/StdAfx.h
  • BMWS_APPID : SPGames/StdAfx.h, Solpack/StdAfx.h
  • BMWS_BROWSERCONTAINER_GETLOCATION : Solpack/StdAfx.h
  • BMWS_COMPOUND_XML_CONTENTS : bmws_compound_xml.h
  • BMWS_COMPOUND_XML_RENAME : bmws_compound_xml.h
  • BMWS_COMPOUND_XML_SPEW : bmws_compound_xml.h
  • BMWS_ERROR_DLL : SPGames/StdAfx.h
  • BMWS_ERROR_INCLUDEIE : Solpack/StdAfx.h
  • BMWS_HH_ADDSTYLE : bmws_htmlhelpers.cpp
  • BMWS_HH_CREATEELEMENT : bmws_htmlhelpers.cpp
  • BMWS_HH_DOCWRITE : bmws_htmlhelpers.cpp
  • BMWS_HH_ENABLE : bmws_htmlhelpers.cpp
  • BMWS_HH_FOCUSELEMENT : bmws_htmlhelpers.cpp
  • BMWS_HH_GETCLIPBOARDDATA : bmws_htmlhelpers.cpp
  • BMWS_HH_GETEVENT : bmws_htmlhelpers.cpp
  • BMWS_HH_GETRULESTYLE : bmws_htmlhelpers.cpp
  • BMWS_HH_GETSTYLE : bmws_htmlhelpers.cpp
  • BMWS_HH_GETTEXT : bmws_htmlhelpers.cpp
  • BMWS_HH_PROTECTUI : bmws_htmlhelpers.cpp
  • BMWS_HH_SETTEXT : bmws_htmlhelpers.cpp
  • BMWS_HH_SHOWELEMENT : bmws_htmlhelpers.cpp
  • BMWS_HTMLHELPERS_ADDSTYLE : Solpack/StdAfx.h
  • BMWS_HTMLHELPERS_INCLUDEELINT : Solpack/StdAfx.h
  • BMWS_HTMLHELPERS_PROTECTUI : Solpack/StdAfx.h
  • BMWS_REGISTRY_SETKEYANDVALUE : SPGames/StdAfx.h
  • BMWS_STRING_DLGITEM : Solpack/StdAfx.h
  • BMWS_STRING_EXTRACTSUBSTRING : Solpack/StdAfx.h
  • BMWS_USEDISPBASE : SPGames/StdAfx.h, Solpack/StdAfx.h
  • BMWS_USEEVENTHANDLER : Solpack/StdAfx.h
  • BMWS_USEEVENTSINK : Solpack/StdAfx.h
  • BMWS_USEPOINTER : Solpack/StdAfx.h
  • BMWS_USEUNKBASE : Solpack/StdAfx.h
  • BMWS_WINDOWPLACEMENT : Solpack/StdAfx.h
  • BMWS_XML_MINIMAL : Solpack/StdAfx.h
  • BMWSMemAlloc() : bmws_trackmemalloc.h, bmws_trackmemalloc.cpp
  • BMWSMemFree() : bmws_trackmemalloc.h, bmws_trackmemalloc.cpp
  • BMWSMemInit() : bmws_trackmemalloc.h, bmws_trackmemalloc.cpp
  • BMWSMemUninit() : bmws_trackmemalloc.h, bmws_trackmemalloc.cpp

- c -
  • CARDHEIGHT : Solpack/StdAfx.h
  • CARDWIDTH : Solpack/StdAfx.h
  • CATCHALL : bmws_error.h
  • CATCHCOM : bmws_error.h
  • CATCHOOM : bmws_error.h
  • CATCHOTHER : bmws_error.h
  • CATID_SolpackGameLibs : Solpack_catid.c
  • CBOOLArray : bmws_boolarray.h
  • CCompoundXMLDocumentPtr : bmws_compound_xml.h
  • CDispatchPtr : bmws_ptr.h
  • CDWORDArray : bmws_dwordarray.h
  • CHECKCOMOOM : bmws_error.h
  • CHECKFOROOM : bmws_error.h
  • CheckForUpdate() : bmws_update.h, bmws_update.cpp
  • CHECKHR : bmws_error.h
  • CHECKHRCOM : bmws_error.h
  • CheckHRCom() : bmws_error.h, bmws_error.cpp
  • CHECKPTR : bmws_common.h
  • CHILDOF_CREATEIFNOTFOUND : bmws_xml.h
  • CHILDOF_FAILIFNOTFOUND : bmws_xml.h
  • CHILDOF_NULLIFNOTFOUND : bmws_xml.h
  • CHlinkWindowMgrPtr : bmws_hlink.h
  • CHlinkWindowPtrArray : bmws_hlink.h
  • ChooseColorDialogHook() : bmws_choosecolor.cpp
  • ChooseColorEx() : bmws_choosecolor.h, bmws_choosecolor.cpp
  • ChooseColorReadReg() : bmws_choosecolor.h, bmws_choosecolor.cpp
  • ChooseColorWriteReg() : bmws_choosecolor.h, bmws_choosecolor.cpp
  • CHTMLElement2Ptr : bmws_htmlhelpers.h
  • CHTMLElementPtr : bmws_htmlhelpers.h
  • CHTMLEventObjPtr : bmws_htmlhelpers.h
  • CHTMLImgElementPtr : bmws_htmlhelpers.h
  • CHTMLRuleStylePtr : bmws_htmlhelpers.h
  • CHTMLStyleElementPtr : bmws_htmlhelpers.h
  • CHTMLStylePtr : bmws_htmlhelpers.h
  • CHTMLStyleSheetPtr : bmws_htmlhelpers.h
  • CHTMLWindow3Ptr : bmws_htmlhelpers.h
  • CHWNDPtr : bmws_window.h
  • CleanupCheckForUpdate() : bmws_update.h, bmws_update.cpp
  • ClearDirectory() : bmws_cleardir.h, bmws_cleardir.cpp
  • CLSID : SPGames_i.c, Solpack_i.c, Solpack_catid.c, SolpackInternal_i.c
  • CLSID_CrShatter : bmws_3dshatter.cpp
  • CLSID_SPGames : SPGames.h
  • COMPOUND_XML_MAXFILESIZE : bmws_compound_xml.cpp
  • COMPOUNDXMLINTERNALEXCEP : bmws_compound_xml.cpp
  • ConstructElements() : bmws_array.h
  • CopyElements() : bmws_array.h
  • CPSOUNDS_DROP : CPSoundsIDs.h
  • CPSOUNDS_FLIP : CPSoundsIDs.h
  • CPSOUNDS_SHUFFLE : CPSoundsIDs.h
  • CPSOUNDS_WON : CPSoundsIDs.h
  • CREATEGAMEFN : GameInfo.h
  • CreateResURL() : bmws_resurl.h, bmws_resurl.cpp
  • CShellDataObjPtr : bmws_shelldataobj.h
  • CSolpackAppPtr : SolpackIncl.h
  • CSolpackCardArray : SolpackArrays.h
  • CSolpackCardPtr : SolpackIncl.h
  • CSolpackFragmentPtr : SolpackIncl.h
  • CSolpackGameDataArray : SolpackArrays.h
  • CSolpackGameDataPtr : SolpackIncl.h
  • CSolpackGameInfoPtr : SolpackIncl.h
  • CSolpackGameLibPtr : SolpackIncl.h
  • CSolpackGamePtr : SolpackIncl.h
  • CSolpackPileArray : SolpackArrays.h
  • CSolpackPilePtr : SolpackIncl.h
  • CTSTRArray : bmws_stringarray.h
  • CUINTArray : bmws_uintarray.h
  • CUnknownPtr : bmws_ptr.h
  • cvt_ascii() : bmws_base64.cpp
  • CWebBrowser2Ptr : bmws_browsercontainer.h
  • CX_STACKSPC : Pile.cpp
  • CX_TABLEAURIGHTSPC : Pile.cpp
  • CX_TALON3SPC : Pile.cpp
  • CXMLDocumentPtr : bmws_xml.h
  • CXMLElementPtr : bmws_xml.h
  • CXY_SPLITTER : HelpPane.cpp
  • CY_BROWSER_MIN : MainWindow.cpp
  • CY_HELPPANE_DEFAULT : UserPrefs.cpp
  • CY_HELPPANE_MIN : UserPrefs.cpp, MainWindow.cpp
  • CY_STACKSPC : Pile.cpp
  • CY_TABLEAUDOWNSPC : Pile.cpp
  • CY_TALON3SPC : Pile.cpp

- d -
  • DECLARE_IUNKNOWN : bmws_unkbase.h
  • DECLARE_IUNKNOWN_AND_IDISPATCH : bmws_dispbase.h
  • DEFAULTBKCOLOR : UserPrefs.cpp
  • DEFAULTTEXTCOLOR : UserPrefs.cpp
  • DEFINE_GUID() : Solpack.idl, Solpack.h, SolpackInternal.h
  • DestructElements() : bmws_array.h
  • DIFFICULTY_EASY : Solpack.h
  • DIFFICULTY_HARD : Solpack.h
  • DIFFICULTY_MEDIUM : Solpack.h
  • DISPID_SOLPACK_APP : solpackdid.h
  • DISPID_SOLPACK_APP_ADDGAMECOMMAND : solpackdid.h
  • DISPID_SOLPACK_APP_CARDHEIGHT : solpackdid.h
  • DISPID_SOLPACK_APP_CARDWIDTH : solpackdid.h
  • DISPID_SOLPACK_APP_CREATEGAMEDATA : solpackdid.h
  • DISPID_SOLPACK_APP_CREATEPILE : solpackdid.h
  • DISPID_SOLPACK_APP_ENABLEGAMECOMMAND : solpackdid.h
  • DISPID_SOLPACK_APP_FRAGMENT : solpackdid.h
  • DISPID_SOLPACK_APP_GAMEWON : solpackdid.h
  • DISPID_SOLPACK_APP_SCORE : solpackdid.h
  • DISPID_SOLPACK_APP_SPACINGX : solpackdid.h
  • DISPID_SOLPACK_APP_SPACINGY : solpackdid.h
  • DISPID_SOLPACK_APP_WINDOWHEIGHT : solpackdid.h
  • DISPID_SOLPACK_APP_WINDOWWIDTH : solpackdid.h
  • DISPID_SOLPACK_CARD : solpackdid.h
  • DISPID_SOLPACK_CARD_CANDRAG : solpackdid.h
  • DISPID_SOLPACK_CARD_FACEUP : solpackdid.h
  • DISPID_SOLPACK_CARD_ID : solpackdid.h
  • DISPID_SOLPACK_CARD_INDEX : solpackdid.h
  • DISPID_SOLPACK_CARD_PILE : solpackdid.h
  • DISPID_SOLPACK_CARD_RANK : solpackdid.h
  • DISPID_SOLPACK_CARD_SUIT : solpackdid.h
  • DISPID_SOLPACK_FRAGMENT : solpackdid.h
  • DISPID_SOLPACK_FRAGMENT_ADDTOFRAGMENT : solpackdid.h
  • DISPID_SOLPACK_FRAGMENT_MOVETOPILE : solpackdid.h
  • DISPID_SOLPACK_GAME : solpackdid.h
  • DISPID_SOLPACK_GAME_AUTOPLAY : solpackdid.h
  • DISPID_SOLPACK_GAME_AUTOPLAYCARD : solpackdid.h
  • DISPID_SOLPACK_GAME_CANCELMOVE : solpackdid.h
  • DISPID_SOLPACK_GAME_DEAL : solpackdid.h
  • DISPID_SOLPACK_GAME_DROPFRAGMENT : solpackdid.h
  • DISPID_SOLPACK_GAME_HANDLECOMMAND : solpackdid.h
  • DISPID_SOLPACK_GAME_INFO : solpackdid.h
  • DISPID_SOLPACK_GAME_INITIALIZE : solpackdid.h
  • DISPID_SOLPACK_GAME_PILECLICKED : solpackdid.h
  • DISPID_SOLPACK_GAME_RECALCLAYOUT : solpackdid.h
  • DISPID_SOLPACK_GAME_SETUPFRAGMENT : solpackdid.h
  • DISPID_SOLPACK_GAME_UNINITIALIZE : solpackdid.h
  • DISPID_SOLPACK_GAMEDATA : solpackdid.h
  • DISPID_SOLPACK_GAMEDATA_DATA : solpackdid.h
  • DISPID_SOLPACK_GAMEINFO : solpackdid.h
  • DISPID_SOLPACK_GAMEINFO_DIFFICULTY : solpackdid.h
  • DISPID_SOLPACK_GAMEINFO_RULES : solpackdid.h
  • DISPID_SOLPACK_GAMEINFO_TITLE : solpackdid.h
  • DISPID_SOLPACK_GAMELIB : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_AUTHOR : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_EMAIL : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_GETGAME : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_GETGAMEINFO : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_NUMGAMES : solpackdid.h
  • DISPID_SOLPACK_GAMELIB_WEBSITE : solpackdid.h
  • DISPID_SOLPACK_PILE : solpackdid.h
  • DISPID_SOLPACK_PILE_BASETYPE : solpackdid.h
  • DISPID_SOLPACK_PILE_COMMENTTOOLTIP : solpackdid.h
  • DISPID_SOLPACK_PILE_GETCARD : solpackdid.h
  • DISPID_SOLPACK_PILE_HEIGHT : solpackdid.h
  • DISPID_SOLPACK_PILE_HEIGHTWITH : solpackdid.h
  • DISPID_SOLPACK_PILE_NUMCARDS : solpackdid.h
  • DISPID_SOLPACK_PILE_SHOWNUMCARDSTOOLTIP : solpackdid.h
  • DISPID_SOLPACK_PILE_SHUFFLE : solpackdid.h
  • DISPID_SOLPACK_PILE_TYPE : solpackdid.h
  • DISPID_SOLPACK_PILE_WIDTH : solpackdid.h
  • DISPID_SOLPACK_PILE_WIDTHWITH : solpackdid.h
  • DISPID_SOLPACK_PILE_X : solpackdid.h
  • DISPID_SOLPACK_PILE_Y : solpackdid.h
  • DllCanUnloadNow() : SPGames.cpp
  • DllGetClassObject() : SPGames.cpp
  • DllMain() : SPGames.cpp
  • DllRegisterServer() : SPGames.cpp
  • DllUnregisterServer() : SPGames.cpp
  • DPAIR : Fragment.cpp

- e -
  • ENG_ANIM : Engine.cpp
  • ENG_AUTOPLAY : Engine.cpp
  • ENG_DEAL : Engine.cpp
  • ENG_DROPFRAG : Engine.cpp
  • ENG_FLAGS : Engine.cpp
  • ENG_GAMEWON : Engine.cpp
  • ENG_HANDLECMD : Engine.cpp
  • ENG_IDLE : Engine.cpp
  • ENG_INACTIVE : Engine.cpp
  • ENG_INITTING : Engine.cpp
  • ENG_MOUSEDOWN : Engine.cpp
  • ENG_PILECLICKED : Engine.cpp
  • ENG_SETUPFRAG : Engine.cpp
  • ENG_STARTGAME : Engine.cpp
  • ENG_STOPGAME : Engine.cpp
  • ENG_UNDO : Engine.cpp
  • ENG_UNINIT : Engine.cpp
  • ENGEVENT_BODYCLICK : Engine.cpp
  • ENGOBJ_CARD : EngineObj.h
  • ENGOBJ_PILE : EngineObj.h
  • ENGSTATE : Engine.cpp
  • ENSUREALLOC : bmws_error.h
  • EnsureAlloc() : bmws_error.h, bmws_error.cpp
  • ENSUREBASE : GameBase.h
  • EOEVENT_LOSECAPTURE : EngineObj.cpp
  • EOEVENT_MOUSEDOWN : EngineObj.cpp
  • EOEVENT_MOUSEMOVE : EngineObj.cpp
  • EOEVENT_MOUSEUP : EngineObj.cpp
  • ERROR_ERRORINS_INT : bmws_error.h
  • ERROR_ERRORINS_LPTSTR : bmws_error.h
  • ERROR_NOCLOSE : bmws_error.h
  • ERROR_REMEDYINS_INT : bmws_error.h
  • ERROR_REMEDYINS_LPTSTR : bmws_error.h
  • ExecURL() : bmws_hlink.h, bmws_hlink.cpp

- f -
  • FILEVER : VersionNo.h
  • FMTINT : bmws_string.h
  • FormatDouble() : bmws_formatdouble.h, bmws_formatdouble.cpp
  • FPCREATEINSTANCE : bmws_comserver.h

- g -
  • g_aBase64Alphabet : bmws_base64.cpp
  • g_aCustomColors : bmws_choosecolor.cpp
  • g_aFactoryData : SPGames.cpp, bmws_comserver.cpp
  • g_bExited : SolpackApp.cpp, MainWindow.cpp
  • g_bFatalExit : SolpackApp.cpp, bmws_error.cpp
  • g_bInitted : SPGames.cpp
  • g_bUpdateDone : bmws_update.cpp
  • g_cActiveComponents : SPGames.cpp, Solpack.cpp, bmws_unkbase.cpp, bmws_dispbase.cpp, bmws_comserver.cpp
  • g_cFactoryDataEntries : SPGames.cpp, bmws_comserver.cpp
  • g_colorHlink : MainWindow.cpp, AboutDlg.cpp
  • g_hInst : SPGames/String.cpp, SPGames.cpp, SPGames/Helpers.cpp, COMServer.cpp, UserPrefs.cpp, Solpack/String.cpp, StatusBar.cpp, SolpackApp.cpp, MainWindow.cpp, HelpPane.cpp, Solpack/Helpers.cpp, DispBase.cpp, AboutDlg.cpp, bmws_window.cpp, bmws_tlb.cpp, bmws_string.cpp, bmws_splashscreen.cpp, bmws_regservices.cpp, bmws_registry.cpp, bmws_limitsingleinstance.cpp, bmws_hlink.cpp, bmws_error.cpp, bmws_dlg.cpp, bmws_dispbase.cpp, bmws_cpsounds.cpp, bmws_comserver.cpp
  • g_hInstLC : SPGames.cpp, GameLib.cpp, GameInfo.cpp, GameBase.cpp, UserPrefs.cpp, StatusBar.cpp, SolpackApp.cpp, MainWindow.cpp, HelpPane.cpp, Engine.cpp, bmws_updatedlg.cpp, bmws_string.cpp, bmws_splashscreen.cpp, bmws_regservices.cpp, bmws_error.cpp, bmws_dlg.cpp, bmws_cpsounds.cpp
  • g_hWnd : SPGames.cpp, UserPrefs.cpp, SolpackApp.cpp, MainWindow.cpp, GameMenu.cpp, bmws_xml.cpp, bmws_update.cpp, bmws_string.cpp, bmws_error.h, bmws_compound_xml.cpp, bmws_browsercontainer.cpp
  • g_lpfnOFNDialogProc : bmws_multiofn.cpp
  • g_lpszUserName : SolpackApp.cpp, MainWindow.cpp, AboutDlg.cpp
  • g_nBytesAlloc : bmws_trackmemalloc.cpp
  • g_nBytesFreed : bmws_trackmemalloc.cpp
  • g_nBytesMax : bmws_trackmemalloc.cpp
  • g_OOMExcep : SPGames.cpp
  • g_pMalloc : bmws_trackmemalloc.cpp
  • g_pOOMExcep : SPGames.cpp, UserPrefs.cpp, SolpackApp.cpp, MainWindow.cpp, bmws_xml.cpp, bmws_string.cpp, bmws_error.h, bmws_compound_xml.cpp, bmws_browsercontainer.cpp, bmws_base64.cpp, bmws_3dshatter.cpp
  • g_pTypeLib : SPGames.cpp, GameLib.cpp, GameInfo.cpp, GameBase.cpp, SolpackApp.cpp, Pile.cpp, GameData.cpp, Fragment.cpp, Engine.cpp, Card.cpp
  • g_pUpdateDoc : bmws_update.cpp
  • g_szAppTitle : SPGames.cpp, UserPrefs.cpp, SolpackApp.cpp, Solpack.cpp, MainWindow.cpp, bmws_updatedlg.cpp, bmws_error.cpp, bmws_cpsounds.cpp
  • g_szErrorBuffer : bmws_error.cpp
  • g_szErrorError : bmws_error.cpp
  • g_szErrorErrorIns : bmws_error.cpp
  • g_szErrorHolder : bmws_error.cpp
  • g_szErrorRemedy : bmws_error.cpp
  • g_szErrorRemedyIns : bmws_error.cpp
  • g_szModule : bmws_trackmemalloc.cpp
  • GAME_LABELLELUCIE : GameIDs.h
  • GAME_SPIDER : GameIDs.h
  • GenerateHashID() : bmws_regservices.cpp
  • GETCHK : UserPrefs.cpp
  • GetHlinkColor() : bmws_hlinkcolor.h, bmws_hlinkcolor.cpp
  • GetProductKey() : bmws_registry.h, bmws_registry.cpp
  • GetRegDWORDValue() : bmws_registry.h, bmws_registry.cpp
  • GetRegisteredName() : bmws_regservices.h, bmws_regservices.cpp
  • GetRegStringValue() : bmws_registry.h, bmws_registry.cpp
  • GMEVENT_INSTR : GameMenu.cpp
  • GMEVENT_PLAY : GameMenu.cpp
  • GMIEVENT_CLICKED : GameMenuItem.cpp
  • GMIEVENT_DBLCLICKED : GameMenuItem.cpp
  • GUIDToString() : bmws_comserver.cpp

- h -
  • HANDLECLOSEFN : bmws_handle.h
  • HandleError() : bmws_error.h, bmws_error.cpp
  • HHInternalExcep() : bmws_htmlhelpers.cpp
  • HLINK_PPM_CONTINUE : bmws_hlink.h
  • HLINK_PPM_RETURNDIRECT : bmws_hlink.h
  • HLINK_PPM_RETURNNORMAL : bmws_hlink.h
  • HTMLEDIT_CHANGE : bmws_htmledit.cpp
  • HTMLEDIT_KEYPRESS : bmws_htmledit.cpp
  • HTMLEDIT_PASTE : bmws_htmledit.cpp

- i -
  • ID_HELPPANEREBAR : HelpPane.cpp
  • IDB_BARCLOSE : Solpack/resource.h
  • IDB_BMWS_CPSOUNDS_PLAY : bmws_cpsounds_res_lc.h
  • IDB_BMWS_CPSOUNDS_STOP : bmws_cpsounds_res_lc.h
  • IDB_SPLASH : SolpckLC/resource.h
  • IDC_ABOUT_BMWSURL : SolpckLC/resource.h
  • IDC_ABOUT_REG : SolpckLC/resource.h
  • IDC_ABOUT_REGISTER : SolpckLC/resource.h
  • IDC_ABOUT_SOLPACKICON : SolpckLC/resource.h
  • IDC_BMWS_CPSOUNDS_BROWSE : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_DETAILS : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_FILENAME : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_L_FILENAME : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_L_PREVIEW : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_L_TREE : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_PLAY : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_STOP : bmws_cpsounds_res_lc.h
  • IDC_BMWS_CPSOUNDS_TREE : bmws_cpsounds_res_lc.h
  • IDC_BMWS_HLINK_HANDCUR : bmws_hlink_res.h
  • IDC_BMWS_REGSVC_ACCESSIDEDIT : bmws_regservices_res_lc.h
  • IDC_BMWS_REGSVC_PRODUCTEDIT : bmws_regservices_res_lc.h
  • IDC_BMWS_REGSVC_STATUS : bmws_regservices_res_lc.h
  • IDC_BMWS_REGSVC_URL : bmws_regservices_res_lc.h
  • IDC_BMWS_REGSVC_USERNAMEEDIT : bmws_regservices_res_lc.h
  • IDC_BMWS_UPDATEDLG_AVAILBOX : bmws_updatedlg_res_lc.h
  • IDC_BMWS_UPDATEDLG_CHECKEXTRAS : bmws_updatedlg_res_lc.h
  • IDC_BMWS_UPDATEDLG_CHECKNEWVER : bmws_updatedlg_res_lc.h
  • IDC_BMWS_UPDATEDLG_URL : bmws_updatedlg_res_lc.h
  • IDC_OPTAPP_BKCOLOR : SolpckLC/resource.h
  • IDC_OPTAPP_BKIMGCHK : SolpckLC/resource.h
  • IDC_OPTAPP_BKIMGEDIT : SolpckLC/resource.h
  • IDC_OPTAPP_BROWSEBKIMG : SolpckLC/resource.h
  • IDC_OPTAPP_RESTORE : SolpckLC/resource.h
  • IDC_OPTAPP_TEXTCOLOR : SolpckLC/resource.h
  • IDC_OPTGENERAL_ANIMATEWON : SolpckLC/resource.h
  • IDC_OPTGENERAL_ANIMCARDS : SolpckLC/resource.h
  • IDC_OPTGENERAL_CHECKEXTRAS : SolpckLC/resource.h
  • IDC_OPTGENERAL_CHECKNEWVER : SolpckLC/resource.h
  • IDC_OPTGENERAL_STATUSBAR : SolpckLC/resource.h
  • IDC_OPTGENERAL_TOOLTIPS : SolpckLC/resource.h
  • IDC_STATIC : SolpckLC/resource.h, bmws_updatedlg_res_lc.h, bmws_regservices_res_lc.h, bmws_cpsounds_res_lc.h
  • IDD_ABOUTBOX : SolpckLC/resource.h
  • IDD_BMWS_CPSOUNDSDLG : bmws_cpsounds_res_lc.h
  • IDD_BMWS_REGDIALOG : bmws_regservices_res_lc.h
  • IDD_BMWS_UPDATEDLG : bmws_updatedlg_res_lc.h
  • IDD_OPTIONS_APPEARANCE : SolpckLC/resource.h
  • IDD_OPTIONS_GENERAL : SolpckLC/resource.h
  • IDI_BMWS_CPSOUNDS_ICON : bmws_cpsounds_res.h
  • IDI_BMWS_CPSOUNDS_NULLICON : bmws_cpsounds_res.h
  • IDI_SOLPACK : Solpack/resource.h
  • IDM_GAME_AUTOPLAY : SolpckLC/resource.h
  • IDM_GAME_DEAL : SolpckLC/resource.h
  • IDM_GAME_EXIT : SolpckLC/resource.h
  • IDM_GAME_GAMESMENU : SolpckLC/resource.h
  • IDM_GAME_REDO : SolpckLC/resource.h
  • IDM_GAME_UNDO : SolpckLC/resource.h
  • IDM_HELP_ABOUT : SolpckLC/resource.h
  • IDM_HELP_CONTENTSANDINDEX : SolpckLC/resource.h
  • IDM_HELP_GAMEINSTRUCTIONS : SolpckLC/resource.h
  • IDM_HELP_REGISTER : SolpckLC/resource.h
  • IDM_OPTIONS_ADDGAMELIBRARY : SolpckLC/resource.h
  • IDM_OPTIONS_PROGRAMOPTIONS : SolpckLC/resource.h
  • IDR_MAINMENU : SolpckLC/resource.h
  • IDR_SOLPACKACCEL : SolpckLC/resource.h
  • IDS_ADDGAMELIBTITLE : SolpckLC/resource.h
  • IDS_ANIMGIF : Solpack/resource.h
  • IDS_APP_TITLE : SPGameLC/resource.h, SolpckLC/resource.h
  • IDS_BARCLASSNAME : Solpack/resource.h
  • IDS_BMWS_BROWSERCONTAINER_E_INTERNAL : bmws_browsercontainer_res_lc.h
  • IDS_BMWS_BROWSERCONTAINER_E_WBCREATE : bmws_browsercontainer_res_lc.h
  • IDS_BMWS_COM_APARTMENT : bmws_comserver_res.h
  • IDS_BMWS_COM_CLSID : bmws_comserver_res.h
  • IDS_BMWS_COM_CLSIDROOT : bmws_comserver_res.h
  • IDS_BMWS_COM_CURVER : bmws_comserver_res.h
  • IDS_BMWS_COM_INPROC : bmws_comserver_res.h
  • IDS_BMWS_COM_PROGID : bmws_comserver_res.h
  • IDS_BMWS_COM_PROGIDVI : bmws_comserver_res.h
  • IDS_BMWS_COM_THREADINGMODEL : bmws_comserver_res.h
  • IDS_BMWS_COM_TYPELIBROOT : bmws_comserver_res.h
  • IDS_BMWS_COMPOUND_XML_ATTR_DATA : bmws_compound_xml_res.h
  • IDS_BMWS_COMPOUND_XML_ATTR_NAME : bmws_compound_xml_res.h
  • IDS_BMWS_COMPOUND_XML_E_INTERNAL : bmws_compound_xml_res_lc.h
  • IDS_BMWS_COMPOUND_XML_EL_FILE : bmws_compound_xml_res.h
  • IDS_BMWS_COMPOUND_XML_EL_FILES : bmws_compound_xml_res.h
  • IDS_BMWS_COMPOUND_XML_R_DIFFERENTFILE : bmws_compound_xml_res_lc.h
  • IDS_BMWS_COMPOUND_XML_RENFORMAT : bmws_compound_xml_res.h
  • IDS_BMWS_CPSOUNDS_APPEVENTS : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_BROWSETITLEHOLDER : bmws_cpsounds_res_lc.h
  • IDS_BMWS_CPSOUNDS_CURRENT : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_EVENTLABELS : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_FILTER : bmws_cpsounds_res_lc.h
  • IDS_BMWS_CPSOUNDS_INVALIDFILE : bmws_cpsounds_res_lc.h
  • IDS_BMWS_CPSOUNDS_NONE : bmws_cpsounds_res_lc.h
  • IDS_BMWS_CPSOUNDS_POPUPFILE : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_REG_MEDIAPATH : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_REG_WIN : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_SCHEMESAPPS : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_WAVEXT : bmws_cpsounds_res.h
  • IDS_BMWS_CPSOUNDS_WAVWILDCARD : bmws_cpsounds_res.h
  • IDS_BMWS_ERROR_ACCEL : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_COMERROR : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_COMMCTRL : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_COMMDLG : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_HOLDER : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_INTERNAL : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_OLE : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_OOM : bmws_error_res_lc.h
  • IDS_BMWS_ERROR_SYSTEMHOLDER : bmws_error_res_lc.h
  • IDS_BMWS_HELPMGR_POPUPHOLDER : bmws_helpmgr_res.h
  • IDS_BMWS_HLINKCOLOR_MSIEREG : bmws_hlinkcolor_res.h
  • IDS_BMWS_HLINKCOLOR_VALUENAME : bmws_hlinkcolor_res.h
  • IDS_BMWS_HTML_BEFOREEND : bmws_htmlhelpers_res.h
  • IDS_BMWS_HTML_DISPLAYNONE : bmws_htmlhelpers_res.h
  • IDS_BMWS_HTML_E_INTERNAL : bmws_htmlhelpers_res_lc.h
  • IDS_BMWS_HTML_E_NOELEMENT : bmws_htmlhelpers_res_lc.h
  • IDS_BMWS_HTML_E_QIELEMENT : bmws_htmlhelpers_res_lc.h
  • IDS_BMWS_HTMLEDIT_CLIP_TEXT : bmws_htmledit_res.h
  • IDS_BMWS_HTMLLINK_DISABLED : bmws_htmllink_res.h
  • IDS_BMWS_HTMLLINK_HOLDER : bmws_htmllink_res.h
  • IDS_BMWS_HTMLSELECT_OPTIONTAG : bmws_htmlselect_res.h
  • IDS_BMWS_HTMLSTATIC_DISABLED : bmws_htmlstatic_res.h
  • IDS_BMWS_HTMLSTATIC_HOLDER : bmws_htmlstatic_res.h
  • IDS_BMWS_REGSVC_ACCESSID : bmws_regservices_res.h
  • IDS_BMWS_REGSVC_INCORRECT : bmws_regservices_res_lc.h
  • IDS_BMWS_REGSVC_USERNAME : bmws_regservices_res.h
  • IDS_BMWS_REMEDY_CONTACTBMWS : bmws_error_res_lc.h
  • IDS_BMWS_REMEDY_REINSTALL : bmws_error_res_lc.h
  • IDS_BMWS_REMEDY_RESTART : bmws_error_res_lc.h
  • IDS_BMWS_RESURL_RESPROTOCOL : bmws_resurl_res.h
  • IDS_BMWS_SPLASH_FONT : bmws_splashscreen_res.h
  • IDS_BMWS_SPLASH_REGMSG : bmws_splashscreen_res_lc.h
  • IDS_BMWS_SPLASH_UNREGMSG : bmws_splashscreen_res_lc.h
  • IDS_BMWS_STRING_RESNOTFOUND : bmws_string_res_lc.h
  • IDS_BMWS_TECHSUPP_REGMSG : bmws_techsupport_res_lc.h
  • IDS_BMWS_TECHSUPP_UNREGMSG : bmws_techsupport_res_lc.h
  • IDS_BMWS_UPDATE_E_INVALIDUPDATE : bmws_update_res_lc.h
  • IDS_BMWS_UPDATE_EXTRAATTR : bmws_update_res.h
  • IDS_BMWS_UPDATE_EXTRAVERATTR : bmws_update_res.h
  • IDS_BMWS_UPDATE_REG_EXTRAVER : bmws_update_res.h
  • IDS_BMWS_UPDATE_VERATTR : bmws_update_res.h
  • IDS_BMWS_UPDATE_VEREXTRA : bmws_update_res.h
  • IDS_BMWS_UPDATEDLG_POPUPFILE : bmws_updatedlg_res.h
  • IDS_BMWS_WINDOW_E_CREATEWND : bmws_window_res_lc.h
  • IDS_BMWS_WINDOW_E_REGWNDCLASS : bmws_window_res_lc.h
  • IDS_BMWS_XML_E_GETATTR : bmws_xml_res_lc.h
  • IDS_BMWS_XML_E_GETROOTEL : bmws_xml_res_lc.h
  • IDS_BMWS_XML_E_GETTEXT : bmws_xml_res_lc.h
  • IDS_BMWS_XML_E_INTERNAL : bmws_xml_res_lc.h
  • IDS_BMWS_XML_E_MSXMLCREATE : bmws_xml_res_lc.h
  • IDS_BMWS_XML_PI_DATA : bmws_xml_res.h
  • IDS_BMWS_XML_PI_TARGET : bmws_xml_res.h
  • IDS_BMWS_XML_XSLINDEX : bmws_xml_res.h
  • IDS_BROWSEBKIMG : SolpckLC/resource.h
  • IDS_CATDESC : SolpckLC/resource.h
  • IDS_CHOOSECOLOR_TITLE : SolpckLC/resource.h
  • IDS_CLASS_CARD : Solpack/resource.h
  • IDS_CLASS_PILEBASE : Solpack/resource.h
  • IDS_CLASSNAME : Solpack/resource.h
  • IDS_CMD_LABELLELUCIE_REDEAL : SPGameLC/resource.h
  • IDS_CMDHELP_LABELLELUCIE_REDEAL : SPGameLC/resource.h
  • IDS_COLOR_BKG : SolpckLC/resource.h
  • IDS_COLOR_TEXT : SolpckLC/resource.h
  • IDS_COMMENT_ACEKINGFOUNDATION : SPGameLC/resource.h
  • IDS_COMMENT_SPIDERSTOCK : SPGameLC/resource.h
  • IDS_COMPANY : SPGames/resource.h, Solpack/resource.h
  • IDS_DEFEXT : Solpack/resource.h
  • IDS_DIFFICULTY_EASY : SolpckLC/resource.h
  • IDS_DIFFICULTY_HARD : SolpckLC/resource.h
  • IDS_DIFFICULTY_MEDIUM : SolpckLC/resource.h
  • IDS_EL_BODY : Solpack/resource.h
  • IDS_EL_COMMANDBARHOLDER : Solpack/resource.h
  • IDS_EL_COMMANDROW : Solpack/resource.h
  • IDS_EL_DAVC : Solpack/resource.h
  • IDS_EL_ENGINE : Solpack/resource.h
  • IDS_EL_FRAGMENT : Solpack/resource.h
  • IDS_EL_GAMEMENU : Solpack/resource.h
  • IDS_EL_HELPGAME : Solpack/resource.h
  • IDS_EL_HELPINSTR : Solpack/resource.h
  • IDS_EL_MENUDIFFICULTY : Solpack/resource.h
  • IDS_EL_MENUGAME : Solpack/resource.h
  • IDS_EL_MENUHOLDER : Solpack/resource.h
  • IDS_EL_MENUINSTR : Solpack/resource.h
  • IDS_EL_MENULIB : Solpack/resource.h
  • IDS_EL_MENULIBAUTHOR : Solpack/resource.h
  • IDS_EL_MENULIBEMAIL : Solpack/resource.h
  • IDS_EL_MENULIBWEBSITE : Solpack/resource.h
  • IDS_EL_MENUPANE : Solpack/resource.h
  • IDS_EL_MENUPLAY : Solpack/resource.h
  • IDS_EL_TABLEAU : Solpack/resource.h
  • IDS_EMAIL : SPGames/resource.h
  • IDS_ERR_IMLCREATE : SolpckLC/resource.h
  • IDS_ERR_LCNOTFOUND : Solpack/resource.h
  • IDS_ERR_LOADIMAGE : SolpckLC/resource.h
  • IDS_FILENOTFOUND : SolpckLC/resource.h
  • IDS_FILTER : SolpckLC/resource.h
  • IDS_HELPHTML : Solpack/resource.h
  • IDS_HEXCOLORHOLDER : Solpack/resource.h
  • IDS_HIDERULES : SolpckLC/resource.h
  • IDS_IMG_BASE_FOUNDATION : Solpack/resource.h
  • IDS_IMG_BASE_FRAME : Solpack/resource.h
  • IDS_IMG_BASE_NONE : Solpack/resource.h
  • IDS_IMG_BASE_NOREDEAL : Solpack/resource.h
  • IDS_IMG_BASE_REDEAL : Solpack/resource.h
  • IDS_IMG_CLUB : Solpack/resource.h
  • IDS_IMG_DIAMOND : Solpack/resource.h
  • IDS_IMG_HEART : Solpack/resource.h
  • IDS_IMG_SPADE : Solpack/resource.h
  • IDS_IMGFILTER : SolpckLC/resource.h
  • IDS_IMGHOLDER : Solpack/resource.h
  • IDS_MAILTOPROTOCOL : Solpack/resource.h
  • IDS_MAINHTML : Solpack/resource.h
  • IDS_MENUCELL : Solpack/resource.h
  • IDS_NEWVERHOLDER : SolpckLC/resource.h
  • IDS_NUMCARDSTOOLTIP : SolpckLC/resource.h
  • IDS_OPTIONSDLGTITLE : SolpckLC/resource.h
  • IDS_PANECLASSNAME : Solpack/resource.h
  • IDS_PERCENTS : SPGames/resource.h
  • IDS_REG_ANIMCARDS : Solpack/resource.h
  • IDS_REG_ANIMWON : Solpack/resource.h
  • IDS_REG_BGCOLOR : Solpack/resource.h
  • IDS_REG_BGIMG : Solpack/resource.h
  • IDS_REG_CUSTCOLORS : Solpack/resource.h
  • IDS_REG_EVENTSTITLE : Solpack/resource.h
  • IDS_REG_HELPPANE : Solpack/resource.h
  • IDS_REG_HELPPANEHEIGHT : Solpack/resource.h
  • IDS_REG_LIBDESC : SPGameLC/resource.h
  • IDS_REG_MAINWNDPLACEMENT : Solpack/resource.h
  • IDS_REG_NOTIFYEXTRAS : Solpack/resource.h
  • IDS_REG_NOTIFYUPDATE : Solpack/resource.h
  • IDS_REG_PROGIDHOLDER : SPGames/resource.h
  • IDS_REG_PROGIDVIHOLDER : SPGames/resource.h
  • IDS_REG_SOFTWARE : SPGames/resource.h, Solpack/resource.h
  • IDS_REG_SOUND_DROP : Solpack/resource.h
  • IDS_REG_SOUND_FLIP : Solpack/resource.h
  • IDS_REG_SOUND_SHUFFLE : Solpack/resource.h
  • IDS_REG_SOUND_WON : Solpack/resource.h
  • IDS_REG_SPGAMESPROGID : SPGames/resource.h
  • IDS_REG_STATUSBAR : Solpack/resource.h
  • IDS_REG_TEXTCOLOR : Solpack/resource.h
  • IDS_REGISTEREDGREETING : SolpckLC/resource.h
  • IDS_REGISTERURL : SolpckLC/resource.h
  • IDS_SC_MAXIMIZE : SolpckLC/resource.h
  • IDS_SC_MINIMIZE : SolpckLC/resource.h
  • IDS_SC_MOVE : SolpckLC/resource.h
  • IDS_SC_RESTORE : SolpckLC/resource.h
  • IDS_SC_SIZE : SolpckLC/resource.h
  • IDS_SC_TASKLIST : SolpckLC/resource.h
  • IDS_SEL_PILEBASECLASS : Solpack/resource.h
  • IDS_SHATTERCOLOR : Solpack/resource.h
  • IDS_SHOWRULES : SolpckLC/resource.h
  • IDS_SITEURL : SolpckLC/resource.h
  • IDS_SOUND_DROP : SolpckLC/resource.h
  • IDS_SOUND_FLIP : SolpckLC/resource.h
  • IDS_SOUND_SHUFFLE : SolpckLC/resource.h
  • IDS_SOUND_WON : SolpckLC/resource.h
  • IDS_SOUNDFILE_DROP : SolpckLC/resource.h
  • IDS_SOUNDFILE_FLIP : SolpckLC/resource.h
  • IDS_SOUNDFILE_SHUFFLE : SolpckLC/resource.h
  • IDS_SOUNDFILE_WON : SolpckLC/resource.h
  • IDS_SPLASHCLASSNAME : Solpack/resource.h
  • IDS_SPLASHCOPYRIGHT : SolpckLC/resource.h
  • IDS_SPLASHVERSION : SolpckLC/resource.h
  • IDS_STATUS_INITDECK : SolpckLC/resource.h
  • IDS_STATUS_INITGAME : SolpckLC/resource.h
  • IDS_STATUS_INITMENU : SolpckLC/resource.h
  • IDS_STATUS_SCORE : SolpckLC/resource.h
  • IDS_STYLE_COLOR : Solpack/resource.h
  • IDS_STYLE_PILEBASEFILTER : Solpack/resource.h
  • IDS_SYSMENU : SolpckLC/resource.h
  • IDS_TAG_A : Solpack/resource.h
  • IDS_TAG_IMG : Solpack/resource.h
  • IDS_TAG_SPAN : Solpack/resource.h
  • IDS_TB_CLOSE : SolpckLC/resource.h
  • IDS_TITLEBARHOLDER : SolpckLC/resource.h
  • IDS_TITLEBASE : SPGameLC/resource.h
  • IDS_UNREGISTERED : SolpckLC/resource.h
  • IDS_UPDATEXML : SolpckLC/resource.h
  • IDS_WEBSITE : SPGames/resource.h
  • IID : SPGames_i.c, Solpack_i.c, Solpack_catid.c, SolpackInternal_i.c
  • IID_ICrShatter : bmws_3dshatter.cpp
  • IID_IDXTRedirect : bmws_3dshatter.cpp
  • IID_IInternalCard : SolpackInternal_i.c
  • IID_IInternalPile : SolpackInternal_i.c
  • IID_ISolpackApp : Solpack.h
  • IID_ISolpackCard : Solpack.h
  • IID_ISolpackFragment : Solpack.h
  • IID_ISolpackGame : Solpack.h
  • IID_ISolpackGameData : Solpack.h
  • IID_ISolpackGameInfo : Solpack.h
  • IID_ISolpackGameLib : Solpack.h
  • IID_ISolpackPile : Solpack.h
  • InitErrorHandler() : bmws_error.h, bmws_error.cpp
  • InitModule() : SPGames.cpp
  • ISolpackApp : Solpack.h
  • ISolpackApp_AddGameCommand_Proxy() : Solpack.h
  • ISolpackApp_AddGameCommand_Stub() : Solpack.h
  • ISolpackApp_CreateGameData_Proxy() : Solpack.h
  • ISolpackApp_CreateGameData_Stub() : Solpack.h
  • ISolpackApp_CreatePile_Proxy() : Solpack.h
  • ISolpackApp_CreatePile_Stub() : Solpack.h
  • ISolpackApp_EnableGameCommand_Proxy() : Solpack.h
  • ISolpackApp_EnableGameCommand_Stub() : Solpack.h
  • ISolpackApp_GameWon_Proxy() : Solpack.h
  • ISolpackApp_GameWon_Stub() : Solpack.h
  • ISolpackApp_get_CardHeight_Proxy() : Solpack.h
  • ISolpackApp_get_CardHeight_Stub() : Solpack.h
  • ISolpackApp_get_CardWidth_Proxy() : Solpack.h
  • ISolpackApp_get_CardWidth_Stub() : Solpack.h
  • ISolpackApp_get_Fragment_Proxy() : Solpack.h
  • ISolpackApp_get_Fragment_Stub() : Solpack.h
  • ISolpackApp_get_Score_Proxy() : Solpack.h
  • ISolpackApp_get_Score_Stub() : Solpack.h
  • ISolpackApp_get_SpacingX_Proxy() : Solpack.h
  • ISolpackApp_get_SpacingX_Stub() : Solpack.h
  • ISolpackApp_get_SpacingY_Proxy() : Solpack.h
  • ISolpackApp_get_SpacingY_Stub() : Solpack.h
  • ISolpackApp_get_WindowHeight_Proxy() : Solpack.h
  • ISolpackApp_get_WindowHeight_Stub() : Solpack.h
  • ISolpackApp_get_WindowWidth_Proxy() : Solpack.h
  • ISolpackApp_get_WindowWidth_Stub() : Solpack.h
  • ISolpackApp_put_Score_Proxy() : Solpack.h
  • ISolpackApp_put_Score_Stub() : Solpack.h
  • ISolpackAppVtbl : Solpack.h
  • ISolpackCard : Solpack.h
  • ISolpackCard_get_CanDrag_Proxy() : Solpack.h
  • ISolpackCard_get_CanDrag_Stub() : Solpack.h
  • ISolpackCard_get_FaceUp_Proxy() : Solpack.h
  • ISolpackCard_get_FaceUp_Stub() : Solpack.h
  • ISolpackCard_get_ID_Proxy() : Solpack.h
  • ISolpackCard_get_ID_Stub() : Solpack.h
  • ISolpackCard_get_Index_Proxy() : Solpack.h
  • ISolpackCard_get_Index_Stub() : Solpack.h
  • ISolpackCard_get_Pile_Proxy() : Solpack.h
  • ISolpackCard_get_Pile_Stub() : Solpack.h
  • ISolpackCard_get_Rank_Proxy() : Solpack.h
  • ISolpackCard_get_Rank_Stub() : Solpack.h
  • ISolpackCard_get_Suit_Proxy() : Solpack.h
  • ISolpackCard_get_Suit_Stub() : Solpack.h
  • ISolpackCard_put_CanDrag_Proxy() : Solpack.h
  • ISolpackCard_put_CanDrag_Stub() : Solpack.h
  • ISolpackCard_put_FaceUp_Proxy() : Solpack.h
  • ISolpackCard_put_FaceUp_Stub() : Solpack.h
  • ISolpackCard_put_Index_Proxy() : Solpack.h
  • ISolpackCard_put_Index_Stub() : Solpack.h
  • ISolpackCardVtbl : Solpack.h
  • ISolpackFragment : Solpack.h
  • ISolpackFragment_AddToFragment_Proxy() : Solpack.h
  • ISolpackFragment_AddToFragment_Stub() : Solpack.h
  • ISolpackFragment_MoveToPile_Proxy() : Solpack.h
  • ISolpackFragment_MoveToPile_Stub() : Solpack.h
  • ISolpackFragmentVtbl : Solpack.h
  • ISolpackGame : Solpack.h
  • ISolpackGame_AutoPlay_Proxy() : Solpack.h
  • ISolpackGame_AutoPlay_Stub() : Solpack.h
  • ISolpackGame_AutoPlayCard_Proxy() : Solpack.h
  • ISolpackGame_AutoPlayCard_Stub() : Solpack.h
  • ISolpackGame_CancelMove_Proxy() : Solpack.h
  • ISolpackGame_CancelMove_Stub() : Solpack.h
  • ISolpackGame_Deal_Proxy() : Solpack.h
  • ISolpackGame_Deal_Stub() : Solpack.h
  • ISolpackGame_DropFragment_Proxy() : Solpack.h
  • ISolpackGame_DropFragment_Stub() : Solpack.h
  • ISolpackGame_get_Info_Proxy() : Solpack.h
  • ISolpackGame_get_Info_Stub() : Solpack.h
  • ISolpackGame_HandleCommand_Proxy() : Solpack.h
  • ISolpackGame_HandleCommand_Stub() : Solpack.h
  • ISolpackGame_Initialize_Proxy() : Solpack.h
  • ISolpackGame_Initialize_Stub() : Solpack.h
  • ISolpackGame_PileClicked_Proxy() : Solpack.h
  • ISolpackGame_PileClicked_Stub() : Solpack.h
  • ISolpackGame_RecalcLayout_Proxy() : Solpack.h
  • ISolpackGame_RecalcLayout_Stub() : Solpack.h
  • ISolpackGame_SetupFragment_Proxy() : Solpack.h
  • ISolpackGame_SetupFragment_Stub() : Solpack.h
  • ISolpackGame_Uninitialize_Proxy() : Solpack.h
  • ISolpackGame_Uninitialize_Stub() : Solpack.h
  • ISolpackGameData : Solpack.h
  • ISolpackGameData_get_Data_Proxy() : Solpack.h
  • ISolpackGameData_get_Data_Stub() : Solpack.h
  • ISolpackGameData_put_Data_Proxy() : Solpack.h
  • ISolpackGameData_put_Data_Stub() : Solpack.h
  • ISolpackGameDataVtbl : Solpack.h
  • ISolpackGameInfo : Solpack.h
  • ISolpackGameInfo_get_Difficulty_Proxy() : Solpack.h
  • ISolpackGameInfo_get_Difficulty_Stub() : Solpack.h
  • ISolpackGameInfo_get_Rules_Proxy() : Solpack.h
  • ISolpackGameInfo_get_Rules_Stub() : Solpack.h
  • ISolpackGameInfo_get_Title_Proxy() : Solpack.h
  • ISolpackGameInfo_get_Title_Stub() : Solpack.h
  • ISolpackGameInfoVtbl : Solpack.h
  • ISolpackGameLib : Solpack.h
  • ISolpackGameLib_get_Author_Proxy() : Solpack.h
  • ISolpackGameLib_get_Author_Stub() : Solpack.h
  • ISolpackGameLib_get_Email_Proxy() : Solpack.h
  • ISolpackGameLib_get_Email_Stub() : Solpack.h
  • ISolpackGameLib_get_NumGames_Proxy() : Solpack.h
  • ISolpackGameLib_get_NumGames_Stub() : Solpack.h
  • ISolpackGameLib_get_WebSite_Proxy() : Solpack.h
  • ISolpackGameLib_get_WebSite_Stub() : Solpack.h
  • ISolpackGameLib_GetGame_Proxy() : Solpack.h
  • ISolpackGameLib_GetGame_Stub() : Solpack.h
  • ISolpackGameLib_GetGameInfo_Proxy() : Solpack.h
  • ISolpackGameLib_GetGameInfo_Stub() : Solpack.h
  • ISolpackGameLibVtbl : Solpack.h
  • ISolpackGameVtbl : Solpack.h
  • ISolpackPile : Solpack.h
  • ISolpackPile_get_BaseType_Proxy() : Solpack.h
  • ISolpackPile_get_BaseType_Stub() : Solpack.h
  • ISolpackPile_get_CommentTooltip_Proxy() : Solpack.h
  • ISolpackPile_get_CommentTooltip_Stub() : Solpack.h
  • ISolpackPile_get_Height_Proxy() : Solpack.h
  • ISolpackPile_get_Height_Stub() : Solpack.h
  • ISolpackPile_get_NumCards_Proxy() : Solpack.h
  • ISolpackPile_get_NumCards_Stub() : Solpack.h
  • ISolpackPile_get_ShowNumCardsTooltip_Proxy() : Solpack.h
  • ISolpackPile_get_ShowNumCardsTooltip_Stub() : Solpack.h
  • ISolpackPile_get_Type_Proxy() : Solpack.h
  • ISolpackPile_get_Type_Stub() : Solpack.h
  • ISolpackPile_get_Width_Proxy() : Solpack.h
  • ISolpackPile_get_Width_Stub() : Solpack.h
  • ISolpackPile_get_X_Proxy() : Solpack.h
  • ISolpackPile_get_X_Stub() : Solpack.h
  • ISolpackPile_get_Y_Proxy() : Solpack.h
  • ISolpackPile_get_Y_Stub() : Solpack.h
  • ISolpackPile_GetCard_Proxy() : Solpack.h
  • ISolpackPile_GetCard_Stub() : Solpack.h
  • ISolpackPile_HeightWith_Proxy() : Solpack.h
  • ISolpackPile_HeightWith_Stub() : Solpack.h
  • ISolpackPile_put_BaseType_Proxy() : Solpack.h
  • ISolpackPile_put_BaseType_Stub() : Solpack.h
  • ISolpackPile_put_CommentTooltip_Proxy() : Solpack.h
  • ISolpackPile_put_CommentTooltip_Stub() : Solpack.h
  • ISolpackPile_put_ShowNumCardsTooltip_Proxy() : Solpack.h
  • ISolpackPile_put_ShowNumCardsTooltip_Stub() : Solpack.h
  • ISolpackPile_put_X_Proxy() : Solpack.h
  • ISolpackPile_put_X_Stub() : Solpack.h
  • ISolpackPile_put_Y_Proxy() : Solpack.h
  • ISolpackPile_put_Y_Stub() : Solpack.h
  • ISolpackPile_Shuffle_Proxy() : Solpack.h
  • ISolpackPile_Shuffle_Stub() : Solpack.h
  • ISolpackPile_WidthWith_Proxy() : Solpack.h
  • ISolpackPile_WidthWith_Stub() : Solpack.h
  • ISolpackPileVtbl : Solpack.h
  • IsValidRegistration() : bmws_regservices.cpp

- l -
  • LIBID_SolpackLib : Solpack.h
  • LIBID_SPGamesLib : SPGames.h
  • LPFACTORYDATA : bmws_comserver.h

- m -
  • MIDL_DEFINE_GUID : SPGames_i.c, Solpack_i.c, SPGames_i.c, Solpack_i.c
  • MIDL_user_allocate() : SPGames.h, Solpack.h
  • MIDL_user_free() : SPGames.h, Solpack.h
  • MS_CARD_AUTOPLAY : Engine.cpp
  • MS_CARD_LBD : Engine.cpp
  • MS_CARD_LBDNODRAG : Engine.cpp
  • MS_CARD_RBD : Engine.cpp
  • MS_DRAGGING : Engine.cpp
  • MS_IDLE : Engine.cpp
  • MS_PILE_CLICKED : Engine.cpp
  • MS_PILE_LBD : Engine.cpp
  • MS_TRYDROP : Engine.cpp
  • MS_WAITALL : Engine.cpp
  • MultiOFN() : bmws_multiofn.h, bmws_multiofn.cpp
  • MW_CREATING : MainWindow.cpp
  • MW_ENGINE : MainWindow.cpp
  • MW_GAMEMENU : MainWindow.cpp
  • MW_INITHTML : MainWindow.cpp
  • MW_UNINIT : MainWindow.cpp
  • MW_WAITFORHTML : MainWindow.cpp

- n -
  • NOTRACK_SAFEFREEMEMORY : bmws_common.h
  • NUMCARDSINSTACKGROUP : Pile.cpp

- o -
  • ODS : bmws_common.h
  • ODS2 : bmws_common.h
  • OFNDialogHook() : bmws_multiofn.cpp
  • OfnGetFilter() : bmws_ofn.h, bmws_ofn.cpp

- p -
  • PILE_DECK : Solpack.h
  • PILE_FRAGMENT : Solpack.h
  • PILE_STACK : Solpack.h
  • PILE_TABLEAUDOWN : Solpack.h
  • PILE_TABLEAURIGHT : Solpack.h
  • PILE_TALON : Solpack.h
  • PILE_TALON3 : Solpack.h
  • PILESPACINGX : Engine.h
  • PILESPACINGY : Engine.h
  • PRODUCTVER : VersionNo.h

- r -
  • RANDOMNUM : Pile.cpp
  • RANK_10 : Solpack.h
  • RANK_2 : Solpack.h
  • RANK_3 : Solpack.h
  • RANK_4 : Solpack.h
  • RANK_5 : Solpack.h
  • RANK_6 : Solpack.h
  • RANK_7 : Solpack.h
  • RANK_8 : Solpack.h
  • RANK_9 : Solpack.h
  • RANK_ACE : Solpack.h
  • RANK_JACK : Solpack.h
  • RANK_KING : Solpack.h
  • RANK_QUEEN : Solpack.h
  • RegisterComponent() : bmws_comserver.h, bmws_comserver.cpp
  • RegisterTLB() : bmws_tlb.h, bmws_tlb.cpp
  • RegistrationProc() : bmws_regservices.cpp
  • RETHROWCOM : bmws_error.h

- s -
  • SAFEALLOC : bmws_common.h
  • SAFEALLOCMEMORY : bmws_common.h
  • SAFEALLOCW : bmws_common.h
  • SAFEDELETE : bmws_common.h
  • SAFEFREEMEMORY : bmws_common.h
  • SAFEFREESTRING : bmws_common.h
  • SAFERELEASE : bmws_common.h
  • SETCHK : UserPrefs.cpp
  • SetErrorInserts() : bmws_error.h, bmws_error.cpp
  • SetRegDWORDValue() : bmws_registry.h, bmws_registry.cpp
  • SetRegStringValue() : bmws_registry.h, bmws_registry.cpp
  • SETTING_ALL : UserPrefs.h
  • SETTING_APPEARANCE : UserPrefs.h
  • SETTING_GENERAL : UserPrefs.h
  • SETTING_NOTIFY : UserPrefs.h
  • SHANDLE_PTR : Solpack/StdAfx.h
  • ShowRegistrationDialog() : bmws_regservices.h, bmws_regservices.cpp
  • SINGLE_OFN_INITFILETITLE : bmws_singleofn.h
  • SINGLE_OFN_SAVE : bmws_singleofn.h
  • SingleOFN() : bmws_singleofn.h, bmws_singleofn.cpp
  • SingleOFNDialogHook() : bmws_singleofn.cpp
  • SOLPACK_HASHVALUE : Solpack/StdAfx.h
  • SOLPACK_LCID : Solpack/StdAfx.h
  • SOLPACKBASETYPE : Solpack.h
  • SOLPACKDIFFICULTY : Solpack.h
  • SOLPACKPILETYPE : Solpack.h
  • SOLPACKRANK : Solpack.h
  • SOLPACKSUIT : Solpack.h
  • SPGames : SPGames.h
  • SPKREG_NONE : SolpackApp.cpp
  • SPKREG_REGISTER : SolpackApp.cpp
  • SPKREG_UNREGISTER : SolpackApp.cpp
  • SPLASH_FONTSIZE : bmws_splashscreen.cpp
  • STDMETHODIMP_() : bmws_unkbase.cpp, bmws_dispbase.cpp, bmws_comserver.cpp
  • STEPDISTANCE : Fragment.cpp
  • STRFILEVER : VersionNo.h
  • StringToLowerCase() : bmws_string.h
  • STRPRODUCTVER : VersionNo.h
  • SUIT_CLUB : Solpack.h
  • SUIT_DIAMOND : Solpack.h
  • SUIT_HEART : Solpack.h
  • SUIT_SPADE : Solpack.h

- t -
  • tagSOLPACKBASETYPE : Solpack.h
  • tagSOLPACKDIFFICULTY : Solpack.h
  • tagSOLPACKPILETYPE : Solpack.h
  • tagSOLPACKRANK : Solpack.h
  • tagSOLPACKSUIT : Solpack.h
  • THROW : bmws_error.h

- u -
  • UA_ALL : UserPrefs.h
  • UA_BKCOLOR : UserPrefs.h
  • UA_BKIMG : UserPrefs.h
  • UA_TEXTCOLOR : UserPrefs.h
  • UnregisterComponent() : bmws_comserver.h, bmws_comserver.cpp
  • UnregisterTLB() : bmws_tlb.h, bmws_tlb.cpp
  • UNREGTYPELIBFN : bmws_tlb.cpp

- w -
  • WIN32_LEAN_AND_MEAN : SPGames/StdAfx.h, Solpack/StdAfx.h
  • WinMain() : Solpack.cpp
  • WINVER : SPGames/StdAfx.h, Solpack/StdAfx.h
  • WM_PANESIZE_END : HelpPane.h
  • WM_PANESIZE_MOVE : HelpPane.h
  • WM_PANESIZE_START : HelpPane.h

- x -
  • XMLINTERNALEXCEP : bmws_xml.cpp
Generated on Wed May 8 12:40:26 2002 for Solitaire Pack by doxygen 1.2.15


Namespace Member Index

Solitaire Pack Namespace Members

b | c | d | f | i | p | r | s | t | x

Here is a list of all namespace members with links to the namespace documentation for each member:

- b -

  • BASE_FOUNDATION : SolpackLib
  • BASE_FRAME : SolpackLib
  • BASE_NONE : SolpackLib
  • BASE_NOREDEAL : SolpackLib
  • BASE_REDEAL : SolpackLib

- c -
  • cards : SolpackLib
  • circle : SolpackLib

- d -
  • deck : SolpackLib

- f -
  • frame : SolpackLib

- i -
  • importlib() : SPGamesLib, SolpackLib

- p -
  • PILE_DECK : SolpackLib
  • PILE_FRAGMENT : SolpackLib
  • PILE_STACK : SolpackLib
  • PILE_TABLEAUDOWN : SolpackLib
  • PILE_TABLEAURIGHT : SolpackLib
  • PILE_TALON : SolpackLib
  • PILE_TALON3 : SolpackLib
  • position : SolpackLib

- r -
  • RANK_10 : SolpackLib
  • RANK_2 : SolpackLib
  • RANK_3 : SolpackLib
  • RANK_4 : SolpackLib
  • RANK_5 : SolpackLib
  • RANK_6 : SolpackLib
  • RANK_7 : SolpackLib
  • RANK_8 : SolpackLib
  • RANK_9 : SolpackLib
  • RANK_ACE : SolpackLib
  • RANK_JACK : SolpackLib
  • RANK_KING : SolpackLib
  • RANK_QUEEN : SolpackLib

- s -
  • single : SolpackLib
  • SOLPACKBASETYPE : SolpackLib
  • SOLPACKDIFFICULTY : SolpackLib
  • SOLPACKPILETYPE : SolpackLib
  • SOLPACKRANK : SolpackLib
  • SOLPACKSUIT : SolpackLib
  • SUIT_CLUB : SolpackLib
  • SUIT_DIAMOND : SolpackLib
  • SUIT_HEART : SolpackLib
  • SUIT_SPADE : SolpackLib

- t -
  • tagSOLPACKBASETYPE : SolpackLib
  • tagSOLPACKDIFFICULTY : SolpackLib
  • tagSOLPACKPILETYPE : SolpackLib
  • tagSOLPACKRANK : SolpackLib
  • tagSOLPACKSUIT : SolpackLib

- x -
  • X : SolpackLib
Generated on Wed May 8 12:40:26 2002 for Solitaire Pack by doxygen 1.2.15


Annotated Index

Solitaire Pack Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
_IID
C3DShatter
CAboutDlg
CAction
CAppearanceDlg
CArray
CBrowserContainer
CBSTR
CCard
CCardIndexAction
CCOMExcep
CCompoundXMLDocument
CCPSounds
CCPSoundsDlg
CDeck
CDispBase
CDlg
CEngine
CEngineObj
CEventHandler
CEventSink
CExcep
CExcepEx
CFactory
CFactoryData
CFragment
CFragmentAction
CFragmentAdd
CFragmentAddCard
CFragmentAddPile
CGameBase
CGameCommand
CGameCommandMgr
CGameData
CGameDataAction
CGameInfo
CGameLaBelleLucie
CGameLib
tagGAMEDATA
CGameMenu
CGameMenuItem
CGameSpider
CHandle
CHelpMgr
CHelpPane
CHlinkWindow
CHlinkWindowMgr
CHTMLChk
CHTMLChooseColor
CHTMLControl
CHTMLEdit
CHTMLEnable
CHTMLHelper
CHTMLLink
CHTMLRadioGroup
CHTMLSelect
CHTMLStatic
CHWND
CKey
CLib
CLibMgr
CLimitSingleInstance
CMainWindow
COOMExcep
CPidl
CPile
CPileCommentAction
CPileShuffleAction
CPointer
CPtr
CPtrArray
CQuitExcep
CRefCount
CRegDlgInfo
CScriptFn
CShellDataObj
CSolpackApp
CSplashWindow
CStatusBar
CTechSupportDlg
CTSTR
CTurn
CUndoMgr
CUnkBase
CUpdateDlg
CUpdateInfo
CUserPrefs
CVariant
CWaitCursor
CWinExcep
CXMLDocument
CXMLElement
CXMLExcep
IActionSite
ICardPileSite
ICardSite
ICompoundXMLDocumentSite
IEngineObjSite
IEngineSite
IEventHandlerSite
IEventSinkSite
IFragmentSite
IGameCommandMgrSite
IGameMenuItemSite
IGameMenuSite
IHlinkWindowSite
IHTMLChooseColorSite
IHTMLControlSite
IHTMLEnableSite
IHTMLLinkSite
IMsgProcessor
INDUnknown
INDUnknownAndDispatch
IPileSite
ISolpackApp
ISolpackApp
ISolpackAppVtbl
ISolpackCard
ISolpackCard
ISolpackCardVtbl
ISolpackFragment
ISolpackFragment
ISolpackFragmentVtbl
ISolpackGame
ISolpackGame
ISolpackGameData
ISolpackGameData
ISolpackGameDataVtbl
ISolpackGameInfo
ISolpackGameInfo
ISolpackGameInfoVtbl
ISolpackGameLib
ISolpackGameLib
ISolpackGameLibVtbl
ISolpackGameVtbl
ISolpackPile
ISolpackPile
ISolpackPileVtbl
IStatusBarMgr
IUndoMgrOwner
IUpdateDlgSite
IUpdateSite
IUserPrefsSite
IXMLDocumentSite
tagDPAIR
Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Alphabetical index

Solitaire Pack Compound Index

_
CFragmentAddCard CKey CWaitCursor ISolpackCard (SolpackLib)
_IID CFragmentAddPile CLib CWinExcep ISolpackCard
C
CGameBase CLibMgr CXMLDocument ISolpackCardVtbl
C3DShatter CGameCommand CLimitSingleInstance CXMLElement ISolpackFragment
CAboutDlg CGameCommandMgr CMainWindow CXMLExcep ISolpackFragment (SolpackLib)
CAction CGameData COOMExcep
I
ISolpackFragmentVtbl
CAppearanceDlg CGameDataAction CPidl IActionSite ISolpackGame (SolpackLib)
CArray CGameInfo CPile ICardPileSite ISolpackGame
CBrowserContainer CGameLaBelleLucie CPileCommentAction ICardSite ISolpackGameData
CBSTR CGameLib CPileShuffleAction ICompoundXMLDocumentSite ISolpackGameData (SolpackLib)
CCard tagGAMEDATA CPointer IEngineObjSite ISolpackGameDataVtbl
CCardIndexAction CGameMenu CPtr IEngineSite ISolpackGameInfo
CCOMExcep CGameMenuItem CPtrArray IEventHandlerSite ISolpackGameInfo (SolpackLib)
CCompoundXMLDocument CGameSpider CQuitExcep IEventSinkSite ISolpackGameInfoVtbl
CCPSounds CHandle CRefCount IFragmentSite ISolpackGameLib
CCPSoundsDlg CHelpMgr CRegDlgInfo IGameCommandMgrSite ISolpackGameLib (SolpackLib)
CDeck CHelpPane CScriptFn IGameMenuItemSite ISolpackGameLibVtbl
CDispBase CHlinkWindow CShellDataObj IGameMenuSite ISolpackGameVtbl
CDlg CHlinkWindowMgr CSolpackApp IHlinkWindowSite ISolpackPile
CEngine CHTMLChk CSplashWindow IHTMLChooseColorSite ISolpackPile (SolpackLib)
CEngineObj CHTMLChooseColor CStatusBar IHTMLControlSite ISolpackPileVtbl
CEventHandler CHTMLControl CTechSupportDlg IHTMLEnableSite IStatusBarMgr
CEventSink CHTMLEdit CTSTR IHTMLLinkSite IUndoMgrOwner
CExcep CHTMLEnable CTurn IMsgProcessor IUpdateDlgSite
CExcepEx CHTMLHelper CUndoMgr INDUnknown IUpdateSite
CFactory CHTMLLink CUnkBase INDUnknownAndDispatch IUserPrefsSite
CFactoryData CHTMLRadioGroup CUpdateDlg IPileSite IXMLDocumentSite
CFragment CHTMLSelect CUpdateInfo ISolpackApp (SolpackLib)
T
CFragmentAction CHTMLStatic CUserPrefs ISolpackApp tagDPAIR
CFragmentAdd CHWND CVariant ISolpackAppVtbl
Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


File Index

Solitaire Pack File List

Here is a list of all files with brief descriptions:
3dshatter.cpp [code]
AboutDlg.cpp [code]
AboutDlg.h [code]
Action.cpp [code]
Action.h [code]
bmws_3dshatter.cpp [code]
bmws_3dshatter.h [code]
bmws_array.h [code]
bmws_base64.cpp [code]
bmws_base64.h [code]
bmws_boolarray.h [code]
bmws_browsercontainer.cpp [code]
bmws_browsercontainer.h [code]
bmws_browsercontainer_res_lc.h [code]
bmws_choosecolor.cpp [code]
bmws_choosecolor.h [code]
bmws_cleardir.cpp [code]
bmws_cleardir.h [code]
bmws_common.h [code]
bmws_compound_xml.cpp [code]
bmws_compound_xml.h [code]
bmws_compound_xml_res.h [code]
bmws_compound_xml_res_lc.h [code]
bmws_comserver.cpp [code]
bmws_comserver.h [code]
bmws_comserver_res.h [code]
bmws_cpsounds.cpp [code]
bmws_cpsounds.h [code]
bmws_cpsounds_res.h [code]
bmws_cpsounds_res_lc.h [code]
bmws_dispbase.cpp [code]
bmws_dispbase.h [code]
bmws_dlg.cpp [code]
bmws_dlg.h [code]
bmws_dwordarray.h [code]
bmws_error.cpp [code]
bmws_error.h [code]
bmws_error_res_lc.h [code]
bmws_eventhandler.cpp [code]
bmws_eventhandler.h [code]
bmws_eventsink.cpp [code]
bmws_eventsink.h [code]
bmws_formatdouble.cpp [code]
bmws_formatdouble.h [code]
bmws_handle.h [code]
bmws_helpmgr.cpp [code]
bmws_helpmgr.h [code]
bmws_helpmgr_res.h [code]
bmws_hlink.cpp [code]
bmws_hlink.h [code]
bmws_hlink_res.h [code]
bmws_hlinkcolor.cpp [code]
bmws_hlinkcolor.h [code]
bmws_hlinkcolor_res.h [code]
bmws_htmlchk.cpp [code]
bmws_htmlchk.h [code]
bmws_htmlchoosecolor.cpp [code]
bmws_htmlchoosecolor.h [code]
bmws_htmlcontrol.cpp [code]
bmws_htmlcontrol.h [code]
bmws_htmledit.cpp [code]
bmws_htmledit.h [code]
bmws_htmledit_res.h [code]
bmws_htmlenable.cpp [code]
bmws_htmlenable.h [code]
bmws_htmlhelpers.cpp [code]
bmws_htmlhelpers.h [code]
bmws_htmlhelpers_res.h [code]
bmws_htmlhelpers_res_lc.h [code]
bmws_htmllink.cpp [code]
bmws_htmllink.h [code]
bmws_htmllink_res.h [code]
bmws_htmlradiogroup.cpp [code]
bmws_htmlradiogroup.h [code]
bmws_htmlselect.cpp [code]
bmws_htmlselect.h [code]
bmws_htmlselect_res.h [code]
bmws_htmlstatic.cpp [code]
bmws_htmlstatic.h [code]
bmws_htmlstatic_res.h [code]
bmws_key.h [code]
bmws_lib.h [code]
bmws_limitsingleinstance.cpp [code]
bmws_limitsingleinstance.h [code]
bmws_multiofn.cpp [code]
bmws_multiofn.h [code]
bmws_ofn.cpp [code]
bmws_ofn.h [code]
bmws_pidl.h [code]
bmws_pointer.cpp [code]
bmws_pointer.h [code]
bmws_ptr.h [code]
bmws_registry.cpp [code]
bmws_registry.h [code]
bmws_regservices.cpp [code]
bmws_regservices.h [code]
bmws_regservices_res.h [code]
bmws_regservices_res_lc.h [code]
bmws_resurl.cpp [code]
bmws_resurl.h [code]
bmws_resurl_res.h [code]
bmws_scriptfn.cpp [code]
bmws_scriptfn.h [code]
bmws_shelldataobj.cpp [code]
bmws_shelldataobj.h [code]
bmws_singleofn.cpp [code]
bmws_singleofn.h [code]
bmws_splashscreen.cpp [code]
bmws_splashscreen.h [code]
bmws_splashscreen_res.h [code]
bmws_splashscreen_res_lc.h [code]
bmws_string.cpp [code]
bmws_string.h [code]
bmws_string_res_lc.h [code]
bmws_stringarray.cpp [code]
bmws_stringarray.h [code]
bmws_techsupport.cpp [code]
bmws_techsupport.h [code]
bmws_techsupport_res_lc.h [code]
bmws_tlb.cpp [code]
bmws_tlb.h [code]
bmws_trackmemalloc.cpp [code]
bmws_trackmemalloc.h [code]
bmws_uintarray.h [code]
bmws_unkbase.cpp [code]
bmws_unkbase.h [code]
bmws_update.cpp [code]
bmws_update.h [code]
bmws_update_res.h [code]
bmws_update_res_lc.h [code]
bmws_updatedlg.cpp [code]
bmws_updatedlg.h [code]
bmws_updatedlg_res.h [code]
bmws_updatedlg_res_lc.h [code]
bmws_variant.h [code]
bmws_waitcursor.cpp [code]
bmws_waitcursor.h [code]
bmws_window.cpp [code]
bmws_window.h [code]
bmws_window_res_lc.h [code]
bmws_xml.cpp [code]
bmws_xml.h [code]
bmws_xml_res.h [code]
bmws_xml_res_lc.h [code]
BrowserContainer.cpp [code]
Card.cpp [code]
Card.h [code]
COMServer.cpp [code]
CPSounds.cpp [code]
CPSoundsIDs.h [code]
Deck.cpp [code]
Deck.h [code]
DispBase.cpp [code]
Engine.cpp [code]
Engine.h [code]
EngineObj.cpp [code]
EngineObj.h [code]
Event.cpp [code]
Fragment.cpp [code]
Fragment.h [code]
FragmentAdd.cpp [code]
FragmentAdd.h [code]
GameBase.cpp [code]
GameBase.h [code]
GameCommandMgr.cpp [code]
GameCommandMgr.h [code]
GameData.cpp [code]
GameData.h [code]
GameIDs.h [code]
GameInfo.cpp [code]
GameInfo.h [code]
GameLaBelleLucie.cpp [code]
GameLaBelleLucie.h [code]
GameLib.cpp [code]
GameLib.h [code]
GameMenu.cpp [code]
GameMenu.h [code]
GameMenuItem.cpp [code]
GameMenuItem.h [code]
GameSpider.cpp [code]
GameSpider.h [code]
Solpack/Helpers.cpp [code]
SPGames/Helpers.cpp [code]
HelpPane.cpp [code]
HelpPane.h [code]
Hlink.cpp [code]
HTMLHelpers.cpp [code]
LibMgr.cpp [code]
LibMgr.h [code]
MainWindow.cpp [code]
MainWindow.h [code]
OFN.cpp [code]
Pile.cpp [code]
Pile.h [code]
ProcessMsg.h [code]
RegServices.cpp [code]
Solpack/resource.h [code]
SolpckLC/resource.h [code]
SPGameLC/resource.h [code]
SPGames/resource.h [code]
Solpack.cpp [code]
Solpack.h [code]
Solpack.idl [code]
Solpack_catid.c [code]
Solpack_i.c [code]
SolpackApp.cpp [code]
SolpackApp.h [code]
SolpackArrays.h [code]
solpackdid.h [code]
SolpackIncl.h [code]
SolpackInternal.h [code]
SolpackInternal_i.c [code]
SPGames.cpp [code]
SPGames.h [code]
SPGames.idl [code]
SPGames_i.c [code]
SplashWindow.cpp [code]
StatusBar.cpp [code]
StatusBar.h [code]
StatusBarMgr.h [code]
Solpack/StdAfx.cpp [code]
SPGames/StdAfx.cpp [code]
Solpack/StdAfx.h [code]
SPGames/StdAfx.h [code]
Solpack/String.cpp [code]
SPGames/String.cpp [code]
Turn.cpp [code]
Turn.h [code]
UndoMgr.cpp [code]
UndoMgr.h [code]
Update.cpp [code]
UserPrefs.cpp [code]
UserPrefs.h [code]
VersionNo.h [code]
Window.cpp [code]
xml.cpp [code]
Generated on Wed May 8 12:38:45 2002 for Solitaire Pack by doxygen 1.2.15


Hierarchical Index

Solitaire Pack Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • _IID
  • CAction
    • CCardIndexAction
    • CFragmentAction
    • CGameDataAction
    • CPileCommentAction
    • CPileShuffleAction
  • CAppearanceDlg
  • CArray
  • CArray< TP, TPA >
    • CPtrArray
  • CBSTR
  • CCPSounds
  • CCPSoundsDlg
  • CDlg
    • CAboutDlg
    • CTechSupportDlg
    • CUpdateDlg
  • CEventHandler
  • CEventSink
  • CExcep
    • CCOMExcep
    • CExcepEx
      • CWinExcep
      • CXMLExcep
    • COOMExcep
    • CQuitExcep
  • CFactory
  • CFactoryData
  • CFragmentAdd
    • CFragmentAddCard
    • CFragmentAddPile
  • CGameCommand
  • tagGAMEDATA
  • CHandle
  • CHelpMgr
  • CHlinkWindow
  • CHTMLEnable
    • CHTMLLink
    • CHTMLStatic
  • CHTMLHelper
  • CKey
  • CLib
  • CLibMgr
  • CLimitSingleInstance
  • CPidl
  • CPointer
  • CPtr
  • CRefCount
    • CHlinkWindowMgr
    • CHWND
      • CHelpPane
      • CMainWindow
      • CSplashWindow
      • CStatusBar
    • CShellDataObj
    • CXMLDocument
      • CCompoundXMLDocument
    • CXMLElement
  • CScriptFn
  • CTSTR
  • CTurn
  • CUndoMgr
  • CUserPrefs
  • CVariant
  • CWaitCursor
  • IActionSite
    • CCard
    • CEngine
    • CGameData
    • CPile
      • CDeck
      • CFragment
  • ICardPileSite
    • CPile
  • ICardSite
    • CEngine
  • IEngineObjSite
    • CEngine
  • IEngineSite
    • CMainWindow
  • IEventHandlerSite
    • CEngine
    • CEngineObj
      • CCard
      • CPile
    • CGameCommandMgr
    • CGameMenu
    • CGameMenuItem
    • CHTMLControl
      • CHTMLChk
      • CHTMLChooseColor
      • CHTMLEdit
      • CHTMLRadioGroup
      • CHTMLSelect
    • CHTMLLink
    • CXMLDocument
  • IEventSinkSite
    • C3DShatter
    • CHelpPane
    • CMainWindow
    • CTechSupportDlg
  • IFragmentSite
    • CEngine
  • IGameCommandMgrSite
    • CEngine
  • IGameMenuItemSite
    • CGameMenu
  • IGameMenuSite
    • CMainWindow
  • IHlinkWindowSite
    • CRegDlgInfo
  • IHTMLChooseColorSite
  • IHTMLControlSite
    • CHTMLRadioGroup
  • IHTMLEnableSite
  • IHTMLLinkSite
  • IMsgProcessor
    • CSolpackApp
  • INDUnknown
    • CUnkBase
      • CBrowserContainer
  • INDUnknownAndDispatch
    • CDispBase
      • CCard
      • CEngine
      • CGameBase
        • CGameLaBelleLucie
        • CGameSpider
      • CGameData
      • CGameInfo
      • CGameLib
      • CPile
  • IPileSite
    • CEngine
  • ISolpackApp
  • ISolpackApp
  • ISolpackAppVtbl
  • ISolpackCard
  • ISolpackCard
  • ISolpackCardVtbl
  • ISolpackFragment
  • ISolpackFragment
  • ISolpackFragmentVtbl
  • ISolpackGame
  • ISolpackGame
  • ISolpackGameData
  • ISolpackGameData
  • ISolpackGameDataVtbl
  • ISolpackGameInfo
  • ISolpackGameInfo
  • ISolpackGameInfoVtbl
  • ISolpackGameLib
  • ISolpackGameLib
  • ISolpackGameLibVtbl
  • ISolpackGameVtbl
  • ISolpackPile
  • ISolpackPile
  • ISolpackPileVtbl
  • IStatusBarMgr
    • CMainWindow
  • IUndoMgrOwner
    • CEngine
  • IUpdateDlgSite
    • CMainWindow
  • IUpdateSite
    • CMainWindow
  • IUserPrefsSite
    • CMainWindow
  • IXMLDocumentSite
    • CCompoundXMLDocument
    • CUpdateInfo
    • ICompoundXMLDocumentSite
  • tagDPAIR
Generated on Wed May 8 12:39:28 2002 for Solitaire Pack by doxygen 1.2.15


Namespace Index

Solitaire Pack Namespace List

Here is a list of all namespaces with brief descriptions:
SolpackLib
SPGamesLib
Generated on Wed May 8 12:40:22 2002 for Solitaire Pack by doxygen 1.2.15