akumaramar
3/1/2007 1:32:00 PM
Hi,
I have below declaration in C#
void
UpdateSpousePayrollDetails([MarshalAs(UnmanagedType.IUnknown)]Object
termlf, [MarshalAs(UnmanagedType.IUnknown)]Object dpyCdh,
[MarshalAs(UnmanagedType.BStr)]String SD04);
and want to call this function from C++. The code to call this
function is
CComBSTR SD04;
SD04 = L"N";
pTermlfRules->UpdateSpousePayrollDetails(pObj,pUnkPydCdh,SD04);
While compilation, I am getting following error.
cannot convert parameter 3 from 'ATL::CComBSTR' to '_bstr_t' . No user-
defined-conversion operator available that can perform this
conversion, or the operator cannot be called.
I can not use SD04 as _bstr_t instead of CComBSTR. Since, it is being
used lots of places and I need to change lots of VC++ code. Initial 2
parameters are working properly.
How can we resolve this issue?
Thanks
Ajay