home *** CD-ROM | disk | FTP | other *** search
- //
- // Stg.cpp
- //+
- // implementation file
- //-
- // rev 11/02/98 gls
- //
-
- #include "stdafx.h"
- #include "gstg.h"
- #include "Stg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CStg
-
- IMPLEMENT_DYNCREATE(CStg, CCmdTarget)
-
- CStg::CStg()
- {
- EnableAutomation();
-
- // To keep the application running as long as an OLE automation
- // object is active, the constructor calls AfxOleLockApp.
-
- AfxOleLockApp();
- }
-
- CStg::~CStg()
- {
- // To terminate the application when all objects created with
- // with OLE automation, the destructor calls AfxOleUnlockApp.
-
- AfxOleUnlockApp();
- }
-
-
- void CStg::OnFinalRelease()
- {
- // When the last reference for an automation object is released
- // OnFinalRelease is called. The base class will automatically
- // deletes the object. Add additional cleanup required for your
- // object before calling the base class.
-
- CCmdTarget::OnFinalRelease();
- }
-
-
- BEGIN_MESSAGE_MAP(CStg, CCmdTarget)
- //{{AFX_MSG_MAP(CStg)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- BEGIN_DISPATCH_MAP(CStg, CCmdTarget)
- //{{AFX_DISPATCH_MAP(CStg)
- DISP_FUNCTION(CStg, "getStgCount", getStgCount, VT_I4, VTS_NONE)
- DISP_FUNCTION(CStg, "getStg", getStg, VT_BSTR, VTS_I4)
- DISP_FUNCTION(CStg, "Scan", Scan, VT_I4, VTS_BSTR VTS_BSTR)
- //}}AFX_DISPATCH_MAP
- END_DISPATCH_MAP()
-
- // Note: we add support for IID_IStg to support typesafe binding
- // from VBA. This IID must match the GUID that is attached to the
- // dispinterface in the .ODL file.
-
- // {05641F41-7255-11D2-9F15-00A0246D0F63}
- static const IID IID_IStg =
- { 0x5641f41, 0x7255, 0x11d2, { 0x9f, 0x15, 0x0, 0xa0, 0x24, 0x6d, 0xf, 0x63 } };
-
- BEGIN_INTERFACE_MAP(CStg, CCmdTarget)
- INTERFACE_PART(CStg, IID_IStg, Dispatch)
- END_INTERFACE_MAP()
-
- // {05641F42-7255-11D2-9F15-00A0246D0F63}
- IMPLEMENT_OLECREATE(CStg, "gstg.Stg", 0x5641f42, 0x7255, 0x11d2, 0x9f, 0x15, 0x0, 0xa0, 0x24, 0x6d, 0xf, 0x63)
-
- // CStg message handlers
-
- // ////////////////////////////////////////////////////////////
- long CStg::Scan(LPCTSTR pszFileStg, LPCTSTR pszStgSpec)
- {
-
- return( S_OK );
- }
- // ////////////////////////////////////////////////////////////
-
- long CStg::getStgCount()
- {
-
- return( S_OK );
- }
- // ////////////////////////////////////////////////////////////
-
- BSTR CStg::getStg(long iStg)
- {
- CString sResult;
-
- return( sResult.AllocSysString() );
- }
- // ////////////////////////////////////////////////////////////
- // ////////////////////////////////////////////////////////////
- // ////////////////////////////////////////////////////////////
-
-