M
Microsoft
Hi;
I want to create a function point.With is point I can call the member
function in a class. The Sample Code just like:
__gc struct NodeMapItem
{
String *NodeID;
void (*FuncPnt)(reportNode *);
};
__gc class CReportManager
{
public:
CReportManager(void);
~CReportManager(void);
private:
public:
void DspRpt(TreeNode *pNode);
void Load_JH_HZ_001(reportNode *pNode);
};
////in .cpp file
void CReportManager::Load_JH_HZ_001(reportNode *pNode);
{
......
}
void CReportManager:spRpt(TreeNode *pNode)
{
reportNode *pSltNode;
pSltNode= dynamic_cast<reportNode*>(pNode);
RptMapFunc=new NodeMapItem*[2];
RptMapFunc[0]=new NodeMapItem;
RptMapFunc[0]->FuncPntLoad_JH_HZ_001;->there is some error:C2440
//RptMapFunc[0]->FuncPnt=&CReportManager::Load_JH_HZ_001;-> there is some
error too.
if (!pSltNode->m_pNodeType->CompareTo(REPORT))
{
pDspView=RptMapFunc[0]->FuncPnt;
pDspView(pSltNode);
}
}
I do not know how to define point type.Some ont told me I should define a
Class Fundction Point,but how to do that?
Please help me!By the way my develop tools is .Net 2003 and os is Window
2000 perfessional;
Thanx
David
2004-8-12
I want to create a function point.With is point I can call the member
function in a class. The Sample Code just like:
__gc struct NodeMapItem
{
String *NodeID;
void (*FuncPnt)(reportNode *);
};
__gc class CReportManager
{
public:
CReportManager(void);
~CReportManager(void);
private:
public:
void DspRpt(TreeNode *pNode);
void Load_JH_HZ_001(reportNode *pNode);
};
////in .cpp file
void CReportManager::Load_JH_HZ_001(reportNode *pNode);
{
......
}
void CReportManager:spRpt(TreeNode *pNode)
{
reportNode *pSltNode;
pSltNode= dynamic_cast<reportNode*>(pNode);
RptMapFunc=new NodeMapItem*[2];
RptMapFunc[0]=new NodeMapItem;
RptMapFunc[0]->FuncPntLoad_JH_HZ_001;->there is some error:C2440
//RptMapFunc[0]->FuncPnt=&CReportManager::Load_JH_HZ_001;-> there is some
error too.
if (!pSltNode->m_pNodeType->CompareTo(REPORT))
{
pDspView=RptMapFunc[0]->FuncPnt;
pDspView(pSltNode);
}
}
I do not know how to define point type.Some ont told me I should define a
Class Fundction Point,but how to do that?
Please help me!By the way my develop tools is .Net 2003 and os is Window
2000 perfessional;
Thanx
David
2004-8-12