Share this post

Link to post

majstang 19

majstang
19

The scripting language in the codebox is VBScript, but it is correct AutoHotkey is the preferred scripting language of mine and this fails with that too. Regarding AutoHotkey, which is the scripting language Im using to do some favourites channel switching features for a DVBViewer thumbnailed app, does actually support COM objects arrays https://autohotkey.com/docs/commands/ComObjArray.htm

Share this post

Link to post

Griga 613

Griga
613

As already mentioned, I didn't make the COM interface, I never used it, so I have no idea how it works in practice.

But from looking at the interface declaration

function GetFavoritesList(out List: OleVariant): Integer; safecall;

I guess it returns the list count as function result and a pointer to a variant as out parameter containing the list. (corrected - see below) No idea if and how this can be handled in VBScript. The following

function GetFavorites: IFavoritesCollection; safecall;

looks more promising to me, because it simply returns an IFavoriteCollection interface. I guess (again) that it also allows to access the whole favourites list by index (via IFavoritesCollection.Get_Count and IFavoritesCollection.Get_Item).

Share this post

Link to post

majstang 19

majstang
19

Cool, with this info it might be time to take an another crack at this. Havent seen it as priority since Im fetching the Favourites List from the DMS API instead. It would be a shame to take the easy road and leave things unsolved

As you can see the return (the Count) from Griga's declaration ist the first Parameter as an reference, the list is the second parameter. And the return of this function is not the Count, but a HRESULT.

The crux is that the SDK - Interface-description is only for Delphi like languages correct.

As you can see the return (the Count) from Griga's declaration ist the first Parameter as an reference, the list is the second parameter. And the return of this function is not the Count, but a HRESULT.

The crux is that the SDK - Interface-description is only for Delphi like languages correct.

Hello Erwin,

A really smart dude (qwerty12) at the AHK forum figured out how to do it with AHK at least. Whether its possible to retrieve the safearray with VBScript I will leave be. True VBScripters might find it fun to try to work it out .

Share this post

Link to post

majstang 19

majstang
19

Yeah, im on top retrieving all the safearrays. Surprisingly it was, what I supposed being the easy stuff, that in reality proved to be the completely unsolvable nut to crack, at least with AutoHotkey. I could not figure out how to get to the raw Time VARIANT data type of the EPGItem. http://www.DVBViewer.tv/forum/topic/59840-com-epgitem-variant-type/

Perhaps, if you are up to it, you might wanna have a go at it with Delphi to see if you get the same result as I get with both AHK and VBScript? FYI in that thread I was mistakenly under the assumption AHK did some faulty conversion, but I later discovered AutoHotkey doesn't understand or interpret date-time values. For any types it doesn't understand, it just requests a standard COM conversion to string. The COM IDispatch interface has several helper functions doing conversions and upon conversion request from client (AHK) IDispatch probably calls one of those and I get back a crappy converted string for all shows starting at midnight (00:00:00). So I suspect you get the same result if trying with Delphi. The problem is how to call the VariantTimeToSystemTime function (which provenly returns better result) correctly when there is no way to get the variant data type for the EPGItem.