New Win32 project, how can I view the main form?

I've made (very!) simple Windows programs before but always as empty projects and typed in the code (WinMain, InitInstance, etc.) manually to try to learn more. But now I'm dabbling in creating a Win32 project that isn't empty. I recognize quite a bit of the code that is generated for me. Hitting F5 (I'm using Visual Studio 2010) brings up a nice empty window. But for the life of me I can't figure out how to open that window in Visual Studio so I can drag controls onto it. The only one that I've found that I can open is the About dialog window that is automatically generated for the project. Am I missing something that is glaringly apparent (a distinct possibility!)?
There is no such option in Visual Studio Express for win32 projects. You can use a 3rd party resource editor like ResEdit:
http://www.resedit.net/
I'm using Visual Studio Professional.
There no option to edit a normal window in the case of a Win32 app irrespective of the version of Visual Studio. The Visual Studio Resource Editor, which comes with the pro edition, and ResEdit can only handle dialog templates. (The C++/CLI, C#, and VB guys, with their Forms Designer, have all the luck!)

So...

You could use a dialog for your view window, it it's flexible enough, and then you can use the resource editor to edit your dialog templates.

Or you can create an MFC app which uses views based on CFormView, which is a view which holds an embedded dialogs. Then you can edit the views in the same was as you can a dialog (well, it is just a dialog template.)

Or, if you're really keen, you could implement your own dialog embedding mechanism ground-up using raw Win32?

Or you could just add your child windows/controls programmatically.

Andy
Last edited on
I should have known that it wouldn't be that simple LOL.

From what I can tell, what I have been doing isn't anything that a dialog window can't handle. With that in mind, where would the line be drawn when a dialog window just won't do what you need?

That aside, the real issue from a learning perspective is which of those routes you mentioned should I start learning? I'm still going to work on my coding in general (definitely have a lot of wrinkles to iron out there) but what would be a recommended path to go down as far as application programming? I got into programming to create games (educational language games) so a lot of this Windows programming is very new to me and I've jumped into it out of necessity.
where would the line be drawn when a dialog window just won't do what you need?

When the main window is more than just a host for child controls.

For example, if you wanted to extend you app so it's a full blown editor like Notepad with the capability of marking up the variations in spelling (orthography?), then I wouldn't use a dialog. That would be a Edit window hosted directly in the frame (which basically is what Notepad is; the frame holds the edit window plus the status bar.)

Or you're writing a graphical computer game, or a spreadsheet, or a video player, etc.

which of those routes you mentioned should I start learning?

Difficult to day; that should be driven by your needs.

But at some point you should decide whether to continue with Win32 or switch to C++/CLI, or even C#. Or maybe a cross-platform GUI toolkit, if you'd like to target platforms other than Windows in the future.

If you continue with C++, then you should learn more about the standard libraries, including the containers, iterators, and algorihtms. And there's the new features provided by C++1 to think about, too.

Andy
Last edited on
I got into C++ because it was/is still more or less the standard in game development (although there is a lot of new stuff emerging). I started out with the "Hello world!" console stuff, started learning loops, variables, classes, polymorphism, etc. Then I started messing around with SDL and a little with programming simple games in a Windows window. But since my (limited!) Windows programming experience is geared toward just enough to get some graphics on the screen, I've missed out on quite a bit of the "basics" as far as Windows application programming (which my ignorance is VERY grateful for your time and patience!!). Which is why I'm curious which route I should go as far as application programming. I'm thinking I won't need to worry about performance since I don't have any plans for any resource/processor heavy applications so maybe I can go the route of the "drag and drop" type program development (near as I can tell, C++/CLI and C# does this) and keep the specific C++ stuff (containers, iterators, etc.) for game development. My possibly naïve knee-jerk reaction is to go with C++/CLI so I can somewhat stay in the realm of C++. What do you think? I've been teaching myself programming so I'm not intimidated by diving into whatever I need to :).
My possibly naïve knee-jerk reaction is to go with C++/CLI

On the plus side, that does mean you can use the Forms Desginer.

On the minus side, possibly, it does close off cross-platform development pretty much. And you will have to get used to managed pointers (the ^), etc.

But don't forget you can use more language to write an app. You could write the GUI using C# but code some components which need speed in native C++. You could even write a web-based front end in javascript and put all your C++, high performance code in a plug-in.

Andy

There is also C++/CX which is another derivative of C++ from Microsoft. C++/CX is tied to WinRT, the new "platform-homogeneous application architecture" which is part of Windows 8, and which is used to write Metro-style apps. So if you think it's worth the effort of developing an app in C++, that's what you'd use. (But you'd also have to get up to speed with COM as the WinRT API is COM based.)
Topic archived. No new replies allowed.