#ifndef __Util_h__
#define __Util_h__
//
// Util.h
// - Shared utilities
//
namespace Util
{
void Trace(char* szLabel, const char* szText, HRESULT hr) ;
void ErrorMessage(HRESULT hr) ;
} ;
#endif // __Util_h__
#include <stdlib.h>
#include <iostream.h>
#include <assert.h>
#include "Util.h"
namespace Util
{
//
// Print out a message with a label.
//
void Trace(char* szLabel, const char* szText, HRESULT hr)
{
cout << szLabel
<< ": /t"
<< szText
<< endl ;
if (FAILED(hr))
{
ErrorMessage(hr) ;
}
}
//
// Print out the COM/OLE error string for an HRESULT.
//
void ErrorMessage(HRESULT hr)
{
void* pMsgBuf ;
::FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
hr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &pMsgBuf,
0,
NULL) ;
cout << "Error (" << hex << hr << "): "
<< (LPTSTR)pMsgBuf << endl ;
// Free the buffer.
LocalFree(pMsgBuf) ;
}
} ; // End Namespace Util
分享到:
相关推荐
GNU utilities for Win32 100多个Linux和Unix下的常用工具和命令, 转成win下的exe,非常好用又实在的工具, 收集了好久的。 如:agrep、zip、tr、cat
Utilities for Windows NT Besides my research work I am responsible for a couple of computers at the physics department of the University of Mainz which are running under Windows NT. Therefore I ...
linux utilities for windows 在windows环境下使用Linux命令
MVS JCL and Utilities For Entry Level Training
Java大牛Doug Lea的关于EE方面并发编程的研究著作预览版。
在Unix 下的命令可以在Windows下运行的软件,不用装虚拟机的,就可以使用Unix的相关命令,所以很方便!
UtilitiES UtilitiES UtilitiES UtilitiES UtilitiES
dos 下用的 norton 系统工具。第8版,共有4个工具,包括硬盘分区工具 partition magic
Part III Oracle Database Server Utilities Messages 17 Export Messages (EXP) 18 Import Messages (IMP) 19 SQL*Loader Messages (SQL*Loader) 20 External Tables Messages (KUP) 21 DBVERIFY Messages (DBV) 22...
单击“Windows CE .NET Utilities v1.1 for Visual Studio .NET 2003.EXE” 链接,开始下载。 然后执行下列操作之一: 要立即开始安装,请单击“打开”或“在当前位置运行该程序”。 要将下载文件复制到计算机上...
UTIlITIES UTIlITIES UTIlITIESOK
batch utilities.scpbatch utilities.scp
MP3 Player Utilities v3.57 给MP3刷机用的。
Amule 远程控制的客户端,windows用的
Norton Utilities15 破解补丁
This manual describes the following DOC Driver utilities for Windows XP and DOS that may be used with SanDisk’s mDOC H3 products: • DFORMAT • DINFO • DIMAGE • SPLITIMAGE • MNGIMG
史上最强大的TuneUp Utilities™ TuneUp Utilities™ 2012现在可供使用了,并且比以往任何时候都更好。改造过的Program Deactivator™可以将PC速度提高50 %。 崭新的TuneUp节能模式革命性地延长了电池寿命。TuneUp ...
Oculus Utilities For Unity 1.12.0,用于使用Unity开发Oculus应用的工具,因为现在国内无法打开Oculus官网,所以下载有些困难,这里直接奉献给你
TuneUp Utilities 是你PC的瑞士军刀——德国系统调校工具第一品牌 TuneUp Utilities,能优化系统性能、解决问题并帮助你定制系统,以满足你的需要!通过 TuneUp Utilities, 你能使 Windows 运行更快、更安全、更舒适...
Glary Utilities注册码