PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: call to a procedure
DotNetDelegate (Example)
Example: call to a procedure
WINDEVWEBDEV - Server codeReports and QueriesWindowsWindows MobileUser code (UMC)
//------------------------------------------------
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 in parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("1) The string passed in 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 in parameter via the delegate"  ...
"is identical to the string received")
ELSE
Info("2) The string passed in 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