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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:02:20+00:00 2026-05-17T23:02:20+00:00

Thank you so much for reading this! I think the fix is relatively easy,

  • 0

Thank you so much for reading this! I think the fix is relatively easy, but it is beyond me! I can never get my BeginInvokes correct.

I am still learning, and not very good yet, so please don’t laugh too hard! As a temporary measure, I am using some public domain code, just to get a feel for what is being done in the code, before I write some similar stuff with only the bits I actually need. However, I do really need the answer if anyone can help. I have uploaded the public domain code to an area of my website, and will link to it later, but I don’t think it is necessary, as I have picked out the bits that I think matter below:

My test application works fine, but my main application doesn’t. Here is the method I am trying to call:

public ProcessCaller(ISynchronizeInvoke isi)
    : base(isi)
{
}

Here is the code that calls this method from my test application. This works perfectly.

private void btnOk_Click(object sender, System.EventArgs e)
    {
        processCaller = new ProcessCaller(this);
        processCaller.FileName = @"..\..\test.exe";
        processCaller.Arguments = "";
        processCaller.StdErrReceived += new DataReceivedHandler(writeStreamInfo);
        processCaller.StdOutReceived += new DataReceivedHandler(writeStreamInfo);
        processCaller.Completed += new EventHandler(processCompletedOrCancelled);
        processCaller.Cancelled += new EventHandler(processCompletedOrCancelled);
        // processCaller.Failed += no event handler for this one, yet.

        // the following function starts a process and returns immediately,
        // thus allowing the form to stay responsive.
        processCaller.Start();  
    }

Here is the code to run the same method from the main app. This RunTest is actually called from a BackGroundWorker. I see that this is slightly pointless, but even when I run it directly, removing the extra BackGroundWorker, I still get exactly the same error, outlined below.

public void RunTest()
    {
        try
        {
        processCaller = new ProcessCaller(this);
        processCaller.FileName = "test.exe";
        processCaller.Arguments = "/test";
        processCaller.StdErrReceived += new DataReceivedHandler(writeStreamInfo);
        processCaller.StdOutReceived += new DataReceivedHandler(writeStreamInfo);
        processCaller.Completed += new EventHandler(processCompletedOrCancelled);
        processCaller.Cancelled += new EventHandler(processCompletedOrCancelled);
        // processCaller.Failed += no event handler for this one, yet.

        // the following function starts a process and returns immediately,
        // thus allowing the form to stay responsive.
        processCaller.Start();
        }
   }

However, this code does not work. The problem is this line. The bit it does not like is “this”.

processCaller = new ProcessCaller(this);

When I try to build, I get two errors:

Argument 1: cannot convert from ‘App.Backend.Tools.Test’ to ‘System.ComponentModel.ISynchronizeInvoke’

and

The best overloaded method match for ‘App.Backend.Tools.ProcessCaller.ProcessCaller(System.ComponentModel.ISynchronizeInvoke)’ has some invalid arguments

I kind of understand the issue. I am not calling this from my GUI or Button (object sender stuff) as in my Test App. I kind of know that I need to Invoke it but I haven’t got a clue how to do this! If BeginInvoke/Invoke is the correct course of action, could someone please show me how to do it!?

Thanks so much in advance!

Richard

P.S: Just in case anybody does need it, I have uploaded the public domain code I am using here, but I don’t think that anybody does need it.

AsyncOperation

ProcessCaller

  • 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-17T23:02:20+00:00Added an answer on May 17, 2026 at 11:02 pm

    The parameter required by the ProcessCaller constructor must be of type System.ComponentModel.ISynchronizeInvoke. The compiler is telling you that your “this” object (of type App.Backend.Tools.Test) does not implement ISynchronizeInvoke.

    Change your Test class definition so that it implements ISynchronizeInvoke, something similar to the following:

    namespace App.Backend.Tools
    {
        class Test : System.ComponentModel.ISynchronizeInvoke
        {
            // Existing code, as well as required implementations
            // of ISynchronizeInvoke members.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thank you very much in advance for reading. I'm programming a web application in
I'm reading this book: http://eloquentjavascript.net/ which I think is brilliant. However I'm having difficulty
I've been reading up on dependency injection and I think I pretty much understand
I'm currently reading an article , but I do not really understand how this
this questions looks really easy but I'm a noob in C++ and MySQL so
I think this may be a false positive, but I could be wrong. I
This post on SO answers most of the questions I have (much thanks to
This function is much faster than its recursive version: crossSubstrings :: String -> String
It's shown that 'as' casting is much faster than prefix casting, but what about
First of all, I have some time reading this page and I find very

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.