When must I set a variable to “Nothing” in VB6?

后端 未结 8 3544
刺人心
刺人心 2021-02-20 19:00

In one of my VB6 forms, I create several other Form objects and store them in member variables.

Private m_frm1 as MyForm
Private m_frm2 as MyForm

// Later...
Se         


        
8条回答
  •  既然无缘
    2021-02-20 19:08

    I had a problem similar to this a while back. I seem to think it would also prevent the app from closing, but it may be applicable here.

    I pulled up the old code and it looks something like:

    Dim y As Long
    For y = 0 To Forms.Count -1
        Unload Forms(x)
    Next
    

    It may be safer to Unload the m_frm1. and not just set it to nothing.

提交回复
热议问题