I was able to resolve this issue, but not in a way I completely understand. It seems the IBho interface only supports 4 methods exposed by the IDL. After that, the methods are visible to the caller, but will not execute. I have no idea why this is, and have yet to find any documentation that addresses this.
To address the issue, I simply created a new COM class intended to manage storage and exposed it to COM through the IDL and registration process. That allowed me to expand the storage related APIs to include the DeletePreference
method, as well as add other requested functionality to the BHO. This is probably better coding practice anyway. Here's what this looks like now:
Preferences.h
class CPreferences :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CPreferences, &CLSID_Preferences>,
public IDispatchImpl<IPreferences , &IID_IPreferences >
{
...
/implementation
};
IDL:
[
object,
uuid(/*uuid/*),
dual,
nonextensible,
helpstring("IBho Interface"),
pointer_default(unique)
]
interface IBho : IDispatch{
...
[id(4), helpstring("method DoSomeThing")] HRESULT DoSomeThing([in] BSTR prefName);
};
[
object,
uuid(/*uuid/*),
dual,
nonextensible,
helpstring("IPreferences Interface"),
pointer_default(unique)
]
interface IPreferences : IDispatch{
...
[id(3), helpstring("method DeletePreference")] HRESULT DeletePreference([in] BSTR prefName);
};
[
uuid(/*uuid*/),
version(1.0),
helpstring("Bho1.0 Type Library")
]
library MyBhoLib
{
importlib("stdole2.tlb");
[
uuid(36BA1FA3-144A-4A1A-BE62-8301C4E4ADEF),
helpstring("Bho Class")
]
coclass BhoSite
{
[default] interface IBho;
};
[
uuid(uuid),
helpstring("Preferences Class")
]
coclass Preferences
{
[default] interface IPreferences;
};
}