Microsoft Visual C++ 6.0 ** Am I missing something?
People have told me that in the workplace visual C++ is the standard compiler that you work with.... so I bought visual studio and have been using it rather then gcc/bloodshed. I'm trying to learn windows based programming but keep on getting errors on code that will compile in bloodshed. Can someone who used visual C++ tell me what I have to do to this code and why simple **** won't compile in visual... I gota be missing something.
#include <stdio.h>
#include <windows.h>
main()
{
MessageBox (NULL, "blaat" , "fux0r owned j00", 0 | MB_ICONEXCLAMATION);
system("PAUSE");
return 0;
}
Re: Microsoft Visual C++ 6.0 ** Am I missing something?
I'm don't know why bloodshed allows the code to compile . . . I've never used bloodshed, so I comment on it's ability. However, in Visual C++ 6, your code will compile if you use the Win32 Application entrance (instead of the Win32 Console Application entrance):
I called the following "testmsg.c":
//////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, "blaat" , "fux0r owned j00", 0 | MB_ICONEXCLAMATION);
system("PAUSE");
return 0;
}
//////////////////////////////////////////////////////////////////////////
I'm not familiar with system("PAUSE") in Windows, so I don't know if it's necessary. If you can do without it, then you can probably lose stdio.h as well. Also, you might want to use windows.h's TEXT() macro around the strings, if you plan on using UNICODE.
If you're not used to seeing all of the above Windows typedefs, don't worry . . . they're really, really easy after you get Petzold's Programming Windows (off of e-bay ;) ).
Hope This Helps,
Joshua Burkholder