c# OpenFileDialog problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sonia Igla

    c# OpenFileDialog problem

    Hi.
    I use in my windows c# project External
    Dlls(Assembly.L oadFrom(dllName );...).
    All work fine.
    I add to one of my forms using of OpenFileDialog. First time I call
    this form
    It works. Next times I get Error: "File or assembly name Extended.dll,
    or one of its dependencies, was not found." in all modules this dll is
    using.
    This happen only by OpenFileDialog selects files (by cancel not
    affect).

    Help me please by this trouble.
    Thanks Sonia
  • Marcin GrzÄ™bski

    #2
    Re: c# OpenFileDialog problem

    Hi Sonia,

    Is it possible that your assembly uses other assembly "Extended.d ll"
    that is not loaded?

    Marcin
    [color=blue]
    > Hi.
    > I use in my windows c# project External
    > Dlls(Assembly.L oadFrom(dllName );...).
    > All work fine.
    > I add to one of my forms using of OpenFileDialog. First time I call
    > this form
    > It works. Next times I get Error: "File or assembly name Extended.dll,
    > or one of its dependencies, was not found." in all modules this dll is
    > using.
    > This happen only by OpenFileDialog selects files (by cancel not
    > affect).
    >
    > Help me please by this trouble.
    > Thanks Sonia[/color]

    Comment

    • Ignacio Machin \( .NET/ C#  MVP \)

      #3
      Re: c# OpenFileDialog problem

      Hi,

      Is extended.dll used in your project somewhere? , If so is it used in the
      code that gives you the error, are you sure that its loaded before?

      Does the error occur inside the dialog, or in your code after the dialog
      closes.

      If no post more details.

      cheers,

      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation


      "Sonia Igla" <sonia@mer.co.i l> wrote in message
      news:6d8e563b.0 409280154.40199 845@posting.goo gle.com...[color=blue]
      > Hi.
      > I use in my windows c# project External
      > Dlls(Assembly.L oadFrom(dllName );...).
      > All work fine.
      > I add to one of my forms using of OpenFileDialog. First time I call
      > this form
      > It works. Next times I get Error: "File or assembly name Extended.dll,
      > or one of its dependencies, was not found." in all modules this dll is
      > using.
      > This happen only by OpenFileDialog selects files (by cancel not
      > affect).
      >
      > Help me please by this trouble.
      > Thanks Sonia[/color]


      Comment

      • Sonia Igla

        #4
        Re: c# OpenFileDialog problem



        The extended.dll using in several parts of my project is loaded by:

        Assembly a = Assembly.LoadFr om(extended.dll );
        Type theType = a.GetType(nameS pace,true);

        int paramLen = param.GetLength (0);
        Type[] paramType = new Type[paramLen];
        for(int i=0; i<paramLen;i++ )
        {
        paramType[i] = param[i].GetType();
        }
        ConstructorInfo ci = theType.GetCons tructor(paramTy pe);

        try
        {
        bc = (BaseControl)ci .Invoke(param);
        }
        catch(Exception ex)
        {
        throw new MeteoException( ex.InnerExcepti on + "." + ex.Message);
        }

        Extended.dll is my assembly and contains some modules and forms. The
        problem OpenFileDialog component is used in one of this forms of
        extened.dll.


        This all works fine in my project.

        The problem occur after first time call and open with OK result (Cancel
        not) OpenFileDialog in one of modules (forms) of extended.dll.
        After that, All Loadings this dll by Assembly.LoadFr om (
        extended.dll) gives error.

        If not Open this OpenFileDialog( OK Result) the same forms works fine.

        Thanks Sonia.


        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Sonia Igla

          #5
          Re: c# OpenFileDialog problem

          No it is not.
          Extended.dll is my Assembly containing some forms that are called by
          Assembly.LoadFr om(dllName) command and creating by
          theType.GetCons tructor(paramTy pe).

          One of this forms (of Extended.dll) include OpenFileDialog.
          After using this form and open with OK Result the Dialog
          I Get Error by all forms (of Extended.dll) create.

          It not occurs if not open with OK Result the Dialog.

          The same program reexecute (without rebuild) gives the same schema of
          problems (First loading with OpenFileDialog call works, after ...).
          Consequently all used dlls are on there places.

          Thanks Sonia.


          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Sonia Igla

            #6
            Re: c# OpenFileDialog problem



            I found answer on my problem.
            OpenFileDialog RestoreDirector y must be true.

            Sonia.

            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            Working...