Sign in to follow this  
Rayben

windows programming

Recommended Posts

Hi everyone! I'm very in to A.I. and I would love to be able to experiment with it but I can only take it so far with console programming. I've looked in to Windows programming but it seems I have to write a full page of code just to get a "blank sheet". Then there's the GDI and the GDI+... -.- 1. Is there no simpler way of drawing dots and lines in a window? If not, then does someone know why: #include <windows.h> doesn't work in visual c++ express? The error message reads: fatal error C1083: Cannot open include file: 'windows.h': No such file or directory. Obviously it can't find the file.. but why? Shouldn't it be in there with all the other standard includes? Thanx in advance. /Desperate house programmer

Share this post


Link to post
Share on other sites
It does take quite a bit to get a basic Windows program up and running unfortunately. You can learn GDI which is fine for lines and things but is very slow or you can learn OpenGL of Direct3D for your graphics. Again however there is a bit of a learning curve.

Not sure why that include does not work. If you are using Express make sure you have installed the latest Platform SDK.

Share this post


Link to post
Share on other sites
Only learn GDI if you want to keep you're requirements low. IMO OpenGL is easier to code with than using GDI.

btw windows.h isn't a standard

Share this post


Link to post
Share on other sites
I would strongly suggest that you try out C#. Very nice for doing AI work and the GDI stuff is very easy to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rayben
1. Is there no simpler way of drawing dots and lines in a window?


SDL/DirectX provides an easy-to-use layer for input, window events, etc. For drawing things you should use a graphics libary (GL) like OpenGL or DirectX.

I would recommend sticking to the wide standards and use as few properiertary elements of programming (libaries / languages (C#)) as possible.

Share this post


Link to post
Share on other sites
Thanks alot everyone!
Especially Trip99 for your great site, it helped alot.

However, the universe is still screwing around with me ;)
With the help of Trip99's site I managed to code what is needed to show a blank window but now it's having trouble linking stuff:
main.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16
main.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16
I've only included these two but it says the same about GetMessage, UpdateWindow, CreateWindow and a few more.
Iv'e checked the paths and they are good (I removed them and added them one by one). Please help me once more.

Thanks in advance!

Share this post


Link to post
Share on other sites
It sounds like when you installed the Platform SDK you didn't set the AdditionalDependencies to "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" in the corewin_express.vsprops file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this