dllutilities.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2009 Autodesk, Inc.  All rights reserved.
00003 //
00004 // Use of this software is subject to the terms of the Autodesk license
00005 // agreement provided at the time of installation or download, or which
00006 // otherwise accompanies this software in either electronic or hard copy form.  
00007 //
00008 //
00009 
00010 #pragma once
00011 
00012 #include "GetResourceString.h"
00013 
00014 // The Microsoft linker provides the __ImageBase pseudo-variable to point
00015 // to the start of a module in memory.  It is equivalent to HINSTANCE.
00016 EXTERN_C IMAGE_DOS_HEADER __ImageBase;
00017 
00018 namespace MaxSDK
00019 {
00020 
00026 inline HINSTANCE GetHInstance()
00027 {
00028     return reinterpret_cast<HINSTANCE>(&__ImageBase);
00029 }
00030 
00048 inline const MCHAR* GetResourceString(UINT resourceId)
00049 {
00050     return MaxSDK::GetResourceString(GetHInstance(), resourceId);
00051 }
00052 
00064 inline  MSTR GetResourceStringAsMSTR(UINT resourceId)
00065 {
00066     return MaxSDK::GetResourceStringAsMSTR(GetHInstance(), resourceId);
00067 }
00068 
00081 inline  bool GetResourceStringAsMSTR(UINT resourceId, MSTR& resourceString)
00082 {
00083     return MaxSDK::GetResourceStringAsMSTR(GetHInstance(), resourceId, resourceString);
00084 
00085 }
00086 
00087 
00088 }