Jump to content

Search the Community

Showing results for tags 'observer'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Hello, I have an issue with the TOmniContainerWindowsMessageObserver and observers in general. I use one instance of TOmniMessageQueue to send data from a background thread to the main thread. However, it happens that several window are interested in receiving messages from the queue. So, I setup things like this: each form will create a TOmniContainerWindowsMessageObserver observer and attach it to the TOmniMessageQueue like this during the form's show event: MQObserver := CreateContainerWindowsMessageObserver(handle, WM_NEW_ITEM, 0, 0); // Create an observer that will notify the main form when new messages are received UserMessageQueue.ContainerSubject.Attach(MQObserver, coiNotifyOnAllInserts); // attach the observer to the message queue Likewise, when the form closes, the observer is detached and destroyed: UserMessageQueue.ContainerSubject.Detach(MQObserver, coiNotifyOnAllInserts); // we don't need the observer anymore FreeAndNil(MQObserver); My problem is that as soon as one observer is detached from the queue, all other observer stops notifying the other windows of the fact that a new message has been inserted. What am I missing here?
×