Hi
Are there any examples of using MadShell for C++ Builder?
I have no Pascal knowledge and the generated .hpp files aren't making any sense to me...
Andy
C++ Builder
Re: C++ Builder
Something like this seems to work for me:
Generally, madShell uses Delphi type interfaces which are reference counted and automatically freed by the compiler. So you don't have to free/release "shortCut" in the example above, it's done automatically by Delphi/C++.
Code: Select all
#include "madShell.h"
_di_IShortCut shortCut = NewShortCut("D:\\Desktop\\test.exe");
shortCut->WorkingDir = "D:\\Desktop";
shortCut->ShowCmd = SW_SHOWMAXIMIZED;
shortCut->Save("D:\\desktop\\test.lnk");
Re: C++ Builder
Hi
Thanks for the tip and sorry for not replying sooner...
Using the LMD shell notify component, I'm getting a PItemIDList for, say, the Drive Add event.
I use this code to get the _di_IIDList:
_di_IIDList list = IDList(aPIDL);
But I can't get any useful info from this. For example, if I try:
_di_IIDList b = list->GetPath();
String c = b->GetStrBuf();
to get some info about the Drive that's been added, variable c is null. The _di_IIDList returned by GetPath(); seems to be a valid object.
The docs on IIDList seem to indicate that GetPath and GetStrBuf should return what I'm after, but I can't make them work...
Andy
Thanks for the tip and sorry for not replying sooner...
Using the LMD shell notify component, I'm getting a PItemIDList for, say, the Drive Add event.
I use this code to get the _di_IIDList:
_di_IIDList list = IDList(aPIDL);
But I can't get any useful info from this. For example, if I try:
_di_IIDList b = list->GetPath();
String c = b->GetStrBuf();
to get some info about the Drive that's been added, variable c is null. The _di_IIDList returned by GetPath(); seems to be a valid object.
The docs on IIDList seem to indicate that GetPath and GetStrBuf should return what I'm after, but I can't make them work...
Andy
Re: C++ Builder
Are you sure that the PIDL is both valid and absolute? If it's a relative PIDL, then madShell won't be able to interpret it without having a reference to the "parent folder".
For example, if you were to ask properties about a folder named "Bla", then you would not get any useful results, unless you provide the full path (e.g. "C:\Program Files\Bla"), not just the relative path "Bla".
For example, if you were to ask properties about a folder named "Bla", then you would not get any useful results, unless you provide the full path (e.g. "C:\Program Files\Bla"), not just the relative path "Bla".