
Problems creating a valid object using CComObject<...>::CreateInstance
Quote:
> Do you mention IConnectionEvents in your interface map?
yes. here :
class ATL_NO_VTABLE CSaxoConnEvents :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CSaxoConnEvents, &CLSID_SaxoConnEvents>,
public IDispatchImpl<ISaxoConnEvents, &IID_ISaxoConnEvents,
&LIBID_nyfxLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
public IConnectionEvents
{
public:
CSaxoConnEvents()
{
}
~CSaxoConnEvents() {}
DECLARE_REGISTRY_RESOURCEID(IDR_SAXOCONNEVENTS)
BEGIN_COM_MAP(CSaxoConnEvents)
COM_INTERFACE_ENTRY(ISaxoConnEvents)
COM_INTERFACE_ENTRY(IConnectionEvents)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
...
Quote:
}
> What kind of interface is it - custom, dispinterface, dual? Show the IDL
> definition of their interfaces and coclasses.
here it is:
struct __declspec(uuid("5b8023d1-7b32-11d3-9a90-00105acc135c"))
IConnectionEvents : IUnknown
{
//
// Wrapper methods for error-handling
//
HRESULT LogInProgress (
long StatusCode,
_bstr_t StatusText );
HRESULT LogInCompleted ( );
HRESULT LogInFailed (
long ErrorCode,
_bstr_t ErrorText );
HRESULT ReceiveCompleted (
long BytesReceived );
HRESULT DisConnected (
long ErrorCode,
_bstr_t ErrorText );
HRESULT ListUpdated (
ListTypes ListType,
_bstr_t Parameters );
HRESULT ListUpdateFailed (
ListTypes ListType,
_bstr_t Parameters,
long ErrorCode,
_bstr_t ErrorText );
HRESULT RsUpdated (
ListTypes ListType,
_bstr_t Parameters );
HRESULT RsUpdateFailed (
ListTypes ListType,
_bstr_t Parameters,
long ErrorCode,
_bstr_t ErrorText );
HRESULT PasswordChanged ( );
HRESULT PasswordChangeFailed (
long ErrorCode,
_bstr_t ErrorText );
HRESULT TradeConfirmation (
_bstr_t AccountId,
long OrderId,
_bstr_t Confirmation );
HRESULT ForceInfo (
VARIANT_BOOL WebPageURL,
_bstr_t Text );
HRESULT ModuleListUpdated (
ClientSWCompatibilityLevels CompatibilityLevel );
HRESULT MenuStructureUpdated (
ClientSWCompatibilityLevels CompatibilityLevel );
HRESULT AppCustomizationChanged ( );
//
// Raw methods provided by interface
//
virtual HRESULT __stdcall raw_LogInProgress (
/*[in]*/ long StatusCode,
/*[in]*/ BSTR StatusText ) = 0;
virtual HRESULT __stdcall raw_LogInCompleted ( ) = 0;
virtual HRESULT __stdcall raw_LogInFailed (
/*[in]*/ long ErrorCode,
/*[in]*/ BSTR ErrorText ) = 0;
virtual HRESULT __stdcall raw_ReceiveCompleted (
/*[in]*/ long BytesReceived ) = 0;
virtual HRESULT __stdcall raw_DisConnected (
/*[in]*/ long ErrorCode,
/*[in]*/ BSTR ErrorText ) = 0;
virtual HRESULT __stdcall raw_ListUpdated (
/*[in]*/ ListTypes ListType,
/*[in]*/ BSTR Parameters ) = 0;
virtual HRESULT __stdcall raw_ListUpdateFailed (
/*[in]*/ ListTypes ListType,
/*[in]*/ BSTR Parameters,
/*[in]*/ long ErrorCode,
/*[in]*/ BSTR ErrorText ) = 0;
virtual HRESULT __stdcall raw_RsUpdated (
/*[in]*/ ListTypes ListType,
/*[in]*/ BSTR Parameters ) = 0;
virtual HRESULT __stdcall raw_RsUpdateFailed (
/*[in]*/ ListTypes ListType,
/*[in]*/ BSTR Parameters,
/*[in]*/ long ErrorCode,
/*[in]*/ BSTR ErrorText ) = 0;
virtual HRESULT __stdcall raw_PasswordChanged ( ) = 0;
virtual HRESULT __stdcall raw_PasswordChangeFailed (
/*[in]*/ long ErrorCode,
/*[in]*/ BSTR ErrorText ) = 0;
virtual HRESULT __stdcall raw_TradeConfirmation (
/*[in]*/ BSTR AccountId,
/*[in]*/ long OrderId,
/*[in]*/ BSTR Confirmation ) = 0;
virtual HRESULT __stdcall raw_ForceInfo (
/*[in]*/ VARIANT_BOOL WebPageURL,
/*[in]*/ BSTR Text ) = 0;
virtual HRESULT __stdcall raw_ModuleListUpdated (
/*[in]*/ ClientSWCompatibilityLevels CompatibilityLevel ) = 0;
virtual HRESULT __stdcall raw_MenuStructureUpdated (
/*[in]*/ ClientSWCompatibilityLevels CompatibilityLevel ) = 0;
virtual HRESULT __stdcall raw_AppCustomizationChanged ( ) = 0;
Quote:
};
thanks,
inna