VC++ 7.1 annoying bug?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vc.

Post a new message to this list...

Ioannis Vranos
Why does this annoying thing happen?

#include <windows.h>

#using <mscorlib.dll>

using namespace System;
using namespace System::Windows::Forms;

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{

}

C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

temp.cpp
temp.cpp(6) : error C2039: 'Windows' : is not a member of 'System'
temp.cpp(6) : error C2871: 'Forms' : a namespace with this name does not
exist

C:\c>

--
Ioannis Vranos
Reply to this message...
 
    
Steve McLellan
Hi,

This happens in projects in the IDE when no reference to the DLL has been
added. I think the command line arg is
/FU "C:\Windows\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
for Forms.

Steve

"Ioannis Vranos" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Ioannis Vranos
Steve McLellan wrote:

[Original message clipped]

Yes after adding a #using <System.Windows.Forms.dll>, this error got
fixed. However other strange errors occurred,and the bottom line is that
we need to use the Windows Form Application project to make things work.

Thanks for the help.

--
Ioannis Vranos
Reply to this message...
 
    
Steve McLellan
Hi,

That's not true... I've used a Form in a console project. Adding the
reference in Solution Explorer/References did the trick, I didn't need
#using <...Forms.dll>.

Steve

"Ioannis Vranos" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com