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 7043183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:15:29+00:00 2026-05-28T02:15:29+00:00

In Delphi 2009, synchronize’d functions that worked fine in Delphi 7 execute with sublime

  • 0

In Delphi 2009, synchronize’d functions that worked fine in Delphi 7 execute with sublime slowness until you wiggle the mouse over the open form. Wiggling the mouse causes the program to go into some mouse idle state which does CheckSynchronize(). CheckSynchronize() appears to be called less frequently in Delphi 2009 than in Delphi 7, but we can’t figure out why or where.

Placing this code:

    procedure TMyForm.FormCreate(Sender : TObject)
       Classes.WakeMainThread := WakeMainThread;
    end;

    procedure TMyForm.WakeMainThread(Sender: TObject);
    begin 
      SendMessage(Application.MainForm.Handle, WM_NULL, 0, 0);
    end;

Speeds things along at the normal rate. But I get: EAccessViolation in module rtl120.bpl when the thread dies if it’s used in a modal app (works fine for a simple dialog utility). I’m guessing ‘Classes.WakeMainThread()’ is being called just as much as it is in Delphi 7, but sending WM_NULL to application.handle isn’t accomplishing anything. I guess it’s time to ‘get steppin’.

  • 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-28T02:15:30+00:00Added an answer on May 28, 2026 at 2:15 am

    TApplication.Create is getting called from another DLL, hence it is waking an invalid handle or some nonsense in that callback.

    You need to eliminate statically linked DLLs that include [vcl.]controls.pas because TApplication.Create happens in some initialization code in that unit.

    Once you do this, synchronize will be restored to it’s former glory.

    Unfortunately, fixes you make in one version of Delphi might be undone by changes made in another version of Delphi. So if the problem comes back, go back to the drawing board. Step through the initialization code, specifically the initUnits procedure in system.pas. It runs the initialization code and will bump into vcl.controls.pas eventually and you can peer into the UnitInfo record to find out which file this is being called from.


    The best way to fix this is to use the delayed with all your external dlls (at least all your Delphi VCL external DLLs).

     function didntknowIusedcontrolsbutIdo() : Integer; external 'useful.dll' delayed;
    

    But this only works in Delphi 2010 and up. Good thing you upgraded to XE2 between the time you asked this question and the time you finally find a satisfying answer to it.

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

Sidebar

Related Questions

In Delphi 2009 I'm finding that any time I use TThread.CurrentThread in an application,
I just got Delphi 2009 and have previously read some articles about modifications that
One of Delphi 2009's advertised features was PNG support. That's great, because the Unicode
I am using Delphi 2009 and I noticed that there is a macro recorder
I'm using Delphi 2009. My program has been compiling and running fine. I use
Delphi 2009 and above support unicode. I have few legacy pascal source files that
In Delphi 2009 or later (Unicode), are there any built-in functions or small routines
I have a Delphi 2009 program that handles a lot of data and needs
I'm using Delphi 2009 to write an app that uses an Access database. I
my delphi 2009 app uses a DLL that performs some activities that may take

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.