views:

453

answers:

3

Using Visual C++ 2008. First time, I'm experimenting in crossing over from C# and wanted to try my hand at it. I have not changed base settings much, other than a few things like smart block and maybe a few colors. Because I'm at level ZERO on c++ knowledge all the googling I've done is over my head. Issue with intellisense and error listing/checking

Part 1 of the probelm My issue is that I just created my first windows form project. now that I double click and go into something like this, intellisense doesn't list any members?

private: System::Void executeDocumentationCmd_Click(System::Object^ sender, System::EventArgs^ e) { this. NOTHING POPS UP? }

If I type in MessageBox::, then it will popup intellisense for "Show". Is this normal? I find it helpful as I'm learning basics to have it list available txt boxes and members, but it won't do that like it does in c# intellisense.

I have stdafx.h included. I deleted the ncb file per online help and restarted, nothing. Additional headers? Remember I'm new, and I haven't done anything beyond a simple "hello" world in c++ so help me out if you can.

Part 2 of the problem: No underlined errors in realtime coding as in c# editing. Is this a feature that c++ express has, error checking before the compile, since I'm not seeing any warnings or errors listed as I type in wrong information.

Thanks!

+2  A: 

this in C++ is a pointer that is dereferenced by -> not .

Also, intellisense for C++ in VS2008 is not as helpful as in C#, this includes not having error checking. VS2010 will be introducing inline error checking for C++.

There are some very big differences between C# and C++ that you will need to be aware of. It's a big topic so I don't think a post here can summarise them but two important points are the lack of garbage collection (lookup the delete keyword) and pointers. Pointers exist in C# but they are only available in unsafe code blocks whereas in C++, pointers are almost king. You may want to invest in a book to help you with your learning.

Jeff Yates
oh! i feel pretty stupid, as soon as I did your arrow sign, the intellisense popped up... as for the error checking.. no wonder I couldn't find it! Lol. New to me. Any idea when the release for express 2010 c++ would be out?
Sheldon
right. I just took class in c# "intermediate" level... and decided that c++ was where I wanted to focus my energy, then come back to c# later (or keep learning on the side)... i will be getting a book, for now I was experinment with simple string functions to become a little familar with it. thanks!
Sheldon
You're very welcome. It's great to see that you've decided to take this step. C++ is a very powerful language and it can be quite daunting, but your C# work will be richer and your understanding of Windows better if you study C++.
Jeff Yates
A: 

For a bit of history, C++ was specifically designed to be compatible with C, which C# and Java were not. One consequence is that C++ is hard to parse, so it's harder to make intellisense work for C++ than for C#. I find it flaky, and hope it's better in VS 2010.

Also, C and C++ have much more of a distinction between variables and pointers than most languages. I'm not familiar with C#, but in languages like Java and Common Lisp, pretty much everything is a pointer, so there's no special notation. When I worked with Pascal, very few things were done with pointers. C and C++ are the languages I've used with the most potential confusion. They also allow pointer arithmetic, which is the reason for very many bugs.

I don't think that any language is a really good one just to try to slip into C++ from. I'd suggest that, as long as you're interested in C++, you learn it as if it were a new language. Get a good modern introduction.

David Thornley
+1  A: 

FYI, according to your code snippet, you are not really using C++ but C++/CLI which is a different language.

Nemanja Trifunovic
ok.... i just now read this and discovered it on google... reviews seem negative of the cli version. I want to remove myself from the .net framework since i plan on trying my hand at some game development... recommendation for now for free visual oriented (forms) c++? WITHOUT .netframework?
Sheldon
also is it very difficult to develop window forms applications without .net framework? c# seems so much easier that to stray away from .net seems difficult
Sheldon
Look at this discussion and make up your mind (if you can): http://stackoverflow.com/questions/115045/good-c-gui-library-for-windows
Nemanja Trifunovic