Microsoft KB Archive/246288: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 50: Line 50:


When you use the API Text Viewer to get the declaration for the API '''SHFileOperation()''' function, the following '''Declare''' statement is produced:
When you use the API Text Viewer to get the declaration for the API '''SHFileOperation()''' function, the following '''Declare''' statement is produced:
<pre class="codesample">Public Declare Function SHFileOperation Lib &quot;shell32.dll&quot; Alias &quot; SHFileOperationA&quot; (lpFileOp As SHFILEOPSTRUCT) As Long
<pre class="codesample">Public Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
                 </pre>
                 </pre>
Note that the '''Declare''' statement in the code has an embedded space character before '''SHFileOperationA'''. If you use this API in your Visual Basic code, you receive the following error message when you run your application:
Note that the '''Declare''' statement in the code has an embedded space character before '''SHFileOperationA'''. If you use this API in your Visual Basic code, you receive the following error message when you run your application:
Line 69: Line 69:


The correct '''Declare''' statement is:
The correct '''Declare''' statement is:
<pre class="codesample">Public Declare Function SHFileOperation Lib &quot;shell32.dll&quot; Alias &quot;SHFileOperationA&quot; (lpFileOp As SHFILEOPSTRUCT) As Long
<pre class="codesample">Public Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
                 </pre>
                 </pre>



Latest revision as of 13:49, 21 July 2020

Knowledge Base


BUG: Error in Declaration of SHFileOperation() from API Text Viewer

Article ID: 246288

Article Last Modified on 5/12/2003



APPLIES TO

  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Learning Edition



This article was previously published under Q246288

SYMPTOMS

When you use the API Text Viewer to get the declaration for the API SHFileOperation() function, the following Declare statement is produced:

Public Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
                

Note that the Declare statement in the code has an embedded space character before SHFileOperationA. If you use this API in your Visual Basic code, you receive the following error message when you run your application:

Run-time error '453':

Can't find DLL entry point  SHFileOperationA in shell32.dll
                    

Note that the extra space is also present in the error message text.

RESOLUTION

The correct Declare statement is:

Public Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
                

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug kbshellgrp kbapi kbpending KB246288