请大家看看如何解决这个问题(关于类的指针参数传递出错)
我想实现从一个DLL中把一个类或结构的数据传递到主调程序,采用网友建议的
类指针作参数从主调程序中传入DLL,然后在DLL中用所得数据填充到传入的类
中,运行跟踪时出错,信息为:
HEAP[TestEdCode.exe]: Invalid Address specified to RtlValidateHeap( 003F0000, 5F4CCAE8 )
我的代码为,其中CRetStu是我定义的用于传递数据的导出类,CEdCode也是导出类:
DLL中:
int CEdCode::FindFirstStu(CString strStuName,CRetStu* pStudff)
{
....
pStudff->m_strName=name;
...
}
主程序中:
...
CRetStu* stu=new CRetStu();
CEdCode ec;
int iCount=ec.FindFirstStu(name,stu);
...
请大家帮帮小弟吧,一定加分!