Click to See Complete Forum and Search --> : How to toss an error message for an invalid ActiveX control property assignment?


FreeOperator
March 12th, 2001, 08:13 PM
Hi, there
I am working on an VB activeX control. In the "Let" functions of my control's properties, I'd like to report those invalid assignment. For example, if the user assigned a negative value to a property which only accepts positive value, I would like VB to pop up a message box with a red cross in it and carries the error message defined by me. I know how to achieve it with ATL control, but I don't know how with VB activeX control. Please advise and thanks in advance...

Clearcode
March 13th, 2001, 02:56 AM
To raise an error from an activeX control :

Err.Raise vbObjectError + 1000, "ActiveXCTLName", "Incorrect Parameter"




You can replacte the description and source, but it is best to have your error number > the constant vbObjectError to avoid conflicting with existing error numbers.

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com