Tuesday, March 17, 2020
Sunday, March 15, 2020
MFC message mapping
MFC message mapping
- Message Map Macros (MFC)
- About Messages and Message Queues
- Message Maps (MFC)
- Message Map Macros (MFC)
- CWnd Class
- Module 2: Getting Started with Visual C++ 6.0 AppWizard 1
- Module 2: Getting Started with Visual C++ 6.0 AppWizard 2
- Windows Message Handling - Part 1
- Windows Message Handling - Part 2
- Message Management
- Message Cracker Wizard for Win32 SDK Developers
Provides the base functionality of all window classes in the Microsoft Foundation Class Library.
Saturday, March 14, 2020
Error: RC2135 file not found: 0 PropertySheet C:\Demo\PropertySheet\PropertySheet\Prop.rc 97
when I compile PropertySheet Dialog resource file, I got this error:
Error RC2135 file not found: 0 PropertySheet C:\Demo\PropertySheet\PropertySheet\Prop.rc 97
- RC2135 file not found error
- Error RC 2135 file not found
- RC2135 file not found after edit resource.
- compile error 1>ReClassEx.rc(1): error RC2135: file not found: Visual #53
- Resource Compiler Error RC2104
- error RC2247: Symbol name too long (winnt.h)
- VS2008 resource view crashes with RC2247 when prsht.h included as a resource include.
- RC2247 : Cannot open Rc file : Resource explorer cannot load resource ; Load failed
- VS2008 resource view crashes with RC2247 when prsht.h included as a resource include.
- error RC2247: Symbol name too long (winnt.h)
- Resource Compiler error RC2247 SYMBOL name too long
- Migrating old project to VS2008 - resource file errors
- Upgraded to Visual Studio 2010
- windows - RC2247 : Cannot open Rc file : Resource explorer cannot load resource ; Load failed -
- 【Visual Studio】【两种方法解决】error rc2247: SYMBOL name too long
- 汉字的Unicode范围
- 打开rc文件时出现“SYMBOL name too long”错误
- [Windows] VS打开资源文件(.rc)时显示 error RC2247 : SYMBOL name too long
- EU-can-code
- error RC2247 : SYMBOL name too long[ZHUAN]
Error RC2104: undefined keyword or key name: LISTBOX1 PropertySheet C:\Demo\PropertySheet\PropertySheet\Prop.rc 107
error RC2247: Symbol name too long (winnt.h)
my case is : I should have LISTBOX in .rc definition file, but I put LISTBOX1 instead.
this trick worth a further look:
#define apstudio_hidden_symbols
#include "windows.h"
#include "prsht.h"
#undef apstudio_hidden_symbols
smallest circle topics
smallest circle topics
- Coding Challenge: Smallest Circle Problem
- Visual Studio Custom Tools - Make It Smarter
- Demo Data
- Color Scheme Selector
- VSMinifier2013Plus
- Implementing ICustomFormatter in C#
When you are about to present an application/feature to a potential customer or future user, the data you are using is very important. Missing details, too few records, repetitive info or gibberish can create bad impression. Wrong display can ruin all your effort you put into your code, after all what people see is the surface...
In this article you will see a tool, that I used to randomize usable data...
Sunday, March 8, 2020
How To deliver MFC application?
How To deliver MFC application?
under my Laptop Alpha, I find all MFC dll under this folder: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86
there are two DLLs:mfc140u.dll and mfcm140u.dll.
- Determining Which DLLs to Redistribute
- Redistributing the MFC Library
- Redistributing Visual C++ Files
- MFC Library Versions
- Redistributing the MFC Library
- Regular DLL using: MFC Shared vs MFC statically linked
- Migrating Projects Created with Visual Studio Versions Earlier than 2010
- 20.7. Use MFC in static library or use MFC in shared DLL?
- Create projects easily with private MFC, ATL and CRT assemblies
- Threads with MFC
- Unicode, MBCS and Generic text mappings
- An MFC Curve Control
- MFC under the hood
- Deploying Controls to VS.NET ToolBox Programatically
- Deployment Examples
- Deploying Native Desktop Applications (Visual C++)
vcruntimeversion.dll: Runtime Library for native code. Applications that use the normal C and C++ language startup and termination services.
mfcversion.dll : Microsoft Foundation Classes (MFC) Library. Applications that use the MFC Library.
mfcversionu.dll: MFC Library with Unicode support. Applications that use the MFC Library and require Unicode support.
To deploy redistributable Visual C++ files, you can use the Visual C++ Redistributable Packages (VCRedist_x86.exe, VCRedist_x64.exe, or VCRedist_arm.exe) that are included in Visual Studio. In Visual Studio 2017, these files can be found in the Program Files[ (x86)]\Microsoft Visual Studio\2017\edition\VC\Redist\MSVC\lib-version folder, where edition is the Visual Studio edition installed, and lib-version is the version of the libraries to redistribute.
In Visual Studio 2015, these files can be found under your Visual Studio installation directory in Program Files [(x86)]\Microsoft Visual Studio version\VC\redist\locale\.
Another option is to use redistributable merge modules (.msm files), which in Visual Studio 2017 can be found in the Program Files [(x86)]\Microsoft Visual Studio\2017\edition\VC\Redist\MSVC\lib-version\MergeModules\ folder. In Visual Studio 2015 these can be found in Program Files [(x86)]\Common Files\Merge Modules\.
It's also possible to directly install redistributable Visual C++ DLLs in the application local folder, which is the folder that contains your executable application file. For servicing reasons, we do not recommend that you use this installation location.
Saturday, March 7, 2020
Layout manager research topics-C++ related
- Persistence of Window State and Appearance for .NET Applications
- Layout Manager for Dialogs, Formviews, DialogBars and PropertyPages
- MFC/C++ Helper Class for Window Resizing
- WPF content model and layout
- WPF Layouts - A Visual Quick Start
- The Ultimate Toolbox Layout Manager
- FreeLayout: A New Java Layout
- BoxPlanner - Simple Layout Algorithm
- Fun with Physics: Implementing a Physics based layout manager
- Sharp Layout
- I do not find the atlapp.h file in the installation any place!
- A Few Classes to Work With Date, Time, Datetime and Timezone Data
- Fun with Physics: Implementing a Physics based layout manager
- Designing the Layout of Windows Forms using a TableLayoutPanel, with auto-expand panels
- Creating a wizard layout using C#
- Sequential Structure Layout For Speed
- Part I: Unifying Web and Windows Form design and layout
- Marc Clifton on GitHub
- Part II: Web & Window Form Unification: Synchronous And Asynchronous Event Handling For Controls Created At Runtime
- Persistence of Window State and Appearance for .NET Applications
- Layout Persistence for your Forms including all of their subcontrols
- SolidWidgets Layout Manager Tutorial - Part 1
- EvaLayout, Lay It Be!
- Control Positioning and Sizing using a C++ Helper Class
- FlowPanel
- Windows Ribbon for WinForms, Part 21 – SizeDefinition
- Visual Studio IDE like Dock Container - Second Version
- Visual Studio IDE like Dock Container
- AutoLayout and UILabel Don't Get Along
- Dockable CAB Workspaces
- Ruler Control
- A Professional Ribbon You Will Use (Now with orb!)
- MultisplitContainer - A FlowlayoutPanel Providing Sizeable Contents
- ListView Layout Manager
- WPF Layout to Layout Transitions
- Customizable Window Layouts
- WPF Tutorial : Layout-Panels-Containers & Layout Transformation
- Planning the form layout in VB.NET
- Layout Manager for Prism v2
- EasySize - Dialog resizing in no time!
- CCreditsCtrl - An advanced About Box
- Moveable Resizable Objects
- X-Window Manager like dragging and resizing of windows
- A Resizable Graphical Rectangle
- Resizing Controls When Resizing Form
- Smooth Resize and Reposition
- Automatic Layout of Resizable Dialog
- Automatic resizing controls
- Runtime Control Resizer
- VB.NET - Dynamically Resize and Reposition All Controls when Form is Resized, Including Font Sizes
- Simple and more powerful resizable dialog
- WTL CPropertySheet as a Resizable View
- Control Resizing on a UserControl in WinForms
- Resize/Reposition the Controls in a Dialog at your Pleasure
- Allow the User to Resize Controls at Runtime
- Resizing Win32 Dialogs with DialogBox() and Dialog Resources
above post deserves more review.
good points in comment section.
windows resizing research
research: windows resizing
Monday, March 2, 2020
MFC CTreeCtrl instructions
MFC CTreeCtrl instructions
when I build a demo project on CTreeCtrl, I added treectrl.h file into .rc resource file. it caused compilation errors:
Error RC2188 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\afxcmn3.inl(502) : warning RC4011: identifier truncated to '_CSTRING_DISABLE_NARROW_WIDE_CO' TreeControl C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlalloc.h 665
ErrorRC2188 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlalloc.h(609) : error RC2188: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlalloc.h(640) : warning RC4011: identifier truncated to '_ATL_USE_WINAPI_FAMILY_DESKTOP_' TreeControl C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlconv.h 22
then I googled and find this post. it gives me a clue:
- Warning RC4011 and error RC2188
- VS Preview 2019 vcruntime.h causes RC4011 warning
- What is this error: invalid preprocessor command 'include_next' ?
I told you in my first reply, you have to check all the headers included by the resource file, some of them cannot be parsed by the resource compiler and the need to be excluded by using #ifndef RC_INVOKED.
You have 2 headers that may cause this problem in your resource file: resacz99.h and widgets.h. One of them must somehow include ATL headers.
Thanks for your hint.
I found an include on one resource file that made use of stdio.h . Removing that dependence, the warning vanished.
then I compiled this project again and ran into another error:
Error RC1004 unexpected end of file found TreeControl C:\Demo\TreeControl\TreeControl\ids.h 21
then I googled and find another wonderful link. tested the solution and it works well. amazing internet!
Full Error Name: Resource Compiler Fatal Error RC1004 unexpected end of file found
To Fix: Be sure to hit enter at the end of the last line in both the resource.h and the resource.rc files.
good research on CTreeCtrl.
- CDeviceTree
- Using CTreeCtrl:: gateway to articles
- Using Tree Controls:: detailed steps
- Tree Control Styles
- Tree-View Control Window Styles
- Tree Control Notification Messages::Mcirosodt Official Message List
- TN061: ON_NOTIFY and WM_NOTIFY Messages
- Module 5b: The Modal Dialog and Windows Common Controls 3
- Thread: CTreeCtrl and DeleteItem notification
- MFC Controls: The Tree Control
- CTreeCtrl Notification Message
- CTreeCtrl, TrackPopupMenu and CCmdTarget
- MFC-- manually call message response function CTreeCtrl
- CTreeCtrl使用演示
- CTreeCtrl使用演示
it lists all notification message designed for this CTreeCtrl control.
it has detailed instructions on mapping message handlers.
the bottom section touched on CTreeCtrl and Notification Message. needs to take a look:
The Tree Control
The list control and the tree control have some things in common: they can both use the same image list, and they share some of the same notification messages. Their methods of identifying items are different, however. The tree control uses an HTREEITEM handle instead of an integer index. To insert an item, you call the InsertItem() member function, but first you must build up a TV_INSERTSTRUCT structure that identifies (among other things) the string, the image list index, and the handle of the parent item (which is null for top-level items). As with list controls, infinite customization possibilities are available for the tree control. For example, you can allow the user to edit items and to insert and delete items.
The WM_NOTIFY Message
The original Windows controls sent their notifications in WM_COMMAND messages. The standard 32-bit wParam and lParam message parameters are not sufficient, however, for the information that a common control needs to send to its parent. Microsoft solved this "bandwidth" problem by defining a new message, WM_NOTIFY. With the WM_NOTIFY message, wParam is the control ID and lParam is a pointer to an NMHDR structure, which is managed by the control. This C structure is defined by the following code:
typedef struct tagNMHDR { HWND hwndFrom; // handle to control sending the message UINT idFrom; // ID of control sending the message UINT code; // control-specific notification code } NMHDR;
Many controls, however, send WM_NOTIFY messages with pointers to structures larger than NMHDR. Those structures contain the three members above plus appended control-specific members. Many tree control notifications, for example, pass a pointer to an NM_TREEVIEW structure that contains TV_ITEM structures, a drag point, and so forth. When ClassWizard maps a WM_NOTIFY message, it generates a pointer to the appropriate structure.
Sunday, March 1, 2020
MFC ClistCtrl topics
MFC ClistCtrl topics
- CListCtrl For Beginners
- Other C++ Sites: good list to take a look
- Creating an MFC Application Without the AppWizard
- Resource Editors (C++)
- CListCtrl and Displaying a Tooltip
- CListCtrl and Cell Navigation
- fatal error CVT1100: duplicate resource. type:MANIFEST, name:1,
- Solve CVT1100: duplicate resource. type:MANIFEST issue in Visual Studio for MFC/C++
- Understanding Manifest Generation for C/C++ Programs
- Custom ToolTips for MFC Projects
- ListControl: on YouTube.com
- MFC Virtual List Control
- MFC Controls: The List Control
- About Tooltip & CListCtrl
- /Clistctrl sample.md on GitHub
- How to add BCGControlBar/BCGSuite for MFC controls to dialogs
- CListCtrl Class
- Using CListCtrl
- MFC - List Control
- Using the List Control
- error Please #define _AFXDLL or do not use /MD[d] occurs even after making changes in Project Properties
- CListCtrl and Grouping Rows
- CListCtrl and Displaying a Tooltip
- CListCtrl and sorting rows
- Searching for a reliable hardware ID
- CListCtrl and sorting rows
- Using the List Control
- TN035: Using Multiple Resource Files and Header Files with Visual C++
- What are the macros in resource.h used for?
- Need understanding of the code
- Localizing resources problem
- Microsoft Visual C++ generated resource script
- fatal error:can not open afxres.h file
- MFC中的Resource.h文件理解
how to open the file in resource view.
I got error when I compiled this project in Visual Studio 2017.
Error CVT1100 duplicate resource. type:MANIFEST, name:1, language:0x0409 ListCtrl_CellNav C:\Users\chris_alpha\Downloads\ListCtrl_CellNav\ListCtrl_CellNav\CVTRES 1
I tested this solution:
This error message shows the given resource was specified more than once. I would suggest you try to set Embed Manifest to No through Project > Properties... > Configuration Properties > Manifest Tools > Input and Output , or try to comment/remove the manifest from .rc file.
another solution: edit .rc file and remove manifest file
I know this is a late response, but I had the same issue. I found that if I removed the manifest.xml or whatever extension from the .RC2 file and explicitly put in under MANIFEST TOOLS> INPUT AND OUTPUT>
Additional Manifest Files: _____ full path \ manifest.xml
Everything works as it should. This applies for Visual Studio 2013.
a good comment needs attention:
The error is often cause by two resources having the same resource ID. i.e. the same source resource (.rc) values in a (downloaded) library as in your main application.
This needs to be fixed by making sure any included resources (from a library) do not conflict with your main program resources. A quick edit of the ID numbers will fix the problem (don't forget to alter the next issue number at bottom to the resource file!),
For our own libraries we ensure they all use different ranges to the main application.
demo steps on how to add these controls into project
Requirements: Header: afxcmn.h
this project is very good example to learn CListCtrl basics. when I compiled this project, I got this errors when I used static MFC library.
Error C1189 #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] ListCtrlDemo c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\atlmfc\include\afx.h 24
my solution is tested the same with this post:
In my experience is a two ways step. suppose You want STATIC linking: a) set "Use MFC in a Static Library" b) add: #define _AFXDLL 1 in stdafx.h works on VS 2012