BUG: Unexpected Error Entering Break Mode in Shared Module
ID: Q191000
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0
SYMPTOMS
When sharing code modules between projects that run in the IDE at the same
time, an unexpected error occurs if one project has the shared module open
while the other project enters break mode in the same module. The error
message received is:
The copy of this file which might have changes is already opened.
Clicking OK on this message causes "Unexpected Error (59999)" to occur.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
MORE INFORMATIONSteps to Reproduce Behavior
Create a Shared Module:
- Create a new Standard EXE project in Visual Basic. Form1 is created by
default.
- Add a CommandButton to Form1, and paste the following code into
the Form1 code window:
Private Sub Command1_Click()
Module1.SharedCode
End Sub
- On the Project menu, click Add Module. Module1 is added to the project.
- Paste the following code into Module1:
Public Sub SharedCode()
Debug.Print "Shared Code"
End Sub
- Click the insertion point on the Debug.Print line, and then press the F9
key to toggle the breakpoint on.
- Save the module as Module1, and close its code window.
Add the Shared Module to Another Project:
- On the File menu, click Add Project. Select ActiveX Control, and then
click Open. UserControl1 is created by default.
- Add Module1 to Project2.
- Place a CommandButton on UserControl1 in Project2, and then paste the
following code into the UserControl1 code window:
Private Sub Command1_Click()
Module1.SharedCode
End Sub
- Open Module1 in Project2, and repeat step 5 to place a breakpoint on
the Debug.Print line.
- Close the design window of UserControl1, and place it on Form1 of
Project1 so the CommandButtons on both are visible.
Run Both Projects with the Shared Module:
- Press the F5 key to run Project1. Click Command1 on UserControl1.
- Press the F5 key at the breakpoint.
- Click Command1 on Form1.
RESULTS: The IDE attempts to open Form1's instance of the shared module
(Module1), and you receive the following error message:
The copy of this file which might have changes is already opened.
Clicking OK on this message causes "Unexpected Error (59999)" to occur.
Additional query words:
kbVBp500bug kbVBp600bug kbide kbdss kbDSupport kbVBp
Keywords : kbGrpVB
Version :
Platform : WINDOWS
Issue type : kbbug
|