I am trying to learn C++/CLR but it seems very tricky compared to things I have done in the past.
I wish to open a second form when I click a button, it should be simple but just refuses to work.
From the MSDN:
Code Snippet
void ShowMyDialogBox()
{
Form2^ testDialog = gcnew Form2;
// Show testDialog as a modal dialog and determine if DialogResult = OK.
if ( testDialog->ShowDialog( this ) == ::DialogResult::OK )
{
// etc etc etc.
However, I have added a second form (Project->Add New Item->Windows Form) Form2. When I get to testDialog->ShowDialog(this) it says "Expression to the left of . or -> has a type which could not be resolved". I have done lots of fiddling but cant work out what I am doing wrong.
When I type it all in anyway I get the following compile errors;
Error 1 error C2065: 'Form2' : undeclared identifier 86
Error 2 error C2065: 'test' : undeclared identifier 86
Error 3 error C2061: syntax error : identifier 'Form2' 86
Error 4 error C2227: left of '->ShowDialog' must point to class/struct/union/generic type 87
Any ideas
I had it working in seconds using C# and obviously a minor alteration of code.
Another thing I noticed was that C# IDE has a much better autocomplete feature than the C++ IDE, is this just a problem with me, or is it meant to be like it
Thank you for your time!