Hi there,
I'm trying to use a function pointer in a VCL app in Borland C++ Builder 5.0, but it won't work. I already tried it in a Console app, and it runs perfectly, but using it in VCL doesn't (probably the issue is related to static-non static members, but that's just an idea)
Here's what i did..
//in .h of class TfrmplgXMLstuff, 'private' section, the
//following:
void Check(CXml::Iterator& it);
void (*Delegate)(CXml::Iterator& it);
//in constructor of the form class (.cpp), the following:
//(already tried without &, without the class
//reference 'TfrmplgXMLstuff::', and a long etc of variants)
Delegate = &TfrmplgXMLstuff::Check;
//implementing Funct in .cpp
void TfrmplgXMLstuff::Check(CXml::Iterator& it)
{
// function code
}
The issue is that the compiler marks the assignation line in the contructor (Delegate = &TfrmplgXMLstuff::Check as error, and specifies:
[C++ Error] DlgplgXMLstuff.cpp(25): E2034 Cannot convert 'void (TfrmplgXMLstuff::*)(CTree<CXml::CXmlNode,const char *>::iterator &)' to 'void (*)(CTree<CXml::CXmlNode,const char *>::iterator &)'.
Since i used the exac same syntax in a console app, and it worked all right, i can't come up with any new idea...
would any one help?
Thx
B
I'm trying to use a function pointer in a VCL app in Borland C++ Builder 5.0, but it won't work. I already tried it in a Console app, and it runs perfectly, but using it in VCL doesn't (probably the issue is related to static-non static members, but that's just an idea)
Here's what i did..
//in .h of class TfrmplgXMLstuff, 'private' section, the
//following:
void Check(CXml::Iterator& it);
void (*Delegate)(CXml::Iterator& it);
//in constructor of the form class (.cpp), the following:
//(already tried without &, without the class
//reference 'TfrmplgXMLstuff::', and a long etc of variants)
Delegate = &TfrmplgXMLstuff::Check;
//implementing Funct in .cpp
void TfrmplgXMLstuff::Check(CXml::Iterator& it)
{
// function code
}
The issue is that the compiler marks the assignation line in the contructor (Delegate = &TfrmplgXMLstuff::Check as error, and specifies:
[C++ Error] DlgplgXMLstuff.cpp(25): E2034 Cannot convert 'void (TfrmplgXMLstuff::*)(CTree<CXml::CXmlNode,const char *>::iterator &)' to 'void (*)(CTree<CXml::CXmlNode,const char *>::iterator &)'.
Since i used the exac same syntax in a console app, and it worked all right, i can't come up with any new idea...
would any one help?
Thx
B