[fpc-pascal] Illegal type conversion: "LongInt" to "TObject"

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Jan 28 09:41:03 CET 2010


On 28 January 2010 10:30, Michael Van Canneyt <michael at freepascal.org> wrote:
>>
>>
>>  SetObjectProp(AObject, LPropInfo, TObject(PtrUInt(APropValue)));
>
> This is correct _if_ APropvalue is a 64-bit integer on a 64-bit system.

In that case APropValue will be a reference to a Object. I trust
reference to objects on a 64-bit system is a 64-bit integer?  And on
32-bit systems they will be a 32-bit integer.



> Better dump the whole procedure. Using variants is inviting problems.

It is one function that can handle various data types. To not use
variants, I would have to create stacks of overloaded functions all
with pretty much the same implementation - that's lots of code
duplication. For now that function works 100% and has been unit tested
- so I feel pretty confident that in this case variants are doing
their job correctly.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list