(DataFlex) Replace Deprecated GetExpirationDt
Shows how to replace the deprecated GetExpirationDt method.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoCache
String sCache_item_key
Variant vDt1
Handle hoDt1
Handle hoDt2
Boolean iSuccess
String sTemp1
Get Create (RefClass(cComChilkatCache)) To hoCache
If (Not(IsComObjectCreated(hoCache))) Begin
Send CreateComObject of hoCache
End
// ....
// ....
Move "xyz" To sCache_item_key
// Instead of this:
Get ComGetExpirationDt Of hoCache sCache_item_key To vDt1
If (IsComObject(vDt1)) Begin
Get Create (RefClass(cComCkDateTime)) To hoDt1
Set pvComObject Of hoDt1 To vDt1
End
Send Destroy of hoDt1
// Do this:
Get Create (RefClass(cComCkDateTime)) To hoDt2
If (Not(IsComObjectCreated(hoDt2))) Begin
Send CreateComObject of hoDt2
End
Get ComGetExpirationStr Of hoCache sCache_item_key To sTemp1
Get ComSetFromRfc822 Of hoDt2 sTemp1 To iSuccess
End_Procedure
|