cast to std::string

Simon Pickles <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
  Hi,

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

   try
   {
     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?


Thanks

SImon







------------------------------------------------------------------------------
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:
http://p.sf.net/sfu/dev2dev-palm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.