FIX: Run-Time Error When DataObject Passed as Object (171812)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q171812 SYMPTOMS
When you pass a DataObject as an Object to another procedure, you receive
one of the following errors:
Run-time error '-2147417848 (80010108)':
Method 'GetFormat' of object 'IVBDataObject' failed
Run-time error '-2147319765 (8002802b)':
Automation Error
RESOLUTION
This problem is corrected with Microsoft Visual Studio 97 Service Pack 2.
You may also work around this issue by obtaining the correct interface to
the DataObject that contains the GetFormat method. The example below
illustrates this workaround. In this example, the DataObject is passed to a
subroutine as an Object and is then set to a variable of type
MSFlexGridLib.DataObject:
Private Sub MSFlexGrid1_OLEDragDrop( _
Data As msflexgridlib.DataObject, Effect As Long, Button As _
Integer, Shift As Integer, x As Single, y As Single)
PrintIt Data
End Sub
Sub PrintIt(d As Object)
Dim iDataObject As MSFlexGridLib.DataObject
Set iDataObject = d
Debug.Print iDataObject.GetFormat(vbCFText)
End Sub
This method allows you to communicate directly with the DataObject
interface of the Object that is passed to the PrintIt procedure.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 2.
For more information on the Visual Studio 97 Service Pack 2, please see the
following article in the Microsoft Knowledge Base: 170365
: INFO: Visual Studio 97 Service Packs - What, Where, and Why
For a list of the Visual Basic 5.0 bugs that were fixed in the Visual
Studio 97 Service Pack 2, please see the following article in the Microsoft
Knowledge Base: 171554
: INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2
Modification Type: | Major | Last Reviewed: | 2/24/2004 |
---|
Keywords: | kbbug kbfix kbvbp500sp2fix kbVS97sp2fix KB171812 |
---|
|