This week's book giveaways are in the Angular and TypeScript and Web Services forums.
We're giving away four copies each of Programming with Types and The Design of Web APIs and have the authors on-line!
See this thread and this one for details.
Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

Please dont kick off of the ranch, but...

 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hate to say this but I am taking a C++ course in school right now, I was trying to hold out for an Enterprise Java course but it's not offered this semester - anyway...
It's GUI course using the MFC, we have to create a document-view app that draws lines on the screen - dont laugh!!
I decided to be creative and create a class called MyLine (pretty original huh?) to hold line objects so I could store them in a vector in the document. The problem is that I've created the class, it compiles and everything is fine as far as the actuall MyLine class goes, but when I try to use a MyLine in either the view or the document classes I get:
"error C2061: syntax error : identifier 'MyLine'"
I have tried everything to get it to work, I am including the MyLine header file. I have no idea what else to try, other than scraping the entire class and just hold the points of the lines in another way.
If anyone has any clue I would greatly appreciate it, by the way I'm using Visual studio to do this if it makes a difference.
Thanks
Dave
By the way I realy do hate C++ so dont take away my spurs - please!! (I think it was the first teacher I had for C++, I didn't like him, so now I don't like the language...)
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C++ is not a bad language. Its MFC that is an abomination .
It could be because the constructor for your document class is declared as protected. Try changing it to public. And did you define the class as class MyLine : public CDocument or class MyLine : CDocument . It would help iF you post the offending source here. Its hard to make a guess about the source of the problem because error nbr C2061 is tied to an acknowledged bug in VC++ that spits out an error message which has no connection with the actual error.

[This message has been edited by Sahir Shibley (edited October 02, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Dave Vick:
but I am taking a C++ course in school right


Ahhhh, an honest man!
(PS- I just finished a customer request using Visual Basic )
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sahir
Thanks for the info, what I, and it seems to be working is to move the #include to the header file for the doc class. In visual studio when it created the code for me it put all of the include files in the .cpp file not the .h . so I moved my include for my class to the header file and now it compiles.
I'm sure I'll be back for more help later.
thanks
Dave
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!