Solved

COM & Errors

Posted on 1998-07-21
2
185 Views
Last Modified: 2013-11-25
I've got a COM server written in VC++ 5.0 with ATL whose target client is applications written in VB.  What I would love to do is throw an exception from the COM component and have standard error handling in VB be able to trap it.  This approach isn't working.  I'm having a hard time finding any documentation on this issue.  Please help.
0
Comment
Question by:rayb
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1168206
You need to make sure your server has the ISupportErrorInfo interface. You can use the checkbox in the Object Wizard Attributes tab.

Once you have that, you can call CComCoClass::Error() to create an EXCEPINFO object. Then you must also return a proper error code (for example, E_FAIL).

0
 
LVL 2

Author Comment

by:rayb
ID: 1168207
Thanks, thui.

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now