API Support Forum
OEC API > API Support > GF API COM: No DataFeedEntitlementSubscriptionType Inside of IDataFeedEntitlementPtr
Author Topic: GF API COM: No DataFeedEntitlementSubscriptionType Inside of IDataFeedEntitlementPtr
(36 messages, Page 2 of 2)
Moderators: VPfau
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 19, 2022 @ 11:04 AM             Msg. 2 of 36
That key does exist and there is the version number 4.7.917.200 is underneath it. Do you need the values within there?
JSmith5611
Posts: 187
Joined:


Posted: Sep 19, 2022 @ 11:16 AM             Msg. 4 of 36
No, just the existence of that key is enough to show me the correct version is installed, since that it the UUID of the DataFeedEntitlement SubscriptionType enum.

I'm still not sure what's going on, but i'm continuing to look through the registry to see if there's a way to tell if multipler versions are installed.
Jason Smith
JSmith5611
Posts: 187
Joined:


Posted: Sep 19, 2022 @ 11:56 AM             Msg. 6 of 36
Do you just have one subkey under
\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Record\{8CE4A503-8AFF-388C-A2AA-B9DAAFA72E05}
?
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 19, 2022 @ 12:01 PM             Msg. 8 of 36
Yes just one subkey with the same version as listed before.
JSmith5611
Posts: 187
Joined:


Posted: Sep 19, 2022 @ 12:59 PM             Msg. 10 of 36
This really doesn't make sense. This should be working, you have the right version installed.
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 19, 2022 @ 01:04 PM             Msg. 12 of 36
Is it possible that something went wrong with the build that you sent me vs the one that was published? Like you have it built with the fixes but they didn't get actually published?

Do you have any other suggestions for me to try?
JSmith5611
Posts: 187
Joined:


Posted: Sep 19, 2022 @ 01:15 PM             Msg. 14 of 36
I installed the same build you did, GAIN GFAPI COM 4.7.917.200.exe, downloaded from the website.
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 19, 2022 @ 02:28 PM             Msg. 16 of 36
Yeah I'm not sure. I know they are different version numbers, but there's no way you are downloading a 64 bit by some chance, right?
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 20, 2022 @ 10:47 AM             Msg. 18 of 36
Just downloaded the version here: https://gainfutures.com/gainfuturesapi/documentation/

Same version number but it is working, so I'm not sure what version was sent to me, but it doesn't seem like it had it included.
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 20, 2022 @ 02:02 PM             Msg. 20 of 36
Now that I have the subscription type, it doesn't appear to be correctly getting the subscription type?

To determine if the user has DOM subscription in OEC we did this:
iterating through OECAPI()->DataFeedEntitlements
OECAPICOM::IDataFeedEntitlementPtr pDfe = OECAPI()->DataFeedEntitlements->Item(i);
VARIANT_BOOL hasDom = pDfe->DOM;

-----

in GF we are doing this:
Iterating through GFApi()->Exchanges->GetEntitlements()
IDataFeedEntitlementPtr pDfe = GFApi()->Exchanges->GetEntitlements()->GetAt(i);
VARIANT_BOOL hasDom = (pDfe->SubscriptionType == GF_Api_COM::DataFeedEntitlementSubscriptionType::DataFeedEntitlementSubscriptionType_DOM);

All return false even for demo accounts that should have it unlocked.

Thanks
JSmith5611
Posts: 187
Joined:


Posted: Sep 20, 2022 @ 02:12 PM             Msg. 22 of 36
its a flag enum.

try:

VARIANT_BOOL hasDom = (pDfe->SubscriptionType | GF_Api_COM::DataFeedEntitlementSubscriptionType::DataFeedEntitlementSubscriptionType_DOM) == GF_Api_COM::DataFeedEntitlementSubscriptionType::DataFeedEntitlementSubscriptionType_DOM));

The values in the enum are:

TopOfBook = 1,
DOM = 2

it is possible to have BOTH be true, in which case the underlying value of the enum will be 3.
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 20, 2022 @ 02:18 PM             Msg. 24 of 36
Is there a way that I can tell if an enum is a flag enum?

So I would need to check if it is 0, 2, or 3 since 0 is All?

Thanks again.
JSmith5611
Posts: 187
Joined:


Posted: Sep 20, 2022 @ 02:50 PM             Msg. 26 of 36
Unfortunately, COM strips out the markers for flag enums.
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 20, 2022 @ 02:58 PM             Msg. 28 of 36
VARIANT_BOOL vbDOM = ((pDfe->SubscriptionType | GF_Api_COM::DataFeedEntitlementSubscriptionType::DataFeedEntitlementSubscriptionType_DOM) == GF_Api_COM::DataFeedEntitlementSubscriptionType::DataFeedEntitlementSubscriptionType_DOM);

is returning 0 for both accounts that have DOM as well as do not have DOM.
JSmith5611
Posts: 187
Joined:


Posted: Sep 21, 2022 @ 11:31 AM             Msg. 30 of 36
What do you get when you case the SubscriptionType to an integer?
should either be 2 if only DOM, or 3 if DOM + TopOfBook

Also, what programming language are you using?
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Sep 21, 2022 @ 11:39 AM             Msg. 32 of 36
Casting to an integer appears to work. It is returning 3 for a demo account and 1 for a real account that does not have DOM.

I am using C++

Thanks