Trouble with windows programming C++

Started by
18 comments, last by Crypter 16 years, 2 months ago
try getting rid of \t in the second parameter. Why do you have it there anyway?
Advertisement
Quote:Original post by Exershio
try changing this

int APIENTRY WinMain(HINSTANCE hInstance,

to this

int WINAPI WinMain(HINSTANCE hInstance,


That should fix the problem.


it is the same

int APIENTRY WinMain(HINSTANCE hInstance,

than

int WINAPI WinMain(HINSTANCE hInstance,

APIENTRY is just

#define APIENTRY WINAPI

Quote:Original post by Exershio
try getting rid of \t in the second parameter. Why do you have it there anyway?


\t is a parameter to center the text into the box

[Edited by - fladur on March 22, 2008 9:32:22 PM]
Don't forget to visit my blog here.
Hey! Just let noobs be noobs, after all, we once were noobs right?
One thing you'll notice in Windows API is that the programmers of Windows apparently like to use typedefs; For example, LPCWSTR is an acronym for "long pointer c-style wide string", a wchar_t*; or "a pointer to a c-style string with wide traits". HINSTNACE is a handle (a pointer of sorts) to an instance, and <t>LPSTR, as you can guess is your classic char* string.

Make sure you know what they are :)
Woohoo!
Thanks to fladur it now works!
it wasnt the code that was wrong with his first post it was the fact i was using a empty Win32 console application rather than a Win32 project. i dont know why this makes a difference because they are both empty to begin with. :S
Anyways thanks everyone for helping me out

~Reegan

EDIT: slow computer causes many typos =[
Quote:Original post by Reegan
Woohoo!
Thanks to fladur it now works!
it was he code that was wrong with his first post it was the act i was using a empty Win32 console application rather than a Win32 project. i dont know why this makes a difference because they are both empty to begin with. :S
Anyways thanks everyone for helping me out

~Reegan


great to hear that, c++ is a complex language, there is more than code, there are configurations for Console, for Window, for a lib, etc, so be sure to select the correct type
Don't forget to visit my blog here.
Hey! Just let noobs be noobs, after all, we once were noobs right?
Ok now i have that worked out i moved onto the next tutorial and tried the code there, it had plenty of errors and i dont know where to begin.. is there anywhere better i could learn about windows programming.. some website that applies to my IDE.
google search on "forgers tutorial"

the beginners Bible to the Win32 API

very, very simple steps to follow.

m0ng00se
Quote:Original post by Reegan
Ok now i have that worked out i moved onto the next tutorial and tried the code there, it had plenty of errors and i dont know where to begin.. is there anywhere better i could learn about windows programming.. some website that applies to my IDE.

It shouldn't matter what IDE you use - the Windows API doesn't change.

Could you post some of the errors you're getting? Perhaps we can help.
NextWar: The Quest for Earth available now for Windows Phone 7.
I recomend that u read this tutorial http://www.cplusplus.com/doc/tutorial/ before getting into specific win32 then you try this http://www.winprog.org/tutorial/ hope this helps you
Don't forget to visit my blog here.
Hey! Just let noobs be noobs, after all, we once were noobs right?
@Reegan:

Please start posting your error messages when your are posting. This would have made your original problem much easier to find, and so as your second. Thanks :)

I am glad that you have got your first problem working, however it would be helpful for us if you post your error messages so we can help you with the second problem.

This topic is closed to new replies.

Advertisement