Re: Call a lua function and pass a C++ Class object
Beric Holt <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <9E82C0C42B538E4A9DEECB54EAE2AC3D05F7F52CFA@CHCEX1v.intergen.org.nz> |
Weird. I just tried calling the function with no return type (instead of an int) and it worked. I changed int ret = luabind::call_function<int>(luaVM, "UpdateActor", actor); into luabind::call_function<void>(luaVM, "UpdateActor", actor); So how do I get this going with a return value? Cheers Beric -----Original Message----- From: Beric Holt Sent: Tuesday, 12 May 2009 4:56 p.m. To: [email protected] Subject: RE: [luabind] Call a lua function and pass a C++ Class object I'm getting an exception in the proxy_function_caller->Ret operator code (on line 157 of call_function.hpp of luabind-0.8.1). The exception description is "luabind::cast_failed at memory location 0x0017ebd0." It looks like it's trying to check the return type of the function that I'm trying to call. Because the function is declared in Lua script, and not explicitly declared with a luabind def statement, it doesn't know the full function signature. (It's also entirely possible that I'm barking up the totally wrong tree). Cheers Beric -----Original Message----- From: James Porter [mailto:[email protected]] Sent: Monday, 11 May 2009 5:10 p.m. To: [email protected] Subject: Re: [luabind] Call a lua function and pass a C++ Class object Beric Holt wrote: > I have a function declared in Lua > > I want to be able to call that function from C++ and pass in a C++ class > object, but I'm struggling how to do it. It works fine for me, can you provide more information about what kind of error you're getting? - Jim ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ luabind-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luabind-user ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com