add (simple) archutils tree and AppInstance class
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
#include "../../../stdafx.h"
|
||||||
|
#include "AppInstance.h"
|
||||||
|
|
||||||
|
AppInstance::AppInstance()
|
||||||
|
{
|
||||||
|
/* Little trick to get an HINSTANCE of ourself without having access to the hwnd ... */
|
||||||
|
TCHAR szFullAppPath[MAX_PATH];
|
||||||
|
GetModuleFileName(NULL, szFullAppPath, MAX_PATH);
|
||||||
|
h = LoadLibrary(szFullAppPath);
|
||||||
|
/* h will be NULL if this fails. Most operations that take an HINSTANCE
|
||||||
|
* will still work without one (but may be missing graphics); that's OK. */
|
||||||
|
}
|
||||||
|
|
||||||
|
AppInstance::~AppInstance()
|
||||||
|
{
|
||||||
|
if(h)
|
||||||
|
FreeLibrary(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2002 by the person(s) listed below. All rights reserved.
|
||||||
|
*
|
||||||
|
* Glenn Maynard
|
||||||
|
*/
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef APP_INSTANCE_H
|
||||||
|
#define APP_INSTANCE_H
|
||||||
|
|
||||||
|
/* Win32 only: get an HINSTANCE; used for starting dialog boxes. */
|
||||||
|
class AppInstance
|
||||||
|
{
|
||||||
|
HINSTANCE h;
|
||||||
|
|
||||||
|
public:
|
||||||
|
AppInstance();
|
||||||
|
~AppInstance();
|
||||||
|
HINSTANCE Get() const { return h; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2002 by the person(s) listed below. All rights reserved.
|
||||||
|
*
|
||||||
|
* Glenn Maynard
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user