Lua Userdata

Started by
-1 comments, last by raptorstrike 17 years, 5 months ago
In my application I have a script that has a function that calls an object factory and tells it to create objects. Only problem is once the object is created I am having trouble returning it to the script, heres the function DataType* To_Create = new DataType; lua_pushlightuserdata(gScript,(void*)To_Create); lua_setglobal(gScript, "Generic_Data"); Later I pass this data via script into another c++ function where Add_Data represents a c++ function that takes a void pointer and converts it to the appropriate data. Add_Data(Generic_Data) All of this seems right to me but its not working. Generic data s making it from one side to the other. Anyone who has an experience with this I would appreciate the input. Thanks for your time
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie

This topic is closed to new replies.

Advertisement