kresh Posted November 6, 2007 Report Posted November 6, 2007 Hello everyone! I got a problem accessing the members in a struct created in cc+ in conjuction with LabView. I´m no Labview freak, learning though :-) I got a struct typedef struct { long dimSizes[3]; unsigned char Numeric[1]; } TD2; typedef TD2 **TD2Hdl; A varible static TD2Hdl hClassification3DModel_g; A function for mapping the varible static BOOL bCreateClassification3DModelFiberPos() { hClassification3DModelFiberPos_g = (TD2**)DSNewHandle(sizeof(TD2) + (sizeof(BYTE) * ((lSizeA_g * lSizeB_g * lSizeC_g) - 1))); if (hClassification3DModelFiberPos_g == NULL) return FALSE; (*hClassification3DModelFiberPos_g)->dimSizes[0] = (lSizeA_g); (*hClassification3DModelFiberPos_g)->dimSizes[1] = (lSizeB_g); (*hClassification3DModelFiberPos_g)->dimSizes[2] = (lSizeB_g); return TRUE; } How do i assing values to this struct. I want to loop over all the positions and assign it a value to the right position. As i said, I´m not familiar with LabView but i can type a pseudocode i c for(int i=0; i<lSizeA_g;i++){ for(int j=0; j<lSizeB_g; j++){ for(int k=0; k<lsizeC_g; k++){ hClassification3DModel[j][k] = data; } } } How do I do this? Tried (*hClassification3DModel)->Numeric = data. But how do I get it to loop over all the 3d picture? Thanks in advance Kresh Quote
Rolf Kalbermatter Posted November 12, 2007 Report Posted November 12, 2007 QUOTE(kresh @ Nov 5 2007, 08:17 AM) Hello everyone!I got a problem accessing the members in a struct created in cc+ in conjuction with LabView. I´m no Labview freak, learning though :-) I got a struct typedef struct { long dimSizes[3]; unsigned char Numeric[1]; } TD2; typedef TD2 **TD2Hdl; A varible static TD2Hdl hClassification3DModel_g; A function for mapping the varible static BOOL bCreateClassification3DModelFiberPos() { hClassification3DModelFiberPos_g = (TD2**)DSNewHandle(sizeof(TD2) + (sizeof(BYTE) * ((lSizeA_g * lSizeB_g * lSizeC_g) - 1))); if (hClassification3DModelFiberPos_g == NULL) return FALSE; (*hClassification3DModelFiberPos_g)->dimSizes[0] = (lSizeA_g); (*hClassification3DModelFiberPos_g)->dimSizes[1] = (lSizeB_g); (*hClassification3DModelFiberPos_g)->dimSizes[2] = (lSizeB_g); return TRUE; } How do i assing values to this struct. I want to loop over all the positions and assign it a value to the right position. As i said, I´m not familiar with LabView but i can type a pseudocode i c for(int i=0; i<lSizeA_g;i++){ for(int j=0; j<lSizeB_g; j++){ for(int k=0; k<lsizeC_g; k++){ hClassification3DModel[j][k] = data; } } } How do I do this? Tried (*hClassification3DModel)->Numeric = data. But how do I get it to loop over all the 3d picture? Thanks in advance Duplicate post: http://forums.ni.com/ni/board/message?boar...d=19997#M282599 Rolf Kalbermatter Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.