Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ISupportErrorInfo Example

213 views
Skip to first unread message

Mike Towers

unread,
Dec 14, 2002, 5:14:41 AM12/14/02
to
Hi,

Could someone possibly point me in the direction of a good
example of how to use the ISupportErrorInfo interface.

Thanks

Mike Towers

AlexO

unread,
Dec 16, 2002, 8:53:14 AM12/16/02
to
There is only one method. Use ATL wizard to generate
object that supports it. That would be the best example.

AlexO

>.
>

Trevor

unread,
Dec 16, 2002, 1:11:09 PM12/16/02
to
Once your interface supports ISupportErrorInfo you just add an error string
to the resource and then call AtlReportError when you want to report an
error to the client. If you did everything correctly when VB hits this
error, VB will show a messagebox containing your string resource error
message.

PS: Remember the HINSTANCE parameter to AtlReportError should be
_Module.GetResourceHandle() not GetModuleHandle(NULL)!

"AlexO" <me@work> wrote in message
news:064601c2a50a$7abd5680$d2f82ecf@TK2MSFTNGXA09...

Craig Powers

unread,
Dec 16, 2002, 3:08:29 PM12/16/02
to
Trevor wrote:
>
> Once your interface supports ISupportErrorInfo you just add an error string
> to the resource and then call AtlReportError when you want to report an
> error to the client. If you did everything correctly when VB hits this
> error, VB will show a messagebox containing your string resource error
> message.

You should not, of course, be limited to just one error message.

--
Craig Powers
MVP - Visual C++

0 new messages