API Support Forum
OEC API > API Support > IPrice exceptions
Author Topic: IPrice exceptions
(8 messages, Page 1 of 1)
Moderators: VPfau
WWatson2582
Posts: 43
Joined: May 03, 2018


Posted: Aug 28, 2024 @ 12:51 PM             Msg. 1 of 8
Using the COM interface API for version 4.15.726.321, in the OnPriceTick callback, when I try to do anything with the "Fields" member of the funtion's "price" parameter, I get an immediate _com_issue_errorex exception thrown.

For example, if I do the following immediately in this function, the exception occurs:
GF_Api_COM::PriceFields pf = price->Fields;

The Visual Studio Debugger traces this exception to GF_Api_COM::PriceFields GF_Api_COM::IPrice::GetFields( ) in the file GF.Api.COM.tli - there is no stack trace attached to the exception.

Is this something I'm doing wrong (it worked in previous versions)?
Edited by WWatson2582 on Aug 28, 2024 12:52 PM
JHyatt8720
Posts: 9
Joined:


Posted: Aug 29, 2024 @ 03:03 PM             Msg. 2 of 8
Is there more information you can give? what is your surrounding code, ex what was your price variable set to?
WWatson2582
Posts: 43
Joined: May 03, 2018


Posted: Aug 29, 2024 @ 05:19 PM             Msg. 3 of 8
This is immediately upon entry to the OnPriceTick method (see line 251 in GFAPIEvents.h included with your CppCOMSample), so a minimalist example would look like:

void __stdcall CDPBridge::OnPriceTick(GF_Api_COM::IGFComClientPtr client, GF_Api_COM::IContractPtr contract, GF_Api_COM::IPricePtr price)
{
GF_Api_COM::PriceFields pf = price->Fields;
}
WWatson2582
Posts: 43
Joined: May 03, 2018


Posted: Aug 29, 2024 @ 05:32 PM             Msg. 4 of 8
However, you don't need to reference my code at all - just insert the following at line 282 in CppCOMSampleDlg.cpp in your CppCOMSample project, put a breakpoint there, and once connected, checkmark the "Show price updates" and click on the "Subscribe Prices" button and select an active contract, like "ESZ24". When your breakpoint is hit, just single-step to see the exception thrown:

(at line 282:)
GF_Api_COM::PriceFields pf = price->Fields;
Edited by WWatson2582 on Aug 29, 2024 05:32 PM
JHyatt8720
Posts: 9
Joined:


Posted: Sep 03, 2024 @ 09:25 AM             Msg. 5 of 8
We are activly looking into this issue.
WWatson2582
Posts: 43
Joined: May 03, 2018


Posted: Sep 13, 2024 @ 08:30 AM             Msg. 6 of 8
Any updates on this? We have a client eager to use the newest API release.
JHyatt8720
Posts: 9
Joined:


Posted: Sep 13, 2024 @ 10:15 AM             Msg. 7 of 8
Yes, this problem has been fixed and a newer version will be available for download. Please let us know if anything else comes up.
Edited by JHyatt8720 on Sep 13, 2024 10:18 AM
JHyatt8720
Posts: 9
Joined:


Posted: Sep 13, 2024 @ 10:20 AM             Msg. 8 of 8
I will update you when It is available.