PRB: VB Doesn't Generate Compile Error for Misspelled Methods (193265)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning 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 Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q193265 SYMPTOMS
When using a COM component from Visual Basic, you may not receive a compile-
time error if you accidentally misspell a property or method name. Instead,
Visual Basic will generate the following error at run-time:
Run-time error '438':
Object does not support this property or method.
CAUSE
This situation occurs when the object being referenced supports a dual or
dispinterface, and therefore can be late-bound. If the component designer
did not mark the interface as being "nonextensible," then Visual Basic
cannot determine if the misspelled method/property name is misspelled, or
if it is a new method or property added to the interface at a later time.
Consequently, Visual Basic does not raise an error at compile-time, but
rather checks at run-time whether the component supports a method/property
by that name. The run-time error occurs if the object does not have the
named method/property.
The COM component creator can indicate whether or not an interface can be
extended at a later time. If the interface is marked as "nonextensible,"
then Visual Basic will know at compile-time whether the object supports the
named method/property.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbCtrlCreate kbprb KB193265 |
---|
|