This method allows you to call any .NET
async method - any method that returns a
Task object basically - asynchronously by passing in a callback object that is called back when the async method completes or fails.
o.wwDotNetBridge.InvokeTaskMethodAsync(loCallback, loInstance, loMethod)
A callback object that implements
OnError() methods that are called when the async method call completes or fails.
The object on which the async method is called
The method that is to be called as a string
Up to 10 parameters that can be passed to the method.
do wwDotNetBridge LOCAL loBridge as wwDotNetBridge loBridge = CreateObject("wwDotNetBridge","V4") loClient = loBridge.CreateInstance("System.Net.WebClient") loCallback = CREATEOBJECT("HttpCallback") *** execute and returns immediately loTask = loBridge.InvokeTaskMethodAsync(loCallback, loClient,"DownloadStringTaskAsync","https://west-wind.com") ? loTask && object ? "Done..." RETURN DEFINE CLASS HttpCallback as AsyncCallbackEvents *** Returns the result of the method and the name of the method name FUNCTION OnCompleted(lvResult,lcMethod) ? "File received. Size: " + TRANSFORM(LEN(lvResult)) ? SUBSTR(lvResult,1,1500) ENDFUNC * Returns an error message, a .NET Exception and the method name FUNCTION OnError(lcMessage,loException,lcMethod) ? "Error: " + lcMethod,lcMessage ENDFUNC ENDDEFINE
See also:Class wwDotNetBridge
Comment or report problem with topic