Beep function not working (I do not have administrative access).
Also, I get an error of ERROR_MOD_NOT_FOUND.
Any reasons why?
1 2 3 4 5 6 7 8 9 10
#include <windows.h>
#include <cstdio>
int main(void)
{
printf("Beeping!");
printf("\nAny Beep errors?\n%d",Beep(250,1000)); // Returns 1, which means there is something up.
printf("\nAny errors?\n%d",GetLastError()); // Returns 126 (Specific Module could not be found.)
return(0);
}
Edit: Apparently, Beep returns 1 regardless of success (http://www.autoitscript.com/autoit3/docs/functions/Beep.htm).
@usandfriends
Your code works for me so I don't think that is the problem. Also MSDN lists the return value as zero on failure and non-zero on success, I'm not sure how accurate the link you posted is. From googling the error code it looks like it's mostly "thrown" when loading a library fails, maybe check the libs you use are valid?