Share this post

Link to post

majstang 19

majstang
19

As it seems Im having big difficulties to catch the rawTime value (floating point (double) value) before AHK does its implicite conversion to it, when the COM call is mixing Integers with floating point values.

Share this post

Link to post

majstang 19

majstang
19

Don't think the COM Call is mixing integers with floating point values.

Hi nuts!

Im trying to use the same method as the GetAsArray sample to catch the floating point value (TDateTime) or actually a Half-Ptr , before AHK does its conversion which works nicely there. http://www.DVBViewer.tv/forum/topic/59821-get-com-arrays/?do=findComment&comment=462500 . Im trying to fix the failed AHK TTime midnight conversion (missing 00:00:00) for EPGManager.Get as well, but its like banging the head against a door...you only get a headache

For some reason NumGet does not return the pointer to the variant data type for starttime which in the GetAsArray example (for Time var) is the varType VT_UI4 which, apparently, is how a double referring to the date and time is stored as. Without this info I cant convert the TDateTime back into a SYSTEMTIME using the SystemTime class and VariantTimeToSystemTime dll call, which does a much better job than AHK itself. So my problem is I can't work out how to get to the raw Time variant as long as the EPGItem is in the picture. Cannot interpret the non-result it in any other way. This is really advanced stuff and Im hardly understanding it all.

3 hours ago, nuts said:

When you are working with this variant data type variables you need to be very careful.

i.e. you have to convert them again for the next COM call.

No, that Im very aware of, no AHK (badly) converted TDateTime floating pointers can be used in next coming COM calls. But if converted by SystemTime class and VariantTimeToSystemTime they should be accepted, but I havent tried that (yet)

3 hours ago, nuts said:

Everything in AHK is stored as variant (?).

Dont know, but it is important getting those right when doing VariantTimeToSystemTime dll call, in order to accurately convert back the floating point to systemtime.

Perhaps you wanna have a go at it yourself? Im working with this code:

Share this post

Link to post

majstang 19

majstang
19

Yep, cuz when AHK translates/converts it the 00:00:00 (TTime part of TDateTime vanishes when converted to systemtime HH:mm:ss) is missing for all shows starting at midnight. Im trying to convert the TDateTime to systemtime yyyy-MM-dd HH:mm:ss using the SystemTime class and the "VariantTimeToSystemTime", the opposite to the "SystemTimeToVariantTime" Maybe you know an easier method?

To conclude: The IEPGItem.Time and IEPGItem.EndTime are of type TDateTime = Doubble = 8 byte floating point number. In Delphi there is a unit (Library) which handles all types of conversions for TDateTime. Maybe you can find a library for AHK for that. A few examples from DateUtils.pas:

Share this post

Link to post

majstang 19

majstang
19

To conclude: The IEPGItem.Time and IEPGItem.EndTime are of type TDateTime = Doubble = 8 byte floating point number.

Yes, I know this, but AHK doesnt. NumGet() cant return the binary number stored at the specified address+offset for EPGItems, due to reasons unknown to me (as if the variant type has changed). That was possible in the GetAsArray sample (which creates total confusion for me), although those were no EPGItems.

5 hours ago, Delphi said:

In Delphi there is a unit (Library) which handles all types of conversions for TDateTime. Maybe you can find a library for AHK for that.

There are none for AHK, but with increasing COM usage it might be needed. But not likely, cuz "VariantTimeToSystemTime" function is probably the best there is handling TDateTime to system time conversions.