Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Typcasting a RB Class

edited August 2007 in General
I have inherited from the standard ppDlg form: TppPrintDialog to enhance it.
One of my events for a combobox has the following warning:

[DCC Warning]: W1048 Unsafe typecast of 'TObject' to 'TppFileDeviceClass'

for the following code:

lFileDevice := TppFileDeviceClass(
cbxPrintToFileTypes.Items.Objects[iVal] );

lFileDevice is TppFileDeviceClass

Is there any way to get rid of this warning besides wraping it with {$WARN
UNSAFE_CAST OFF}?

Delphi 2007 Ent
RB 10.6 Ent

Thanks,

Ken Brumback

Comments

  • edited August 2007
    Hi Ken,

    The Delphi compiler warnings - UnsafeType, UnsafeCode, UnsafeTypeCast were
    added prior to VCL.NET being released with the intent that developers could
    prepare their VCL Win32 code to be compiled for VCL.NET. (The .NET framework
    has stricter type checking than Delphi.)

    ReportBuilder is compiled with those warnings turned off.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.