System.Windows.Forms.Control.Invoke() throws ArgumentException aftersp1

N

Nicki Carstensen

Greetings and salutations...

I'm using the ISynchronizeInvoke interface to call events on a
userinterface from a worker thread. But after i installed .net framework
1.1 sp1, one of the events (with a delegate like this:
public delegate void FigureReceivedHandler(Stream figure);
now thorws the exception below:

System.ArgumentException: "Invalid parameter used."
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate
method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at MopoClient.MopoClient.FigureScriptThreadFunc(String scriptname,
MATEngineImageFormat format)

Obviously there something wrong with the Stream object, but what? It
worked fine before I installed the sp1. The Stream is a MemoryStream
containing an enhancedmetafile image.

Thanks in advance

regards
Nicki
 
G

Guest

Hey Nicki,

There should not be any problems passing a MemoryStream between to threads
living in the same AppDomain.

I tried calling Form.Invoke from a worker-thread using a delegate similar to
yours and it worked fine. Can you post some code showing the call to Invoke?

Regards, Jakob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top