Property Storage

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Krzysztof Dorko

Property Storage

Post by Krzysztof Dorko » 28 Mar 2008, 02:01

 Posted by:  Krzysztof Dorko 

Hi
Small problem (not GTD related but...)
I just play a little with Property Storage (using C++ ). Looks like I have
all research done I mean I can read them and write them back.
My problem is related to speed issue. Up to now I have been using single
property reading method but getting properties for 2000 files takes forever.
So I tried read them at once with one call/per file. (Results are presented
in attachment) Basically it works but my poor knowledge of c++ forced me to
use not so intelligent solution where returned values are hardcoded I mean
function return only title, comment, Subject and a few more. Ideal solution
will be set input array of params to return and get output array of values.
I tried get array of values back and even it was almost ok (I was able to
get values back) but sometimes gtd crashed - probably because I created this
array (of pointers to the strings) inside dll in not correct way. Case is
pretty complex - sometimes property is empty sometimes is Unicode sometimes
ansi.
So my question is How I should create array of strings when a few of them
could be null and return it to my app. Unicode/ansi seems not be a problem
since my conversion is working now.
BTW I hope somebody will find my example useful (it is part of something
bigger so probably needs some cleanup)

Regards
Kris

You do not have the required permissions to view the files attached to this post.

Krzysztof Dorko

Re: Property Storage

Post by Krzysztof Dorko » 01 Apr 2008, 20:54

 Posted by:  Krzysztof Dorko 

So
looks like I have solved my C++ array problem
there is a result.
Kris

You do not have the required permissions to view the files attached to this post.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Property Storage

Post by Jeff Luther » 03 Apr 2008, 20:38

 Posted by:  Jeff Luther 

Hi ~ Thank you for the sample, but I am cannot understand what is going on. The
DLL declarations in your latest zip file have changed to:
Library name: FileStorage.dll
Function: ListViewSortBy
Returns
Boolean: BOOL
Parameters
Window Handle: HWND
Window Handle: HWND
Number: UINT
Number: INT
Function: WriteProprtyValue
Returns
Boolean: BOOL
Parameters
String: LPVOID
Number: LONG
String: LPVOID
Function: ReadMultiProprties
Returns
Boolean: BOOL
Parameters
String: LPSTR
Number: LONG
Number: INT
Receive String: LPVOID

so your original FileProperty.apt is no longer current with this DLL and there
is no updated version of the apt in the zip. The EXE you provide has an "Apply"
pb but that does not appear to update the properties of a sample file I was
testing with.

Perhaps a updated version of your APT will give us the answers??

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/unify/

Krzysztof Dorko

Re: Property Storage

Post by Krzysztof Dorko » 03 Apr 2008, 21:24

 Posted by:  Krzysztof Dorko 

I am sorry
Of course I put exe instead of apt.
Now should be better :)
Apply button should works if only file in not "Read only"( you should have
access to write).
If does not work please send me this file to test and info about windows
system (Vista/xp..).
I have been testing apply only on Xp so maybe it does not works on Vista
since it is Unicode and maybe I mist something (some conversion or..).
Basically Apply works on my XP and I try write all properties as Unicode.
Thx
Kris

You do not have the required permissions to view the files attached to this post.

Krzysztof Dorko

Re: Property Storage

Post by Krzysztof Dorko » 03 Apr 2008, 21:36

 Posted by:  Krzysztof Dorko 

Ok it does not work correctly (this apply option) I see this

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Property Storage

Post by Jeff Luther » 03 Apr 2008, 23:44

 Posted by:  Jeff Luther 

"it does not work correctly (this apply option)" - ?? pbApply works for me!

Thank you for the updated APT sample.

- Jeff

Krzysztof Dorko

Re: Property Storage

Post by Krzysztof Dorko » 04 Apr 2008, 00:23

 Posted by:  Krzysztof Dorko 

It depends from file type i.e. *.jpg when I write title using my app I
cannot read them via Summary tab on properties window. And when I write
Title to jpg file using this summary tab I cannot read them via my app
(still see my "custom value"). So looks like for some types of files My app
writes/reads data to a different property ID. Or for some type of files
windows maps summary info to different properties.
I.E. Title has ID = 2 but maybe for jpg windows maps title to other Id.
Basically it works ok for doc, xls, txt, rpt ,pdf and ... NOT works (if you
need to read them via summary tab) for jpg, xps ...
So it is not so bad (for me) since I am working mainly with rpt, doc,xls and
pdf

thx
Kris

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Property Storage

Post by Jeff Luther » 04 Apr 2008, 00:29

 Posted by:  Jeff Luther 

Thanks for the update. Yes, my sample file was in TXT format.

- Jeff

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests