N
Nik
Hi,
I'm trying (and failing) to learn MC++ and I get the
feeling that when I ask this question, the proverbial
record will scratch to a halt and everyone will stare at
me as though I'm totally weird, but here goes...
Using VS.NET 2003, I have created a MC++ .NET Class
Library project. I have create a class in the default
header file created by the project.
So far, so good. )
In C# (my normal mode of operation), I would normally
create another .cs file to hold a second class and,
assuming that the two classes shared a common namespace, I
would be able to use one class in the other. Therefore
this is what I tried to do in MC++, by creating a new
header and associated cpp file. I wrote the second class
in the header file and this is where I'm stuck because I
can't use the second class in the first because the
compiler tells me:
error C2061: syntax error : indetifier 'MyClassName'
'Ahhh', thought I. Perhaps it wants me to specify the
full namespace ('explicit is good' and all, or so I'm led
to believe). However, if I reference the class with the
full namespace (MyNamespace::MyClassName) the compiler
tells me:
error C2039: 'MyClassName' : is not a member
of 'MyNamespace'
However, the IntelliSense picks it up okay and if I hover
over the class name in the assignment statement, the
tooltip seems to display the correct class too.
Am I going mad? Is there a philosophy I'm missing which
dictates that all classes must be contained in the same
file? Or am I simply missing a #using clause somewhere?
I'm trying (and failing) to learn MC++ and I get the
feeling that when I ask this question, the proverbial
record will scratch to a halt and everyone will stare at
me as though I'm totally weird, but here goes...
Using VS.NET 2003, I have created a MC++ .NET Class
Library project. I have create a class in the default
header file created by the project.
So far, so good. )
In C# (my normal mode of operation), I would normally
create another .cs file to hold a second class and,
assuming that the two classes shared a common namespace, I
would be able to use one class in the other. Therefore
this is what I tried to do in MC++, by creating a new
header and associated cpp file. I wrote the second class
in the header file and this is where I'm stuck because I
can't use the second class in the first because the
compiler tells me:
error C2061: syntax error : indetifier 'MyClassName'
'Ahhh', thought I. Perhaps it wants me to specify the
full namespace ('explicit is good' and all, or so I'm led
to believe). However, if I reference the class with the
full namespace (MyNamespace::MyClassName) the compiler
tells me:
error C2039: 'MyClassName' : is not a member
of 'MyNamespace'
However, the IntelliSense picks it up okay and if I hover
over the class name in the assignment statement, the
tooltip seems to display the correct class too.
Am I going mad? Is there a philosophy I'm missing which
dictates that all classes must be contained in the same
file? Or am I simply missing a #using clause somewhere?