using or not using namespaces

this work :
#pragma once
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
using namespace System::Windows::Forms;
__gc public class C_SimWindowForm : public Form {
public:

C_SimWindowForm(){
MainMenu* teste = new MainMenu();

};

};
and this dosent work: (why?) :
#pragma once
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
__gc public class C_SimWindowForm : public System::Windows::Forms::Form {
public:

C_SimWindowForm(){
System::Windows::Forms::MainMenu::MainMenu* teste = new System::Windows::Forms::MainMenu::MainMenu();

};

};

[773 byte] By [stalag] at [2007-12-16]
# 1
I believe you have an extra MainMenu.

By doing MainMenu::MainMenu, you are actually referencing the constructor.

You probably meant to do "System::Windows::Forms::MainMenu* teste" to point to the name of the class and not its constrcutor.

Thanks,
Ayman Shoukry
VC++ Team.

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...