Quote Originally Posted by ahmd View Post
Code:
SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOPDIRECTORY, &pidl);
SHGetPathFromIDList(pidl, path);

CString pPathLinkTo;
pPathLinkTo = path + LinkName;

//Use 'path' to create a shortcut
IShellLink* psl;
CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
    reinterpret_cast<void**>(&psl));
psl->SetPath(pPathLinkTo);

IPersistFile* ppf;
psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf));
ppf->Save(pSaveLinkTo, TRUE);

ppf->Release(); 
psl->Release();
I borrow ahmd's code to make a question about CLSID_ShellLink
The steps I started to learn about COM are done as above
COInittialise->CoCreate->QueryInterface etc
There are interfaces that have CLSID_ as CLSID_ShellLink above
but there are classes not having such CLSID_ specified in msdn, what should I do to complete the steps to call methods from the interfaces I'd like to use ?

Thank you