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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:51:52+00:00 2026-06-03T04:51:52+00:00

I have a 3rd party dll that I am including in a C# WPF

  • 0

I have a 3rd party dll that I am including in a C# WPF project with Dllimport directives.
I have a static c# function that they call as a callback when a certain hardware event occurs.

I would like to accomplish what an old school PostMessage would accomplish. Just notify my mainwindow that the callback occurred. I know I could just get my window and cast and call the mainwindow’s function directly but that seems a little flaky. I like the old async PostMessage pattern. Perhaps my question is more about loosely coupling a couple of components in the app.

Should I just invoke a command?

  • 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-06-03T04:51:53+00:00Added an answer on June 3, 2026 at 4:51 am

    You should look at using loosely coupled events as you suggest. Some useful starting points are

    • Prism’s Event Aggregator

    • Caliburns’s Event Aggregator

    • MVVM Light‘s Messenger

    which all do similar pub-sub messaging.

    I suspect your callback will be on another thread so you’ll probably need to use Dispatcher.Invoke to marshal the call to your UI thread.

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

Sidebar

Related Questions

I have a 3rd party C++ DLL that I call from C#. The methods
VS2005.NET I have a website project that references 3rd party dll's and i'd like
I have a WCF service which references a 3rd party DLL. That DLL looks
I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets
We have a project where a 3rd party DLL is accessed through JacoZoom in
I have a 3rd party .dll that I have successfully added as a reference
I have a legacy 3rd party COM .dll that is used to provide an
We have a system that makes a use of 3rd party COM DLL written
I have an MFC DLL that is loaded by a 3rd party application. How
I have a 3rd party DLL that needs to be loaded dynamically using LoadLibrary()

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.