Sign in to follow this  

2 errors in basic hello world in DirectX 9

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

// DIRECT X 9 TESTING.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <iostream>
using namespace std;

int WINAPI WinMain(HINSTANCE hInstance,
				   HINSTANCE hPrevInstance,
				   LPSTR lpCmdLine,
				   int nCmdShow)
{
	MessageBox(NULL,
		L"Hello World",
		L"Just another hello world program",
		MB_ICONEXCLAMATION | MB_OK);
	return 0;
}
THis is my code,it has 2 errors,someone please help me. THanks

Share this post


Link to post
Share on other sites
My guess is that you're not compiling for unicode, and so MessageBox isn't expecting wide strings.

Or, based on your comment, your compiling as a console app... which doesn't start with a WinMain like you have, but just a normal C style main: int main(int argc, char **argv)

Share this post


Link to post
Share on other sites
No.

Please show some inituitive in solving your problem before posting to these forums. We shouldn't be your first port of call whenever things don't work out perfectly. Try pressing "F1" on any compile errors to bring up their help page, copy-n-paste the message into a search engine... for runtime errors, do some basic debugging with breakpoints etc...

Once you've tried those sorts of things and if you still can't get it to work then you're more than welcome to post here and we'll see what we can do to help [smile]

Jack

Share this post


Link to post
Share on other sites

This topic is 3743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this