How to avoid the "A class named AClassName already exists" error when using DLLs in your applications
Description
I'm working on a project which uses the ExpressQuantumGrid and ExpressBars. Some of the application's modules are built as DLLs. When I try to load a particular DLL an error occurs:
"A class named TdxStatusBarContainerControl already exists".
What am I doing wrong?
Solution
There is a strict rule that you should follow when compiling a DLL: You must compile both the main module and the DLLs with those runtime packages, which contain the classes used in both modules. In your case, you should include the ExpressQuantumGrid's and the ExpressBars' (the TdxStatusBarContainerControl component is a part of the ExpressBars) runtime packages to the list of runtime packages when compiling your application and DLLs. This way, everything will work fine.
NOTE: This approach requires you to deploy the corresponding runtime packages with your application.
主程序和子程序 编译使用的bpl 个数和数量应一致
感谢:http://ntotl.blog.com.cn/archives/2007/2554664.shtml
本文介绍了解决使用ExpressQuantumGrid和ExpressBars组件时遇到的DLL加载错误“A class named ACClassName already exists”的方法。通过确保主程序与DLL使用相同的运行时包,可以避免此类错误。
1039

被折叠的 条评论
为什么被折叠?



