Wednesday, February 5, 2020

DLL basics & CRT distribution & VS building tricks

DLL basics

  1. MSI Custom Action DLL
  2. Regular DLL Tutor For Beginners
  3. Making DLLs easy to build and use
  4. Basic C++ Win32 DLL
  5. How to link DLLs to C++ Projects
  6. Deploying Visual C++ Runtime Files as Private Assemblies
  7. Super Easy DLL
  8. some comments are really good:

    I'm fairly new to C++ and have been trying to follow this example after struggling on my own. But the problem I've got is I can't seem to get Visual Studio to create a .lib file, have you got any suggestions? Because without the .lib I can't link it into my projects... :S

    You will have do the following. 1. Right click on your project on solution explorer and click "Properties". 2. Expand the "Linker" item in the tree. 3. Click on "Input" 4. Type in the name of your def file in the case of this example it would be "EasyDll.def" in the text box beside "Module Definition File". 5. Selection "Release" from the configuration dropdown box at the top left and enter in "EasyDll.def" to make sure that you also are given a .lib file when you compile for release mode too. Cheers,

  9. Create projects easily with private MFC, ATL and CRT assemblies
  10. Change WINVER
  11. Including stdafx.h in a non-default location
  12. Visual Studio Project Converter
  13. A-Utility-to-Convert-VS-NET-2003-Project-Files

Windows 98 basic concepts:: Win32 programming

Windows 98 basic concepts:: Win32 programming

  1. Using Windows: an example to demo a window basic
  2. WinMain function
  3. Windows Data Types
  4. Large Integers

  5. Window Classes: summary and index to all classes and their functions
  6. About Window Classes
  7. Window Class Styles
  8. WNDCLASSEX
  9. Using Window Classes
  10. Window Class Reference
  11. Window Class Functions
  12. WNDCLASSEXA structure
  13. Timers
  14. Window Properties

  15. Window Procedures: summary and indexes
  16. winuser.h header
  17. windowsx.h header
  18. Windows GDI
  19. winbase.h header
  20. Messages and Message Queues
  21. this configuration section has good code snippet to test all these functions and get/set the parameters. good to practice them.

  22. Configuration
  23. GetSystemMetrics function
  24. SystemParametersInfoA function
  25. GetSysColor function
  26. SetSysColors function
  27. WINDOWINFO structure
  28. WINDOWPLACEMENT structure
  29. WINDOWPOS structure
  30. WNDCLASSA structure
  31. WNDCLASSEXW structure
  32. WNDCLASSEXA structure
  33. WNDCLASSW structure

Monday, February 3, 2020

exception handling in C++

tips on fixing compilation error of temp file cleaning tool

tips on fixing compilation error of temp file cleaning tool

Error D8016 '/ZI' and '/Gy-' command-line options are incompatible DirClean C:\Demo\dirclean\cl

Note: If you get the error “ Command line error D8016: '/ZI' and '/Gy-' command-line options are incompatible” -

Solution 1 : Use “Release” mode

Solution 2 : Go to “Project”>”Properties”>”C/C++”>”General” and replace the “Debug Information Format” from “/Zl” to “/Zi”

  1. Note if you get the error command line error d8016 zi
  2. Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
  3. Build failed with D8016 'ZI' and '/Gy-' command-line options are incompatible message
  4. Error_D8016_'/ZI' and '/Gy-' command-line options are incompatible

issue:: Error C1189 #error: MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header. DirClean c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\atlmfc\include\afxv_w32.h 40

  1. MFC does not support WINVER less than 0x0501
  2. Converting Projects from VC++ 6.0 to Visual Studio 2005

Error C1083 Cannot open include file: 'atlimpl.cpp': No such file or directory DirClean c:\demo\dirclean\stdafx.cpp 34

the answer is: in my case: remove atlimp.h from stdafx.cpp file.

NeoKenshinX wrote: I'm migrating a VS 6.0 C++ project to VS 2010. The compiler tells me to remove following files:

statreg.cpp is obsolete. Please remove it from your project. atlimpl.cpp is obsolete. Please remove it from your project.

How can I remove these files (they are in the "External Dependencies" folder)?

They are #included in stdafx.cpp, if I recall correctly (or is it stdafx.h? ) And why is it necessary to remove them?

It's not necessary, but if you don't, you'll see this annoying warning every time you build. If you look at these files, they consist of nothing but #pragma message "statreg.cpp is obsolete. Please remove it from your project."

  1. statreg.cpp, atlimpl.cpp is obsolete
  2. error C1083:cannot open include file: 'atlimpl cpp': No such file or directory
  3. Cannot open include file with Visual Studio
  4. Error 102 error C1083 : Cannot open include file: 'atlimpl.cpp': No such file or directory
  5. Error 102 error C1083 : Cannot open include file: 'atlimpl.cpp': No such file or directory

issue is:

Error C2316 'CMemoryException': cannot be caught as the destructor and/or copy constructor are inaccessible or deleted DirClean c:\demo\dirclean\cshellfileop.cpp 82

  1. why does the below code compile successfully in VS2010?
  2. Compiler Error C2316
  3. Visual Studio Context Menu Shortcut

clipboard topics in VC

clipboard topics in VC. it will be used in my .NET version check project.

the first two articles are very useful and need to test their code and get good grasp on them.

  1. Clipboard little helper
  2. Using the Clipboard, Part I: Transferring Simple Text
  3. Clipboard backup (Visual C++)
  4. SmartClip - A Clipboard enhancement utility
  5. All You Ever Wanted to Know About the Clipboard...
  6. ClipSpy
  7. The Complete Idiot's Guide to Writing Shell Extensions - Part I
  8. The Complete Guide to C++ Strings, Part I - Win32 Character Encodings
  9. The Complete Guide to C++ Strings, Part II - String Wrapper Classes
  10. A Handy Debugging Macro for Switch Statements
  11. An Advanced Windows Hotfix Manager
  12. A Utility to Clean Up Compiler Temp Files
  13. CShellFileOp - Wrapper for SHFileOperation
  14. SHFileOperationA function
  15. What is the Win32 API function to use to delete a folder?
  16. Copy, Move, Delete Files and Folders Using SHFileOperation
  17. SHFILEOPSTRUCT and the SHFileOperation
  18. How to Implement Drag and Drop Between Your Program and Explorer

Saturday, February 1, 2020

time issues in Win32 MFC programming

time issues in Win32 MFC programming. one issue is:

Severity Code Description Project File Line Suppression State Error C2660 'ATL::CTime::GetLocalTm': function does not take 0 arguments Message5 c:\demo\message5\message5\message5.cpp 64

  1. A problem with ATL::CTime.GetLocalTm()
  2. this post gives two ways to resolve the issue

  3. CTime Class
  4. how to remove warning C4996 with gmtime and asctime
  5. This function or variable may be unsafe visual studio
  6. Date and Time in C++
  7. Developing MMC Snap-ins
  8. what is the error of this code?
  9. how to solve this error?