API access to DateTime values

Matthew Jew mjew at icnc.com
Tue Mar 7 18:01:47 CST 2006


Ruslan,

On Mar 6, 2006, at 11:34 PM, valentina-request at lists.macserve.net wrote:

> On 3/7/06 5:38 AM, "Matthew Jew" <mjew at icnc.com> wrote:
>
> Hi Matthew,
>
>> I have been working with the C++ VSDK using the "Class way" and the
>> API way.
>
>> I am unsure about how to get an I_ValueDateTime from an FBL_I_Field.
>> The method "get_Value" returns a Const_I_Value_Ptr, which lets me
>> access String and numeric values.
>>
>> How do I get an I_ValueDateTime out of an FBL_I_Field?
>>
>> I do NOT want the DateTime value as either a string or numeric value.
>
>     I_Value_Ptr pv = fld->get_Value();
>     I_ValueDateTime_Ptr pdtv = fbl_dynamic_cast<I_ValueDateTime> 
> ( pv );
>
>

I used the code above, but got the following compile-time error:

error: invalid conversion from 'const fbl::I_Value*' to 'fbl::I_Value*'

I changed the code to read:

     Const_I_Value_Ptr pv = fld->get_Value();
     Const_I_ValueDateTime_Ptr pdtv =  
fbl_dynamic_cast<I_ValueDateTime>( pv );

and then I get the following compile-time error:

error: cannot dynamic_cast '(+ p)->fbl::smart_ptr<T>::get [with T =  
const fbl::I_Value]()' (of type 'const struct fbl::I_Value*') to type  
'struct fbl::I_ValueDateTime*' (conversion casts away constness)

Do you have a solution for this?

- Matthew



More information about the Valentina mailing list