works 4 me. Try this example
Code:
#include <malloc.h>
#include <iostream>
#include <windows.h>
using namespace std;
#define ROWS 5
#define COLS 5
typedef struct{
int id; // Cell id
HWND child; // Cell child (either browse,edit,static or combo)
LPSTR data; // Text or num if static
}MITHTABCELLSTRUCT, *LPMITHTABCELLSTRUCT;
typedef struct{
int cellHeight; // The height of the cells
int cellWidth; // The width of the cells
int xOffset; // x offset where cells begin in parent
int yOffset; // y offset Where cells begin in parent
int padding; // Padding in cells (higher = smaller text, lower = larger text)
int spacing; // Spacing between cells
int rows; // Number of cell rows
int cols; // Number of cell columns
MITHTABCELLSTRUCT **cells; //The cells (2d array defined by int rows,cols
}MITHDATATABSTRUCT, *LPMITHDATATABSTRUCT;
void InitStruct(MITHDATATABSTRUCT* s)
{
int y;
int x;
s-> cells=(MITHTABCELLSTRUCT**)malloc(sizeof(MITHTABCELLSTRUCT*)*ROWS);
for(y=0;y<ROWS;y++)
{
s-> cells[y]=(MITHTABCELLSTRUCT*)malloc(sizeof(MITHTABCELLSTRUCT)*COLS);
for(x=0;x<COLS;x++)
s->cells[y][x].id=y*COLS+x;
}
}
int main(int argc, char* argv[])
{
MITHDATATABSTRUCT test;
InitStruct(&test);
int y,x;
for(y=0;y<ROWS;y++)
for(x=0;x<COLS;x++)
cout<<test.cells[y][x].id<<endl;
return 0;
}