Announcement

Collapse
No announcement yet.

Caling a plugin in VB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bachelet claude
    replied
    thanks a lot.
    it is working all right.

    Claude

    Leave a comment:


  • mrhappy
    replied
    Not sure if thats a direct copy for your vb.net script...if so you will need to specify a parameter so try changing

    Sub Main()

    To

    Sub Main(ByVal Parms As Object)

    It may explain the parameter count error message, I use hs.plugin("My Plugin") myself rather than getpluginex - i'm not sure if this will also give you a problem, so try

    Sub Main(ByVal Parms As Object)
    Dim xap as object
    xap = hs.Plugin("mcsXap")
    xap.SendXapMessage("test.rest.test", "BSC.Message", "Fonction", "Valeur" & Chr(1) & "Value")
    End Sub

    Its probably not worth using a with/end with function if your only sending one command either but its not a massive problem

    Leave a comment:


  • bachelet claude
    started a topic Caling a plugin in VB

    Caling a plugin in VB

    Hi,
    I am trying to convert a scrit accessing a plugin from basic (.txt) to VB (.vb)

    the original working script ( .txt) is :
    sub main
    with hs.plugin("mcsXap")
    .SendXapMessage "test.rest.test", "BSC.Message", "Fonction", "Valeur" & Chr(1) & "Value"
    End With
    [font=Calibri]end sub

    the vb version :
    Sub Main()
    Dim xap as object
    xap = hs.GetPluginsEX("mcsXap")
    with xap
    .SendXapMessage("test.rest.test", "BSC.Message", "Fonction", "Valeur" & Chr(1) & "Value")

    End With

    End Sub

    and i get the following :
    Scripting runtime error: System.Reflection.TargetParameterCountException: Parameter count mismatch. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)

    Does anyone have a idea why ?
Working...
X