Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Nov 18, 2017 2:41 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Sat May 04, 2013 11:09 am 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
Thanks again. I have changed that line to:

n = SHGetFileInfo sPath, 0, FInfo, Len("FInfo"), SHGFI_TYPENAME

and now I get this error:

Code, Module2.GetFileDescription, line 14, This method requires more parameters than were passed, n = SHGetFileInfo sPath, 0, FInfo, Len("FInfo"), SHGFI_TYPENAME

It seems to me that the number of parameters match.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Sat May 04, 2013 2:48 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
In your previous code, you only had one parameter for GetFileDescription - the FolderItem. Those parameters look like they should be passed to SHGetFileInfo, not your method named GetFileDescription.

Also, there is an error in that Len("Finfo") should not have Finfo in quotes.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Sun May 05, 2013 2:52 pm 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
I commented out SHGetFileinfo and the return and set a break point to see if the bgfile gets passed to GetFileDescription and it does.
It shows up as the absolutepath in the variable sPath that is used in SHGetFileinfo.

I think that is just the way it should work so I still am not sure what other parameter it needs.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Thu May 09, 2013 10:39 pm 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
Can anyone please clue me in on what parameters I am missing for SHGetFileinfo?


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Thu May 09, 2013 11:19 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
When you call a function that returns a value, you must enclose the parameters in parens:

n = SHGetFileInfo(sPath, 0, FInfo, FInfo.Size, SHGFI_TYPENAME)


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Mon May 13, 2013 11:51 am 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
Well I fixed the parenthesis problem and so the next error is as follows complaining about Len(FIno)

Code, Module2.GetFileDescription, line 13, Parameters are not compatible with this function, n = SHGetFileInfo(sPath, 0, FInfo,Len(FInfo), SHGFI_TYPENAME)

So I know the length and I replaced Len(FInfo) with 352 like so n = SHGetFileInfo(sPath, 0, FInfo,352, SHGFI_TYPENAME) and it seems to work that way

and now the next problem that shows up is:

Code, Module2.GetFileDescription, line 16, Syntax error, Return Left(FInfo.szTypeName, InStr(FInfo.szTypeName & chr(0), chr(0)) - 1)


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Mon May 13, 2013 3:33 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
To get the size of a structure, use FInfo.Size, not Len(FInfo). Len() is for string variables.
The string concatenation operator is +, not &.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Tue May 14, 2013 12:09 pm 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
Thanks again for all your help. Now the program does run to completion.
Trouble is it does not return the comments for the current background image.
I want to show the comments that are in the properties/details tab from windows explorer in textarea1 along with the file name, but the code I have does not return anything.
The file name part works fine but the comments do not.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Fri May 17, 2013 12:08 pm 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
I want to show the comments that are in the properties/details tab from windows explorer in textarea1.
Does anyone know if SHGetFileInfo will give me the above comments or if not is there any other way to accomplish this?


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Fri May 17, 2013 12:29 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Comments for an image file are stored in the file itself. You need to read and parse the exif data.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Mon May 20, 2013 11:45 am 
Offline

Joined: Sun Dec 02, 2012 10:50 pm
Posts: 30
Hi timhare,

I thought that was what SHGetFileInfo was for but I did not get anything returned from it.
Do you know if SHGetFileInfo is accessing the EXIF data? Another term that I've seen is
Metadata. Is this the same as EXIF data?
I have been searching for info on where in the file the comments are stored so that I can
access them. So far I have seen info on where a lot of other info on the file is stored but
have not seen anything about the comments. I will keep searching.
Thanks again for all your help.


Top
 Profile  
Reply with quote  
 Post subject: Re: how do you access comments of a file from windows explor
PostPosted: Mon May 20, 2013 2:33 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
mandjb wrote:
I thought that was what SHGetFileInfo was for but I did not get anything returned from it.
Do you know if SHGetFileInfo is accessing the EXIF data?

It is not.

Quote:
Another term that I've seen is Metadata. Is this the same as EXIF data?

Yes. At least, it can refer to the exif data. It can be used in a broader sense, also.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group