?
Solved

COM & Errors

Posted on 1998-07-21
2
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 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