Link to home
Start Free TrialLog in
Avatar of Marshow
Marshow

asked on

Getting FileType with MFC

I recently started using c++ with MFC, but I can't find all the functions that the api has.
I usually used the SHGetFileInfo with the SHGFI_TYPENAME argument to receive the filetype before I began with MFC.

Now I use the CFileFind class to locate files on the harddisk, it works fine, but I can't find any function that receives the FileType... I've searched for other classes like the CFile but with no succeed.

how do I receive the filetype description of a file?
Avatar of Triskelion
Triskelion
Flag of United States of America image

Can you give me an example of what you mean by file type?
Avatar of Marshow
Marshow

ASKER

A description of the extension like "Winamp media file" or "Textdocument" or "WinRAR ZIP Archive".
ASKER CERTIFIED SOLUTION
Avatar of naveenkohli
naveenkohli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
>>I usually used the SHGetFileInfo with the SHGFI_TYPENAME argument to receive the filetype before I began with MFC.

Why did you stop using it?  All Win32 API fns are availabe in MFC.  Example:

  SHFILEINFO rInfo;
  SHGetFileInfo( "*.ZIP", 0, &rInfo, sizeof(rInfo), SHGFI_TYPENAME );

  MessageBox( rInfo.szTypeName, "The type is..." );

-- Dan
Avatar of Marshow

ASKER

aha, ok, I thought that all api functions was included within the MFC.
You were correct before: All Win32 API functions are included in MFC.

-- Dan