I have an existing (unchangeable) native application that uses
(currently only native) COM plug-ins. The application communicates
with its plug-ins via an automation interface (IDispatch only). The
COM plug-ins return errors by calling AfxThrowOleDispatchException
passing a 16-bit error code and error string. This results in the
application receiving an HRESULT of DISP_E_EXCEPTION from the Invoke
call, and a filled in EXCEPINFO structure containing the wCode and
bstrDescription specified by the plug-in.
I would like to implement a new plug-in for this application in C#
using a CCW, but I can't figure out how to pass back the wCode value.
I can throw an Exception(String) object containing an error message,
which makes it back to the native application in
EXCEPINFO.bstrDescription (along with EXCEPINFO.scode = 0x80131500 --
not sure what that is), or I can throw a COMException(String, Int32)
object with an error message and an error code, but this returns the
error code value in the EXCEPINFO.scode member (with a wCode value of
zero). I don't seem to be able to find a way to pass back a wCode
value.
Because I can't change the native application, I really need to find a
way of passing the wCode back to the application. Can anyone please
help?
Thanks,
Gary
Gary - 18 Aug 2006 19:20 GMT
Anyone? Any pointers at all?
Thanks,
Gary
> I have an existing (unchangeable) native application that uses
> (currently only native) COM plug-ins. The application communicates
[quoted text clipped - 22 lines]
> Thanks,
> Gary