RE: system.invalidcastexception

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sounds to me that the control you are using does not implement
ISupportInitialize

how to make the Exception go away? ... remove the code.

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk


"DavideR" wrote:

> I have converted my program from vb6
> In the initializecomponent event the following code give a n exception
> CType(Me.controlname, System.ComponentModel.ISupportInitialize).EndInit()
> Exception first-chance of type "System.InvalidCastException" in
> system.windows.forms.dll
>
> Additional information: Cast not supported.
> what's wrong? I am using vsnet2002 with framework 1.0 sp3.
> how can i take this exception away
>
.



Relevant Pages

  • Re: Multithreaded GUI issues
    ... The code is happening in a try/catch handler, but the exception is taking place in a callback thread that I have no control over. ... were actually trying to close a socket at the time the exception occurred, so you might want to check to see why something is trying to close a socket when you don't expect to. ... But how do I know that creating an Image object is thread safe? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What does it mean?
    ... > But, if you would like to save yourself all of the exception processing, a ... (That's what a cast does internally.) ... > control array is a particular control. ... >> where the result isn't a TextBox, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Deleting Problem
    ... TestBox control for the description and a hidden control for the ID. ... An unhandled exception occurred during the execution of the ... be identified using the exception stack trace below. ... The delete query i am using is as follows: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Deleting Problem
    ... TestBox control for the description and a hidden control for the ID. ... An unhandled exception occurred during the execution of the ... be identified using the exception stack trace below. ... The delete query i am using is as follows: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Flex Grid control issue, - Exception code: E06D7363
    ... of something triggered by the SetRedraw, which, as you point out, does seem odd. ... is my component, which holds FlexGrid control, ... So until you can be sure that your call of Redraw is not a method of the MSFlexGrid (I do ... this exception might represent a ...
    (microsoft.public.vc.mfc)