World's simplest MC++ question

Raven Darque

Member
Joined
Sep 24, 2003
Messages
5
Location
Hampshire, UK
I should warn you that Im failing miserably at learning MC++. :o)

This must be simple, but Im totally stumped. All Im trying to do is create two _gc classes and use one in the other. I put one class in the default header file created by VS.NET (its a .NET Class Library project), then I created another cpp and associated header file and put the second class in the new header file - the way I would normally work in C# (my native language). Now, when I try to create an instance of the second class in the first, I get a compiler error:

error C2061: syntax error : identifier MyClassName

I tried to include the full namespace (explicit is good Im told) but then I get the following compiler error:

error C2039: Retriever : is not a member of Odyssey

Both the tooltip and intellisense seem to concur that the class is the right one and can be found, but the compiler doesnt agree. What am I doing wrong?
 
Am I alone here?!

Come on guys! Someone must know what Im talking about! Maybe an example will help:

Code:
//File1.h
#pragma once
using namespace System;
namespace MyNameSpace
{
	public __gc class MyCallingClass
	{

	private: void MyMethod()
		//the following line fails with a compiler error
		MyCalledClass *mcc = new MyCalledClass();
	};
}

//File2.h
#pragma once
using namespace System;
namespace MyNameSpace
{
	public __gc class MyCalledClass
	{

	public: void DoSomething()
		//do something...
	};
}

Why doesnt this work?! Surely this is the simplest thing in the world?
 
Okay, I found out from another newsgroup. I needed to #include the second file in the first.

Its like a ghost town here.

I feel like Im talking into a void.

Alone.

In the dark.

...

.

.

.

Just kidding.
 
Back
Top