I'm building a data grid control.
It's struct which is I set in SetWindowLong is the MITH32GRIDSTRUCT struct.
Code:
typedef struct{
LPSTR lpText,lpValue;
int id,iIndex,iNumObjects,iType,iValue;
bool bState,bValue;
void *objects;
RECT rc;
}GRIDOBJECT;
typedef struct{
GRIDOBJECT*stems;
int iNumStems;
bool bInit,bSet;
HICON *icons;
}MITH32GRIDSTRUCT,*lpMITH32GRIDSTRUCT;
Anyway, as you can see the grid has an array of GRIDOBJECT (stems)..
I needed GRIDOBJECT to have an array of GRIDOBJECT, I could have made an identical struct but I thought I could use void* for it.. However now when it comes time to size the rects of each item in the grid (which I handle on WM_SIZE) I have a problem..
Code:
void size( GRIDOBJECT* object, int index, int type, RECT rc ){
int j = index;
while( j < (GRIDOBJECT)object->objects[index]->iNumObjects ){
if( object->objects[j]->iType == 1 ){
object->objects[j]->rc.top = rc.bottom;
object->objects[j]->rc.bottom += rc.bottom-rc.top;
object->objects[j]->rc.left = rc.left;
object->objects[j]->rc.right = rc.right;
}else{
object->objects[j]->rc.top = rc.bottom;
object->objects[j]->rc.bottom = rc.bottom-rc.top;
object->objects[j]->rc.left = rc.left;
object->objects[j]->rc.right = rc.right;
size(&object->objects[j], 0, 1, rc);
}
j++;
}
}
I call that for each of the GRIDOBJECT*stems in the MITH32GRIDSTRUCT struct. But I get an error because object->objects[] is a void* ...
void* is not a pointer-to-object type
What should I do?