200分,倾囊而出。QuantumGrid 的 TdxTreeList, TdxDBGrid 各继承出一个控件(即使一行也不加)编译通过,链接出错(200分)

  • 主题发起人 主题发起人 huzb
  • 开始时间 开始时间
H

huzb

Unregistered / Unconfirmed
GUEST, unregistred user!
在CB4中, 从 DevExpress QuantumGrid (由源码在CB4编译)的 TdxTreeList, TdxDBGrid 各继承出一个控件(由Component菜单,即使一行也不加)编译通过,链接出错:

[Linker Error] Unresolved external '__fastcall Dxtl::TCustomdxTreeListControl::DoDrawCell(Graphics::TCanvas *, Windows::TRect&, Dxtl::TdxTreeListNode *, int, bool, bool, bool, bool, bool, void *, System::AnsiString&, Graphics::TColor&, Graphics::TFont *, Classes::TAlignment&, bool&)' referenced from C:/TEMPBCB/HDXTREELIST.OBJ.
[Linker Error] Unresolved external '__fastcall Dxtl::TCustomdxTreeList::DrawCell(Graphics::TCanvas *, const Windows::TRect&, Graphics::TBitmap *, Dxtl::TdxTreeListNode *, int, int, bool, bool, Graphics::TColor, void *, bool, Dxtl::TdxGridDrawCellKind, bool, bool)' referenced from C:/TEMPBCB/HDXTREELIST.OBJ.
[Linker Error] Unresolved external '__fastcall Dxtl::TCustomdxTreeList::DrawGroupPanel(Graphics::TCanvas *, const Windows::TRect&, void *)' referenced from C:/TEMPBCB/HDXTREELIST.OBJ.
[Linker Error] Unresolved external '__fastcall Dxtl::TCustomdxTreeList::DrawPreview(Graphics::TCanvas *, const Windows::TRect&, Graphics::TBitmap *, Dxtl::TdxTreeListNode *, Graphics::TColor, Graphics::TColor, void *, bool)' referenced from C:/TEMPBCB/HDXTREELIST.OBJ.
 
加入 DevExpress 带来的lib文件到project中
 
问题的要点是DevExpress 的 Delphi 源程序及编译出的.hpp的函数参数类型
与CBuilder类型不匹配。造成本来是同一个函数,却被当成两个了。
 
This problem occurs due to the difference between Pascal and C type definitions. To be more specific the HBRUSH type in Delphi is Integer, but in Builder it is void*. The only workaround is to make changes to the header files.

Please, open the following files from your CBuilder4/Include/Vcl directory and replace all "HBRUSH" strings with "unsigned int".

dxDBGrid.hpp
dxGrClms.hpp
dxTL.hpp
dxTLClms.hpp.

You may also try to employ the following code in your projects:

#define HBRUSH unsigned int
#include ...
#include ...
#include ...
#include ...
#undef HBRUSH
 
接受答案了.
 
后退
顶部