FIX: Eight or More ActiveX DLLs in Compiled Project Cause Error

This article was previously published under Q192653
This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
A Visual Basic project group contains at least eight ActiveX DLL projectsand one standard EXE project. The Standard EXE project creates and releasesthe ActiveX DLL files. The project group is compiled into DLL and EXEfiles. The EXE file is run.

The first time you create and release the ActiveX DLL files, the programruns successfully. However, the second time you create and release theActiveX DLL files, an application error occurs and displays the followingmessage:
The instruction at "0x6602c2c5 referenced memory at "0x010b008c". The Memory could not be "written".
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
MORE INFORMATION
The bug occurs only when the compiled projects are run outside the VisualBasic IDE. The bug does not occur when you run the project through theVisual Basic IDE.

This section shows you how to create a sample project that demonstrates thebug behavior. The section assumes you are familiar with creating ActiveXDLL projects, standard EXE projects, project groups, and compiling thesefiles into a executable file.

Steps to Reproduce Behavior

The sample project contains eight ActiveX DLL projects that will be used ina Standard EXE project. The Standard EXE project is then compiled into anexecutable file. The executable file is then run to demonstrate the bugbehavior.

To create the eight ActiveX DLL projects:
  1. Start a new ActiveX DLL project in Visual Basic. Class1 is created by default.
  2. Copy the following code to the Code window of the Class1:
    Option Explicit      Public Sub DoNothing()      End Sub					
  3. Save this Class module as Class1.cls and this project as Project1.vbp.
  4. Add another ActiveX DLL project to the project group. Class1 is created by default. Remove the Class1 class module from this project and add the Class1 class module you created for Project1.vbp to the new ActiveX DLL project.
  5. Save this project as Project2.vbp.
  6. Repeat steps 4 and 5 to add six other ActiveX DLL projects with the same Class1 class module to the project group. Save these projects as Project3.vbp through Project8.vbp.

    You have just created a project group with eight ActiveX DLL projects saved as Project1.vbp to Project8.vbp. Each ActiveX DLL project references the same Class1 class module created in Project1.vbp.

    The next step is to create a Standard EXE project that uses the eight ActiveX DLL projects.
To create the Standard EXE project:
  1. Add a new Standard EXE project to the same project group containing the eight ActiveX DLL projects. Form1 is created by default.
  2. Add a CommandButton to Form1.
  3. Copy the following code to the Code window of the Form1 form:
          Option Explicit      Private Sub Command1_Click()         Dim o(8) As Object         Dim i As Integer         Dim strProgID As String         For i = 1 To 8            strProgID = "Project" & i & ".Class1"            Set o(i) = CreateObject(strProgID)            o(i).donothing            Set o(i) = Nothing         Next         MsgBox "Done"      End Sub					
  4. Save the project as Project9.vbp.
  5. Set Project9.vbp as the Start up project. In the Project Explorer, right-click Project9.vbp and then click Set as Start Up. Project9.vbp appears in bold in the Project Explorer.
  6. Press the F5 key to start to run the project in IDE. Click the Command1 button in Form1 several times and it note that it works correctly.
  7. Compile the Project Group.
  8. Run Project9.exe outside the IDE. The Form1 form appears. Click Command1. A message box appears. Click OK to close the message box. Click Command1 again. Note that an application error occurs and displays the following message box:
    The instruction at "0x6602c2c5 referenced memory at "0x010b008c". The Memory could not be "written".
COM ActiveX InProc
Properties

Article ID: 192653 - Last Review: 02/23/2014 01:10:53 - Revision: 2.1

Microsoft Visual Basic 6.0 Learning Edition, Microsoft Visual Basic 6.0 Professional Edition, Microsoft Visual Basic 6.0 Enterprise Edition

  • kbnosurvey kbarchive kbbug kbfix kbide kbvs600sp1fix kbdll kbvs600sp2fix kbvs600sp3fix KB192653
Feedback