Forms inheritance problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sergey Poberezovskiy

    Forms inheritance problem

    Hi,

    I created two base forms: frmList and frmDetail, compiled
    them into a dll, and then want to use in my new project.
    The problem: When I created new inherited form, say
    frmClients, I cannot load the form in design view - the
    IDE complains with
    "Argument 'Path' is Nothing or empty." error.

    It does not stop however the project to compile, and even
    works correctly while running the project.

    Unfortunately, I cannot add controls on the form
    (frmClients) in design view - the IDE simply won't load
    it.

    Does anyone know what may be the problem and how to fix
    it?

    Any help will be greatly appreciated.

  • One Handed Man

    #2
    Re: Forms inheritance problem

    I dont think this is possible. The reason for this is that once you have
    compiled it into a library, non of the source information is then available
    for the IDE using that reference.

    I suggest that you complete your design and debug it and fully test it, once
    you have done this you can then put the form into a library.

    Regards - OHM


    Sergey Poberezovskiy wrote:[color=blue]
    > Hi,
    >
    > I created two base forms: frmList and frmDetail, compiled
    > them into a dll, and then want to use in my new project.
    > The problem: When I created new inherited form, say
    > frmClients, I cannot load the form in design view - the
    > IDE complains with
    > "Argument 'Path' is Nothing or empty." error.
    >
    > It does not stop however the project to compile, and even
    > works correctly while running the project.
    >
    > Unfortunately, I cannot add controls on the form
    > (frmClients) in design view - the IDE simply won't load
    > it.
    >
    > Does anyone know what may be the problem and how to fix
    > it?
    >
    > Any help will be greatly appreciated.[/color]


    Comment

    • Sergey Poberezovskiy

      #3
      Re: Forms inheritance problem

      There is something wierd happening - I cannot event load
      an inherited form within the dll project - event though I
      can easily load both frmList and frmDetail in design view.

      Any ideas?..
      [color=blue]
      >-----Original Message-----
      >I dont think this is possible. The reason for this is[/color]
      that once you have[color=blue]
      >compiled it into a library, non of the source[/color]
      information is then available[color=blue]
      >for the IDE using that reference.
      >
      >I suggest that you complete your design and debug it and[/color]
      fully test it, once[color=blue]
      >you have done this you can then put the form into a[/color]
      library.[color=blue]
      >
      >Regards - OHM
      >
      >
      >Sergey Poberezovskiy wrote:[color=green]
      >> Hi,
      >>
      >> I created two base forms: frmList and frmDetail,[/color][/color]
      compiled[color=blue][color=green]
      >> them into a dll, and then want to use in my new[/color][/color]
      project.[color=blue][color=green]
      >> The problem: When I created new inherited form, say
      >> frmClients, I cannot load the form in design view - the
      >> IDE complains with
      >> "Argument 'Path' is Nothing or empty." error.
      >>
      >> It does not stop however the project to compile, and[/color][/color]
      even[color=blue][color=green]
      >> works correctly while running the project.
      >>
      >> Unfortunately, I cannot add controls on the form
      >> (frmClients) in design view - the IDE simply won't load
      >> it.
      >>
      >> Does anyone know what may be the problem and how to fix
      >> it?
      >>
      >> Any help will be greatly appreciated.[/color]
      >
      >
      >.
      >[/color]

      Comment

      • One Handed Man

        #4
        Re: Forms inheritance problem

        This may help ?



        Regards OHM


        Sergey Poberezovskiy wrote:[color=blue]
        > There is something wierd happening - I cannot event load
        > an inherited form within the dll project - event though I
        > can easily load both frmList and frmDetail in design view.
        >
        > Any ideas?..
        >[color=green]
        >> -----Original Message-----
        >> I dont think this is possible. The reason for this is that once you
        >> have compiled it into a library, non of the source information is
        >> then available for the IDE using that reference.
        >>
        >> I suggest that you complete your design and debug it and fully test
        >> it, once you have done this you can then put the form into a library.
        >>
        >> Regards - OHM
        >>
        >>
        >> Sergey Poberezovskiy wrote:[color=darkred]
        >>> Hi,
        >>>
        >>> I created two base forms: frmList and frmDetail, compiled
        >>> them into a dll, and then want to use in my new project.
        >>> The problem: When I created new inherited form, say
        >>> frmClients, I cannot load the form in design view - the
        >>> IDE complains with
        >>> "Argument 'Path' is Nothing or empty." error.
        >>>
        >>> It does not stop however the project to compile, and even
        >>> works correctly while running the project.
        >>>
        >>> Unfortunately, I cannot add controls on the form
        >>> (frmClients) in design view - the IDE simply won't load
        >>> it.
        >>>
        >>> Does anyone know what may be the problem and how to fix
        >>> it?
        >>>
        >>> Any help will be greatly appreciated.[/color]
        >>
        >>
        >> .[/color][/color]


        Comment

        • One Handed Man

          #5
          Re: Forms inheritance problem

          OOps. Sorry, I dont think I can help you further on this as its not
          something I normally do, Perhaps you could repost the question again and I
          will not take part. That way maybe you will get an answer.

          Regards - OHM

          Sergey Poberezovskiy wrote:[color=blue]
          > I'm using 2003 Enterprise Architect - so this is not
          > applicable either...
          >[color=green]
          >> -----Original Message-----
          >> This may help ?
          >>
          >> http://visualbasic.about.com/library.../aa081703a.htm
          >>
          >> Regards OHM
          >>
          >>
          >> Sergey Poberezovskiy wrote:[color=darkred]
          >>> There is something wierd happening - I cannot event load
          >>> an inherited form within the dll project - event though I
          >>> can easily load both frmList and frmDetail in design view.
          >>>
          >>> Any ideas?..
          >>>
          >>>> -----Original Message-----
          >>>> I dont think this is possible. The reason for this is that once you
          >>>> have compiled it into a library, non of the source information is
          >>>> then available for the IDE using that reference.
          >>>>
          >>>> I suggest that you complete your design and debug it and fully test
          >>>> it, once you have done this you can then put the form into a
          >>>> library.
          >>>>
          >>>> Regards - OHM
          >>>>
          >>>>
          >>>> Sergey Poberezovskiy wrote:
          >>>>> Hi,
          >>>>>
          >>>>> I created two base forms: frmList and frmDetail, compiled
          >>>>> them into a dll, and then want to use in my new project.
          >>>>> The problem: When I created new inherited form, say
          >>>>> frmClients, I cannot load the form in design view - the
          >>>>> IDE complains with
          >>>>> "Argument 'Path' is Nothing or empty." error.
          >>>>>
          >>>>> It does not stop however the project to compile, and even
          >>>>> works correctly while running the project.
          >>>>>
          >>>>> Unfortunately, I cannot add controls on the form
          >>>>> (frmClients) in design view - the IDE simply won't load
          >>>>> it.
          >>>>>
          >>>>> Does anyone know what may be the problem and how to fix
          >>>>> it?
          >>>>>
          >>>>> Any help will be greatly appreciated.
          >>>>
          >>>>
          >>>> .[/color]
          >>
          >>
          >> .[/color][/color]


          Comment

          • Chris Dunaway

            #6
            Re: Forms inheritance problem

            On Sun, 23 Nov 2003 20:21:55 -0800, Sergey Poberezovskiy wrote:
            [color=blue]
            >
            > Unfortunately, I cannot add controls on the form
            > (frmClients) in design view - the IDE simply won't load
            > it.[/color]

            Does your form class have a constructor that takes NO arguments? That is
            necessary for the form designer to be able to instantiate it. Can you show
            us the code for the form class and information on the constructors?

            --
            Chris

            To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
            address.

            Comment

            • Sergey Poberezovskiy

              #7
              Re: Forms inheritance problem

              Every form has an overloaded constructor, but one without
              parameters amongst them. The code for the frmDetail, and
              frmClient is as follows:

              frmDetail:

              Imports System.Windows. Forms

              Namespace Forms
              Public Class frmDetail
              Inherits System.Windows. Forms.Form

              Protected _id As Int32
              Protected _openMode As Constants.FormO penMode
              Private _detailName As String =
              Constants.Empty String

              #Region " Windows Form Designer generated code "

              #Region " Constructor"
              Public Sub New()
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              End Sub

              Public Sub New(ByVal parentMDI As Form)
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              Me.ParentMDI = parentMDI
              End Sub

              Public Sub New(ByVal detailName As String)
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              Me.DetailName = detailName
              End Sub

              Public Sub New(ByVal parentMDI As Form, ByVal
              detailName As String)
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              Me.ParentMDI = parentMDI
              Me.DetailName = detailName
              End Sub
              #End Region

              'Form overrides dispose to clean up the component
              list.
              Protected Overloads Overrides Sub Dispose(ByVal
              disposing As Boolean)
              If disposing Then
              If Not (components Is Nothing) Then
              components.Disp ose()
              End If
              End If
              MyBase.Dispose( disposing)
              End Sub

              'Required by the Windows Form Designer
              Private components As
              System.Componen tModel.IContain er

              'NOTE: The following procedure is required by the
              Windows Form Designer
              'It can be modified using the Windows Form
              Designer.
              'Do not modify it using the code editor.
              Protected Friend WithEvents btnSave As
              System.Windows. Forms.Button
              Protected Friend WithEvents btnCancel As
              System.Windows. Forms.Button

              <System.Diagnos tics.DebuggerSt epThrough()>
              Private Sub InitializeCompo nent()
              Me.btnSave = New System.Windows. Forms.Button
              Me.btnCancel = New System.Windows. Forms.Button
              Me.SuspendLayou t()
              '
              'btnSave
              '
              Me.btnSave.Anch or = CType
              ((System.Window s.Forms.AnchorS tyles.Bottom Or
              System.Windows. Forms.AnchorSty les.Right),
              System.Windows. Forms.AnchorSty les)
              Me.btnSave.Dial ogResult =
              System.Windows. Forms.DialogRes ult.Cancel
              Me.btnSave.Loca tion = New System.Drawing. Point
              (175, 298)
              Me.btnSave.Name = "btnSave"
              Me.btnSave.Size = New System.Drawing. Size(70,
              25)
              Me.btnSave.TabI ndex = 19
              Me.btnSave.Text = "&Save"
              '
              'btnCancel
              '
              Me.btnCancel.An chor = CType
              ((System.Window s.Forms.AnchorS tyles.Bottom Or
              System.Windows. Forms.AnchorSty les.Right),
              System.Windows. Forms.AnchorSty les)
              Me.btnCancel.Di alogResult =
              System.Windows. Forms.DialogRes ult.Cancel
              Me.btnCancel.Lo cation = New
              System.Drawing. Point(284, 298)
              Me.btnCancel.Na me = "btnCancel"
              Me.btnCancel.Si ze = New System.Drawing. Size
              (70, 25)
              Me.btnCancel.Ta bIndex = 17
              Me.btnCancel.Te xt = "&Cancel"
              '
              'frmDetail
              '
              Me.AutoScaleBas eSize = New System.Drawing. Size
              (5, 13)
              Me.ClientSize = New System.Drawing. Size(367,
              332)
              Me.Controls.Add (Me.btnSave)
              Me.Controls.Add (Me.btnCancel)
              Me.MinimumSize = New System.Drawing. Size(375,
              370)
              Me.Name = "frmDetail"
              Me.ResumeLayout (False)

              End Sub
              #End Region

              #Region " Public Properties"
              Public Property Id() As Int32
              Get
              Return _id
              End Get
              Set(ByVal Value As Int32)
              If Not _id.Equals(Valu e) Then
              _id = Value
              sbSetFormText()
              If Not Value.Equals(0) Then
              sbSetRecord()
              End If
              End If
              End Set
              End Property

              Public Property DetailName() As String
              Get
              Return _detailName
              End Get
              Set(ByVal Value As String)
              _detailName = Value
              End Set
              End Property

              Public WriteOnly Property ParentMDI() As Form
              Set(ByVal Value As Form)
              Me.MdiParent = Value
              End Set
              End Property

              Public WriteOnly Property OpenMode() As
              Constants.FormO penMode
              Set(ByVal Value As Constants.FormO penMode)
              _openMode = Value
              sbSetFormText()
              sbSetControlsMo de()
              End Set
              End Property
              #End Region

              #Region " Private routines"
              Protected Overridable Sub sbSetControlsMo de()

              End Sub

              Protected Overridable Sub sbSetRecord()

              End Sub

              Protected Overridable Function fnCheck() As
              Boolean

              End Function

              Protected Overridable Sub sbSetFormText()
              Select Case _openMode
              Case Constants.FormO penMode.newReco rd
              Me.Text = "Create New " & _detailName
              Case Constants.FormO penMode.editRec ord
              Me.Text = "Modify " & _detailName
              & " " & _id.ToString
              Case Constants.FormO penMode.viewRec ord
              Me.Text = "View " & _detailName & " "
              & _id.ToString
              End Select
              End Sub
              #End Region

              Private Sub frm_Load(ByVal sender As
              System.Object, ByVal e As System.EventArg s) Handles
              MyBase.Load
              General.SetForm Position(Me)
              End Sub

              Private Sub frm_Closing(ByV al sender As Object,
              ByVal e As System.Componen tModel.CancelEv entArgs) Handles
              MyBase.Closing
              General.SaveFor mPosition(Me)
              Me.Dispose()
              End Sub

              Private Sub btnCancel_Click (ByVal sender As
              System.Object, ByVal e As System.EventArg s) Handles
              btnCancel.Click
              Me.Close()
              End Sub

              End Class
              End Namespace

              And frmClient:

              Friend Class frmClient
              Inherits BaseClasses.For ms.frmDetail

              #Region " Windows Form Designer generated code "
              #Region " Constructor"
              Public Sub New()
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              End Sub

              Public Sub New(ByVal openMode As
              Constants.FormO penMode)
              MyBase.New()
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              Me.OpenMode = openMode
              End Sub

              Public Sub New(ByVal parentMDI As Form)
              MyBase.New(pare ntMDI)
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              End Sub

              Public Sub New(ByVal parentMDI As Form, ByVal
              openMode As Constants.FormO penMode)
              MyBase.New(pare ntMDI)
              'This call is required by the Windows Form
              Designer.
              InitializeCompo nent()
              Me.OpenMode = openMode
              End Sub
              #End Region

              'Form overrides dispose to clean up the component
              list.
              Protected Overloads Overrides Sub Dispose(ByVal
              disposing As Boolean)
              If disposing Then
              If Not (components Is Nothing) Then
              components.Disp ose()
              End If
              End If
              MyBase.Dispose( disposing)
              End Sub

              'Required by the Windows Form Designer
              Private components As System.Componen tModel.IContain er

              'NOTE: The following procedure is required by the
              Windows Form Designer
              'It can be modified using the Windows Form Designer.
              'Do not modify it using the code editor.
              <System.Diagnos tics.DebuggerSt epThrough()> Private
              Sub InitializeCompo nent()
              components = New System.Componen tModel.Containe r
              Me.Text = "frmClient"
              End Sub
              #End Region

              #Region " Overrides"
              Protected Overrides Sub btnSave_Click(B yVal sender As
              Object, ByVal e As System.EventArg s)

              End Sub
              #End Region

              Protected Overrides Function fnCheck() As Boolean

              End Function

              Protected Overrides Sub sbSetControlsMo de()

              End Sub

              Protected Overrides Sub sbSetRecord()

              End Sub
              End Class

              There isn't much code in those as I cannot add controls
              to it...
              [color=blue]
              >-----Original Message-----
              >On Sun, 23 Nov 2003 20:21:55 -0800, Sergey Poberezovskiy[/color]
              wrote:[color=blue]
              >[color=green]
              >>
              >> Unfortunately, I cannot add controls on the form
              >> (frmClients) in design view - the IDE simply won't[/color][/color]
              load[color=blue][color=green]
              >> it.[/color]
              >
              >Does your form class have a constructor that takes NO[/color]
              arguments? That is[color=blue]
              >necessary for the form designer to be able to[/color]
              instantiate it. Can you show[color=blue]
              >us the code for the form class and information on the[/color]
              constructors?[color=blue]
              >
              >--
              >Chris
              >
              >To send me an E-mail, remove the underscores and[/color]
              lunchmeat from my E-Mail[color=blue]
              >address.
              >.
              >[/color]

              Comment

              • Anand Balasubramanian

                #8
                Re: Forms inheritance problem

                Hi,
                I have a suggestion that you can try out. Sometimes these types of weird
                errors occur when one of the system dlls copylocal property is set to
                true. So please check properties of the system dlls in your references
                section and make sure their copylocal property is set to false. SAve the
                project and then reload it and see if you can get into the desinger.

                Thanks
                Anand Balasubramanian
                Microsoft, Visual Basic .NET

                This posting is provided "AS IS" with no warranties, and confers no rights.
                Please reply to newsgroups only. Thanks

                Comment

                Working...