Forums

We want to share an important update with our Betfair Community users.

Over the coming months, the Betfair Community platform will be winding down. The final active day for the platform will be December 21st. From December 22nd, users will no longer be able to access the platform.

Your discussions, insights, engagement, and, most importantly, feedback have helped shape the platform and guided innovation. Your feedback continues to be important to us, and we will continue to listen via our dedicated feedback channels, as well as through product testing and innovations.

To share your feedback and experience, visit: https://support.betfair.com/app/home

General Betting

There is currently 1 person viewing this thread.
Contrarian
19 May 10 19:40
Joined:
Date Joined: 19 May 03
| Topic/replies: 1,028 | Blogger: Contrarian's blog
Has anyone else managed to import the web references into a Visual C++ project (using Visual Studio)?

Most of my other Betfair applications are in C#, and I was able to import the web references into Visual Studio without difficulty.

When I do it in a C++ project, though, I get two errors:

"error C2504: 'com_betfairapi::APIRequest' : base class undefined"
"error C2504: 'com_betfairapi::RacingSilk' : base class undefined"

This seems very odd, because the base classes here appear elsewhere in the project without generating this error.

Help, anyone?


Thanks.

P.S. Apologies for posting this here. I have also posted on the developers forum, but responses there tend to be a bit slow.

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 12
By:
Escapee
When: 19 May 10 19:45
Seems likely that you have a missing #include file.
By:
Escapee
When: 19 May 10 19:47
in your com_betfairapi.h file.


does the compiler give a file/line no ?
By:
Contrarian
When: 19 May 10 19:56
Escapee,

The errors are in the com_betfairapi.h file at lines 2374 and 4724.

If I were missing an #include statement, then wouldn't this affect the other uses of these base classes?
By:
Escapee
When: 19 May 10 20:36
Sorry about the delay, ( gf on the phone )

in my experience Those C2504 errors mostly resolve to a missing "include file.h" omitted from a .cpp file.

2504's can be misleading as the compiler resolves and reports them as errors in a '.h' file

I can't actually point you to the exact error with out seeing the code, only suggest that you try and identify the .cpp file which is causing the .h file to throw the erro and at the top of the .cpp file will be missing #include xxx.h


less common but happens enough to note:
at the top/bottom of each include header.h file are
#ifdef fname #endifdef constructs

and if these get out of kilter then the include file gets included incorrectly and can generate 2504's
By:
Contrarian
When: 19 May 10 21:00
Thanks for trying Escapee, but I still can't see what's wrong.

The .cpp files all have the #include "stdafx.h" statement, and the stdafx.h header file has both #include statements referring to the two Betfair web services.

Re. this comment of yours:

less common but happens enough to note:
at the top/bottom of each include header.h file are
#ifdef fname #endifdef constructs

and if these get out of kilter then the include file gets included incorrectly and can generate 2504's


I can't see any such constructs in the header files.

If you have Visual Studio, I don't suppose you could try creating a new project and then adding the Betfair web references (https://api.betfair.com/global/v3/BFGlobalService.wsdl nad https://api.betfair.com/exchange/v5/BFExchangeService.wsdl) could you? This is all I did to get the above problem, so it should appear for you as well.

Thanks.
By:
Contrarian
When: 19 May 10 21:13
I'm sure you know the web service address anyway, but just in case, they are:

https://api.betfair.com/global/v3/BFGlobalService.wsdl

and

https://api.betfair.com/exchange/v5/BFExchangeService.wsdl
By:
Escapee
When: 19 May 10 21:25
I'll give it a spin in 45 minutes or so
By:
Contrarian
When: 19 May 10 21:27
Thanks Escapee.
By:
Escapee
When: 19 May 10 22:27
Well the good news is I've recreated your problem, the bad news is of course I haven't solved the problem.

it's causes by BFExchangeService.wsdl

I've run out of time to find the exact problem so I'll have a look tommorow if you haven't fixed it by then
By:
Contrarian
When: 19 May 10 22:38
Thanks Escapee, I would really appreciate it if you could have a look. Detecting what exactly would be wrong with BFExhangeService.wsdl is well beyond me.
By:
Escapee
When: 20 May 10 13:11
I think I've found a quick 'n dirty fix....


The system generated code in the .h file has got a headache over the the base class for getSilkRequest and RacingSilkV2.

To fix it,

1) compile it to generate the 2 errors in the output window

2) click on the error's to navigate to the line(s) of code and edit the lines ( after copying and commenting out ) to remove the base class definition, like this:

    //public ref class GetSilksReq : public com_betfairapi1::APIRequest {

remove the emboldened text to leave this


    public ref class GetSilksReq {


do the same for both lines and it will compile.
I haven't been able to look further into the reasons getSilkReq has a base class or if getSilkReq will work with out a base class as I'm on the free API which doesn't allow me to use GetSilkReq anyway. But all the other methods should be unaffected.


Hope this Helps.
By:
Contrarian
When: 20 May 10 13:56
Thank you so much Escapee. It compiles now.

I owe you one.
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com