2012-01-16 05:03 PM - last edited on 2023-08-02 04:27 PM by Doreena Deng
API_WallRelation wallRelation; BNZeroMemory(&wallRelation, sizeof(API_WallRelation)); ACAPI_Element_GetRelations(guid, API_WallID, (void*) &wallRelation); ... if (wallRelation.nConRef == 2) { API_Element wallBegin; API_Element wallEnd; if (wallRelation.conRef[0]->conWithBeg) { wallBegin = FindWall(wallRelation.conRef[0]->guid); // Crashes here... wallEnd = FindWall(wallRelation.conRef[1]->guid); } else { // Or Crashes here... wallBegin = FindWall(wallRelation.conRef[1]->guid); wallEnd = FindWall(wallRelation.conRef[0]->guid); } ... }I've kept only the relevant parts of the code. It seems to me that the pointer returned by wallRelation.conRef[1] is invalid for some reason. Is this a bug in the API or am I doing something wrong?
2012-01-16 11:24 PM
Andre wrote:
It seems to me that the pointer returned by wallRelation.conRef[1] is invalid for some reason. Is this a bug in the API or am I doing something wrong?
wallRelation.conRef[1]->guid...you need to do this:
(*wallRelation.conRef)[1].guid