A while ago, you very kindly helped me to sort out a problem I was having with creating the Betfair classes in C++ within Visual Studio.
If you remember, the problem is that when the Betfair web references are imported into the project, the errors:
error C2504: 'com_betfairapi::APIRequest' : base class undefined error C2504: 'com_betfairapi::RacingSilk' : base class undefined
are generated. You gave me a rough-and-ready solution which involved just removing the references to the base class in the relevant lines of code.
To some extent, this solution does work for me (I have created C++ applications that function with this fix). The problem, though, is that whenever I develop a Windows form-based project in VS C++, after a while the form class cannot be viewed in designer mode (generates an error message if you try to view it). I looked up this error message on the MS forums, and it seems that it may be due to a corrupt reference in the project (which would make sense, given what we know about the errors that are generated when the web references are imported).
I don't suppose you have any idea about how I might fix this problem at a deeper level? I've tried asking the BDP people, but, even though I've been a £200/month subscriber for about 5 years, they say they can't help with queries involving C++.
Off the top of my head, sounds like a resource file curruption problem to me.
What version of Visual studio ?
On VC6++ I used to occasionally get corruption in the .rc file and it would grow from a few hundred K to to a few 10's of mega bytes. The only way to fix that problem was to delicately edit the crap out.
First off I would try a Build->Clean to see if that cleared the problem without any further investigation needed.
Whats The Error Message ? Number ?Off the top of my head, sounds like a resource file curruption problem to me.What version of Visual studio ?On VC6++ I used to occasionally get corruption in the .rc file and it would grow from a few hundred K to to
Incidently I worked out that this line caused error C2504
public ref class RacingSilkV2 : public com_betfairapi1::RacingSilk {
Because the Class RacingSilk is defined after RacingSilkV2 and V2 is trying to inherit an as yet undefined Class
I moved the entire definition of RacingSilk to above RacingSilkV2 and it compiles.
Incidently I worked out that this line caused error C2504public ref class RacingSilkV2 : public com_betfairapi1::RacingSilk {Because the Class RacingSilk is defined after RacingSilkV2 and V2 is trying to inherit an as yet undefined ClassI moved the e
Thanks for the tip about moving the base classes. This works fine now (and resolves both of the C2504 errors).
The error message for the Windows form designer failure is:
"Either VCProject or VCCodeModel is not ready yet. Please close designer and try again."
There is no code number.
I'm using VS2008.
Maybe see you at Xmas drinks.
Hi Escapee,Sorry for the late response.Thanks for the tip about moving the base classes. This works fine now (and resolves both of the C2504 errors).The error message for the Windows form designer failure is:"Either VCProject or VCCodeModel is not re
If that means as opposed to MFC, then, yes (I think!).
It is the sort of project that is created when you click on 'New Project' and then select 'Windows Form Application'.
If that means as opposed to MFC, then, yes (I think!).It is the sort of project that is created when you click on 'New Project' and then select 'Windows Form Application'.
Its likely that you have some code or class in your Form1.h file outside of the Form1 Class itself.
Unlike older versions of Visual Studio, where all the info about what cotrols you have on the form/dialog was held in a xxxxxxz.rc file. The 'Designer' for VS2005+ now creates what you see 'on the fly' from the content of the corresponding .h file ( i.e. Form1.h )
Being Microsoft, it is easy to confuse the designer.
I recreated the problem by adding a simple structure outside the Form1 class ( the bottom of the file )
ref struct Test { int ii; int xxx[ 100 ]; };
And there you have your problem.
To cure the problem: 1) remove or comment out the offending code 2) Save the Form1.h file 3) 'X' close the the 'Form1 - [Design]' Tab 4) reopen the Form1 designer by clicking on Form1.h in the 'Solution Explorer'
And Bingo ! you should be back in business.
Let me know if this does or doesn't work. And if you can't spot the offending code then maybe post your Form1.h file on here and I'll have a gander.
I've managed to recreate your problem !Its likely that you have some code or class in your Form1.h file outside of the Form1 Class itself.Unlike older versions of Visual Studio, where all the info about what cotrols you have on the form/dialog was he
Seems like Escapee should certainly win the accolade of being probably the most helpful poster on here. Extremely generous with his time and advice. Good to read ( though I never understand one bit of it at all ).
Seems like Escapee should certainly win the accolade of being probably the most helpful poster on here.Extremely generous with his time and advice.Good to read ( though I never understand one bit of it at all ).