Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hello World! - nothing works.
Message
 
To
09/04/1998 22:15:37
General information
Forum:
Visual C++
Category:
Other
Miscellaneous
Thread ID:
00090585
Message ID:
00091007
Views:
27
>If you want to use plain C language, you should choose "Win32 console application" type of project.
>
>Besides that, "winmain" must be "WinMain". As you know, C is case sensitive. Also, the prototype for WinMain does not accept void as parameters.
>
>Another mistake in your code is the string "c:\test". The backslesh is reserved character inside character strings. If you want to have one backslesh, than you have to use "\\". So, your string becomes: "c:\\test".
>
>Here's the code that works if you start with Win32 console app projects:
>
>#include
>
> void main(void)
> {
> int nTemp;
> nTemp=MessageBox(NULL,"Hello World",NULL,MB_OK);
> }
>
> ------
>
> #include
> #include
>
> void main(void)
> {
> FILE *filehandle;
>
> filehandle=fopen("c:\\test.txt","w");
> fprintf(filehandle,"%s\n","Hello World");
> fclose(filehandle);
> }
>
>Vlad

Many thanks for your reply. I didn't take much notice of the WinMain in the help - I will keep an eye on that (I have noticed that when using API calls). As for the double backslash - what can I say? I've done that so many times, I should know by now - thanks again,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform