Do MTS components support COM Exceptions? 
Author Message
 Do MTS components support COM Exceptions?

Hi,

Do MTS components support COM Exceptions? In ATL object wizard, for objects
of type MS Transaction Server, there is no attribute like 'Support
ISupportErrorInfo'. And also if I try to manually implement
ISupportErrorInfo, I am receiving unhandled memory exception error from the
client.

Thanks,
Palaniappan Ganesh.



Fri, 19 Jul 2002 03:00:00 GMT  
 Do MTS components support COM Exceptions?
Just add
    public ISupportErrorInfoImpl<&IID_IYourInterface> to the declaration
and
    COM_INTERFACE_ENTRY(ISupportErrorInfo)
in the COM Map in the header file. Nothing to do in the corresponding CPP
file.

HTH
Hardy

An example is as follows:

////////////////////////////////////////////////////////////////////////////
/
// CCARSwareUser
class ATL_NO_VTABLE CCARSwareUser :
 public CComObjectRootEx<CComSingleThreadModel>,
 public CComCoClass<CCARSwareUser, &CLSID_CARSwareUser>,
 public ISupportErrorInfoImpl<&IID_ICARSwareUser>,
 public IObjectControl,
 public IDispatchImpl<ICARSwareUser, &IID_ICARSwareUser, &LIBID_CWSLIB>
{
public:
 CCARSwareUser()
 {
 }

DECLARE_REGISTRY_RESOURCEID(IDR_CARSWAREUSER)

DECLARE_PROTECT_FINAL_CONSTRUCT()

DECLARE_NOT_AGGREGATABLE(CCARSwareUser)

BEGIN_COM_MAP(CCARSwareUser)
 COM_INTERFACE_ENTRY(ICARSwareUser)
 COM_INTERFACE_ENTRY(IObjectControl)
 COM_INTERFACE_ENTRY(IDispatch)
 COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()

// IObjectControl
public:
 STDMETHOD(Activate)();
 STDMETHOD_(BOOL, CanBePooled)();
 STDMETHOD_(void, Deactivate)();

 CComPtr<IObjectContext> m_spObjectContext;

// ICARSwareUser
public:
 STDMETHOD(IsValid)(/*[in]*/ BSTR bstrLawFirm, /*[in]*/ BSTR bstrUserID,
/*[in]*/ BSTR bstrPassword, /*[out, retval]*/ VARIANT_BOOL* pbValid);
 STDMETHOD(GetConnectionString)(/*[in]*/ BSTR bstrLawFirm, /*[out, retval]*/
BSTR* bstrConnectionString);

private:
    void GetUserDatabaseDSN(TCHAR* szDSN);

Quote:
};



Quote:
> Hi,

> Do MTS components support COM Exceptions? In ATL object wizard, for
objects
> of type MS Transaction Server, there is no attribute like 'Support
> ISupportErrorInfo'. And also if I try to manually implement
> ISupportErrorInfo, I am receiving unhandled memory exception error from
the
> client.

> Thanks,
> Palaniappan Ganesh.



Fri, 19 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Is there any way to achieve multithreading inside MTS COM components

2. VC ATL Com with MTS support problem!!

3. how to throw exceptions from a COM component?

4. COM component and MTS. Problems with the DLL when used in MTS environment.

5. VC6++: a Link error in a MTS component using ADO1.5

6. Failure to commit database inserts by child mts component

7. Holding a list within a transactional MTS component

8. Threading Model of MTS-based ATL components

9. Threading model for MTS components

10. Debug MTS Component in Windows 2000

11. Passing an external ADO connection into an MTS component

12. Only 1 record added using MTS component

 

 
Powered by phpBB® Forum Software