大家帮一下忙,这到底是怎么回事?

geniusdhc 2004-02-03 02:44:04
我写了一个dll(比如aa.dll),每当主程序project1.exe执行到LoadLibrary("aa.dll");的时候,弹出错误:Project project1.exe raised exeception class EFilterError with message 'A class named TdxTreeListColumn already exists'.
点击‘确定‘按钮后, 又出现 Project project1.exe raised exeception class EStackOverflow with message 'Stack overflow'.

请问这是怎么回事?先谢谢大家。
...全文
67 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
geniusdhc 2004-02-03
  • 打赏
  • 举报
回复
if( NULL == DLLInst )
DLLInst = LoadLibrary("topodll.dll"); //就是在这行上出错
if (DLLInst)
{
CreateFromFunct = (void (__stdcall*)()) GetProcAddress(DLLInst, "UpdateTopo_XLT");
if (CreateFromFunct)
CreateFromFunct();
else
ShowMessage("Could not obtain function pointer");
}
else ShowMessage("Could not load DLL.dll");


下面是要调用的函数
extern "C" void __declspec(dllexport) __stdcall ShowTopo(AnsiString objectid,TForm* parentform,TTreeView* ObjectTreeView,TList* vMenuList)
{
for(int i=(parentform->MDIChildCount-1);i>=0 ;i--)
{
if(parentform->MDIChildren[i]->Name.Pos("frmTopoLayer")>0)
{
if(((TfrmTopoLayer*)parentform->MDIChildren[i])->root_maplayer_id==AnsiString(objectid))
{
parentform->MDIChildren[i]->BringToFront();
return;
}
}
}

if(objectid != NULL)
{
TTreeView* view;
view = (TTreeView*)ObjectTreeView;
///////如果把下面几行注释掉旧不会有问题。
TfrmTopoLayer *frmTopoLayer = new TfrmTopoLayer(NULL);
frmTopoLayer->setMaplayerParam("90", objectid,vMenuList,view->Selected->Text);
frmTopoLayer->Show();
if(frmTopoLayer!= NULL)
{
delete frmTopoLayer;
frmTopoLayer = NULL;
}
///////注释范围end
}
}
劣势 2004-02-03
  • 打赏
  • 举报
回复
代码贴出来吧,提示的含义是栈溢出

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧