COM compiler errors
-
Hi, I'm working in VC++ 6.0 and am trying to compile the sample application at http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx[^] It's a MFC wrapper class for the SHBrowseForFolder API. I'm having trouble resolving some of the compiler errors. I created a .dsw project file from the .sln and .vcproj files using http://www.codeproject.com/tools/prjconverter.asp[^] Some of the compiler errors are below:- D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(566) : error C2787: 'IShellFolder' : no GUID has been associated with this object D:\temp\FolderPick\FolderDlg.h(133) : error C2504: 'IFolderFilter' : base class undefined D:\temp\FolderPick\FolderDlg.cpp(101) : error C2065: 'StrRetToBuf' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(145) : error C2065: 'BFFM_IUNKNOWN' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(145) : error C2051: case expression not constant D:\temp\FolderPick\FolderDlg.cpp(175) : error C2065: 'IFolderFilterSite' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(175) : error C2955: 'CComQIPtr' : use of class template requires template argument list D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(715) : see declaration of 'CComQIPtr' Where would the GUID of IShellFolder be? Would appreciate any help. Thanks, Mel
-
Hi, I'm working in VC++ 6.0 and am trying to compile the sample application at http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx[^] It's a MFC wrapper class for the SHBrowseForFolder API. I'm having trouble resolving some of the compiler errors. I created a .dsw project file from the .sln and .vcproj files using http://www.codeproject.com/tools/prjconverter.asp[^] Some of the compiler errors are below:- D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(566) : error C2787: 'IShellFolder' : no GUID has been associated with this object D:\temp\FolderPick\FolderDlg.h(133) : error C2504: 'IFolderFilter' : base class undefined D:\temp\FolderPick\FolderDlg.cpp(101) : error C2065: 'StrRetToBuf' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(145) : error C2065: 'BFFM_IUNKNOWN' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(145) : error C2051: case expression not constant D:\temp\FolderPick\FolderDlg.cpp(175) : error C2065: 'IFolderFilterSite' : undeclared identifier D:\temp\FolderPick\FolderDlg.cpp(175) : error C2955: 'CComQIPtr' : use of class template requires template argument list D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(715) : see declaration of 'CComQIPtr' Where would the GUID of IShellFolder be? Would appreciate any help. Thanks, Mel
-
melwyn wrote:
Where would the GUID of IShellFolder be?
Should be in comdef.h, so you might need to include that before including atlbase.h; Out of interest, have you downloaded and installed the Feb2003 PSDK? Steve S Developer for hire
Thanks for your reply. Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter. (By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h) Yes I have Feb 2003 PSDK installed. Does that have some issue? Thanks, Mel
-
Thanks for your reply. Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter. (By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h) Yes I have Feb 2003 PSDK installed. Does that have some issue? Thanks, Mel
melwyn wrote:
Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter. (By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h)
Erm, most of my ATL stuff has the include for atlbase.h in stdafx.h, followed by a module definition, then the rest of the ATL headers I'm using.
melwyn wrote:
Yes I have Feb 2003 PSDK installed. Does that have some issue?
Yes. It includes later header files and libs, as well as a later version of the MIDL compiler. It also happens to be the last version supporting VC6, if that's important. Steve S Developer for hire
-
melwyn wrote:
Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter. (By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h)
Erm, most of my ATL stuff has the include for atlbase.h in stdafx.h, followed by a module definition, then the rest of the ATL headers I'm using.
melwyn wrote:
Yes I have Feb 2003 PSDK installed. Does that have some issue?
Yes. It includes later header files and libs, as well as a later version of the MIDL compiler. It also happens to be the last version supporting VC6, if that's important. Steve S Developer for hire
Doh! Having re-read the thread, you aren't using ATL, so "OOPS". However, the IFolderFilter is defined in SHOBJIDL.H, and CComQIPtr is defined in ATLBASE.H too. It might be causing a problem if IFolderFilter isn't defined first, so try shobjidl.h comdef.h atlbase.h in your stdafx.h It works here. Steve S Developer for hire
-
Doh! Having re-read the thread, you aren't using ATL, so "OOPS". However, the IFolderFilter is defined in SHOBJIDL.H, and CComQIPtr is defined in ATLBASE.H too. It might be causing a problem if IFolderFilter isn't defined first, so try shobjidl.h comdef.h atlbase.h in your stdafx.h It works here. Steve S Developer for hire
Including atlbase.h took care of CComQIPtr. However I don't have shobjidl.h anywhere on my machine. Is that something that would come only with VC 7, looks that way atleast. (On a different note, I don't have "comdefsp.h" either...i think these are VC 7 files). I tried including shlobj.h but didn't help.
-
Including atlbase.h took care of CComQIPtr. However I don't have shobjidl.h anywhere on my machine. Is that something that would come only with VC 7, looks that way atleast. (On a different note, I don't have "comdefsp.h" either...i think these are VC 7 files). I tried including shlobj.h but didn't help.
You should have SHOBJIDL.H and SHOBJIDL.IDL in the platform SDK include directory. Of course, you need to make sure that VC6 is looking in there before it's own directories, and the same for the LIB files (although you may not need them in this project). Steve S Developer for hire