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 / .NET Framework / New Users / February 2004

Tip: Looking for answers? Try searching our database.

C1020

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Deep - 07 Feb 2004 17:39 GMT
Hello,

<snip>

#if (WIN32)
   #include "stdafx.h"
#endif

int _tmain(int argc, _TCHAR **argv) {
   #if (WIN32)
       printf("errrr\n");
   #endif
   return 0;
}

</snip>

I get a C1020 :-( on the first #if instruction.
Why ?
I should be able to use #if out of a function!!
When i remove the the first #if, the program compiles.

Is it a bug from my brain or ms ? :P

Mike
Mike Deep - 07 Feb 2004 23:11 GMT
I would like to inform you that the Managed C++ flag must be enabled to get
the error on VC7.
#if (WIN32)
   #include "stdafx.h"
   #using <mscorlib.dll>
   using namespace System;
#else
   #include <stdio.h>
   #include <stdlib.h>
#endif
#if (WIN32)
   int _tmain(
       int argc,
       _TCHAR *argv[]
   ) {
#else
   signed int main(
       signed int argc,
       signed char **argv
       ) {
#endif

because the pre-processor doesn't detect my first #ifdef the second pre-proc
instruction is dead.

/Od /AI "XXXXXXX" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHsc /MTd /GS
/Yu"stdafx.h" /Fp"Debug/XX.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo
/c /Zi /clr /TP /FU

It really look a microsoft bug, if not that sux for software port.

> Hello,
>
[quoted text clipped - 21 lines]
>
> Mike

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.