S
Shannon Richards
Hello: I am confused about casting...
Option Strict = ON
Example1:
---------------
When I say something like this...
Dim lo_Foo = New Foo
Dim lo_Obj as Object = lo_Foo
Works Fine!
Example2:
---------------
When I say something like this...
Dim lo_Foo = New Foo
OutPutObj(lo_Foo)
Public Sub OutPutObj(ao_Obj as Object)
...
End Sub
Compile Error: "Option Strict ON disallows implicit conversion from
System.Object to type Foo"
Isn't there an implicit conversion in the first example when the variable of
type object is set to the instance of Foo???
Thank you,
Shannon Richards
BBA, AIT, MCP
Option Strict = ON
Example1:
---------------
When I say something like this...
Dim lo_Foo = New Foo
Dim lo_Obj as Object = lo_Foo
Works Fine!
Example2:
---------------
When I say something like this...
Dim lo_Foo = New Foo
OutPutObj(lo_Foo)
Public Sub OutPutObj(ao_Obj as Object)
...
End Sub
Compile Error: "Option Strict ON disallows implicit conversion from
System.Object to type Foo"
Isn't there an implicit conversion in the first example when the variable of
type object is set to the instance of Foo???
Thank you,
Shannon Richards
BBA, AIT, MCP