I'm looking for a Windows (pure DLGTEMPLATE output no .net resources!) dialog template editor (as a library or component) that can be used to modify or/and create new dialog templates for DialogBoxIndirect() function.
Use the Windows resource editor (part of Visual Studio) to create your dialog, then you can simply load the dialog resource to show the dialog.
You could also write some utility that reads the generated resource dialog and generate the DLGTEMPLATE data for it (I don't think it's that hard).
Related
JUCE's Projucer has integrated GUI Editor.
How can I use the GUI Editor to create GUI during Audio Plugin project creation?
You have to:
Select NewComponent.cpp (assuming you created is using "Add new GUI Component")
Switch tabs (for example between Class and Subcomponents).
After these steps the "Add new component" functions become active.
I suspect that this is a bug in Projucer.
I want to make an application in Visual C++ 2012 using MFC frameworks using Document/View structure; I want edit my view (that is the main window) with an editor, not handcoding, but Visual Studio seems that can edit in WYSIWYG mode just dialog boxes; I don't want to make a 'dialog based application', I want to make a Document/View application and edit my View with an editor WYSIWYG; Any solution?
You need to use CFormView as a base class when you creating your MFC application.
If you already have a project, then add a new form using the class wizard. Select CFormView as a base class.
When you open Resource View your new form will be listed in "Dialog" folder
In the last step of the wizard that creates a new document/view application, change the view base class from CView to CFormView. When you do that the CFormView can be edited just like a dialog.
MFC based apps have a WYSIWYG editor. Open the Resource Files folder of your dialog, SDI or MDI project and then open the .rc file. Menus and a toolbox should open up ready for editing.
I have a C/C++ algorithm that I want to create a GUI application for. I would prefer a .exe application that I can pass around to people. I would preferably want to create a dll of my c/c++ algorithm and then bundle it into the Windows GUI application which is basically just a wrapper around the main c/c++ application. How can I create this GUI in VC++ all with a couple of buttons, a text box and a file chooser/browser/opener?
Can someone throw some light on this problem?
Thanks,
Abhishek
There's a number of different options. First we have the microsoft-supported libraries:
MFC - The most heavy-weight library for the windows api.
ATL - A somewhat smaller, lightweight library.
Windows API - Use the Windows API directly.
Beyond that there's a number of third party GUI toolkits, notably:
GTK+
WxWidgets
If you want to make it as small as compact as possible and avoid external DLLs, you should use the Windows API directly or possibly ATL. This also gives you additional flexibility, but it's a bit more complicated. Take a look at for example theForger's tutorial. It's a bit old, but the api has remained more or less the same for the last ten years anyway.
Here's some additional pointers for using the API directly:
What is usually known as controls is called "windows" and are created using CreateWindowEx(). This function creates different things depending on the specified "window class", such as edit, button and static (described below). You create a regular window by registering a custom class.
You can use a function called GetOpenFileName() to invoke an open dialog.
The common text box is known as the edit control in the API.
Buttons are simply called button controls.
Labels are called static controls.
If it's enough for your purposes, you can also create a dialog window using CreateDialog(). This is possibly a bit easier, since dialogs can be designed using the resource editor, while you have to create all the controls in a regular window programmatically.
In Visual Studio:
File -> New Project
In the left panel choose "Visual C++" (or C# if you prefer) and in the right panel choose Windows Forms Application. Click Ok.
When your project is created, in the Toolbox panel you can find Button, Edit Box, OpenFileDialogs and SaveFileDialogs (which you need). If you can't find Toolbox panel, you can enable it in View->Toolbox menu.
Place the controls you need on the program window as you wish by simply dragging them over.
I would like to create menu item in windows explorer content menu (for all file types) which after click will open my application and pass the selected file name to it. Is there any tutorial for this ? I know there is ShellPlus component available but it's a bit outdated.
Registry
This method is easy since it comes down to adding some registry keys. The downside is that you can't put any logic in it. You can read about it here and here a simple example in Delphi. You get a bit more control if you are using DDE to execute the menu items. See here for a Delphi example.
Shell Extension
This method is a bit more work, but you can completely control the context menu from code. You would have to write a DLL, implement IContextMenu (or others) and register the dll with Windows Explorer. You can read about it here. You already mentioned Shell+.
Delphi includes a demo project for shell extensions. Look in the Demos\ActiveX\ShellExt folder.
This is possible independendly from the programming language by setting up shortcut menu handlers for the desired filetype(s) in the registry. There you can call your application with the correct path, the correct options and the right file-placeholders.
See the MSDN article on Creating Shortcut Menu Handlers for more detailled information.
I'm trying to create an About box for my Windows C++ application. In Visual Studio 2008, I'm using the dialog editor to design the dialog. I want the About box to display the application's version in a static label.
I can hardcode the version into the dialog, stored in a .rc file, but then I'll have to remember to update the version in multiple places.
My application version is #defined in version.h as APPLICATION_VERSION. The resource editor can be convinced to put
#include "version.h"
at the top of the .rc file, so I have access to the APPLICATION_VERSION symbol.
However, I cannot use this symbol from the dialog editor. I can edit the .rc file by hand, replacing the hardcoded version string by the symbol APPLICATION_VERSION. That works fine until I edit the dialog in the dialog editor again: upon saving the .rc from the dialog editor, the symbol gets overwritten with its current value.
Of course, I can set the version label to some dummy text, overriding that text when I receive WM_INITDIALOG, but that feels very clunky and unnecessary. Is there any other workaround that allows me to keep the application version in a single place?
The way I do this is to put the resource in a separate file with a .rc2 extension, and #include that into the .rc file (like you're doing with your version.h). I then edit the .rc2 files with a normal text editor, not the Visual Studio resource editor.
That system's not too bad for VERSIONINFO resources, which is what I use it for, but I can see it would be more of a pain for dialog resources. I'd love to hear of a better way, but I don't know of one.