Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Finalize Thread Pool on Program ExitIf your code is calling asynchronous Chilkat methods (i.e. methods having names ending with "Async"), then it's a good idea to call the FinalizeThreadPool when your program is about to exit. It's best if all asynch methods have cleanly finished prior to calling FinalizeThreadPool. If any asynchronous methods are in progress when FinalizeThreadPool is called, they will be aborted and the threads shutdown.
#include <CkGlobal.h> void ChilkatSample(void) { CkString strOut; // Asynchronous Chilkat methods are run in background threads managed // by a thread pool manager thread, which is also a background thread. // Prior to exiting, it is good practice to ensure all asynchronous methods // have completed or are aborted/cancelled, and that the thread pool manager // thread is also shutdown. // // The FinalizeThreadPool method should be called just before the application exits // to ensure all background threads, including the thread pool manager thread, are // cleanly shutdown. // This is how to do it: CkGlobal glob; glob.FinalizeThreadPool(); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.