I was hoping to go gang busters on my pop-out project, but it doesn’t look like its going to happen..
I disabled some code a few days back that seem to cure most of my constraint problems except for a fixed point constraint.
This is probably a good mental work out for me… Lets see if I can figure this out.
I fired up heekcad sketcher true to connected lines and than tried to constrain the endpoint. Heeks crashed when I attempted to save the endpoint.
The crash occured in this section of code(I think it was reading out a null)
void: Constraint::EndSave(TiXmlNode *root) in src/constraint.cpp
Jon Pry had added this function to heekscad which help him debug the other issue which was occurring
void HeeksObj::ToString(char *str, unsigned int* rlen, unsigned int len)
{
unsigned int printed;
*rlen = 0;printed = snprintf(str,len,”ID: 0x%X, Type: 0x%X, MarkingMask: 0x%X, IDGroup: 0x%X\n”,GetID(),GetType(),GetMarkingMask(),GetIDGroupType());
if(printed >= len)
goto abort;
*rlen += printed; len -= printed;abort:
*rlen = 0;
}
I found some info the snprintf here http://www.cppreference.com/wiki/c/io/snprintf
So… I think this might be my rosetta stone to figure out whats going on here.
I think the crash might be do to some null values being written out to the xml…
I thought I’d try my luck and see if I could get the output in ToString which is in a c_str to display in a wxMessagebox.
It’s been a while since I mucked with this stuff. How hard can it be?
Lets see specs:http://docs.wxwidgets.org/2.8/wx_dialogfunctions.html#wxmessagebox
Appears I need to convert a character array to wxstring
http://docs.wxwidgets.org/2.8/wx_wxstring.html#wxstring
This is too much work, I think I rather just “cout” it to a terminal window. But hold on … Where is the terminal window in codeblocks during debugging… I vaguely remember something weird about this…
If I just run non-debugging the terminal output just works fine.
This might provide some insight. http://forums.codeblocks.org/index.php?topic=12678.0;wap2
This log is shown by going to Settings -> Compiler & Debugger -> Debugger -> Display debugger’s log…
Ok… Now it seems the thing is displaying….
It seems that the issue is that I’m getting a null when I’m expecting something else… The problem lays further upstream… Enough fun with this tonight..
This is going to take some time..