Microsoft KB Archive/96007

= PRB: Add Graph Error: GSW.EXE and GSWDLL.DLL Version Mismatch =

Article ID: 96007

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Professional Edition

-



This article was previously published under Q96007



SYMPTOMS
Loading the graph control into a project when different versions of GSW.EXE and GSWDLL.DLL exist on the same computer can cause one of the following two error messages:

GSW.EXE and GSWDLL.DLL Version Mismatch

Need Graphics Server 2.00 or later



CAUSE
Because the graph control uses a graphing and charting library (GSWDLL.DLL) along with a graphics server (GSW.EXE) to provide its graphing capabilities, it must have the same versions of these two files.



RESOLUTION
To work around the problem, place the 2.0 version of all three files (GRAPH.VBX, GSW.EXE, and GSWDLL.DLL) in the \WINDOWS\SYSTEM directory, and delete or move the older versions out of the following directories:


 * The \WINDOWS directory
 * The \WINDOWS\SYSTEM directory
 * All directories located on the MS-DOS path



MORE INFORMATION
The setup program for the Professional Edition of Visual Basic version 2.0, correctly updates the GRAPH.VBX and its two auxiliary files if previous versions of the files exist in the \WINDOWS\SYSTEM directory. If prior versions of the control reside in a different directory, such as the \WINDOWS directory, the setup program for Visual Basic version 2.0 will not rename or remove the older versions. However, it does place the version 2.0 versions of the controls in the \WINDOWS\SYSTEM directory.

When you load the graph control, either by choosing Add File from the File menu or by adding GRAPH.VBX to the AUTOLOAD.MAK file, the graph control searches the directories for its two auxiliary files in this order:


 * 1) The directory where GRAPH.VBX resides, unless it's \WINDOWS\SYSTEM
 * 2) The \WINDOWS directory
 * 3) The \WINDOWS\SYSTEM directory
 * 4) The directories on MS-DOS path

If GRAPH.VBX resides in the \WINDOWS\SYSTEM directory the search begins with step 2. The error message, therefore, can occur when a copy of GRAPH.VBX resides in the \WINDOWS\SYSTEM directory and an older version of either GSW.EXE or GSWDLL.DLL resides in the \WINDOWS directory while 2.0 versions reside in the \WINDOWS\SYSTEM directory with GRAPH.VBX.

Steps to Reproduce Behavior
 Run SETUP.EXE from the Professional Toolkit for Visual Basic version 1.0. Install the Toolkit in the \VB1 directory using these two options:

 Select the option to install Controls/Samples. Select Yes, when asked if you want to install duplicate copies of the Toolkit controls in the \VB1\VBX directory.

This will install copies of the custom controls in the \WINDOWS\SYSTEM and \VB1\VBX directories. Run SETUP.EXE from the Visual Basic Professional Edition version 2.0 for Windows.</li> Install Visual Basic version 2.0 in the default directory (\VB) using the Complete Installation option.</li></ol>

At this point, the Visual Basic version 1.0 controls in the \WINDOWS\SYSTEM directory are updated to their 2.0 versions, including GRAPH.VBX, GSW.EXE, and GSWDLL.DLL.

<ol> Rename GSW.EXE in the \WINDOWS\SYSTEM directory to GSW.OLD. Using File Manager, navigate to the \WINDOWS\SYSTEM directory and select GSW.EXE from the list of files. From the File menu, choose Rename (ALT, F, N). In the To box, enter GSW.OLD.

By doing this, you will retain a 2.0 version of the Graph control's server program.</li> Copy GSW.EXE from the \VB1\VBX directory into the \WINDOWS\SYSTEM directory. Using File Manager, navigate to the \VB1\VBX directory and select GSW.EXE from the list of files. From the File menu, choose Copy (ALT, F, C).

Now you have conflicting versions of the GRAPH.VBX and GSW.EXE files in the same directory.</li> Run Visual Basic, or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

The AUTOLOAD.MAK file, installed with Visual Basic 2.0, will attempt to load all custom controls shipped with the Professional Edition. When the loading process reaches the graph control, the following error message occurs:

GSW.EXE & GSWDLL.DLL version mismatch

Upon closing the error message box, a second error message box appears:

Can't load Custom Control DLL: C:\WINDOWS\SYSTEM\GRAPH.VBX

The two error messages also occur when you choose Add File from the File menu</li></ol>

Even though this example incorrectly updates only the GSW.EXE file, the same error messages occur when all three files related to the graph control have different versions.

Additional query words: 2.00

Keywords: kbprb KB96007

-

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

© Microsoft Corporation. All rights reserved.