Thursday, April 2, 2026

Project templates in Visual Studio 2022

After configuring C and C++ projects countless times, base on these settings, I finally bit the bullet and created a reusable template in Visual Studio 2022. And it’s surprisingly simple: create the project and then go Project → Export Template.

The project name itself can be used inside files with $safeprojectname$ string. In order to have it replaced even inside .rc files, edit the .vstemplate and add:

<TemplateContent>
  <Project TargetFileName="ayylmao.vcxproj" File="ayylmao.vcxproj" ReplaceParameters="true">
    <ProjectItem ReplaceParameters="true">RES\$safeprojectname$.rc</ProjectItem>
  </Project>
</TemplateContent>

There’s no GUI for deleting a template, though. One must manually remove the zip files from two different locations:

  • Documents \ My Exported Templates
  • Documents \ Templates \ Project Templates

To restore a template, simply copy the zip back to:

  • Documents \ Templates \ Project Templates

Sunday, February 15, 2026

The Rust doc_cfg fiasco

In WinSafe, Cargo features are used extensively to gate the DLL modules which are currently implemented. This is good because you specify only the modules you need, reducing your compiler effort. The Rust documentation doc_auto_cfg unstable feature was extemely useful, applying tags on each entity specifying the required feature for it.

Then, at some point of October 2025, doc_auto_cfg was merged into doc_cfg. And it’s now completely broken.

I filled an issue at the official repo. I’m not the only one missing that feature, but no one seems to care. This is so demotivating I stopped WinSafe development completely.

I found a workaround by pinning the compiler version using rust-toolchain.toml, along with the last version where doc_auto_cfg works, which I painfully found out:

[toolchain]
channel = "nightly-2025-09-27"
components = ["rust-docs"]
targets = ["x86_64-pc-windows-msvc"]

With the above file, the command line to generate the docs is:

RUSTDOCFLAGS="--cfg docsrs" cargo doc --all-features

Or even better, directly specify the toolchain the command line:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly-2025-09-27 doc --all-features

This compiler has the 1.92.0-nightly version, and it seems I’m gonna using for a long time.

Friday, November 21, 2025

Windows 10 SDK 10.0.20348.0 is gone

I was caught by surprise today after updating Visual Studio 2022 to version 17.14.11. All my projects failed to compile, because the SDK files disappeared. I first thought something broke with VS Code support, but then I saw that Visual Studio itself had the same problem.

Turns out the Windows SDK I was using – 10.0.20348.0 – was simply deprecated and removed in this update, according to here, and the release note itself. Indeed, Visual Studio Installer won’t show it anymore.

Apparently, now I’ll have to install a Windows 11 SDK, even if I’m running Windows 10. I hope this doesn’t break my stuff.

Wednesday, November 5, 2025

Non-movable and non-copyable C++20 classes

On my fantastic journey implementing WinLamb v2, I’m diving deep into C++20, grasping a lot of concepts I never understood before, and having a lot of fun along the way.

One of the things that I implemented was the idea of non-copyable and non-movable classes, at first, using macros. This felt inelegant, so I implemented P2895 paper with utility classes. It ultimately failed with the nested ListView classes, so I discarded the idea too.

My final solution was to = delete move constructor, which will prevent all copy and move. The hard rules are not particularly easy to memorize, so I’ll let them here for further reference:

  1. The two copy operations are independent. Declaring copy constructor does not prevent compiler to generate copy assignment and vice versa. (Same as in C++98.)
  2. Move operations are not independent. Declaring either one of them prevents the compiler to generate the other. (Different from copy operations.)
  3. If any of the copy operations is declared, then none of the move operations will be generated.
  4. If any of the move operations is declared, then none of the copy operations will be generated.
  5. If a destructor is declared, then none of the move operations will be generated. Copy operations are still generated for reverse compatibility with C++98.
  6. Default constructor generated only when no constructor is declared. (Same as in C++98.)

Example:

class Foo {
private:
	Foo(Foo&&) = delete; // non-copyable, non-movable
};

Friday, October 24, 2025

Ibanez Wizard profile history

Since I’m on the market for a “battle” RG guitar to play with bands, I reminded a change that happened to the fretboard width of Wizard necks, from 56 to 58mm. According to Rich, it happened back in 2005.

Digging a bit more, I found more information about the Wizard neck profile history, which I compiled in the table below:

Neck Width Thick Radius
Original Wizard 43/57mm 17/20mm 17"
Pre-2005
Super Wizard 43/56mm 17/19mm 17"
Wizard 43/56mm 18/20mm 17"
Post-2005
Super Wizard 43/58mm 17/19mm 17"
Wizard 43/58mm 18/20mm 17"

Monday, October 20, 2025

Using VSCode for C++ projects

For a long time I thought I only could use Visual Studio to write C++ programs on Windows, because MSVC toolchain requires some particular initializations before being able to run.

Turns out there is a way to smoothly run all the MSVC machinery from within VSCode. The answer is the same I found last year in automating MSVC builds: we need a .bat file to call MSVC’s own .bat, then we invoke VSCode executable right after.

call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
"C:\apps-portable\VS Code\Code.exe"

Save this .bat somewhere, and put a shortcut to it in your start menu, naming it “VSCode MSVC” or something like that.

To my surprise, multiple things work better in VSCode than in Visual Studio itself:

  • file navigation;
  • file creation and deletion;
  • code and comment folding;
  • keyboard shortcuts;
  • error reporting – VSCode highlights in red the files with errors, while in Visual Studio I have to build the project and look at the output to see which files are broken.

Monday, October 13, 2025

Perfect non-locking string winding

While searching my future Ibanez RG Prestige, I found this StewMac video of how to properly wind the strings around the tuning machines:

I remember having seen this technique before, but this time I’m keeping the reference.