[GME-commit] GMESRC/GME/Console Console.cpp,1.1,1.2

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Dec 2 16:00:28 CST 2004


Update of /var/lib/gme/GMESRC/GME/Console
In directory braindrain:/tmp/cvs-serv12495

Modified Files:
	Console.cpp 
Log Message:
console scripting

CVS User: bogyom

Index: Console.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/GME/Console/Console.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Console.cpp	24 Jul 2004 06:41:53 -0000	1.1
--- Console.cpp	2 Dec 2004 22:00:26 -0000	1.2
***************
*** 3,6 ****
--- 3,9 ----
  #include "stdafx.h"
  #include "Console.h"
+ #include <initguid.h>
+ #include "Console_i.c"
+ #include "ScriptHost.h"
  
  #ifdef _DEBUG
***************
*** 25,28 ****
--- 28,34 ----
  {
  	BOOL bInit = COleControlModule::InitInstance();
+ 	if (!InitATL())
+ 		return FALSE;
+ 
  
  	if (bInit)
***************
*** 42,45 ****
--- 48,54 ----
  	// TODO: Add your own module termination code here.
  
+ 	_Module.Term();
+ 
+ 
  	return COleControlModule::ExitInstance();
  }
***************
*** 59,62 ****
--- 68,73 ----
  		return ResultFromScode(SELFREG_E_CLASS);
  
+ 	return _Module.RegisterServer(TRUE);
+ 
  	return NOERROR;
  }
***************
*** 76,79 ****
--- 87,121 ----
  		return ResultFromScode(SELFREG_E_CLASS);
  
+ 	_Module.UnregisterServer(TRUE); //TRUE indicates that typelib is unreg'd
+ 
  	return NOERROR;
+ }
+ 
+ 	
+ CComModule _Module;
+ 
+ BEGIN_OBJECT_MAP(ObjectMap)
+ OBJECT_ENTRY(CLSID_ScriptHost, CScriptHost)
+ END_OBJECT_MAP()
+ 
+ STDAPI DllCanUnloadNow(void)
+ {
+ 	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ 	return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
+ }
+ /////////////////////////////////////////////////////////////////////////////
+ // Returns a class factory to create an object of the requested type
+ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+ {
+ 	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+ 	if(AfxDllGetClassObject(rclsid, riid, ppv) == S_OK)
+ 		return S_OK;
+ 	return _Module.GetClassObject(rclsid, riid, ppv);
+ }
+ 
+ BOOL CConsoleApp::InitATL()
+ {
+ 	_Module.Init(ObjectMap, AfxGetInstanceHandle());
+ 	return TRUE;
+ 
  }



More information about the GME-commit mailing list