🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by Asger Jørgensen Fri, 19 Oct 2007 03:40
SHGetDataFromIDList fails on temporary internet files
#1178
Author: Asger Jørgensen
Date: Fri, 19 Oct 2007 03:40
60 lines
2483 bytes
Hi there

I use SHGetDataFromIDList and PIDL's to get the size 
and the display name of all the files on a drive.
but for some reason this function fails on 
temprary internet files.

when I use FindFirstFile..... I get this structure

Temporary Internet Files
	Content.IE5
		3UCR7HWX // containing lots of files
		4XA345QJ // ....
		73L3NPCW // ....
		8FVNQCXL // ....
		TCJQZFPJ // ....
		TVFVDDK2 // ....
		W9EB8HI3 // ....
		Z58KGR7Z // ....
	Content.MSO

But when I use the explorer 
Temporary Internet Files containing
2877 files but no folders.

And the explorer does show the size of these files.

The code I use:

   IShellFolder *SubFolder = NULL;
   if( FAILED(ParentFolder->BindToObject(pidlSubFolder, NULL, 
IID_IShellFolder, (LPVOID*)&SubFolder)) )
      return;
                                                                
//
   IEnumIDList *Enum = NULL;
   if( FAILED(SubFolder->EnumObjects(NULL, SHCONTF_FOLDERS | 
SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &Enum)) )
   {
      SubFolder->Release();
      return;
   }

   LPITEMIDLIST pidlItem;
   while( Enum->Next(1, &pidlItem, NULL) == S_OK )
   {
      WIN32_FIND_DATA Wfd = {0};
      if( FAILED(SHGetDataFromIDList(SubFolder, pidlItem, 
SHGDFIL_FINDDATA, &Wfd, sizeof(WIN32_FIND_DATA) ) ) )
      {
         CoTaskMemFree(pidlItem);
         continue;// Stop here on temporary internet files.
      }

Snip...From here I just add to my own structure....

Anybody know what to do ?

Thanks in advance
Asger
Re: SHGetDataFromIDList fails on temporary internet files
#1179
Author: Remy Lebeau (TeamB)
Date: Fri, 19 Oct 2007 04:23
24 lines
1888 bytes
"Asger J�rgensen" <junk@Asger-P.dk> wrote in message
news:MPG.218245b2537e015098985c@newsgroups.borland.com...

> when I use FindFirstFile..... I get this structure
<snip>

That is because you are accessing the underlying file system directly, so
you see the raw files and folders.

> But when I use the explorer
> Temporary Internet Files containing
> 2877 files but no folders.

"Temporary Internet Files" is a virtual folder in Windows Explorer.  The
files and subfolders consist of a kind of database, and when you view the
root "Temporary Internet Files" folder, the contents of the subfolders are
displayed in a single view as if their were no subfolders, and other file
information is displayed that would not normally be accessible (such as the
URL of each file).  When you use IShellFolder, you are accessing the items
the same way that Windows Explorer does, not how the file system does.


Gambit
Re: SHGetDataFromIDList fails on temporary internet files
#1180
Author: Asger Jørgensen
Date: Fri, 19 Oct 2007 06:35
19 lines
1884 bytes
Hi Remy

In article <471833b6$1@newsgroups.borland.com>, 
no.spam@no.spam.com says...
> "Temporary Internet Files" is a virtual folder in Windows Explorer.  The
> files and subfolders consist of a kind of database, and when you view the
> root "Temporary Internet Files" folder, the contents of the subfolders are
> displayed in a single view as if their were no subfolders, and other file
> information is displayed that would not normally be accessible (such as the
> URL of each file).  When you use IShellFolder, you are accessing the items
> the same way that Windows Explorer does, not how the file system does.

Thanks for explaining, but how do I get the size 
of each of those files, I can see that I can get 
the display but what about the size ??
Now that SHGetDataFromIDList don't work ?

Thanks in advance
Asger
Re: SHGetDataFromIDList fails on temporary internet files
#1183
Author: Remy Lebeau (TeamB)
Date: Fri, 19 Oct 2007 16:51
11 lines
1368 bytes
"Asger J�rgensen" <junk@Asger-P.dk> wrote in message 
news:MPG.21826e95e6e7cbbe98985e@newsgroups.borland.com...

> Now that SHGetDataFromIDList don't work ?

You have not said yet why it doesn't work for you.  Is it returning an error 
code?  If so, what is it?


Gambit
Re: SHGetDataFromIDList fails on temporary internet files
#1184
Author: Asger Jørgensen
Date: Fri, 19 Oct 2007 21:52
59 lines
2661 bytes
Hi Remy

In article <4718e0b4@newsgroups.borland.com>, 
no.spam@no.spam.com says...
> 
> "Asger Jørgensen" <junk@Asger-P.dk> wrote in message 
> news:MPG.21826e95e6e7cbbe98985e@newsgroups.borland.com...
> 
> > Now that SHGetDataFromIDList don't work ?
> 
> You have not said yet why it doesn't work for you.  Is it returning an error 
> code?  If so, what is it?

Well I just thought it was commenly known that it fails 
on that kind of objects At least the VirtualListView 
example from BCB5 have the same problem.
They do a size = 1 when it fails

But here is what I've been able to get in return:
The function returns -2147467263 every time it fails

GetLastError() returns 0 on all the teporary internet 
files.
but on some of the other object it returns these 
errors:

Name of file from GetDiplayNameOf
Errorstring
Errorcode

My actual startpage
The named module was not found.
126

C:\WINDOWS\Tasks\Plan new task.job
Sizeof dat is to small.
122

For 3 uger siden

12051

2 Weeks Ago
A File that already exist can not be created.
183

P.s. The error messages are translated from Danish.

I have just tested the app on a win2000 and there
it finds all the teporary internet files and the 
structure looks just like it does when I use 
FindFirstFile... nested folder ending with files,
but when I check in the explorer it is the same as 
on XP no folder just files.

Hope You can help
Thanks in advance
Asger
Re: SHGetDataFromIDList fails on temporary internet files
#1192
Author: Asger Jørgensen
Date: Sat, 20 Oct 2007 10:33
44 lines
2283 bytes
Hi Remy

In article <4718e0b4@newsgroups.borland.com> 
no.spam@no.spam.com 
 Remy Lebeau (TeamB) says:
> 
> "Asger Jørgensen" <junk@Asger-P.dk> wrote in message 
> news:MPG.21826e95e6e7cbbe98985e@newsgroups.borland.com...
> 
> > Now that SHGetDataFromIDList don't work ?
> 
> You have not said yet why it doesn't work for you.  Is it returning an error 
> code?  If so, what is it?

Just a little extra info

These are the directories that fails on the contens

D-S = Documents and Settings
Logged on as User1
C:\D-S\User1\LocalSetting\Oversigt\
C:\D-S\User1\LocalSetting\Temporary Internet Files\
C:\WINDOWS\assembly\
C:\WINDOWS\Downloaded Program Files\
C:\WINDOWS\Offline Web Pages\
C:\WINDOWS\Tasks\

Logged on as User_2
C:\D-S\User_2\LocalSetting\Oversigt\
C:\D-S\User_2\LocalSetting\Temporary Internet Files\
C:\WINDOWS\assembly\
C:\WINDOWS\Downloaded Program Files\
C:\WINDOWS\Offline Web Pages\
C:\WINDOWS\Tasks\

The four windows directories fails on all users.
The last to only fails per user
The app find all the files Under other users.

Thanks in advance
Kind regards
Asger
 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads