cast to std::string

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

cast to std::string

Simon Pickles-2

I am trying to get a string from the global namespace. Heres my naive approach:

     const string s = luabind::object_cast<string>( luabind::globals(L)[ "name" ] );
     printf("LuaInterface::GetString: %s = %s\n", name.c_str(), s);
   catch(const std::exception&e)
     printf("LuaInterface::GetString Error: %s\n", e.what() );

I get "unable to make cast".

I assure you I am using luaL_dofile correctly - I can use the above approach to get integers.

Is there a better way?



The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
luabind-user mailing list
[hidden email]