cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't call macro mega from vb.net

Senior Member

Can't call macro mega from vb.net

Hello,

 

I wrote a macro with mega and I can't call it other way than by its name directly

 

in my vb.net project

 

Dim mega  As MegaMapp.MegaObject =getRoot().GetObjectFromID("myscript"))

Dim vb As Object =getRoot().CurrentEnvironment.GetMacro("myscript"))

 

 

''

'' It works!

try

        Console.Write(vb.helloworld("nicolas"))

Catch ex As Exception
End Try

 

''

'' it does not work, exception occurs  HRESULT : 0x80020009

try

         Console.Write(mega.CallFunction("some text"))

         Console.Write(mega.CallMethode("some text"))

Catch ex As Exception

        Console.Write(ex.Message)

End Try

 

 

my simple vb script :

function helloworld(name)
  helloworld="hello "+name
end function

how can I do ?

 

 

Tags (4)