调用DLL 中的MDI子窗体,提示"Cannot create form.No MDI forms are currently active"
DLLMDIChildPro.dll的导出函数
extern "C" __declspec(dllexport)
bool GetReportFileInfo(ReportInfo& rptInfo)
{
rptInfo.formClass = __classid(TFormFirstDLLMDIChild);
rptInfo.ppForm = (TForm **)&FormFirstDLLMDIChild;
//rptInfo.reportTitle = std::string("第一个DLL MDI子窗体");
//rptInfo.reportType = std::string("测试报表");
return true;
}
DLLMDIChildManagePro.dll的导出函数
extern "C" __declspec(dllexport)
void ShowFirstMDIChild(TApplication* pApp)
{
if(g_SavedApp == NULL)
{
g_SavedApp = Application;
Application = pApp;
}
if(g_firstDLLMDIChildIns == NULL)
{
g_firstDLLMDIChildIns = ::LoadLibrary("DLLMDIChildPro.dll");
if(g_firstDLLMDIChildIns == NULL)
{
return ;
}
}
struct ReportInfo rptInfo;
GETREPORTFILEINFOFUNC GetInfo
= (GETREPORTFILEINFOFUNC)::GetProcAddress(g_firstDLLMDIChildIns, "_GetReportFileInfo");
if(GetInfo == NULL)
{
return ;
}
GetInfo(rptInfo);
if(rptInfo.ppForm == NULL)
{
return ;
}
if((*rptInfo.ppForm) == NULL)
{
Application->CreateForm(rptInfo.formClass, rptInfo.ppForm);
}
(*rptInfo.ppForm)->Show();
}
DLLMDIChildTestPro.exe中的调用代码
void __fastcall TFormDLLMDIChildUsage::btn1Click(TObject *Sender)
{
typedef void (*SHOWFIRSTMDICHILDFUNC)(TApplication* pApp);
SHOWFIRSTMDICHILDFUNC ShowFunc
= (SHOWFIRSTMDICHILDFUNC)::GetProcAddress(m_dllMDIChildMIns, "_ShowFirstMDIChild");
if(ShowFunc == NULL)
{
throw(Exception(Format("函数取址失败:%u", ARRAYOFCONST(((int)::GetLastError())))));
}
ShowFunc(Application);
}
Application->CreateForm(rptInfo.formClass, rptInfo.ppForm);
这个是在网上找到的内容,说是在调用DLL中的MDI Child子窗体的时候,需要从外部传入Application,在调试的时候,我查看传进来的Application的MainForm的FFormStyle,是2(fsMDIForm),但是在这一步调用的时,问题提示"Cannot create form.No MDI forms are currently active".
这究竟是什么问题呢?要怎么解决?
相关推荐
delphi中一个值得大家来考虑的DLL问题
在MDI窗体类型的编程中,主窗体(fsMDIForm)怎样调用子窗体(fsMDIChild,此子窗体为DLL)。
How to create a custom preview form
How to create a custom preview form
suipack trial
The lastest version : 6.6, update date: 7 Jan. 2012, see what's new (Newly supports RAD Studio XE2, fully supports Sunisoft Skin Solutions v2) SUIPack is a suite of real WYSIWYG VCL skin components for Delphi & C++Builder. It provides you the ability to create professionally-UI-designed skin and implementations for your applications. Besides the alternative for standard controls, SUIPack provides more additional controls(E.g. non-rectangular forms, MSN-style popup window, etc.). You will never spend many time on programming skin support. SUIPack provides more than 60 controls. Place them on a form, then you can see the skinned appearance immediately even at design time. SUIPack has 5 built-in skins and it supports to load outside skin files. It's real What You See Is What You Get! SUIPack fully supports Sunisoft Skin Solutions v2 now. It means that you can use all skins of Skin Solutions v2. The professionally-UI-designed skins are mostly designed by our UI artists. Please note, we not only provide the UI controls, but also UI design! You also can create your own skins with the brand new SkinBuilder tool. These are snapshots of some skins Midsummer Warm Silver Diamond DeepCyan Page Emerald Wave For a view of all official skins and third-party skins, please go to Skins Library SUIPack is compatible with: RAD Studio XE2/XE/2010/2009/2007, BDS 2006 (including Turbo edition for Win32), Delphi 5/6/7/2005, C++Builder 5/6. SUIPack supports all Win32 platforms (Win95 or later, including Windows Vista). If you are using RAD Studio 2007/2009/2010/XE/XE2, please disable the "runtime themes" option... If you are meeting problem when install SUIPack onto C++Builder 2007 with the installation tool, please download the project file for it at here. What's the difference between SUIPack and SUISkin? SUISkin is the easiest way of making an application skinned. SUISkin provides only one component, you don't need to learn anything about using it. It will make your form skinned automatically. SUISkin just skins the existing controls on the form both the standard controls and the most of third-party controls. SUIPack is a WYSIWYG skin components package. It provides over 60 skin-supported GUI controls as well as 5 built-in skins. And it also provides some extended GUI controls, E.g. MSN-style popup window, non-rectangular forms, side channel, etc. In a word, after installing, you can find only one component for SUISkin but more than 60 controls for SUIPack. And SUISkin can skin the controls from third-party but SUIPack can't. Key features 60+ components 5 built-in skins Dozens of professionally-UI-designed official skins from UI artists and a lot of third-party skins Supports to build the skin files into the EXE file What you see(design-time) is what you get(run-time) Provides stable converting tool to transfer your existing project smoothly Provides SkinBuilder tool to create your own skins, with it which supports to load VisualStyle(*.msstyles) files, you can own thousands of skins now! Supports to create non-rectangular forms and controls Support MSN-Style popup window MDI forms supported DB-Aware components with theme's support Without requiring any DLL or OCX With SUIPack We have over 2,000 customers who are using Sunisoft Skin Solutions v2 around world. The products below are developed with SUIPack by some of our customers. MySQLBackup ShareNET eWall Voice Caster Vremenko ZoneMeteo More: ClockArchive MailFilter Password Generator MP3 Player eMailTouch Professional DX JavaScript Editor Swishsoft products eSanSoft products ImgVert Dating Profile Creator FixVideo.com products dbf2sql & fonts CoolFlash If you developed your products with SUIPack and want to show it here, let us know. What customers say The Dazzling SUIPack VCL - reviewed by James M Sandbrook(www.delphicollection.com) This is the best implementation of skin/themes I have seen in a component! We have a Delphi JavaScript interpreter. Well, I am writing our first Commercial version of the IDE, and with your components, it looks great! Very professional look and feel, and I am sure people will really be shocked to see such a nice JavaScript editor from our company. As we do not do much in the UI world. When I have the product done, and the new web site up and running, I would like to be a show-case for you. You made the hardest part of my development short, simple, and slick!! (I hate doing GUI!!). :) -- from Ozz Nixon, CEO Brain Patchwork DX, LLC. Very nice solid and stable product at an incredibly low price. In my opinion, this is the only product that offers "professional" looking themes suitable for serious business or marketable applications. Some of the others from the competition are priced higher and look like they were designed for video games. Even though there is no substitute for good programming code, your product gives tired old applications a welcomed face lift. Good software such as yours deserves to be recognized but I feel your product gives my applications a great advantage in the marketplace. -- from Don Very nice set of components. I am a registered user of XXXXEngine and I recommend SUIPack over XXXXEngine for speed and ease of use! -- from Cory Herlihy I'm happy I found your product. It will be very useful to me. -- from Bjorn Lindholm How to register Registered user can get: Free email supports Free upgrades, you will never purchase it for upgrade To purchase SUIPack, please click here... Click here to read the License Agreement.
好用免费猴PDM查阅器v1.7
# 好用免费猴PDM查阅器 一个用 Python 写的 **PowerDesigner `.pdm` 模型阅读器**:不用装 PowerDesigner,双击就能把 `.pdm` 里的表、字段、主键、索引、外键、注释全部摊开看,任意内容可直接复制,并一键导出 Excel / HTML / Markdown / 建表 DDL。 - **v1.7**:彻底修掉「再点表就覆盖已打开的 sheet」——已打开的表单独记成一份标签列表,和左侧「选中」不再共用状态,**筛选框找表后再点,永远是新开一个标签、绝不动已有的**;已打开的表在清单里显示为**绿色**,再点它是「切回那个标签」,`Ctrl`+单击才关掉 - **v1.6**:左侧清单**点一下就打开**(不用再按 Ctrl / Shift);启动默认进「标签页切换」;标签页开着 5 张以上时切「并排分屏」会自动弹窗让你挑要保留的 4 张 - **v1.5**:两种多表视图 ——「并排分屏」(≤4 栏,窄栏也显示全部列,Shift+滚轮 / 中键拖动可横向滚动)+「标签页切换」(像 Excel sheet 一样一个表一个标签,最多 12 个,看另一张表时其余自动隐藏);exe 图标改用 Windows 原生多尺寸设置,标题栏/任务栏不再被拉伸糊掉 - **v1.4**:多表分屏 —— 左侧按住 Ctrl / Shift 多选表,右侧每张表开一个独立面板并排展示(最多 4 个,各栏自动等宽),超了会弹窗让你自己挑;exe 换成新的像素猴子图标 - **v1.3**:打开过的文件会被记住,下次启动自动载入同一批模型并回到上次查看的表,不用每次重新选 - **v1.2**:新增程序内复制(任意表格框选 → Ctrl+C / 右键复制,支持 Tab 分隔与 Markdown) - 单文件实现,`pdm_viewer.py` 一个文件
用于计算系统状态的卡尔曼最优增益和最小均方误差(MMSE)估计研究(Matlab代码实现)
内容概要:本文围绕“用于计算系统状态的卡尔曼最优增益和最小均方误差(MMSE)估计研究”展开,系统阐述了卡尔曼滤波在动态系统状态估计中的核心作用,重点探讨了最优增益的递推计算方法与基于最小均方误差准则的状态更新机制。研究内容涵盖线性系统状态估计的完整流程,包括状态预测、协方差传播、创新计算、卡尔曼增益求解及状态校正等关键步骤,并通过Matlab代码实现了算法的仿真验证,展示了其在噪声环境下对系统状态进行高精度跟踪的有效性。文中不仅强调理论推导,还注重工程实现细节,帮助读者深入理解卡尔曼滤波的数学本质与自适应特性。; 适合人群:具备线性代数、概率统计及控制理论基础知识,熟悉Matlab编程语言,从事自动化、电子信息、通信工程、导航制导、信号处理、物联网或智能系统研发等相关领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于传感器数据融合、目标跟踪、惯性导航(如GNSS/INS组合导航)、工业过程监控等存在噪声干扰的状态估计任务;②帮助读者掌握卡尔曼滤波从数学建模到代码实现的全过程,深入理解MMSE估计原理及其在提升系统鲁棒性与精度方面的关键作用;③为后续学习非线性滤波算法(如扩展卡尔曼EKF、无迹卡尔曼UKF)以及更复杂的多传感器融合架构奠定坚实的理论与实践基础。; 阅读建议:建议读者结合提供的Matlab代码逐行调试运行,重点关注预测与更新过程中各矩阵的维度变化与数值演化,尝试调整过程噪声与观测噪声的协方差参数,观察其对滤波收敛速度、估计精度及卡尔曼增益自适应调节的影响,从而深刻领会滤波器的设计思想与调参技巧。


