Sunday, August 23, 2020

threading

research on "SynchronizationContext ";

to use CSemaphore class, we need to include "<"afxmt.h">" header file.

  1. CMutex Class
  2. Represents a "mutex" — a synchronization object that allows one thread mutually exclusive access to a resource.

  3. CEvent Class
  4. Represents an event, which is a synchronization object that enables one thread to notify another that an event has occurred.

    Events are useful when a thread must know when to perform its task. For example, a thread that copies data to a data archive must be notified when new data is available. By using a CEvent object to notify the copy thread when new data is available, the thread can perform its task as soon as possible.

    CEvent objects have two types: manual and automatic.

  5. CCriticalSection Class
  6. Represents a "critical section" — a synchronization object that allows one thread at a time to access a resource or section of code.

    the example is clear. it is good for my file list item retrieval and store it into memory for quick drawing.

  7. CSemaphore Class
  8. An object of class CSemaphore represents a "semaphore" — a synchronization object that allows a limited number of threads in one or more processes to access a Maintains a count of the number of threads currently accessing a specified resource.

  9. SynchronizationContext Class
  10. The .NET Framework's New SynchronizationContext Class
  11. Beginners Guide to Threading in .NET: Part 5 of n
  12. Understanding SynchronizationContext (Part I)
  13. Understanding SynchronizationContext: Part II
  14. Understanding SynchronizationContext: Part III
  15. Understanding the SynchronizationContext in .NET with C#
  16. CRuntimeClass Structure
  17. Each class derived from CObject is associated with a CRuntimeClass structure that you can use to obtain information about an object or its base class at run time.

    the header file is "afx.h"

  18. Logging Using the Composite Pattern
  19. Allow flexiable logging using the Composite design pattern.

  20. Synchronization in Multithreaded Applications with MFC
  21. Introduces synchronization concepts and practices in multithreaded applications

state machine design in C/C++/C#

research "state machine" in cp.com. focus on the first 4 pages. come back later..

  1. State Machine Design in C
  2. State Machine Design in C++
  3. State Machines, in C++
  4. Controlling Multiple Forms with a Finite State Machine gggustafson
  5. A C# Turing Machine
  6. Every computer is equivalent to a Turing Machine, and conversely any Turing Machine can compute anything any other computer can. Perhaps this is one of the more astonishing facts about them: being a really simple machine, a Turing Machine can theoretically, given enough time and resources, run anything you can run on a computer, any algorithm. A small mechanical Turing Machine, such as the one further described, can totally emulate the computer where you are reading this article right now, all the software, operational system etc down to the functionality of the silicon chips. To be more precise, usually Turing Machines are used as basic computational device to which other systems/machines are compare to, so if we say the former is compatible to a Turing Machine, then we mean it has the power to calculate or execute any computable function.

  7. Generic Finite State Machine Revisited
  8. Finite State Machine and Multithreading using .NET
  9. Generic DFA State Machine for .NET
  10. Configuring Simple State Machines
  11. A Simple State Machine
  12. Create loose coupled States using a Finite State Automation (FSM) model.

  13. The State Design Pattern vs. State Machine
  14. How to use the State Design Pattern when compared to State Machines, Switch statements, or If statements.

  15. Configuring Simple State Machines
  16. C++ State Machine with Threads
  17. A .NET State Machine Toolkit - Part I
  18. A .NET State Machine Toolkit - Part II
  19. A .NET State Machine Toolkit - Part III

Saturday, August 22, 2020

Resizable dialog, form, view and document

Resizable dialog, form, view and document

  1. EasySize - Dialog resizing in no time!
  2. Creating a Desktop Application for Converting Audio Files from Each Other
  3. CResizableDialog
  4. ResizableLib
  5. ResizableFormView
  6. CResizableSheet and CResizablePage
  7. CCreditsCtrl - An advanced About Box
  8. A Flat Splitter Window
  9. EasySize - Dialog resizing in no time!
  10. Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
  11. Visual Studio error D8016: '/ZI' and '/O2' command-line options are incompatible
  12. Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
  13. /Gy (Enable Function-Level Linking)
  14. Function-Level Linking (/Gy switch in VC++) - What is it good for?
  15. The Most Underused Compiler Switches in Visual C++: /G and /Gw
  16. Compiler Settings for Microsoft Visual C++ 2005 - 2015
  17. Compiler Settings for Microsoft Visual C++ 2017
  18. Compiler Settings for Microsoft Visual C++ 6.0

MVC pattern in WinForm(C#)

research on MVC pattern in WinForm.

  1. A Practical Use of the MVC Pattern
  2. Introduction to Model View Control (MVC) Pattern using C#
  3. MvC with winform
  4. The Model-View-Controller(MVC) Pattern with C#/WinForms
  5. Understanding Model-View-Controller
  6. Selecting a MVC/MVP Implementation for a Winforms Project
  7. How would you implement MVC in a Windows Forms application?
  8. shane-lab / winforms-mvc

Saturday, August 15, 2020

MFC: Visual Studio Resource Editor Class Wizard doesn't have all control IDs under Member Variables

MFC: Visual Studio Resource Editor Class Wizard doesn't have all control IDs under Member Variables. this post talked about one issue related with my previous note. a control ID is not substantiated. so I can not add any class variable.

  1. MFC: Visual Studio Resource Editor Class Wizard doesn't have all control IDs under Member Variables
  2. Control variable in add member variable wizard is disabled. Why?
  3. Unable to add variable to Edit Control, Error: “object reference not set to an instance of object”
  4. this post confirmed my understanding: need to double click the control to add some default event handler, then add other class memembers.

  5. MFC development in vs2017
  6. Unable to add variable to Edit Control, Error: “object reference not set to an instance of object”
  7. the following answer confirmed my understanding: it is DDE function to be added first..

    Please check whether you have DoDataExchange function added to your dialog class. Once I added this function, I am able to add variable using wizard.

  8. MFC Class Wizard can't add control member variables
  9. TN026: DDX and DDV Routines
  10. TN024: MFC-Defined Messages and Resources
  11. TN025: Document, View, and Frame Creation
  12. TN028: Context-Sensitive Help Support
  13. How to set Company Name and other properties for my DLL file built from Visual Studio 2010 project?
  14. VERSIONINFO resource
  15. What are the various “Build action” settings in Visual Studio project properties and what do they do?
  16. The Clarion Insider
  17. Version resources, part 1: Adding version information to an application
  18. 'Comments' part of VERSIONINFO not displayed
  19. How To Get the Company Name from DLLs or EXE Files
  20. How to set Company Name and other properties for my DLL file built from Visual Studio 2010 project?
  21. Message Compiler (MC.exe)
  22. Using RC (The RC Command Line)
  23. Resource Compiler
  24. Menus and Other Resources::For programming guidance for this technology
  25. Menus and Other Resources
  26. Using the Windows Headers
  27. What is _WIN32_WINNT and how does it work?
  28. Update WINVER and _WIN32_WINNT
  29. When you use the Windows SDK, you can specify which versions of Windows your code can run on. The preprocessor macros WINVER and _WIN32_WINNT specify the minimum operating system version your code supports. Visual Studio and the Microsoft C++ compiler support targeting Windows 7 SP1 and later. Older toolsets include support for Windows XP SP2, Windows Server 2003 SP1, Vista, and Windows Server 2008. Windows 95, Windows 98, Windows ME, Windows NT, and Windows 2000 are unsupported.

    When you upgrade an older project, you may need to update your WINVER or _WIN32_WINNT macros. If they're assigned values for an unsupported version of Windows, you may see compilation errors related to these macros.

  30. This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended
  31. fatal error C1189: #error : _WIN32_WINNT settings conflicts with _WIN32_IE setting
  32. Modify WINVER, _WIN32_WINNT, and _MSC_VER
  33. Windows中一些宏的含义
  34. 修改WINVER、_WIN32_WINNT和_MSC_VER

Saturday, August 8, 2020

Error: catastrophic failure (exception from HRESULT:0x8000FFFF(E_UNEXPECTED))

when I am using Visual Studio 2017 on xps 17 laptop, I am using Class Wizard to add member variable into a MFC SDI demo, I got this error message:

catastrophic failure (exception from HRESULT:0x8000FFFF(E_UNEXPECTED))

I searched internet and I find these links. it gave me some thoughts to fix this error message.

  1. Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
  2. Cycle Clipboard Ring Exception
  3. the solution is one of them: start Visual Stuio as adminstrator. I will try this way and validate it.

    "I am facing exactly the same issue. I have VS 2017 15.5.0 on windows 10."

    I had this error come up fixed it buy running visual studio 2017 as administrator

    the way I started class wizard is from class view in solution folder. then select the form view class->class wizard->cick tab: add memeber variable. this way will cause this error message to throw out.

    my workaroun is to start from resource view->IDD_MYMFC15_FORM class( a class you are interested:). a form is opened. select the edit control I am interested-> right click->select add variable. a new variable will be added into this selected class, as this edit control in this example.

  4. How to: Create a Dialog Box (C++)
  5. Dialog Editor (C++)
  6. Dialog Box Controls (C++)
  7. Menu Editor (C++)
  8. Menu Commands (C++)
  9. String Editor (C++)
  10. Toolbar Editor (C++)
  11. Version Information Editor (C++)
  12. Resource Files (C++)
  13. How to: Create Resources (C++)
  14. How to: Manage Resources (C++)
  15. How to: Include Resources at Compile Time (C++)