Click to See Complete Forum and Search --> : Shell Extensions


May 14th, 1999, 04:45 PM
Hi, I'm trying to write an ATL Shell Extension using VC5. I've cut the code but I can't get the IDL to link. My object has to support IShellExtInit, so I have placed it in the IDL file. However, I get an unresolved external on IShellExtInit. I am importing objidl.h.

Do I need to do anything special for shell extensions ? e.g. an SDK ?

thanks in advance for any help.

Cosmin
May 19th, 1999, 04:35 PM
Hi,

You don't have to specify IShellExtInit in your IDL file. You must implement it. So, inherit your coclass from IShellExtInit and add COM_INTERFACE macros in the COM_MAP, like this:

class ATL_NO_VTABLE CDDD :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CDDD, &CLSID_DDD>,
IShellExtInit,
IShellPropSheetExt
{
...

BEGIN_COM_MAP(CDDD)
COM_INTERFACE_ENTRY_IID(IID_IShellExtInit,IShellExtInit)
COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt,IShellPropSheetExt)
END_COM_MAP()

Also include shlguid.h and shlobj.h.
If you need more, let me know.

Cosmin