오피스 파일 구별하기

/* Word Document (*.doc)  : {00020906-0000-0000-C000-000000000046} */ 
static const GUID CLSID_WORD = 
{ 0x00020906, 0x0, 0x0, { 0xC0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x46 }}; 

/* Excel Worksheet (*.xls) : {00020820-0000-0000-C000-000000000046} */ 
static const GUID CLSID_EXCEL = 
{ 0x00020820, 0x0, 0x0, { 0xC0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x46 }}; 

/* PPT Presentation (*.ppt) : {64818D10-4F9B-11CF-86EA-00AA00B929E8} */ 
static const GUID CLSID_PPT = 
{ 0x64818D10, 0x4F9B, 0x11CF, { 0x86, 0xEA, 0x0, 0xAA, 0x0, 0xB9, 0x29, 0xE8 }}; 


void IDFileType(BSTR bstrFile) 
{ 
HRESULT    hr = S_OK; 
IStorage*  pStg = NULL; 
STATSTG    ST; 
char*      pszApp; 

if(NULL == bstrFile) return; 

/* Open