Situation:
Using SHGetSpecialFolder and then binding the result with the SHGetDesktopFolder's IShellFolder to get a IShellFolder interface to the special folder. And Then using EnumIDList etc... to create a shell browsing app using the COM standard.

Question: All that i have is a pIDL to the current IShellFolder and i wish to create a file within that folder object, is there any API call that can take a pIDL or similar to create a file. Because CreateFile doesn't and if there isn't, what would be relativly be a painless way to get a path string from a pIDL.

Sugestion: Creating a shortcut through the IShellLink interface an then using the find target call to get an string to that path. - seems like a bit of work to convert a pIDL to somthing acceptable for CreateFile.

Thanx,
Black iCE
Posted on 2004-06-15 01:51:26 by Black iCE
I suppose that i will just have to travel through the NameSpace by keeping an absolute pIDL in as a varible and then have to say ok if it is on the desktop then the path would be c:\Documents and settings\user\desktop or if anywhere else i would have to take out "->->" and keep the remainder?

Is this the only and best approach?
Posted on 2004-06-15 09:42:13 by Black iCE
Black ICE,

what is with SHGetPathFromIDlist? Why doesnt that do what you want?

Japheth
Posted on 2004-06-16 02:15:00 by japheth
*Sheepish Grin* thank you japheth.

How does a stand-alone app obtain the IShellBrowser interface that is apparently only exposed by Windows Explorer when you create a shell extension??

Viewing some threads in this section i came across the following thread http://www.asmcommunity.net/board/showthread.php?threadid=11187,
some nice docs (thanx Nan) but what interisted me was what the C++ coder wrote in response the the KB15*** WM_GETISHELLBROWSER.

So is it possible for a standalone app to have a pointer to IShellBrowser and able to use it?

Cause i think the IShellView will make my life so much easier if i could only get a valid pointer to IShellBrowser.

thank you.
Posted on 2004-06-16 03:41:38 by Black iCE
Hi Black ICE,

im afraid the IShellBrowser interface is intended to be used by shell extension dlls in the shells process only.
But if it really works with standalone apps please tell me.

Japheth
Posted on 2004-06-16 06:30:53 by japheth
This is helpful commentary from MSDN: IShellBrowser Interface
Posted on 2004-06-16 21:45:30 by Poimander

Remarks

Applications do not implement this interface.


But according to the ATL C++ code where objects gain the properties and methods of other defined object, well take a look @ his (VC++) code, inside mainfrm.h. He creates an IShellBrowserImpl based upon the interfaces of IShellBrowser (IOleWindow) and ICommDialgBrowser. Then when createing the Window he bases the Window object with IShellBrowserImpl with some other interfaces.
The Link and Screenshot http://www.codeproject.com/shell/explorer.asp BTW coded in 2001 according to the source comments.

The Question would be, it how in ASM do you allow a Window to gain properties - such as similar to his project.

Another would/could be, In the case of SHGetDesktopFolder is a helper function with CoCreateInstance(CLSID_ShellDesktop,NULL,CTX**,IID_IShellFolder,**psf); Mabe there is something similar ... but

We are looking for the TopLevel Browser, so we need IServiceProvider and that is again the same case. IServiceProider is part of the ActiveX, and to use ActiveX we need to give the main window properties to Host Interfaces etc etc.

Note interfaces (IShellBrowser,IShellBrowserService and IServiceProvider) reside within the actxprxy.dll (ActiveX Proxy).

So understandable - the question would be how do WE give property capabilities to our window object in a similar manner so it will allow us to query for IShellBrowser through IServiceProvider?
Posted on 2004-06-17 01:13:22 by Black iCE
Black ICE,

could you please explain what you mean with "properties" in this context. I didn't get it.

Japheth
Posted on 2004-06-17 09:55:20 by japheth
Com interface can inherit the methods of other interfaces... as do in c++ classes.

But ATL uses C++ convesion of classes and the Window Objects can also inherit methods from other interfaces and classes... they sortof become the make-up of the window plus the usual window code (SDK) form.

Now COM is language independant so it should be able to do something similar to other objects. The Window (SDK) i think has the IDispatch interface as one of its interfaces.



class [b]IShellBrowserImpl[/b] : public IShellBrowser, public ICommDlgBrowser
{
....
Method overides and implementations
....
}

Now the Main Window Object


class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>,
public CMessageFilter, public CIdleHandler, [b]public IShellBrowserImpl[/b]
{
....
MESSAGE_MAP //messages not to be processed by default window message
....
Method Overides
}


The Window Object has Interfaces and it in itself is the Host for IShellBrowser. CFrameWindowImpl is a ATL class for windows hosting OLE objects.

I assume this can be nodouptly be done in assembler. So now what must be done is to do a lot of WHAT MAKES ATL and how to DO THIS in ASM.

Not the whole ATL code but just enough as a base to allow the hosting situation that allows Window objects to gain Methods like regular class objects.

BTW i think that ATL is obvously a specially coded class structure....
Posted on 2004-06-17 10:47:54 by Black iCE
Hi Black ICE,

I understand your question now.

As an example for a window to be a IShellBrowser host I would implement:

CMyWindow struct
...
_vtblIShellBrowser dd ?
_refCount dd ?
...
CMyWindow ends

this structure is window specific, best would be to alloc dynamically and then set with SetWindowLong()

Now when the window is asked for WM_GETISHELLBROWSER for example do:

GetWindowlong(hwnd,0)
lea eax, .CMyWindow._vtblIShellBrowser
ret

Of course this topic isnt true COM, it is OOP and possibly this is the better forum for such questions.

Japheth
Posted on 2004-06-18 00:53:54 by japheth
Hi japheth,

Sorry then - it first started out as COM with my dumb question (still feel stupid that i overlooked that API), but then i did find that other post by Nan to you and i took a look at what the VC++ coder was saying.

Ok now i am a bit confuzzed...if you implement


CMyWindow struct
...
_vtblIShellBrowser dd ?
_refCount dd ?
...
CMyWindow ends


Then where would you define your implementation of IShellBrowser??
(as the comment says about COM - not for the faint of heart ... and well not very good at it @ least in MASM)

Anyway why i started about this IShellBrowser is that i would like to obviously create an explorer like app (many have been done) but using COM to browse around the shell.

Pro's: Shell Browsing will look naitive with the opertating system it is running under. Less code would be needed to create this app (assuming for all windows platforms). And well with IShellBrowser you would be able to override/use some methods to allow customisation specific to your app. (considering how slow my listview app is browsing compaired to windows explorer's listview - and i never seem to get it quite right.)+++(I would only like the Listview Object and not that stupid WebView or what eva blue band on the left of it.... XP:: Maybe costomize or make my own 1 for my app.)

Thank you = japheth

(and i step into the OOP form to see what i can get there and more on how..........)
(back and it looks like OOP is what i want to use to accompilsh this....)
Posted on 2004-06-18 08:33:44 by Black iCE