PRB: Unsupported Automation Type Compile Error Using ActiveX Server's Method (241933)
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
This article was previously published under Q241933 SYMPTOMS
When you use an ATL ActiveX DLL server in Microsoft Visual Basic, if one of the server's methods uses parameters with type UINT, then calling this method generates the compile error message:
Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.
CAUSE
As indicated in the error message, the server is using an Automation type not supported in Visual Basic. Check the MSDN document "Type not supported in Visual Basic" for more information.
RESOLUTION
If you are at the design or early development stage for your server, you are encouraged to change the interface prototypes so that only types supported by Visual Basic are used.
If you already released your product or you are using third-party servers, you can work around the problem most of the time with late binding in your Visual Basic code. The reason why late binding works is that Visual Basic does not check the type at the compile time for late binding objects and Visual Basic uses IDispatch->Invoke at run time for late binding objects.
STATUS
This behavior is by design.
REFERENCES
MSDN topic "Type not supported in Visual Basic" For additional information on an alternative to using late binding, click the article number below
to view the article in the Microsoft Knowledge Base:
189133 HOWTO: Make C DLL More Accessible to VB with a Type Library
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbDLL kbprb KB241933 |
---|
|