[HELP] Saving Char* Arrays in Structure.
I AM HAVING PROBLEMS WILLING A STRUCTURE WITH CHAR* [] and getting them back to text. When i put it in MessageBoxA() it Compiles but then it crashed at that location. When in PrintRightText() it just dont draw Anything.
Structures HERE
[PHP]struct sItem
{
char* Name;
char** Options;
int* Value;
bool Selectable;
sItem(char* NAME, char** OPTIONS, int* VALUE, bool SELECTABLE)
{
Name=NAME;
Options=OPTIONS;
Value=VALUE;
Selectable=SELECTABLE;
}
~sItem()
{}
};
typedef struct {
char* Name;
int noItems;
int totHeight;
sItem** Items;
int Selected;
} sTab;
[/PHP]
The Adding FUNCTIONS
[PHP]
void cMenu::AddTab(char* name, bool selected)
{
TABS[noTabs]->Name = name;
TABS[noTabs]->Selected = selected;
TABS[noTabs]->noItems = noTempitems;
TABS[noTabs]->totHeight = temptotHeight;
TABS[noTabs]->Items = tempItems;
noTempitems=temptotHeight=0;
this->tempItems=(sItem **)malloc(10);
for (int i=0; i<10; i++) this->tempItems[i]=(sItem *)malloc(sizeof(sItem));
noTabs++;
totHeight=(noTabs*30);
}
void cMenu::AddItem(char* Item_Name, char** Options, int* DefaultValue)
{
tempItems[noTempitems]=new sItem(Item_Name, Options, DefaultValue, true);
noTempitems++;
temptotHeight=(noTempitems*16);
}[/PHP]
FILL THE STRUCTURES HERE
[php]char* Options[] = {"WEE", "WEE1", "WEE2"};
pMenu->AddText("TEXTXY" , "HEY IT IS WORKING");
pMenu->AddItem("Item 2", Options, &A[1]);
pMenu->AddItem("Item 3", Options, &A[2]);
pMenu->AddTab("Tab 1", true);
[/PHP]
AND NOT THE DRAW STUFFY
[PHP]for (int i=0; i<this->noTabs;i++)
{
for (int o=0; o<(this->TABS[i]->noItems) ;o++)
{
int val=(this->TABS[i]->Items[o]->Value)?(*this->TABS[i]->Items[o]->Value):0;
if (this->TABS[i]->Items[o]->Options){
char* texy = this->TABS[i]->Items[o]->Options[val];
PrintRightText(pFont,posi0+3, posi1+(o*15), 0xffccccff, texy);
}
}
}[/PHP]
Structures HERE
[PHP]struct sItem
{
char* Name;
char** Options;
int* Value;
bool Selectable;
sItem(char* NAME, char** OPTIONS, int* VALUE, bool SELECTABLE)
{
Name=NAME;
Options=OPTIONS;
Value=VALUE;
Selectable=SELECTABLE;
}
~sItem()
{}
};
typedef struct {
char* Name;
int noItems;
int totHeight;
sItem** Items;
int Selected;
} sTab;
[/PHP]
The Adding FUNCTIONS
[PHP]
void cMenu::AddTab(char* name, bool selected)
{
TABS[noTabs]->Name = name;
TABS[noTabs]->Selected = selected;
TABS[noTabs]->noItems = noTempitems;
TABS[noTabs]->totHeight = temptotHeight;
TABS[noTabs]->Items = tempItems;
noTempitems=temptotHeight=0;
this->tempItems=(sItem **)malloc(10);
for (int i=0; i<10; i++) this->tempItems[i]=(sItem *)malloc(sizeof(sItem));
noTabs++;
totHeight=(noTabs*30);
}
void cMenu::AddItem(char* Item_Name, char** Options, int* DefaultValue)
{
tempItems[noTempitems]=new sItem(Item_Name, Options, DefaultValue, true);
noTempitems++;
temptotHeight=(noTempitems*16);
}[/PHP]
FILL THE STRUCTURES HERE

[php]char* Options[] = {"WEE", "WEE1", "WEE2"};
pMenu->AddText("TEXTXY" , "HEY IT IS WORKING");
pMenu->AddItem("Item 2", Options, &A[1]);
pMenu->AddItem("Item 3", Options, &A[2]);
pMenu->AddTab("Tab 1", true);
[/PHP]
AND NOT THE DRAW STUFFY
[PHP]for (int i=0; i<this->noTabs;i++)
{
for (int o=0; o<(this->TABS[i]->noItems) ;o++)
{
int val=(this->TABS[i]->Items[o]->Value)?(*this->TABS[i]->Items[o]->Value):0;
if (this->TABS[i]->Items[o]->Options){
char* texy = this->TABS[i]->Items[o]->Options[val];
PrintRightText(pFont,posi0+3, posi1+(o*15), 0xffccccff, texy);
}
}
}[/PHP]

