Home › Forums › General › Programming › Trying to use unregistered class
- This topic has 3 replies, 2 voices, and was last updated 9 years, 1 month ago by atom.
-
AuthorPosts
-
March 7, 2015 at 11:29 am #39696
Hi,
In my panel I have an array of MemoryBlocks.
I am trying to loop over these and append them all to a file:
for i, data in ipairs(splitData) do if f:appendData(data:getData(), data:getSize()) == false then utils.warnWindow ("File write", "Sorry, the Editor failed to\nwrite the data to file!") end end
The data:getData() functions fail though:
Name: getData Error message: std::runtime_error: 'Trying to use unregistered class'
I see that someone else on this forum had the same issue: http://ctrlr.org/forums/topic/simple-akai-s2000-frontend/page/2/
I’m really a newbie when it comes to Lua but what I grasp from this SO: http://stackoverflow.com/questions/12031366/luabind-trying-to-use-unregistered-class-on-return it could be something in the Ctrlr MemoryBlock class and LuaBind.
I looked in the Ctrlr source code and the getData() function is commented out in LMemoryBlock.h. Could this be a potential problem?
Any help is much appreciated!
BR
/PascalMarch 9, 2015 at 12:58 pm #39939what’s the type of splitData (is it a lua table of MemoryBlocks ?) you can always try to see what type “data” is just use what(data) or the built in debugger (that’s what it’s for)
March 9, 2015 at 7:42 pm #39965Thanks,
This is the output of the program when I add the line you suggested right after the for line, before the if statement:
LUA>> Object type [MemoryBlock] ----------------------------------------------------------------- Members: getData: function setBitRange: function getByte: function loadFromHexString: function toHexString: function insertIntoTable: function setSize: function fillWith: function insert: function setByte: function getSize: function getRange: function removeSection: function createFromTable: function swapWith: function ensureSize: function getBitRange: function copyTo: function replaceWith: function __init: function copyFrom: function toString: function append: function fromBase64Encoding: function toBase64Encoding: function toLuaTable: function Attributes: ----------------------------------------------------------------- LUA>> Object type [MemoryBlock] ----------------------------------------------------------------- Members: getData: function setBitRange: function getByte: function loadFromHexString: function toHexString: function insertIntoTable: function setSize: function fillWith: function insert: function setByte: function getSize: function getRange: function removeSection: function createFromTable: function swapWith: function ensureSize: function getBitRange: function copyTo: function replaceWith: function __init: function copyFrom: function toString: function append: function fromBase64Encoding: function toBase64Encoding: function toLuaTable: function Attributes: ----------------------------------------------------------------- At line [-1]: [C] What: C Namewhat: method Name: getData Error message: std::runtime_error: 'Trying to use unregistered class'
The weird thing is that I get two printouts (there are a lot more elements in the table)
March 10, 2015 at 11:10 am #40018appendData should be taking MemoryBlock as a parameter not pointers, i need to fix that and i’ll post a fix asap
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.