home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Houseplan Collection
/
HRCD2005.ISO
/
data1.cab
/
Zusatz
/
3DS
/
DATA2.Z
/
DialogExplorer.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-11-23
|
2KB
|
93 lines
// DialogExplorer.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "DialogExplorer.h"
#include "ArConEventSink.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogExplorer
BEGIN_MESSAGE_MAP(CDialogExplorer, CWinApp)
//{{AFX_MSG_MAP(CDialogExplorer)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogExplorer construction
CDialogExplorer::CDialogExplorer()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CDialogExplorer object
CDialogExplorer theApp;
IArCon * theExe = NULL;
ArConEventSink * theEventSink = NULL;
// Diese Funktion kann mehrfach aufgerufen werden, je nach Reihenfolge
// des Beendens (erst ArCon, dann das Makro oder andersherum).
void CleanupConnection()
{
if (theEventSink) {
theEventSink->Disconnect();
theEventSink->ExternalRelease();
theEventSink = NULL;
}
if (theExe) {
theExe->Release();
theExe = NULL;
}
}
/////////////////////////////////////////////////////////////////////////////
// CDialogExplorer initialization
BOOL CDialogExplorer::InitInstance()
{
// Standard initialization
AfxOleInit();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
if (FAILED(CoCreateInstance(CLSID_ArCon, NULL, CLSCTX_LOCAL_SERVER, IID_IArCon, (void**)&theExe))) {
CString msg;
msg.LoadString(IDS_NO_ARCON);
AfxMessageBox(msg);
return FALSE;
}
theEventSink = new ArConEventSink(theExe);
VARIANT_BOOL res;
theExe->StartMe(0, NULL, &res);
return TRUE;
}
// Main running routine until application exits
int CDialogExplorer::Run()
{
return CWinThread::Run();
}
int CDialogExplorer::ExitInstance()
{
CleanupConnection();
return CWinApp::ExitInstance();
}