Microsoft KB Archive/191000

= BUG: Unexpected Error Entering Break Mode in Shared Module =

Article ID: 191000

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q191000



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.



Steps 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.</li></ol>

Add the Shared Module to Another Project:

<ol> On the File menu, click Add Project. Select ActiveX Control, and then click Open. UserControl1 is created by default.</li> Add Module1 to Project2.</li>  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 </li> Open Module1 in Project2, and repeat step 5 to place a breakpoint on the Debug.Print line.</li> Close the design window of UserControl1, and place it on Form1 of Project1 so the CommandButtons on both are visible.</li></ol>

Run Both Projects with the Shared Module:


 * 1) Press the F5 key to run Project1. Click Command1 on UserControl1.
 * 2) Press the F5 key at the breakpoint.
 * 3) 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: kbbug KB191000

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.