ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / .Net functions
  • Example: call to a procedure
DotNetDelegate (Example)
Example: call to a procedure
WEBDEV - Server codeWindows
//------------------------------------------------
clDotNet is ClassEventManagement
 
clDotNet:add_m_LogHandler(DotNetDelegate("Proc_Handler", ...
"EventHandler<DllDotNetDelegate.MsgEvent>"))
clDotNet:add_m_LogHandler(DotNetDelegate("Proc_Test", ...
"EventHandler<DllDotNetDelegate.MsgEvent>"))
 
clDotNet:SendAMessage(gsStringSent)
//-------------------------------------------------
 
PROCEDURE Proc_Test(src, args)
 
//Global variable to indicate that the delegate was called
gbDelegateCalled = True
 
sString is string = args:get_Message()
pclMyObj is MsgEvent dynamic = args
 
IF sString = gsStringSent THEN
Info("1) OK: the string passed as parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("1) The string passed as parameter via the delegate " + ...
"is not identical to the string received. "+ ...
sString + " instead of " + gsStringSent)
END
 
IF pclMyObj:get_Message() = gsStringSent THEN
Info("2) OK: the string passed as parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("2) The string passed as parameter via the delegate " + ...
"is not identical to the string received. "+ ...
pclMyObj:get_Message() + " instead of " + gsStringSent)
END
Minimum version required
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help