Reading the computer's serial number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|using namespace winrt::Windows::System::Profile::SystemManufacturers;|
|printf("Serial number = %ls\n", SmbiosInformation::SerialNumber().c_str());|
Jan 9, 2018
The first two includes in Raymond's code where especially troublesome :)
Jan 11, 2018
Out of sheer curiosity ... why the
printf ? AFAIK in no code of yours, you use
Jan 12, 2018
Mainly personal preference. Both are problematic in different ways.
printf is always faster and often more concise.
Jan 18, 2018
True indeed. Although
printf() with a lot of arguments is tedious to get right, but then those examples are rare.
Jun 4, 2018
Nov 17, 2020
Question: Why do you omit the
winrt::init_apartment(); ... winrt::clear_factory_cache(); winrt::uninit_apartment();
or more importantly, why does he include them?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This example was inspired by Raymond Chen's post.