Starting in 1996, Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the Wayback Machine after an embargo period.
If you are someone who likes surprises, I am your friend. I got a pleasent
surprise when I was looking thru the Microsoft Internet control (WebBrowser)
as most people know it.. I opened the shdocvw.dll which comes along with
the Internet explorer 4.0 and surprise, surprise, I found that It
contains Interfaces for the Shell, Shell Link and other stuff which
the shell normally handles and which are painful to implement in C or C++..
See the implementation for the CDirDialog for a sample. This is not present
in IE 3.x ..
Now, In order to use these Interfaces, You need to some work.:-( well,
But this is mucho simpler than the ones we have seen till now.
(continued)
After generating the .ODL file, Create a new MFC project in VC++
to your taste. .. Then, Add class from .tlb and select shdocvw.dll.. Select
all the interfaces listed in the list box shown and ask it to create the
wrapper class.
It will be created as shdocvw.h and shdocvw.cpp. These are also there
in the ZIP file attached..
Since, these interfaces are undocumented, I must caution you about
the fact that this might change.. But, then It might not..
Anyway, Add the following lines to your .CPP file where you want to
call the interface functions..
Of course, before calling any functions, Make sure that the SHDOCVW.DLL
is of the correct version..4.71.1712.5.
You can use the technique
Eran Yariv has pointed out. You might want to do that in the beginning
of your program so that you dont have to do that again until the execution
is over.
Now, after this,, Its left to you to do what you want to do..
Following is a trivial example of invoking "Start-Run" dialog from
your program.
{
IShellDispatch disp; //Create a IShellDispatch
variable
WCHAR szValue[80] ; CLSID clsid; HRESULT sc; sc = ::CoCreateInstance(
CLSID_Shell, NULL, CLSCTX_SERVER, IID_IDispatch, (void**)&disp ) ;
//<== Create an instance of the shell if (FAILED (sc)) {
CString str; str.Format(_T("Failed to create Instance
:-( "));
TRACE( str) ; return; }
disp.FileRun(); //<== Call FileRun
}
Another example for IShellDispatch ,,
The following example is to BrowseForFolder and get the Folder interface
pointer.
Add www.codeguru.com to your favorites Add www.codeguru.com to your browser search box IE 7 | Firefox 2.0 | Firefox 1.5.xReceive news via our XML/RSS feed
RATE THIS ARTICLE:
Excellent Very Good Average Below Average Poor
(You must be signed in to rank an article. Not a member? Click here to register)