Unhandled exception when you pass non-public class object to COM DLL in Visual Basic .NET (317273)
The information in this article applies to:
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
This article was previously published under Q317273 SYMPTOMS
When you pass a non-public Visual Basic .NET class object to a Visual Basic Component Object Model (COM) dynamic-link library (DLL), you may receive the following error message:
An unhandled exception of type 'System.InvalidCastException' occurred in ConsoleApplication1.exe
Additional information: No such interface supported
Note In this error message, ConsoleApplication1.exe is the name of your application .exe file.
CAUSE
By default, the Visual Basic .NET class is not public. Classes that do not specify an access modifier are declared as Friend by default.
RESOLUTION
To resolve this problem, make the Visual Basic .NET class public.
Modification Type: | Minor | Last Reviewed: | 2/3/2006 |
---|
Keywords: | kbvs2005doesnotapply kbtshoot kbvs2005swept kbprb KB317273 |
---|
|