Windows programming?

Hey when you say Windows programming are you talking about writing your own apps for Windows? If so, What types of programs have you guys written? I want to get an idea because I have thought of one app I want to write up for myself but it's much more advanced then the little specific calculation programs I've written in my class. The program I'm thinking of probably does exist but I haven't found it to exist as freeware which I think it should be. It's basically what online-convert.com does as a free service except it wouldn't be limited to only being able to do files one at a time and you could work with files much greater in size than there free limit or limit in all for that matter.
Last edited on
Did I go against forum rules or something?


Bump.
Last edited on
No - I don't think you went against forum rules.

To me it just seems a bit of a vaugue non problem, non question that is difficult
to reply to.

What do you want us to say???

If you want to do it then do it (as per Nike)
Ok thanks for asking me to clarify. Let me try to say it this way. When you guys say Windows programming are you talking about writing programs for OS general with their own IU and all?
Are those the type of programs that this subforum is for?
As I see it, this forum is for discussing C++ programming using the Win API and any other Windows libraries. So if you are writing a GUI program using the WinAPI, this is probably the place for discussing it. But if you're, say, using SFML, that's portable so it would probably be better placed in a more general section.
Windows, Macs and Unix/Linux all have their own different GUIs - Graphical User Interfaces (obviously). With any of these operating systems there are numerous ways to write GUI programs for each respective operating system. Actually, its even ore involved than that. Not only does each operating system have numerous application development frameworks, but numerous programming languages can be used. For Windows programming (I'm personally most familiar with that) I use C++ and PowerBASIC. I code with each of these languages exactly the same way, that is, using the raw Application Programming Interface (API). That's how a significant number of folks here on this forum do it too. There are other possibilities though, and they involve either Application Development Frameworks such as MFC or .NET, or cross platform frameworks such as wxWidgets or QT. Hope this info helps.
Yes it does thanks, Now when you say API is that an option within the compiler? The compiler I use as I've said before is Visual C++ 2010 so if you're familiar with that compiler can you please explain how to open a project file that's designed to have one of those programs written in it? (e.g. which template ect.) Don't worry, all I want to know (for now) is that. I won't ask about what libraries to to use because I'm sure I can just go into the reference section of this site and find that out for myself. :)

Now when you say API is that an option within the compiler?


My best guess as an answer to that question would be no. Both Microsoft's C and C++ compilers (such as you have in your VS 2010) and the GNU MinGW compiler suites (open source software) can generate Windows executables containing only calls to Windows Api functions and intrinsic C or C++ keywords. No specific settings actuated through the Visual Studio 2010 development environment are necessary to accomplish this; what is required to accomplish this is inclusion of the #include <windows.h> at the top of your source code file. That will cause the compiler to process and load into memory all the struct definitions, equates (#defines) and function prototypes required to compile a program making calls to Windows API functions.

I don't have Microsoft's Visual Studio 2010. The latest version I have is Visual Studio 2008 Pro. I don't know how much things have changed but the general technique is likely similiar. You first tell Visual Studio you want to create an empty C++ project. The empty part is important, because Microsoft's path of least resistance will eventually lead you through a series of wizards where you'll end up with auto-generated code from various templates. I think I can speak for most 'real' coders in that the more experienced folks generally won't take that path. I think most 'real' coders want to write their own code, or copy one of their own templates into the code editor. At that point all you need to do is compile.
Yeah my teacher taught me to always open an empty c++ project file. So the API is a library within the compiler? Does it just tell the compiler that your modifying the UI of your program?
Last edited on
An API is more accurately a collection of libraries. These would be included in the MSVS but otherwise they are part of the Microsoft Windows Developer Kit (WDK) or Driver Developer Kit (DDK). It's also important to note that they are NOT part of the compiler and must be linked to manually. Libraries like Kernel32.lib and User32.lib are automatically loaded into any application that is started in Windows so they are already linked to, other libraries, for example the networking library ws2_32.lib, have to be linked to before the functions can be used.
And all I have to do to link them is use the #include command?
No, computergeek brings up a good point. There are two stages to creating an executable once one has the source code ready to compile - the actual code compilation - then the link stage. The proper includes will only get you through compilation. For example, if you call a function ...

1
2
3
SOMESTRUCT SomeStruct;         //  <<< instantiation of object

SomeFunction(&SomeStruct);    //  <<< function call 


... that will work for compilation if through an include the compiler has a declaration of SomeFunction and a description of SOMESTRUCT. However, if those structures and functions reside in an external module, i.e., dll or lib, then the link step will require that the lib/dll be specified.

When you set up a console mode Windows project in Visual Studio, the development environment will only take care of linking you to kernel32.dll, and not other libraries that contain graphical user interface functions. So any calls to those GUI functions will pass the compiler (if #include "windows.h"), but not the linker. So, depending on how you set up a project, the development environment will specify different linker switches and libraries.

Last edited on
Topic archived. No new replies allowed.