I'm trying to get the last windows update check using wuapi. I have the following code:
VARIANT variant;
VariantInit(&variant);
IAutomaticUpdatesResults* pAutomaticUpdatedResults = NULL;
if (pAutomaticUpdatedResults->get_LastSearchSuccessDate(&variant) != S_OK)
throw;
std::cout << variant.date << std::endl;
Understandably I get an exception that pAutomaticUpdatedResults is uninitialized but I'm not sure on the correct way to use the wuapi
You can obtain an
IAutomaticUpdatesResults*fromIAutomaticUpdates2::get_Results.IAutomaticUpdates2is an interface implemented by the AutomaticUpdates coclass.Full sample: