• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1178
  • Last Modified:

SetErrorMode() not supressing GPF Window?

I must not be understanding the full functionality of SetErrorMode. I setup
a small code block to test for your question below and still received a GPF
window. I was expecting that this would supress the GPF window but it
didn't.

    SetErrorMode(SEM_NOGPFAULTERRORBOX);
    SetErrorMode(SEM_FAILCRITICALERRORS);
    char *p=NULL,*q=NULL;
    strcpy(p,q);

Isn't this supposed to supress the GPF window? Is the SetErrorMode() only effective to functions called from my program, not code executing in my program?

Thanks
0
rascal
Asked:
rascal
  • 2
  • 2
1 Solution
 
jkrCommented:
   SetErrorMode(SEM_NOGPFAULTERRORBOX);
    char *p=NULL,*q=NULL;
    strcpy(p,q);

should do it - your 2nd call clears the 'SEM_NOGPFAULTERRORBOX' flag

However,

    SetErrorMode(SEM_NOGPFAULTERRORBOX);
    SetErrorMode(SEM_FAILCRITICALERRORS | SetErrorMode (0));
    char *p=NULL,*q=NULL;
    strcpy(p,q);

should work...
0
 
rascalAuthor Commented:
Adjusted points to 200
0
 
rascalAuthor Commented:
Oh of course!
Well, that's why you're the expert :))

Thanks again!
0
 
jkrCommented:
Fine that it helped!

OK, so I'll 'answer' this ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now