Results 1 to 16 of 16

Thread: Get Summary information [still needing help]

  1. #1

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Question Get Summary information [still needing help]

    I'm wanting to get the file summary from a selected file and put it into seperate strings, title and so on.

    Cheers..
    Last edited by Chrispybee; Jun 14th, 2005 at 11:06 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Get file summary and put it into strings

    What kind of file and what do you mean by "file summary"?

  3. #3

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get file summary and put it into strings

    A file that you have saved on your hard drive. Like, "C:\test.txt". If you right click this file and select Summary (win 2k >) then you have the title, version etc..

    This is the data that I'm wanting to get from files.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Get file summary and put it into strings

    Quote Originally Posted by Chrispybee
    A file that you have saved on your hard drive. Like, "C:\test.txt". If you right click this file and select Summary (win 2k >) then you have the title, version etc..

    This is the data that I'm wanting to get from files.
    Oh...you want the property page. Try something like this
    VB Code:
    1. Option Explicit
    2.  
    3. Private Type SHELLEXECUTEINFO
    4.     cbSize        As Long
    5.     fMask         As Long
    6.     hwnd          As Long
    7.     lpVerb        As String
    8.     lpFile        As String
    9.     lpParameters  As String
    10.     lpDirectory   As String
    11.     nShow         As Long
    12.     hInstApp      As Long
    13.     lpIDList      As Long     'Optional parameter
    14.     lpClass       As String   'Optional parameter
    15.     hkeyClass     As Long     'Optional parameter
    16.     dwHotKey      As Long     'Optional parameter
    17.     hIcon         As Long     'Optional parameter
    18.     hProcess      As Long     'Optional parameter
    19. End Type
    20.  
    21. Private Const SEE_MASK_INVOKEIDLIST = &HC
    22. Private Const SEE_MASK_NOCLOSEPROCESS = &H40
    23. Private Const SEE_MASK_FLAG_NO_UI = &H400
    24.  
    25. Private Declare Function ShellExecuteEx Lib "shell32.dll" _
    26. (SEI As SHELLEXECUTEINFO) As Long
    27.  
    28. Private Sub ShowProperties(filename As String, OwnerhWnd As Long)
    29.  
    30.   'open a file properties property page for
    31.   'specified file if return value
    32.    Dim SEI As SHELLEXECUTEINFO
    33.   'Fill in the SHELLEXECUTEINFO structure
    34.    With SEI
    35.       .cbSize = Len(SEI)
    36.       .fMask = SEE_MASK_NOCLOSEPROCESS Or _
    37.                SEE_MASK_INVOKEIDLIST Or _
    38.                SEE_MASK_FLAG_NO_UI
    39.       .hwnd = OwnerhWnd
    40.       .lpVerb = "properties"
    41.       .lpFile = filename
    42.       .lpParameters = vbNullChar
    43.       .lpDirectory = vbNullChar
    44.       .nShow = 0
    45.       .hInstApp = 0
    46.       .lpIDList = 0
    47.    End With
    48.  
    49.   'call the API to display the property sheet
    50.    Call ShellExecuteEx(SEI)
    51.  
    52. End Sub
    53.  
    54. 'Usage:   Place the full path and file name in the text box
    55. Private Sub Command1_Click()
    56. Call ShowProperties((Text1.Text), Me.hwnd)
    57. End Sub

  5. #5

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get file summary and put it into strings

    Sorry, maybe I didn't make myself clear. I've done this but it's not what I want. This will open the property page where all I want to do, is to say. I want the Title (from the summary page) from C:\test.txt in strTitleSummary.

    I hope that this makes sense. I've tried using FSO and file1 but no joy. I do fell that this is an API call I may have to make but I dont know what it would be??


    Please help..

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Get file summary and put it into strings



    Has someone helped you? Then you can Rate their helpful post.

  7. #7

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get file summary and put it into strings

    Thanks manavo11 for the reply. I cannot make head nor tail of this post. It looks like this is for vb.net and I've not had any experience with vb.net or c++

    Please could explain how this could be used in Visual Basic 6?

  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Get file summary and put it into strings

    Unfortunatelly, I couldn't get much either... I posted hoping that you would...


    Has someone helped you? Then you can Rate their helpful post.

  9. #9

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get file summary and put it into strings

    I need to use the function stgOpenStorageEX that I've found on MSDN. How would I format the below into VB format?

    HRESULT StgOpenStorageEx(
    const WCHAR* pwcsName,
    DWORD grfMode,
    STGFMT stgfmt,
    DWORD grfAttrs,
    STGOPTIONS* pStgOptions,
    void* reserved2,
    REFIID riid,
    void** ppObjectOpen
    );

  10. #10

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get file summary and put it into strings

    I've found the source code I need to perform the required task, the only problem is that it's in Delphi!! Cannot find any VB6 source code at all!!

    Here is the link http://www.delphi-central.com/tutori...mary_Info.aspx
    Please can someone help me rewrite this to VB??

    Thanks

  11. #11

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: convert Deplhi source code to VB6 - Get Summary information

    I'm trying to rewrite the Delphi code from the above website but having difficulties..

    I'm trying to put this
    VB Code:
    1. Public Declare Sub FmtIdToPropStgName Lib "iprop.dll" (ByRef pfmtid As FMTID, ByVal oszName As String)
    but getting "User -Defined Type Not Defined"

    I dont know where to get the FMTID from?

    Any Ideas?? I think that I'm putting the correct API calls into my code but no joy!

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: convert Delphi source code to VB6 - Get Summary information

    Delphi has built in support for the Windows API, but in VB 6 you need to declare all the functions and UDT's your self. A user defined type is the equivalent of a record in Delphi.

    The best I could find on FMTID is this:

    http://msdn.microsoft.com/library/de...n_istorage.asp

    I don't rewally understnad it though, so hopefully someone else will be able to help you convert it to something you can use in VB.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: convert Delphi source code to VB6 - Get Summary information

    Thanks Visual App!! I've been trying to understand how I can declare the FMTID.

    If anyone else can help me, that would be great!! I'm struggling here a bit and new to writing API stuff!!

  14. #14

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: convert Delphi source code to VB6 - Get Summary information

    If you have a look at the Delphi code, it has a few functions that I cannot find by either Internet Search or Using API Viewer.
    Code:
    IPropertySetStorage
    This is the delphi code that i've found

    Code:
    function StgOpenStorageEx (
     const pwcsName : POleStr;  //Pointer to the path of the
                                //file containing storage object
     grfMode : LongInt;         //Specifies the access mode for the object
     stgfmt : DWORD;            //Specifies the storage file format
     grfAttrs : DWORD;          //Reserved; must be zero
     pStgOptions : Pointer;     //Address of STGOPTIONS pointer
     reserved2 : Pointer;       //Reserved; must be zero
     riid : PGUID;              //Specifies the GUID of the interface pointer
     out stgOpen :              //Address of an interface pointer
     IStorage ) : HResult; stdcall; external 'ole32.dll';
    I have been able to find this fine and put it into my Module. The issue that I'm having is finding the IPropertySetStorage, IPropertyStorage, TPropVariant, TPropSpec & IStorage.

    Please help as I cannot find a VB example on how to do this and would be great to be able to get this information.

    Many thanks for all your help!

  15. #15

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Get Summary information [still needing help]

    I am starting to cry!! Please could someone help me. I may be going around this the wrong way. :@(

  16. #16
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Get Summary information [still needing help]

    OK 2 yrs later, any know how to access the StgOpenStorageEx from OLE32.dll using VB6? I can't find any good wrappers.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width