Article ID: 291103
Article Last Modified on 10/21/2005
APPLIES TO
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 6.0 Learning Edition
This article was previously published under Q291103
SYMPTOMS
You can use the InsertObjDlg method of the OLE container control to create an object from a file. However, if the file name contains any extended ASCII characters (that is, characters with the values 0 through 31 and 127 through 255), InsertObjDlg fails, and you receive the following error message:
This error occurs even though the file closes in the operation system.
CAUSE
Before OLE container control checks whether the file name that you provided is valid, it converts all of the characters in the file name from the American National Standards Institute (ANSI) character set to the OEM character set. With extended ASCII characters in the file name, the converted file name is no longer the same as the original file name. Because the converted file name is not available in the system, OLE container control reports an error.
RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.
Note You must have a Visual Studio license agreement to obtain this hotfix.
To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this fix should have the following file attributes or later:
Date Time Version Size File name ----------------------------------------------------- 17-Apr-2001 12:05PM 6.0.91.15 1.42MB Msvbvm60.dll 17-Apr-2001 12:05PM 6.0.0.8965 1.64MB VBA6.dll 17-Apr-2001 12:05PM 6.0.91.15 1.86MB VB6.exe
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
- In the Visual Basic Integrated Development Environment (IDE), create a Visual Basic Standard EXE project. Form1 is created by default.
- Add an OLE container control to the form. Keep the default name OLE1.
Add the following code to the code window of Form1:
Private Sub OLE1_Click() OLE1.InsertObjDlg End Sub
- Press the F5 key to run the project.
- Click the OLE container control.
- In the Insert Object dialog box, click Create from File.
- In the Insert Object dialog box, click Browse, and select a file that uses extended ASCII characters in the file name. For example:
"Caf.doc" (where "" is ASCII 130)
- In the Insert Object dialog box, click OK. You receive the above-mentioned error message.
Additional query words: error 31039
Keywords: kbbug kbqfe kbpending KB291103