Microsoft KB Archive/173049: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 12: | Line 12: | ||
<div id="TitleRow"> | <div id="TitleRow"> | ||
= <span id="KB173049"></span>PRB: | = <span id="KB173049"></span>PRB: "Locate" Dialog Appears When Running Setup Wizard = | ||
Line 47: | Line 47: | ||
== SYMPTOMS == | == SYMPTOMS == | ||
When running the Microsoft Visual Basic Application Setup Wizard, a dialog titled | When running the Microsoft Visual Basic Application Setup Wizard, a dialog titled "Locate Kernel," "Locate User," "Locate GDI," etc., is displayed after you click the Next button on the "Setup Wizard - Select Project and Options" form. | ||
</div> | </div> | ||
Line 54: | Line 54: | ||
== CAUSE == | == CAUSE == | ||
The Visual Basic Application Setup Wizard scans a project's files for Declare statements to determine if any additional dependency files need to be distributed. If any such files are found, the user is prompted for the location of the files with the | The Visual Basic Application Setup Wizard scans a project's files for Declare statements to determine if any additional dependency files need to be distributed. If any such files are found, the user is prompted for the location of the files with the "Locate" dialog.<br /> | ||
<br /> | <br /> | ||
If any declarations for 16-bit DLLs are found in the project's files, the user is prompted for the location. For example, if the following 16-bit declaration appears in the project:<br /> | If any declarations for 16-bit DLLs are found in the project's files, the user is prompted for the location. For example, if the following 16-bit declaration appears in the project:<br /> | ||
<pre class="codesample"> Declare Function GetWindowsDirectory Lib | <pre class="codesample"> Declare Function GetWindowsDirectory Lib "Kernel" _ | ||
(ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | ||
</pre> | </pre> | ||
<br /> | <br /> | ||
Setup Wizard will prompt the user for the location of the Kernel DLL with the | Setup Wizard will prompt the user for the location of the Kernel DLL with the "Locate" dialog.<br /> | ||
<br /> | <br /> | ||
This is a very common problem with applications converted from 16-bit Visual Basic to Visual Basic 5.0, which is 32-bit, or with Visual Basic 4.0 applications that use conditional compilations that have been converted to Visual Basic 5.0. Setup Wizard does not take into consideration the compiler directives when looking for Declare statements resulting, for example, in a | This is a very common problem with applications converted from 16-bit Visual Basic to Visual Basic 5.0, which is 32-bit, or with Visual Basic 4.0 applications that use conditional compilations that have been converted to Visual Basic 5.0. Setup Wizard does not take into consideration the compiler directives when looking for Declare statements resulting, for example, in a "Locate Kernel" dialog for the sample code below:<br /> | ||
<pre class="codesample"> #If Win32 Then | <pre class="codesample"> #If Win32 Then | ||
Declare Function GetWindowsDirectory Lib | Declare Function GetWindowsDirectory Lib "Kernel32" _ | ||
Alias | Alias "GetWindowsDirectoryA" _ | ||
(ByVal lpBuffer As String, ByVal nSize As Long) As Long | (ByVal lpBuffer As String, ByVal nSize As Long) As Long | ||
#Else | #Else | ||
Declare Function GetWindowsDirectory Lib | Declare Function GetWindowsDirectory Lib "Kernel" _ | ||
(ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | ||
#End If | #End If | ||
Line 101: | Line 101: | ||
<li>Add a new module (Module1) to the project.</li> | <li>Add a new module (Module1) to the project.</li> | ||
<li><p>In the General Declarations section of Module1, add following code:</p> | <li><p>In the General Declarations section of Module1, add following code:</p> | ||
<pre class="codesample"> Declare Function GetWindowsDirectory Lib | <pre class="codesample"> Declare Function GetWindowsDirectory Lib "Kernel" _ | ||
(ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer | ||
</pre></li> | </pre></li> | ||
<li>Save the project, compile it, and then exit Visual Basic.</li> | <li>Save the project, compile it, and then exit Visual Basic.</li> | ||
<li>Start the Visual Basic Application Setup Wizard and proceed to the form entitled | <li>Start the Visual Basic Application Setup Wizard and proceed to the form entitled "Setup Wizard - Select Project and Options," click the Browse button, and select the project you compiled.</li> | ||
<li>Click the Next button. A locate file common dialog box entitled | <li>Click the Next button. A locate file common dialog box entitled "Locate Kernel" is displayed.</li></ol> | ||
Latest revision as of 11:06, 21 July 2020
Article ID: 173049
Article Last Modified on 12/10/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Control Creation Edition
- 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 Q173049
SYMPTOMS
When running the Microsoft Visual Basic Application Setup Wizard, a dialog titled "Locate Kernel," "Locate User," "Locate GDI," etc., is displayed after you click the Next button on the "Setup Wizard - Select Project and Options" form.
CAUSE
The Visual Basic Application Setup Wizard scans a project's files for Declare statements to determine if any additional dependency files need to be distributed. If any such files are found, the user is prompted for the location of the files with the "Locate" dialog.
If any declarations for 16-bit DLLs are found in the project's files, the user is prompted for the location. For example, if the following 16-bit declaration appears in the project:
Declare Function GetWindowsDirectory Lib "Kernel" _ (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
Setup Wizard will prompt the user for the location of the Kernel DLL with the "Locate" dialog.
This is a very common problem with applications converted from 16-bit Visual Basic to Visual Basic 5.0, which is 32-bit, or with Visual Basic 4.0 applications that use conditional compilations that have been converted to Visual Basic 5.0. Setup Wizard does not take into consideration the compiler directives when looking for Declare statements resulting, for example, in a "Locate Kernel" dialog for the sample code below:
#If Win32 Then Declare Function GetWindowsDirectory Lib "Kernel32" _ Alias "GetWindowsDirectoryA" _ (ByVal lpBuffer As String, ByVal nSize As Long) As Long #Else Declare Function GetWindowsDirectory Lib "Kernel" _ (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer #End If
RESOLUTION
Convert all 16-bit declarations to their 32-bit equivalents and recompile the project, or, if conditional compilation was used to select between pairs of 16-bit and 32-bit declarations, the conditional compilation statements and 16-bit declarations can be commented out or removed and the project recompiled.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a new Standard EXE project in Visual Basic.
- Add a new module (Module1) to the project.
In the General Declarations section of Module1, add following code:
Declare Function GetWindowsDirectory Lib "Kernel" _ (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
- Save the project, compile it, and then exit Visual Basic.
- Start the Visual Basic Application Setup Wizard and proceed to the form entitled "Setup Wizard - Select Project and Options," click the Browse button, and select the project you compiled.
- Click the Next button. A locate file common dialog box entitled "Locate Kernel" is displayed.
Keywords: kbprb KB173049