Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2005

Tip: Looking for answers? Try searching our database.

Namespace not being recognized

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Oliphant - 04 Oct 2005 01:39 GMT
I'm using VS Studio C++.NET PRO 2002 and created the default "Hello World"
Managed C++ Application. For some reason the following namespace declaration
results in a 'can't find this namespace" error when I add it:

using namespace System::Windows::Forms;

while :

using namespace System;

is just fine. I want to create a managed application using C++ using the
Form class (and other controls).
What's wrong?
Alex Thaman - 04 Oct 2005 06:56 GMT
By default, the compiler imports .NET classes from mscorlib.dll (actually this might be done explicitly in code in 2002 - can't remember off the top of my head).  mscorlib.dll contains most of the commonly used .NET classes.

System::Windows::Forms classes are located in System.Windows.Forms.dll, so you need to first explicitly import this DLL with

#import <System.Windows.Forms.dll>

because only winforms apps use these classes.

Hope that helps!
-Alex

-----Original Message-----
From: Alex Thaman
Posted At: Monday, October 03, 2005 5:39 PM
Posted To: microsoft.public.dotnet.languages.vc
Conversation: Namespace not being recognized
Subject: Namespace not being recognized

I'm using VS Studio C++.NET PRO 2002 and created the default "Hello World"
Managed C++ Application. For some reason the following namespace declaration
results in a 'can't find this namespace" error when I add it:

using namespace System::Windows::Forms;

while :

using namespace System;

is just fine. I want to create a managed application using C++ using the
Form class (and other controls).
What's wrong?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.