Problems with ActiveX - DOM documentElement change - InfoPath Dev
in

InfoPath Dev

Problems with ActiveX - DOM documentElement change

Last post 08-18-2005 10:33 AM by jimbob. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-18-2005 02:44 AM

    • scarabxx
    • Not Ranked
    • Joined on 08-18-2005
    • Slovakia
    • Posts 1

    Problems with ActiveX - DOM documentElement change

    Hello

    I have an ActiveX (Basically an UserControl from Window.Forms
    namespace)written C# (.NET 1.1) which is used in MS InfoPath for displaying
    images.

    The problem is that "sometimes" when constructor of my User control is called
    I got an Exception (Specified cast is not valid).

    The "sometimes" - I mean: the refresh in MS InfoPath caused by changing of
    DOM where my ActiveX is binded. In normal cases like opening document the
    ActiveX works perfect - no exception (see 2.).

    My UserControl had set "Localizable" property to true so settings of
    controls in my UserControl comes from embedded resources (See 1 and 2.):

    1) //(from InitializeComponet method)
    System.Resources.ResourceManager resources = new
    System.Resources.ResourceManager(typeof(MyUserControl));

    2) this.uiPictureBox.Location =
    ((System.Drawing.Point)(resources.GetObject("uiPictureBox.Location")));
    //This is where Exception is thrown

    The problem can NOT be in resource file because ActiveX live under normal
    condition OK, but I strongly suspect ResourceManager, that under some (for me
    unknown) conditions behaves that it has resources loaded, but attemt to cast
    retrieved resources throws an Exception.

    Thank You for Your reply
  • 08-18-2005 10:33 AM In reply to

    • jimbob
    • Top 500 Contributor
    • Joined on 11-25-2004
    • USA
    • Posts 32

    Re: Problems with ActiveX - DOM documentElement change

    Try storing the return value of resources.GetObject(...) to see what is being returned. It might help determining what's going on.

    Jim Cantwell
    InfoPathDev - Redmond
    Jim Cantwell
    InfoPathDev - Redmond
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.