CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2001
    Posts
    84

    How to toss an error message for an invalid ActiveX control property assignment?

    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...


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How to toss an error message for an invalid ActiveX control property assignment?

    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
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured