Home » U++ Library support » U++ MT-multithreading and servers » How to call a C++ function in Witz template?
How to call a C++ function in Witz template? [message #39167] |
Thu, 21 February 2013 11:47  |
Peter
Messages: 16 Registered: October 2012
|
Promising Member |
|
|
Hi.
According to Witz manual it's possible to call a C++ function in Witz template. Unfortunately there's no example showing how to do that. In one of my source files I defined a trivial function:
void fun(int& i)
{
i++;
}
and Skylark handler:
SKYLARK(AAA, "aaa")
{
http("MYVAR", Value(2));
http("MYFUN", fun);
http.RenderResult("Project_name/aaa");
}
The corresponding aaa.witz template looks like this:
<html>
<body>
$MYVAR
$MYFUN($MYVAR)
$MYVAR
</body>
</html>
I expected to see the following output: 2 3 (old and new value of MYVAR). Instead I got the following error message:
"function nor link not found 'MYFUN'".
I assumed I just had to pass a pointer to my function as a value of shared variable MYFUN to make it visible in Witz template, but apparently that's not how it works. What's the correct way to do it?
|
|
|
Goto Forum:
Current Time: Sat May 10 07:08:39 CEST 2025
Total time taken to generate the page: 0.04170 seconds
|