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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:15:53+00:00 2026-05-23T22:15:53+00:00

I have this problem that My WPF App in its MainWindow: public partial class

  • 0

I have this problem that My WPF App in its MainWindow:

public partial class MainWindow : Window, ICallbackNotify

this ” ICallbackNotify ” is to communicate with MapInfo COM
and to assure The interactivity between UI & MapInfo

public interface ICallbackNotify : ISynchronizeInvoke
{
    // Method called by MapInfoCallback class when user chooses custom OLE menuitem 
    void OnMenuItemClick(uint id);

    // Method called by MapInfoCallback class when the status bar text changes 
    void OnStatusBarTextChanged(string text);

    // Method called by MapInfoCallback class when window changes
    void OnWindowContentsChanged(uint windowId);
}

The problem is, this code is working just fine in Windows From but when i put it into WPF there is an ERROR msg :

Error   1   'WpfApplication3.MainWindow' does not implement interface member 'System.ComponentModel.ISynchronizeInvoke.InvokeRequired'  c:\users\dragon\documents\visual studio 2010\Projects\WpfApplication3\WpfApplication3\MainWindow.xaml.cs    25  26  WpfApplication3

and i cant figure out why or how to solve this problem

  • 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-23T22:15:53+00:00Added an answer on May 23, 2026 at 10:15 pm

    Under the hood Windows Forms and WPF are very different.

    ISynchronizeInvoke is a Windows Form concept built upon Win32 API that doesn’t apply to WPF. In WPF, we use the Dispatcher for communicating between threads.

    From your question it sounds like what you want to do is host a WinForms COM control inside a WPF application. In order to bridge these two technologies, Microsoft has a WindowsFormHost control that you can use to contain your component. This blog post has a pretty good write up on that. Checkout this MSDN example: https://msdn.microsoft.com/en-us/library/vstudio/ms751761(v=vs.100).aspx


    Update:

    It sounds like the problem you are having isn’t at runtime but during compilation?? Let slow down and be clear:

    In Windows Forms, all user controls and windows implement ISynchronizeInvoke. WPF isn’t built on the traditional Win32 WinProc message pump, so they do not implement this interface. If you copy and paste your INotifyCallBack interface and implementation “as is” into the MainWindow.xaml.cs, you will get a compilation error because the base interface ISynchronizeInvoke is not implemented in that class. To bypass the compilation error you will have to implement the ISynchronizeInvoke signature:

    public partial class MainWindow : Window, ISynchronizeInvoke
    {
       public IAsyncResult BeginInvoke(Delegate method, object[] args)
       {
          throw new NotImplementedException();
       }
       public object EndInvoke(IAsyncResult result)
       {
          throw new NotImplementedException();
       }
       public object Invoke(Delegate method, object[] args)
       {
          throw new NotImplementedException();
       }
       public bool InvokeRequired
       {
          throw new NotImplementedException();
       }
    }
    

    But guess what? If you do this, it’s up to you to provide the proper mapping between ISynchronizeInvoke and the WPF Dispatcher. So don’t do this! The above code might compile but it likely won’t work correctly (or at all).

    Instead, use the Windows Form Integration capabilities provided by Microsoft to host your control inside a WindowsFormHost control. As you need to implement custom code in your INotifyCallback, you’ll need to put that code into a custom windows forms user control.

    All said, you need to follow the direction provided by the article listed above:

    • Reference System.Windows.Forms.dll and WindowsFormsIntegration.dll
    • Add the appropriate namespaces to your MainWindow.xaml
    • Add the WindowsFormsHost as a container into your MainWindow.xaml, and then put your custom control inside of that.

    So instead of putting your ICallbackNotify implementation on the WPF MainWindow, put it in a standard Windows Form UserControl:

    namespace YourProject {
       using System.ComponentModel;
       using System.Windows.Forms;
    
       public class MyCustomMapControl : UserControl, ICallbackNotify
       {
           // your custom code goes here
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Everyone, I have a WPF app that has a canvas that I have wrapped
I have a WPF application that mostly follows MVVM, which I am trying to
I have a WPF app with a listbox and a contentcontrol. The contentcontrol content
we have an APP, that uses many local resources, such as windows printing API,
I have a bizarre problem that is causing us problems. We have a simple
I have the following setup: MainApp.exe checks for updates, downloads latest updates. The problem
I have a C# class library which starts up a background consumer thread (lazily)
I've spent a while trying to understand why my WPF app wasn't databinding to
Im running a console app that loads a dll and calls a method from
I have two collections displayed in my WPF application, and I'd like to have

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.