Print Page | Close Window

Windows 7 issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=13798
Printed Date: 30 January 2025 at 6:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Windows 7 issue
Posted By: terrym
Subject: Windows 7 issue
Date Posted: 25 March 2009 at 9:05am

The following code gives an error on Windows 7, but works fine on Windows Vista and below.  Any ideas would be appreciated :(, there is more code to this but we broke it down to bare minimum so others can try to help us.

CComPtr<IMalloc> spIMalloc;
HRESULT hResult = ::SHGetMalloc(&spIMalloc);
LPITEMIDLIST progFolder = NULL;
hResult = ::SHGetSpecialFolderLocation(NULL, CSIDL_PRINTERS, &progFolder );
CComPtr<IShellFolder> spIShellFolder;
CComPtr<IShellFolder> spFolderProgram;
hResult = ::SHGetDesktopFolder(&spIShellFolder);
hResult = spIShellFolder->BindToObject(progFolder, NULL, IID_IShellFolder, (void **)&spFolderProgram );
CComPtr<IEnumIDList> spIEnumIDList;
hResult = spFolderProgram->EnumObjects(NULL, SHCONTF_NONFOLDERS, &spIEnumIDList );
ULONG ulCount = 0;
LPITEMIDLIST listNoFolder = NULL;
hResult = spIEnumIDList->Next(1, &listNoFolder, &ulCount ); // hResult shows an error
spIMalloc->Free(progFolder);


-------------
Thank you,
Terry Mancey

email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net