Microsoft KB Archive/837226

= BUG: A &quot;The memory could not be 'read'&quot; error or a &quot;Freedom Engine COM Server has encountered a problem&quot; error may occur when you upgrade a Visual Basic 6.0 project to Visual Basic .NET =

Article ID: 837226

Article Last Modified on 5/17/2007

-

APPLIES TO


 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition

-



SYMPTOMS
When you use the Microsoft Visual Basic .NET Upgrade Wizard to upgrade a Microsoft Visual Basic 6.0 project that contains conditional compilation directives, you may receive either of the following error messages.

Error Message 1
The instruction at &quot;0x73d71805&quot; referenced memory at &quot;0x00000000&quot;. The memory could not be &quot;read&quot;.

Click on OK to terminate the program

Click on CANCEL to debug the program

If you click OK, the Visual Basic .NET Upgrade Wizard does not quit.

Error Message 2
Freedom Engine COM Server has encountered a problem and needs to close.



CAUSE
You may notice this problem if your Visual Basic 6.0 code contains several blank lines before the conditional compilation directives. Typically, you may notice this problem if your code contains at least two conditional compilation blocks and at least three blank lines before each conditional compilation directive.

Note You may notice this problem even if your code does not contain any blank lines before the first conditional compilation directive.



WORKAROUND
To work around this problem, remove all blank lines that are present before any conditional compilation directives in your Visual Basic 6.0 code.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior
 To create a Visual Basic 6.0 project that contains conditional compilation directives, follow these steps:  Start Visual Basic 6.0. On the File menu, click New Project. The New Project dialog box appears. Click ActiveX DLL, and then click OK. The Project1 - Class1 (Code) window appears.  Add the following code to the Class1 class file: Public Test1 As Boolean
 * 1) If Flag1 Then


 * 1) End If

Public Test2 As Boolean
 * 1) If Flag2 Then

On the File menu, click Save Class1. The Save File As dialog box appears.</li> Click Save.</li> On the File menu, click Save Project. The Save Project As dialog box appears.</li> Click Save.</li></ol> </li> Start Microsoft Visual Studio .NET.</li> On the File menu, point to Open, and then click Project. The Open Project dialog box appears.</li> Locate, and then click the Visual Basic 6.0 project that you saved in step 1h, and then click Open. Page 1 of the VisualBasic .NET Upgrade Wizard appears.</li> Click Next on page 1, click Next on page 2, and then click Next on page 3 of the Visual Basic .NET Upgrade Wizard. Click Yes when you are prompted to create a new folder.</li> Click Next on page 4 of the Visual Basic. NET Upgrade Wizard to display page 5 of the Visual Basic .NET Upgrade Wizard. The behavior that is mentioned in the &quot;Symptoms&quot; section occurs.</li></ol>
 * 1) End If </li>

<div class="references_section">