TResId + TransparentBlt in v6.30.11
Borland's Object Windows Library for the modern age
Brought to you by:
jogybl,
sebas_ledesma
Hello there,
We are currently moving our 'old' BC5.02 code to OWLNext+VC2010: finally got
time to do that :D
Everything seems straight-forward, so far... but.
There's a problem with TResId, and VC is complaining about it.
As TResId was previously in classlib, is there something special to change in
includes to avoid the warning?
Obviously, TResId is NOTexported, but in <gdiobjec.h>, there's an _OWLCLASS
forward declaration... weird :S </gdiobjec.h>
Second, why is TransparentBlt NOT a method of TDC? or maybe am i blind ?
Anyway, keep on this good work!
Hi adanteny,
Welcome aboard! I hope the transition is going well.
Note that OWLNext has moved the (necessary parts of the) Borland System Class
Library from the "winsys" to the "owl" include directory. TResId is now
defined in "owl/wsyscls.h". Change the old include path to avoid the warning.
If that is not the problem, then please be more specific; ideally provide an
example.
Thanks for noticing. This is a bug. Although all its functions are defined
inline, I suppose TResId should be exported to ensure that there is no ODR
violation.
According to the MSDN documentation it requires "msimg32.lib", which was
introduced in Windows 98, and thus never part of OWL, it seems. But we could
add it now. I'll register it as a feature request in the Tracker. You're
welcome to provide a patch and an example program.
Thanks,
Vidar Hasfjord
Hey Vidar,
Sorry to be late to reply and thank you, but i was a bit busy lately :)
Anyway...
About TResId, we manually removed the OWLCLASS keyword in gdiobject.h and
recompile owl-6.30.11: no more warning now!
Otherwise i agree with the need to export TResId, which is not harmfull...
About TransparentBlt: according to MSDN (online), it's defined in wingdi.h,
from Win2000 and later, and requires msimg32.lib, true.
Anyway, i don't think it will be dangerous to include it, as well as
GradientFill...
To be safe, a dynamic DLL call could be made on msimg32.dll... (we already do
that, but "outside" TDC)
PS: translation is going well, thanks. We basically need it for UNICODE
compliance :/
TDC::TransparentBlt was added in version 6.32.3. See:
http://sourceforge.net/apps/mediawiki/owlnext/index.php?title=OWLNext_Stable_
Releases#Version_6.32
We could also add TDC::GradientFill, of course.
By the way, I notice at MSDN that TransparentBlt, as well as GradientFill and
AlphaBlend, has been replicated in "gdi32.dll" as GdiTransparentBlt,
GdiGradientFill and GdiAlphaBlend. The MSDN documentation states that they are
equivalent. I guess these duplicates have been added to remove the dependency
on "msimg32.dll", although I don't think that dependency is an issue for us,
since "msimg32.dll" is always present on supported platforms (Windows XP and
later). We could support both sets for completeness, or we could support one
set only. Or, we could even implement one set in terms of the other, e.g.
TDC::TransparentBlt in terms of GdiTransparentBlt, to remove the new build
dependency on "msimg32.lib". Any views?
I ain't read carefully the documentation about the two implementations: which
one is straight-forward and which one is a wrapper of the other, so... no view
so far :)
But, on a general level, i would implement the low-level one, whichever...
Anyway, not a big issue in this example...
OK for v 6.32.3 ;) we'll apply the patches asap.