NDF Diagnostics Example
The following example shows how to launch the NDF user interface and diagnose connectivity to the website https://www.microsoft.com.
#include "ndfapi.h"
NDFHANDLE hNDF;
HRESULT hr = NdfCreateWebIncident (
L"https://www.microsoft.com",
&hNDF);
if(SUCCEEDED(hr))
{
NdfExecuteDiagnosis(hNDF, NULL); // launches the NDF UI
// the UI is not modal to the original window
NdfCloseIncident(hNDF);
}
The NDF UI can be launched as a modal window. To do so, change the second parameter of NdfExecuteDiagnosis from NULL to the handle (HWND) of the parent window.
This example can be modified to diagnose other areas of networking. To do so, replace the NdfCreateWebIncident call with one of the other incident creation functions, such as NdfCreateDNSIncident or NdfCreateWinSockIncident.
Related topics
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for