U++ framework
Do not panic. Ask here before giving up.

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 Go to previous message
Peter is currently offline  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?
 
Read Message
Read Message
Previous Topic: Skylark and Date/Time format
Next Topic: Cant connect but dont get an error
Goto Forum:
  


Current Time: Sun Jun 21 07:17:21 GMT+2 2026

Total time taken to generate the page: 0.00822 seconds