Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6128069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:35:06+00:00 2026-05-23T16:35:06+00:00

What can i do with the error: 997 (io pending) when invoking: RegisterEventSource? Thanks

  • 0

What can i do with the error: 997 (io pending) when invoking: RegisterEventSource?

Thanks for help!

procedure TForm1.Button111Click(Sender: TObject);
var
  StringToAdd: String;
  hEventLog: THandle;
  p: PChar;
  EventID: Word;
  CategoryID: Word;
  wynik: Boolean;
  errnumber: cardinal;
begin
  hEventLog := RegisterEventSource(nil, PChar('app'));

  errnumber := 0;
  errnumber := GetLastError();  //<==997
  showmessage (IntToStr(errnumber));

  if hEventLog > 0 then
  begin
    p := PChar('Test');
    wynik :=
    ReportEvent(
    hEventLog,
    EVENTLOG_INFORMATION_TYPE, // Event Type
    22, // Event Category ID
    500, // Event ID
    nil, // User SID (optional)
    1, // Number of strings
    0, // Size of Binary Data
    @p, // String to be merged with Text in Ressource DLL 
    nil // Address of Binary Data
    );
    errnumber := GetLastError(); //<==997
    showmessage (IntToStr(errnumber));

    DeRegisterEventSource(hEventLog);
  end;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:35:06+00:00Added an answer on May 23, 2026 at 4:35 pm

    You aren’t testing whether or not hEventLog is NULL before calling GetLastError. You should only call GetLastError if the API call failed, as described in the documentation.

    My guess is that RegisterEventSource actually succeeds and you are getting the error code from the failure of another API call that happened earlier in the execution of your program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error: Can't locate Foo.pm in @INC Is there an easier way
Usign the NSString class method stringWithContentsOfFile:encoding:error I can: NSError *error; NSString *fileContent = [NSString
I can't convert ds.Tables[1].Rows[0].ToString() to an int. ds.Tables[1].Rows[0] = 100; Gives an error can't
One of our applications is started suddenly terminate with error Can't load file or
hi im new to c# and was trying to code but getting error can
Why am I getting the following error in my code? Fatal error: Can't use
I am running my Android application but Open 3GLES shows some error can you
my app is getting force close randomly. And every time error can not be
I am using ruby 1.9.2 and sinatra 1.3.2, Datamapper I get error: can't convert
This code returns an error: AttributeError: can't set attribute This is really a pity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.