Hi,

On Mon, 2013-03-18 at 08:09 +0100, Jean-Michel Caricand wrote:
> How can I read a session variable from a C++ function.

in short: you can't. 
longer: you could try to use the tntnet-internal functions to access
variables from the session scope, but then you'll need to know which
session id the request have and you can't access the request object from
your function.

What you need to do is, to pass the session variable to the function,
preferable by reference.

My component :

mycomp.ecpp :

...
<%session>
int myvariable;
</%session>

myfunction(myvariable)
...

myfunction.cpp :

void myfunction(int& _myvariable)
{
    _myvariable = //whatever
    ...
    ...
}


Regards,
Julian


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to