Run-time error '50304' An instance of formxxx cannot be created because its designer window is open
Posted on 2005-04-28
I have a VB app I have been working on in VB6 that runs fine when run in the IDE
When I attempt to make a standalone exe (lets call it xxx.exe) the act of doing so generates the error message listed above.
Apparently, one of the first thing the IDE does when building xxx.exe is to actually run the program.
During this "run" the program encounters the above error that it does not encounter when invoked in the IDE via the run menu.
When it encounters a problem, it lets me debug and reveals that it is stuck on the following line of code:
AddMapDefinition "formabc", frmAbc
(where frmABC is a form I defined in the project) This form contains custom controls that I wrote.
The actual code that makes up AddMapDefinition is listed below:
Public Sub AddMapDefinition(sName As String, frm As Form)
Dim map As New CMapLink
map.Create sName, frm
MapList.Add map, sName
CMapLink is a very straightforward class I wrote, made up of the following lines:
Public m_sName As String
Public m_frmMap As Form
Public Sub Create(sName As String, frm As Form)
m_sName = sName
Set m_frmMap = frm
The form contains instances of controls I wrote and I am assuming it is not necessary to provide the listing for them here.
I searched the site for 50304 as well as Google and was unable to determine how the things described applied to my problems. Apparently the IDE is confused about the "application" (??) or component within the IDE ( a designer?) used in some way in the creation of the form ?
I have tried explictily closing files, saving project, stopping IDE and restarting it without success. I even rebooted machine several times. Any help greatly appreciated.