Re: No matching overload found

Phlox Icon <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Thank you for your response, James. I did what you said and it worked
immediately. I'll just paste the code here for Googlers in future:
//C++
//Global scope
CBaseEntity *NULL_CBaseEntity = NULL;

//in a function somewhere else
luabind::globals( GetLuaHandle()->GetLua() )["NULL_CBaseEntity"] =
NULL_CBaseEntity;

-- in the Lua function
if( pStartEntity and szName ) then
 if ( pStartEntity == NULL ) then
 pStartEntity = NULL_CBaseEntity
 end
-- call function
 gEntList:FindEntityByName( pStartEntity, szName, NULL_CBaseEntity,
NULL_CBaseEntity, NULL_CBaseEntity, NULL_CBaseEntity )
end



Sorry, but I have just one more question regarding this piece of code. This
function returns a base class type. I'm wondering how to cast this another
type. The Lua reference manual and PIL don't seem to mention casting of this
type and Google hasn't been helpful. I basically want:
// in C++
DerivedType d = (DerivedType)g.getObject('objectName') ; // returned base
object is cast to derived type
... // perform derivedType specific functions

but code to the same effect in Lua. Is there an easy LuaBind way of doing
this? I've been at this for over a day so I'd also gladly settle for any way
of doing this casting in Lua.

All input is appreciated :)

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
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.