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



The information in this article applies to:

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

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.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbAPI kbBug kbpending kbShellGrp KB246288