Microsoft KB Archive/190196

= FIX: Command Line Compile Fails with MFC ActiveX Control =

Article ID: 190196

Article Last Modified on 11/18/2003

-

APPLIES TO


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

-



This article was previously published under Q190196



SYMPTOMS
When compiling a Microsoft Visual Basic project from a command line, the following error may occur:

The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".

However, the project does compile successfully from the Visual Basic IDE (Integrated Development Environment.)



CAUSE
An ActiveX Control used within the project does not have a default Icon resource.



RESOLUTION
You must include a Bitmap resource in each ActiveX control used in the project.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0.



Steps to Reproduce Behavior
 In Microsoft Visual C++ 5.0, create a new MFC ActiveX Control Wizard project with all the default selections. Name this project TestControl. Click the ResourceView tab in the Workspace Window. There should be Bitmap Resource containing the default "OCX" bitmap. Double-click the Bitmap Resource, and delete the Bitmap entry. From the Build menu, click Build TestControl.ocx. Start Microsoft Visual Basic, creating a Standard EXE project.</li> From the Project menu, click Components.</li> Check the TestControl ActiveX Control Module entry, and click OK.</li> Site the TestControl onto the default form (Form1).</li> Save the project, and compile it within the IDE.

NOTE: The project should compile with no errors.</li>  Shell out to MS-DOS, and attempt to compile the project through the command line parameters. For example: <pre class="fixed_text">     VB5.EXE /M C:\TestProject\Project1.VBP NOTE: The Microsoft Visual Basic directory should be included in the environment path or a command line compile will not work. Proper quotation marks should be used if the path contains long filenames.

The following error message will be displayed:

The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "read".

</li></ol>

Additional query words: kbDSupport kbVC kbdsd kbVBp500bug kbVBp600fix kbCompiler

Keywords: kbbug kbfix KB190196

-

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

© Microsoft Corporation. All rights reserved.