Board index » cppbuilder » error message, how can I solve it?

error message, how can I solve it?


2004-08-31 06:23:09 PM
cppbuilder65
Dear All ,
When I make a new component , the follow error is claimed, how can I solve
it?
[Linker Error] Unresolved external '__fastcall
Dbctrls::TDBComboBox::ComboWndProc(Messages::TMessage&, int, void *)'
referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\LIB\RELEASE\VCLE.LIB|_t_Dbctr
Thank
 
 

Re:error message, how can I solve it?

Hi,
Quote
[Linker Error] Unresolved external '__fastcall
Dbctrls::TDBComboBox::ComboWndProc(Messages::TMessage&, int, void *)'
referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\LIB\RELEASE\VCLE.LIB|_t_Dbctr

Due to #define STRICT, C++ to Pascal VCL linkage tends to have
problems with some name-mangled names when functions contain HWND
or HDC params (void* vs unsigned.
There are two potential resolutions, either one
should work (the last time I tried):
[these examples resolve the error for a TDBComboBox derivative]
1) Edit the ancestor's header file, e.g.
virtual void __fastcall ComboWndProc(Messages::TMessage &Message,
/*HWND*/unsigned ComboWnd, void * ComboProc);
...OR...
2) Provide an alias for the linker
a)Tdump both sides of the unresolved external problem
tdump -m DBComboBox1.obj DBComboBox1.dmp
tdump -m C:\Windows\System32\VCL60.BPL VCL60.dmp
b)Find the name-mangled names
grep ComboWndProc *.dmp>manglednames.txt
c)Paste the names into an alias in the .cpp source
#pragma alias
"@Dbctrls@TDBComboBox@ComboWndProc$qqrr17Messages@TMessagepvt2"="@Stdctrls@TCustomCombo@ComboWndProc$qqrr17Messages@TMessageuipv"
Method 1) has the problem that you will have to distribute
an edited VCL header with your component. Approach 2) is similar
to what VCL itself does in VCLExx.LIB (VCL Emulation, that
provides similar 'thunks'). Note when using method 2)
that editing an alias while the linker has the image
open in memory can have side affects on the linker (AV's)
but a direct one-time paste per build should work fine.
--Craig