First column text disappears in CListCtrl with editable subitems (MFC) - c++

In my MFC dialog-based application, I'm using a subclassed CListCtrl that allows in-place modification of its subitems. I accomplished this with the great help of tips from here:
http://www.codeguru.com/cpp/controls/listview/editingitemsandsubitem/article.php/c4175/Simplified-Subitem-Editing.htm
This solution worked really great until recently when I wanted to give my application a more modern look by introducing a manifest file.
The problem I'm having now is that it behaves as expected only when I build with "/MANIFEST:NO" (project property: "Generate Manifest: No") linker option.
If I change that option to "/MANIFEST" (project property: "Generate Manifest: Yes"), the text from the first column disappears.
I've tried playing with the code to find the part that draws/clears the item's first column area - with no luck.
I've also made the project to generate the manifest as external file too. The behavior was the same and with the same generated executable it was depending on the presence of "manifest" file.
Below are 2 screenshots of the same app, built with manifest and without - the difference is clearly visible:
without manifest file created - all is fine:
with manifest created - dialog looks more modern but the "Name" text is gone:
In addition I've created a solution to demonstrate the problem:
clistctrl_problem.zip
I'd appreciate if anyone could provide a solution to this strange behavior.
I'm working with Visual Studio 2013, Version 12.0.40629.00 Update 5. Because of that "mfc120.dll" is used.

Related

How to use VS Code C/C++ configurations properly?

I am new to VS Code and, coming from VS, I'm struggling to understand how to set up different configurations using the Microsoft C/C++ extension. I followed the documentation, but it seems to me that the content in c_cpp_properties.json is only affecting Intellisense and has no correlation to the actual build, which is set up in tasks.json. The configurations I enter are showing up and selectable at the lower right of the editor window: Intellisense reflects this by apparent knowledge about include folders, etc. However, when I build or run, they don't have any effect, I get errors such as "No such file or directory" for included files. As far as I see it, this is not mentioned in the documentation at all.
How can I make use of the actual selected configuration for the build system?

Visual Studio 2015 doesn't open saved projects

I'm just starting off with VS (2015 version) (C++ in general) and, knowing my luck, I immediately stumble upon an issue: VS 2015 doesn't open saved projects. I believe that it loads them up but doesn't bother to view them. I can't really describe it in words so I'll post a GIF. Any and all help would be appreciated.
A more detailed GIF
On the right side of your screen there should be a vertical tab called "Solution Explorer".
Clicking on it reveals your solution, its projects, and all the files associated with it. From there you should be able to find the files.
If you still can't find the files, it is likely that you didn't include them. You can add them to a directory in "Solution Explorer" by Right-clicking -> Add -> New Item -> C++ File
This happens when you close every tab in your project, and because VS saves the state of your tabs, when you reopen the project, they are all closed.
Also note that by default, when creating a whole new project, there are no files to open, so the screen will also be empty.
You can also use the shortcut key to show the solution explorer. Ctrl-Alt-L by default I believe.

Why are buttons when not using wxSmith flat?

I'm new to wxWidgets. I'm using Code::Blocks (MSW compiler), version wxWidgets-3.0.2 on Windows 7.
I started learning this, but I got stuck when I found out that I couldn't develop a good looking wxButton when I write the codes myself without using wxSmith.
All I get as output are flat wxButtons and toolbars that look like buttons. I thaught it was my fault, then I created a little frame with wxButton in it, then compiled. The output suits my taste.
I copied the exact code for this little frame and created another project file without wxSmith and I pasted them in their corresponding file. When I compile this same code, all I get is a flat wxButton.
If I hover the mouse over it, it won't turn blue as it does in wxSmith compiled code. I also noticed that anything, e.g, toolBars that is likely to be clickable, will look flat, but not menus.
What am I missing?
It seems like you need to add the manifest to your application. The manifest is the thing that describes your application needs to system: what visual style you want to use, which OS are your app compatible with, etc.
The most simple way to do it with wxWidgets is to add a resource file (*.rc) to your project (or if you already have one then edit the one you have) and put this line of code there:
#include "wx/msw/wx.rc"
You may need to change the path to wx.rc file depending on your project settings. File location is:
<wxWidgets directory>\include\wx\msw\wx.rc
wx.rc will include correct manifest based on your build type:
x86 -> "wx/msw/wx.manifest"
x64 -> "wx/msw/amd64.manifest"
ia64 -> "wx/msw/ia64.manifest"
If you don't want to use wxWidgets default manifest files, then you need to:
create a file name your_app_name.exe.manifest (or your_dll_name.dll.manifest) and fill it manually (you can find description of application manifests and an example here: MSDN: Application Manifests (Windows);
place this manifest file in the folder with your executable file (just to be clear, if your app name is MyCoolApp.exe, then manifest must be named MyCoolApp.exe.manifest) or embed manifest into executable with mt.exe tool (mt.exe is shipped with Visual Studio, you can find the tutorial on how to use it to work with manifests here: MSDN: How to: Embed a Manifest Inside a C/C++ Application.

C++ Setting dll properties via .rc file: Which attributes are shown by Windows 7?

I created a dll and set various attributes in the rc file (by following the tutorial here. If I scan the dll with exiftool, I can see all of my attributes. However, Windows 7 displays only certain attributes when I right-click on the dll, select "Properties" and then go to the "Details" tab. I can't figure out which attributes I have to set to change the values Windows 7 shows me.
Cheers
Alex
According to this answer I had to include windows.h, which solved my problem. The page I linked mentions this only in a completely unrelated example and the official Microsoft example code doesn't have the include either, but mentions it hidden in the "Remarks" chapter.

Visual Studio - unsure about exporting projects

I'm new on here, but not a total beginner to programming. I got a book on creating a 2D DirectX game engine so I could expand my programming knowledge, however I am new to C++ and DirectX itself, so I'm afraid I'm a bit clueless on working with multiple project files and headers. I decided to develop my game engine in a proper development environment, so I got VS2013 Professional though the Dreamspark program.
As I said, I haven't worked with something like VS before, so I'm hitting issues with getting my game engine running and I'm not sure what to do. The book said that if I get all my code down correctly (in 3 .cpp source files, 3 headers and 1 main .cpp source file to initialize my engine in a blank game project) the program should compile fine, and it does. The issue is that I only get the resultant .obj files and the project's static library file to appear in my project folder. I don't know what I have to do to get the project to compile the executable needed to actually run this 'blank game' with the engine.
The actual project solution was taken from the disk which came with the book, I wrote my code on top of that solution as my own was causing linker errors. The project properties show that the project is defined as a .lib project, so how is this supposed to work?
I apologize if this is a simple problem, but I'm only used to working with 1 file console applications in C, this is a big jump for me but I'd like to understand how I'm meant to get an .exe created from this project, I would appreciate it if someone could explain to me how this sort of .lib project works. I can post the code if it's necessary, but there's 7 files of it so it's quite long. Thanks!
Solution 1:
As the project contains a main.cpp it looks like it is not meant to be a library-project.
In VS2013 you can switch the type of a project by
In your Solution Explorer (on the left side by default) rightclick onto the project
Select the item Properties from Context Menu (should be on the bottom)
Select the category General
In the section Project Defaults change the Configuration Type to Executable (.exe)
Solution 2:
It could be possible that the executable is stored somewhere else after a successful build. Check what is configured as output directory:
In your Solution Explorer (on the left side by default) rightclick onto the project
Select the item Properties from Context Menu (should be at the bottom)
Select the category General
In section General there should be an Output Directory defined (At the top of the configuration). Per default it should be something like $(SolutionDir)$(Configuration)\
I'm using VS2013 Express, but it should work with Prof too. I'm also using a German edition, hope I translated everything well.