call_function causes my program to crash

Secretive Loon <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I've successfully used call_function to call Lua functions before and didn't
have a problem. I think it's because they were of global scope like:int sum
= luabind::call_function<int>( L, "add", 2, 3 );

but the one I'm trying to do now is like this, with a different scope:
luabind::call_function<void>( L, "CNPC_Nurse:Update" );

-- Here's the Lua code that I'm trying to call (in a different file from the
C++, of course)
function CNPC_Nurse:Update()
Msg( "\nIn Nurse:Update" )
end

// these came earlier in the file as the above C++ code
luabind::module( L ) [
luabind::class_<CNPC_Nurse>( "CNPC_Nurse" )
];

When I run it, it crashes the application without a message. I've narrowed
it down to the call_function line causes the problem. Any idea why the
"CNPC_Nurse:Update" call breaks it?

Thanks :)

------------------------------------------------------------------------------
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.