views:

100

answers:

1

Hello, stackoverflowers :)

I have given up tryng to figure out the reason of this issue, but here is the story and hope you could give a tip...

As I develop unique app ( http://code.google.com/p/sedev ) and therefore I need to polish it.
I have to add File Summary ( very useful info in my opinion ) to any created files by the app, so I decided to go with NTFS compatible structure edit: code snippet in which problem occurs:

if (FileExists(BaseLocation + LeftStr(GetSSWData, Length(GetSSWData)
              - 1) + '.vkp') = True) then // add NTFS descriptive information to output file
        try
          SetFileSummaryInfo
            (PWideChar(BaseLocation + LeftStr(GetSSWData, Length
                  (GetSSWData) - 1) + '.vkp')); // in my testcase files full path is: C:\Documents and Settings\Kludge\Desktop\sedevrpg\SEDEV_RPG_O_710.vkp
          ShowMessagePos('Patch Created successfuly!' + #13#13 +
              'Please verify created data to www.se-developers.net.',
            ParamStr2X, ParamStr3Y);
          MessageBeep(0);
        except // exception handler does not even fire on exception ...
          on Exception do
          begin
            if (WarningChBx.Checked = True) then
              ShowMessagePos
                ('Unable to add Description to Output file (' +
                  BaseLocation + LeftStr(GetSSWData, Length(GetSSWData)
                    - 1) + '.vkp )', ParamStr2X, ParamStr3Y);
            MessageBeep(0);
          end;
        end

final edit by author: Problem was in SetFileSummaryInfo(PWideChar('')) because after PWideChar conversion you got CHARACTER, not Array of Characters ( aka Strings ) therefore it is not valid path anymore!

Here is main tutorial: http://www.delphipages.com/articles/setting_file_summary_information-9228.html
edit: a better formatted tutorial is here.

BUT, the thing is that I just cannot get that damned FileName param to accept any string ... I have EOleSysError exception: "%1 cannot be found" no matter what.

Faulting operand is:

OleCheck(StgOpenStorageEx(PWideChar(FileName),
 STGM_SHARE_EXCLUSIVE or STGM_READWRITE,
 STGFMT_ANY,
 0, nil,  nil, @IID_IPropertySetStorage, stg));

What I do not understand is why it actually wants %1 MSDOS file name input.
I am not launching app from CMD therefore I highly doubt it needs additional param for File path ...

I have tried all possible String and PString conversions, also tried various param passing methods ... It just does not work ...

Any help appreciated!

A: 

I can only reproduce your case by specifying an invalid filename. Make sure that you include the full path in your filename.

The_Fox
Thanks, The_Fox ! No points for direct answer, but still - you helped a lot!
HX_unbanned