P
Peter
Hi
Does anyone know if it's possible to for Javascript to reference an
enum in a Class that is assigned to a VB.NET Form's embedded browser
control using the ObjectForScripting property?
I define a Class as follows:
<System.Runtime.InteropServices.ComVisibleAttribute(True)> _
Public Class MyClass
Public Enum MyEnum
Enum1 = 1
Enum2 = 2
Enum3 = 3
End Enum
Public Sub MyMethod(Param1 as MyEnum)
<Code goes here>
End Sub
End Class
"MyClass" is then assigned to the browser control as follows:
Dim lMyClass as MyClass
Browser.ObjectForScripting = lMyClass
From my web page which runs inside Browser I want to make the
following call to the MyClass.MyMethod as follows:
function button_click()
{
window.external.MyMethod(MyEnum.Enum2)
}
However it seems the "MyEnum" is not recognised across the COM
interface between the browser and .NET. The "window.external.MyMethod
(MyEnum.Enum2) Javascript statement results in an "Object does not
support Automation" error message (or similar). If I change the
declaration to MyMethod to "MyMethod(Param1 as Integer)" and then use
the following Javascript statement it works fine:
"window.external.MyMethod(2)"
Can someone tell me if it's possible for Javascript to reference an
enum in a Class that is assigned to a VB.NET Form's embedded browser
control using the ObjectForScripting property?
Peter
Does anyone know if it's possible to for Javascript to reference an
enum in a Class that is assigned to a VB.NET Form's embedded browser
control using the ObjectForScripting property?
I define a Class as follows:
<System.Runtime.InteropServices.ComVisibleAttribute(True)> _
Public Class MyClass
Public Enum MyEnum
Enum1 = 1
Enum2 = 2
Enum3 = 3
End Enum
Public Sub MyMethod(Param1 as MyEnum)
<Code goes here>
End Sub
End Class
"MyClass" is then assigned to the browser control as follows:
Dim lMyClass as MyClass
Browser.ObjectForScripting = lMyClass
From my web page which runs inside Browser I want to make the
following call to the MyClass.MyMethod as follows:
function button_click()
{
window.external.MyMethod(MyEnum.Enum2)
}
However it seems the "MyEnum" is not recognised across the COM
interface between the browser and .NET. The "window.external.MyMethod
(MyEnum.Enum2) Javascript statement results in an "Object does not
support Automation" error message (or similar). If I change the
declaration to MyMethod to "MyMethod(Param1 as Integer)" and then use
the following Javascript statement it works fine:
"window.external.MyMethod(2)"
Can someone tell me if it's possible for Javascript to reference an
enum in a Class that is assigned to a VB.NET Form's embedded browser
control using the ObjectForScripting property?
Peter