illegal call of non static function

  • Thread starter Thread starter Taptu¶
  • Start date Start date
T

Taptu¶

Hi

I have a problem. I have a function :


void for3::drzewo() {

m_lista.DeleteAllItems();

m_li.GetImageList();

goi.GetImageCount();


goi.SetBkColor(RGB(0,0,0));
goi.Add(nowe_ikony.ExtractIcon(0));
goi.SetBkColor(RGB(0,0,0));
goi.Add(nowe_ikony.ExtractIcon(1));
goi.SetBkColor(RGB(0,0,0));
goi.Add(nowe_ikony.ExtractIcon(2));
goi.SetBkColor(RGB(0,0,0));
goi.Add(nowe_ikony.ExtractIcon(3));
goi.SetBkColor(RGB(0,0,0));
goi.Add(nowe_ikony.ExtractIcon(4));


goi.GetImageCount();

m_drzewo.SetImageList(&goi,TVSIL_NORMAL);
CString ciag;
utworz_roota("Dyski lokalne");
CString fff;
for (int h=0;h<32;h++) {
fff="";
if (tablica_dyskow[h]!='0') {
fff+=tablica_dyskow[h];
fff+=":";
fff.MakeUpper();
w_dol(fff);
szu_rek(fff);
}
else break;
}

doEnum(0,NULL);
m_drzewo.SortChildren(TVI_ROOT);

}

and I want to call that function from CMainFrm - when i push the button from
my menu.

When I try to do it like that:

void CMainFrame::OnDrzewo()
{

for3::drzewo();

}

This error was occured:

Illegal call of non static function. I know that i must call pointer to for3
but i don't know how.

Help

Taptu¶
 
If you want to be able to call a function without creating an instance of
the object, you can simply put "static" in front of the function's
declaration. Otherwise, create an object like
for3 myobject;
myobject.drzewo;
 
U¿ytkownik "Michiel said:
If you want to be able to call a function without creating an instance of
the object, you can simply put "static" in front of the function's
declaration. Otherwise, create an object like
for3 myobject;
myobject.drzewo;


doesn't work :((((( lot of errors same as the firs one -> illegal call of
non static ............... in function drzewo() :(((((((

I don't want to change all codes. Is there any simple way ?
This id SDI Project. When I push button on MainFrame Menu the function from
class for3 schould be started.


Taptu¶
 
Back
Top