Click here to Skip to main content
15,885,091 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using the following line to get the Status of Windows Defender:

C++
HRESULT WDSTATUS(BOOL * pfEnabled);

How can i use this in a if statement?

What I have tried:

C++
if (WDSTATUS) {

}

if (pfEnabled) {

}
Posted
Updated 8-Sep-22 7:33am

First you have to declare some variables and then you call the function using those variables. Something like this :
C++
HRESULT result;
BOOL enabled;
result = WDStatus( & enabled );
Now you can access the results of the function with your conditional statements. Note that you don't use the function itself in the if statement. You need to use the result that is returned by the function.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900