How i get the relevant logs when the WiFi Direct API return Fail

Xiaojie Ma 0 Reputation points
2024-02-01T09:06:20.2633333+00:00

I use following code to settup a wifi p2p connection after DeviceWatcher added, but sometimes the wfdDevices is nullptr, i don't know why, and how can i get relevant log in windows?

         WiFiDirectDevice wfdDevice = nullptr;
        try
        {
            wfdDevice = WiFiDirectDevice::FromIdAsync(deviceInfo.Id()).get();
        }
        catch (hresult_error const& ex)
        {
             return;
        }
Windows Network
Windows Network
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Network: A group of devices that communicate either wirelessly or via a physical connection.
696 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,787 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Hania Lian 10,446 Reputation points Microsoft Vendor
    2024-02-05T07:00:30.0433333+00:00

    Hello, Thank you for posting in Q&A forum. From Windows aspects there's very few insights, to further figure this issue, you will need to enable the logging by code. Insert logging statements to track the flow of your code and to print related information. You can use the OutputDebugString function to output messages to the debugger and further check it. Best Regards,
    Hania Lian

    ---If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Xiaojie Ma 0 Reputation points
    2024-06-04T05:42:57.96+00:00

    Hi,

    I need to get the log of microsoft so that i can know why the api return fail, not the log of my app.
    
    0 comments No comments