How do I add ISupportErrorInfo manualy to my existing MTS objects? 
Author Message
 How do I add ISupportErrorInfo manualy to my existing MTS objects?

I am tried to add ISupportErrorInfo manualy to my existing MTS objects but
keep getting a error:
    error C2668: 'InlineIsEqualGUID' : ambiguous call to overloaded function

what I did is:
1)  Header File

class ATL_NO_VTABLE CDB :
    ...
    public ISupportErrorInfo,  // manually added
    public IDispatchImpl<IDB, &IID_IDB, &LIBID_BLOOMBERGSRVLib>
{
    BEGIN_COM_MAP(CDB)
     COM_INTERFACE_ENTRY(IDB)
     COM_INTERFACE_ENTRY(IObjectControl)
     COM_INTERFACE_ENTRY(ISupportErrorInfo) // manually added
     COM_INTERFACE_ENTRY(IDispatch)
    END_COM_MAP()

 STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // manually added

CCP file  // manually added
    STDMETHODIMP CDB::InterfaceSupportsErrorInfo(REFIID riid)
    {
     static const IID* arr[] =
     {
      &IID_IDB
     };
     for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
     {
      if (InlineIsEqualGUID(*arr[i],riid))
       return S_OK;
     }
     return S_FALSE;

Quote:
}

Thank in advance for any help!


Mon, 12 Aug 2002 03:00:00 GMT  
 How do I add ISupportErrorInfo manualy to my existing MTS objects?
The easiest way to add ISupportErrorInfo to your MTS objects is as follows:

(1) Add public ISupportErrorInfoImpl<&IID_IDB> (instead of public
ISupportErrorInfo) to the  list of parnt classes of your class
(2) Add COM_INTERFACE_ENTRY(ISupportErrorInfo) in the COM_MAP

That's it! No need to add any method to your class declaration and no need
to add any code to your cpp file.

Hardy


Quote:
> I am tried to add ISupportErrorInfo manualy to my existing MTS objects but
> keep getting a error:
>     error C2668: 'InlineIsEqualGUID' : ambiguous call to overloaded
function

> what I did is:
> 1)  Header File

> class ATL_NO_VTABLE CDB :
>     ...
>     public ISupportErrorInfo,  // manually added
>     public IDispatchImpl<IDB, &IID_IDB, &LIBID_BLOOMBERGSRVLib>
> {
>     BEGIN_COM_MAP(CDB)
>      COM_INTERFACE_ENTRY(IDB)
>      COM_INTERFACE_ENTRY(IObjectControl)
>      COM_INTERFACE_ENTRY(ISupportErrorInfo) // manually added
>      COM_INTERFACE_ENTRY(IDispatch)
>     END_COM_MAP()

>  STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // manually added

> CCP file  // manually added
>     STDMETHODIMP CDB::InterfaceSupportsErrorInfo(REFIID riid)
>     {
>      static const IID* arr[] =
>      {
>       &IID_IDB
>      };
>      for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
>      {
>       if (InlineIsEqualGUID(*arr[i],riid))
>        return S_OK;
>      }
>      return S_FALSE;
> }

> Thank in advance for any help!



Tue, 13 Aug 2002 03:00:00 GMT  
 How do I add ISupportErrorInfo manualy to my existing MTS objects?
This problem was introduced in the September release of the Platform SDK.
Install a newer version.

--
===============================
Alexander Nickolov
Microsoft MVP [VC], MCSD

===============================

Quote:

>I am tried to add ISupportErrorInfo manualy to my existing MTS objects but
>keep getting a error:
>    error C2668: 'InlineIsEqualGUID' : ambiguous call to overloaded
function

>what I did is:
>1)  Header File

>class ATL_NO_VTABLE CDB :
>    ...
>    public ISupportErrorInfo,  // manually added
>    public IDispatchImpl<IDB, &IID_IDB, &LIBID_BLOOMBERGSRVLib>
>{
>    BEGIN_COM_MAP(CDB)
>     COM_INTERFACE_ENTRY(IDB)
>     COM_INTERFACE_ENTRY(IObjectControl)
>     COM_INTERFACE_ENTRY(ISupportErrorInfo) // manually added
>     COM_INTERFACE_ENTRY(IDispatch)
>    END_COM_MAP()

> STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // manually added

>CCP file  // manually added
>    STDMETHODIMP CDB::InterfaceSupportsErrorInfo(REFIID riid)
>    {
>     static const IID* arr[] =
>     {
>      &IID_IDB
>     };
>     for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
>     {
>      if (InlineIsEqualGUID(*arr[i],riid))
>       return S_OK;
>     }
>     return S_FALSE;
>}

>Thank in advance for any help!



Tue, 13 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do I add ISupportErrorInfo manualy to my existing MTS objects?

2. Adding ptr to an object to an existing array of objects

3. ISupportErrorInfo with MTS

4. ISupportErrorInfo with MTS

5. Add methods to an existing object (IDL problem)

6. Aggregating an existing object into a larger object.

7. new Interface in existing object or new object

8. Detecting if a function exists in a DLL for a COM object (specifically DirectX object)

9. Only 1 record added using MTS component

10. Only 1 record added using MTS component

11. How to Remove MTS from ATL Com Object

12. Accessing same object on MTS from local and remote machine

 

 
Powered by phpBB® Forum Software