i'm having a little trouble getting this to work. i took your advice and just used a pointer to the struct as a param. and i'm writing the function right now, and i just have a couple of questions about some things.
for instance, in the Setup_Controls() function, it takes the pointer to the struct, and then i have to loop through each CTRLSET struct item to create each control. but, how do i know when the last item has been reached? for instance, i loop with an incrementing variable, i, but how do i test for the last element of the CTRLSET array?
here is my function so far:
Code:
int Setup_Controls(CTRLSET *csCtrls, HWND hParent, HINSTANCE hInstance)
{
int i = 0;
while(csCtrls[i])
{
csCtrls[i].hCtrl = CreateWindow(csCtrls[i].szClass,
csCtrls[i].szText, csCtrls[i].iStyle,
csCtrls[i].pPos.x, csCtrls[i].pPos.y,
csCtrls[i].pSize.x, csCtrls[i].pSize.y,
hParent, (HMENU)csCtrls[i].iID, hInstance, NULL);
i++;
}
return 0;
}
and here's the struct:
Code:
typedef struct
{
HWND hCtrl;
int iID;
TCHAR szClass[33];
TCHAR szText[255];
int iStyle;
POINT pPos;
POINT pSize;
}CTRLSET;
any idea how to test for the last element in the CTRLSET array? how would i know when i'm done with the loop?
thanks.