FIX: Command Line Compile Fails with MFC ActiveX Control
ID: Q190196
|
The information in this article applies to:
-
Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 5.0
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.
MORE INFORMATION
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.
- From the Project menu, click Components.
- Check the TestControl ActiveX Control Module entry, and click OK.
- Site the TestControl onto the default form (Form1).
- Save the project, and compile it within the IDE.
NOTE: The project should compile with no errors.
- Shell out to MS-DOS, and attempt to compile the project through the
command line parameters. For example:
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".
Additional query words:
kbDSupport kbVC kbdsd kbVBp500bug kbVBp600fix kbCompiler
Keywords : kbGrpVB
Version : WINDOWS:5.0
Platform : WINDOWS
Issue type : kbbug