News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

IShellFolder::Whatever!!! HELP

Started by xandaz, October 24, 2011, 09:29:38 PM

Previous topic - Next topic

dedndave

function pointer   :P
i seem to recall something about function "vector" tables
somehow, you get a pointer to the table, then call functions by index - something like that
the extra dword may be the table base address
search the forum for "com example" or similar

xandaz

   Tout has some examples but he uses that ready to use sdk which makes things even more complicated.

dedndave

that may be the way to go (after all - it's ready to use   :bg )
he probably understands it very well
but, he speaks French - maybe you guys could use google translate and get a dialogue going   :P
i often have a hard time understanding what he is up to

dedndave

Erol gives you a way to go...
http://www.masm32.com/board/index.php?topic=9913.msg72724#msg72724

they also have a manual install version of masm32 v9, intended for win9x
not sure if it has the COM stuff, though
http://www.oby.ro/masm32/m32v9r_legacy.zip

ToutEnMasm

It's not  problem of language,the sdk translate don't speak french.
The interfaces have an usage more simple than the old com stuf who used a complex set of macros and who are not debugged.
To use the interfaces of the sdk translate you must know how to use an API,no more thing is needed,after you have got the pointer.
If you don't know how to use an api,you can't use an interface.
Seem it is the case for xandaz.
A simple way to use them with windows.inc is to copy the needed declaration in an include file.
Here the part to copy:
Quote
   STIShellFolder   STRUCT
      QueryInterface                  comethod3 ?
      AddRef                          comethod1 ?
      Release                         comethod1 ?
      ParseDisplayName                comethod7 ?
      EnumObjects1                    comethod4 ?
      BindToObject                    comethod5 ?
      BindToStorage                   comethod5 ?
      CompareIDs                      comethod4 ?
      CreateViewObject                comethod4 ?
      GetAttributesOf                 comethod4 ?
      GetUIObjectOf                   comethod7 ?
      GetDisplayNameOf                comethod4 ?
      SetNameOf                       comethod6 ?
   STIShellFolder   ENDS


IShellFolder MACRO  Function:REQ, args:VARARG
   ; definition de la macro locale InvokeInterface
    LOCAL InvokeInterface, arg
    FOR arg, <args>     ;verifier que edx n'est pas dans la liste d'arguments args
        IFIDNI <&arg>, <edx>   ;
            .ERR <edx is not allowed as a coinvoke parameter>
        ENDIF
    ENDM
    IFIDNI <&pInterface>, <edx>
        .ERR <edx is not allowed as a coinvoke parameter>
    ENDIF
   ;InvokeInterface = concatene ...CATSTR(concatene) MACRO instruction MASM32   
   InvokeInterface CATSTR <invoke (STIShellFolder PTR[edx]).>,<&Function,ppvIShellFolder>
    IFNB <args>     ; add the list of parameter arguments if any
        InvokeInterface CATSTR InvokeInterface, <, >, <&args>
    ENDIF
   ;   forme les lignes de codes
    mov edx, ppvIShellFolder
    mov edx, [edx]
    InvokeInterface
ENDM      

Here the part who defines the comethod

Quote
pcomethod1   TYPEDEF PROTO :DWORD
pcomethod2   TYPEDEF PROTO :DWORD, :DWORD
pcomethod3   TYPEDEF PROTO :DWORD, :DWORD, :DWORD
pcomethod4   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD
pcomethod5   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD
pcomethod6   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD
pcomethod7   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD
pcomethod8   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD
pcomethod9   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD
pcomethod10   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD
pcomethod11   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD,:DWORD
pcomethod12   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD,:DWORD,:DWORD
pcomethod13   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD,:DWORD,:DWORD,:DWORD
pcomethod14   TYPEDEF PROTO :DWORD, :DWORD, :DWORD, :DWORD , :DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD ,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD


comethod1   TYPEDEF PTR pcomethod1
comethod2   TYPEDEF PTR pcomethod2
comethod3   TYPEDEF PTR pcomethod3
comethod4   TYPEDEF PTR pcomethod4
comethod5   TYPEDEF PTR pcomethod5
comethod6   TYPEDEF PTR pcomethod6
comethod7   TYPEDEF PTR pcomethod7
comethod8   TYPEDEF PTR pcomethod8
comethod9   TYPEDEF PTR pcomethod9
comethod10   TYPEDEF PTR pcomethod10
comethod11   TYPEDEF PTR pcomethod11
comethod12   TYPEDEF PTR pcomethod12
comethod13   TYPEDEF PTR pcomethod13
comethod14   TYPEDEF PTR pcomethod14

I can write the code for you but I can help you any more.


ToutEnMasm

#20
Just one more thing,use of the function who interest you is described here:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775071(v=vs.85).aspx
As i have already explain,get the pointer on IShellFolder,put the value in ppvIShellFolder (dd)
use the function:
IShellFolder GetDisplayNameOf,pidl,flags,addr strret            (strret STRRET <>)
You need a function to translate the path in a pidl.This function is given in the sample i have pointed for you.


xandaz

    I understood what you have explained. I was just wondering why shlobj has an extra :DWORD in the IShellFolder Prototypes. I used Push and then call ppvIShellFolder.GetDisplayNameOf but it crashes. You said you cant help anymore? can you take a look at the code? i'll supply the includes also. Thanks toutenmasm. And also i unserstand french. After all i'm portuguese. You're just two countries away and we're all latin-derived.

ToutEnMasm


I have added the needed declare and corrected the syntax for IShellFolder.
asm compile ok,now.(This not grant he is working)
The ressource need some files to compile.

xandaz

   sorry.... i know that this seems stupid and i'd like to thanks you for the help....i'm not used to macros. How do i call a macro? I tried IShelllFolder,GetDisplayNameOf,addr pIDL,SHGDN_NORMAL,addr strret. Didn't work. Syntax error

ToutEnMasm


It was already written,anyway:
You use the macro exactly as an invoke,it's an invoke .
Quote
;corrected syntax
IShelllFolder GetDisplayNameOf,pIDL,SHGDN_NORMAL,addr strret
Did you put a , just after an invoke ? NO
pIDL  and SHGDN_NORMAL are value passed without addr

xandaz

oh yes pIDL is a memory opperand that the pointer to the ITEMIDLIST, ... correct. I had the impression that macros calls were always done like
someMacro(arg1,...argn)

Thanks for the correction.

xandaz

   Thanks teach...i'm on the right path now.
   Hail M32!!!