SiddiqSoft.acw32h 2.7.2

dotnet add package SiddiqSoft.acw32h --version 2.7.2
NuGet\Install-Package SiddiqSoft.acw32h -Version 2.7.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SiddiqSoft.acw32h" Version="2.7.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.acw32h --version 2.7.2
#r "nuget: SiddiqSoft.acw32h, 2.7.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SiddiqSoft.acw32h as a Cake Addin
#addin nuget:?package=SiddiqSoft.acw32h&version=2.7.2

// Install SiddiqSoft.acw32h as a Cake Tool
#tool nuget:?package=SiddiqSoft.acw32h&version=2.7.2

Auto Closing/Releasing Win32 Handle Objects

CodeQL Build Status alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Objective

Make it easy to track the Win32 HANDLE and HINTERNET objects while keeping their use as drop-in replacement for their respective HANDLE or HINTERNET objects. Use only when you're holding objects that your application is required to close/release.

Requirements

  • C++17
  • Useful for Windows projects

Usage

  • Use the nuget SiddiqSoft.acw32h
  • Be sure to use the proper class ACW32HANDLE or ACW32HINTERNET. The underlying types of HANDLE and HINTERNET end up the same so it is not possible to template them into a single class.
  • Make sure to include the relevant file for your case: acw32handle.hpp or acw32hinternet.hpp as windows headers occasionally have peculiar ordering (notably when WinHTTP, WinINET, WinSock are in the mix).

Example (when using nuget to add the header in the solution)

#include <windows.h>
#include "siddiqsoft/acw32handle.hpp"
#include <winhttp.h>
#include "siddiqsoft/acw32hinternet.hpp"

void foo()
{
   // Use the object
   siddiqsoft::ACW32HANDLE h( ::CreateFileA(...) );

   // or
   HANDLE mh = ::CreateFile(.....);
   // A std::move is required since the implementation requires
   // the transfer of ownership in order to close the handle.
   ACW32HANDLE myHandle( std::move(mh) );

   // C++ will cleanup the handle if it was properly allocated!
}

<small align="right">

© 2021 Siddiq Software LLC. All rights reserved. Refer to LICENSE.

</small>

Product Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SiddiqSoft.acw32h:

Package Downloads
SiddiqSoft.restcl

Focussed REST Client for modern C++

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.7.2 452 6/1/2022
2.7.1 672 11/20/2021
2.7.0 11,634 9/10/2021