Re: Unhandled Exception

Phil Cooper-King <[email protected]> Sun, 30 Oct 2011 05:38:43 +0000
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CAPrH6UM=YrYO1Stuc5kr-zfgTPcNCgGxycDsRZgN855FByhSxQ@mail.gmail.com>
Thanks Nigel,

removing the namespace.

	luabind::module(L)
	[
		luabind::class_<IWindow>("IWindow"),
		luabind::class_<Shift::AppWindow, IWindow>("AppWindow")
			.def(luabind::constructor<unsigned int, unsigned int, bool>())
	];

still results in the exception.

On 30 October 2011 01:17, Nigel J Atkinson <[email protected]> wrote:
> Hi Phil,
>
> Just off the top of my head, looking at your code:
>
> I don't know if it is causing your particular problem, but calling your Lua class "Shift::AppWindow" will not work.  If you need namespace functionality in Lua use the scoping features of luabind, other wise just  call it "AppWindow".
>
> http://www.rasterbar.com/products/luabind/docs.html#scopes
>
> Nigel
>
> On 30/10/2011, at 8:44 AM, Phil Cooper-King wrote:
>
>> Hey,
>>
>> I have a problem trying to get luabind work. I've built the .dll and
>> did a small test app and it worked fine. I'm now trying to add it to a
>> bigger project, but I keep getting an error
>>
>> Unhandled exception at 0x63bc31de (luabind.dll) in Shifters.exe:
>> 0xC0000005: Access violation writing location 0x00d31eae.
>>
>> And the program breaks inside the "LUABIND_API void add_overload(..)"
>> function on the line "if (object overloads = context[name])"
>>
>> I think it might be something todo with how I'm registering my c++
>> class. as the call before add_overload in the call stack is
>> constructor_registration.
>>
>>       luabind::module(L)
>>       [
>>               luabind::class_<IWindow>("IWindow"),
>>               luabind::class_<Shift::AppWindow, IWindow>("Shift::AppWindow")
>>                       .def(luabind::constructor<unsigned int, unsigned int, bool>())
>>       ];
>>
>>
>> I think I've built everything right, although if I hadn't I'd expect
>> linker errors rather than the exception.
>>
>> Any Ideas?
>>
>> Thanks,
>> Phil
>>
>> General Stuff
>> Visual Studio 2010, project and luabind built Multi-Threaded (not DLL)
>>
>> ------------------------------------------------------------------------------
>> Get your Android app more play: Bring it to the BlackBerry PlayBook
>> in minutes. BlackBerry App World&#153; now supports Android&#153; Apps
>> for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple
>> it is! http://p.sf.net/sfu/android-dev2dev
>> _______________________________________________
>> luabind-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/luabind-user
>
>
> ------------------------------------------------------------------------------
> Get your Android app more play: Bring it to the BlackBerry PlayBook
> in minutes. BlackBerry App World&#153; now supports Android&#153; Apps
> for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple
> it is! http://p.sf.net/sfu/android-dev2dev
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev