Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2006

Tip: Looking for answers? Try searching our database.

Passing EXCEPINFO.wCode from .NET to Native

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary - 02 Aug 2006 17:58 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.