VC++ 7.1 annoying bug?

I

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>
 
S

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
 
I

Ioannis Vranos

Steve said:
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.


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.
 
S

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
 
I

Ioannis Vranos

Steve said:
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>.


I assume that these both are equivalent.
 
S

Steve McLellan

Hi,

I don't know whether they're equivalent, but I do know that I've used forms
in console applications. You could look at the command line options that the
IDE gives as a default for a Forms project and see if something else is
different / missing.

Good luck,

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top