473,473 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VC++ 7.1 annoying bug?

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
Nov 17 '05 #1
5 1041
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\Syst em.Windows.Forms.dll"
for Forms.

Steve

"Ioannis Vranos" <iv*@guesswh.at.grad.com> wrote in message
news:O8**************@TK2MSFTNGP14.phx.gbl...
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

Nov 17 '05 #2
Steve McLellan wrote:
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\Syst em.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.

--
Ioannis Vranos
Nov 17 '05 #3
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" <iv*@guesswh.at.grad.com> wrote in message
news:Ov**************@TK2MSFTNGP15.phx.gbl...
Steve McLellan wrote:
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\Syst em.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.

--
Ioannis Vranos

Nov 17 '05 #4
Steve McLellan wrote:
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.


--
Ioannis Vranos
Nov 17 '05 #5
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

"Ioannis Vranos" <iv*@guesswh.at.grad.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Steve McLellan wrote:
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.


--
Ioannis Vranos

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Medi Montaseri | last post by:
Hope this is a right forum, else route me... I'm using map STL in Microsoft Visual C++ 6.0 and am getting warning C4786 which seems to have to do with truncating symbols as VC++ is building a...
3
by: Daniel Lidström | last post by:
Hi, is there an update available for VC 7.1? My version is 7.1.3088. I'd like to have a version that doesn't close some of the source files I have open every 10th (or so) debug session. --...
1
by: Daniel Jenkins | last post by:
I'm currently charged with the task of writing a customized business application. This app will perform order entry, invoicing, accounting, etc. type tasks. Can anyone justify a decision to...
1
by: John Madsen | last post by:
This bug is easier to just show than to explain I think... namespace M { template <class T> struct A { void f(int a = T::foo()) { } // line 5 }; } namespace N { struct B {
4
by: Daniel Lidström | last post by:
Where do the variables that are in VC++ Directories come from? For example, there is a path $(FrameworkSDKDir) in the Executable files directories. Where can I find out what this variable points...
8
by: The unProfessional | last post by:
To the VC .Net'ers out there... I noticed alot of strange behavior in the way VC .Net apps behave in the IDE. It's a bit odd, so maybe people have workarounds. I'm worried to devote my project...
6
by: John Gabriel | last post by:
I have been obtaining the following error in the output window of the IDE: 1>mt.exe:general error c101008d:Failed to write the updated manifest to the resource of file "..\debug\test.exe". The...
27
by: Marc Reinig | last post by:
I have a program written in Visual Studio 2003 Visual Basic. I would like to move it to Visual C++. Is there an automated or relatively automated way of doing that, or do I need to recreate all...
3
by: kim.ruhl | last post by:
I've been coding in visual C++ but am migrating to linux + gnu. I'm not an expert, but my programs seemed to work fine. When I take all the junk out of the VC++ codes and try to run them on my...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.