Connecting Tech Pros Worldwide Forums | Help | Site Map

Invoke does not exist in the current context

The.Relinator@gmail.com
Guest
 
Posts: n/a
#1: Sep 19 '06
Hello, I seem to be getting the following error in one class, but not
in a form. The name 'Invoke' does not exist in the current context.

The code I am trying to execute is:

Invoke(d, new object[] { text });

all my using statements are:

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;

Any help regarding this issue would be greatly appreciated, thankyou

Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Sep 19 '06

re: Invoke does not exist in the current context


Unless your class implements ISynchronizeInvoke (which all classes
deriving from Control do), you won't have the Invoke method implemented.

You need to make the call on a class that implements this interface
(anything derived from Control will do).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

<The.Relinator@gmail.comwrote in message
news:1158686397.750001.286290@i3g2000cwc.googlegro ups.com...
Quote:
Hello, I seem to be getting the following error in one class, but not
in a form. The name 'Invoke' does not exist in the current context.
>
The code I am trying to execute is:
>
Invoke(d, new object[] { text });
>
all my using statements are:
>
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
>
Any help regarding this issue would be greatly appreciated, thankyou
>

The.Relinator@gmail.com
Guest
 
Posts: n/a
#3: Sep 20 '06

re: Invoke does not exist in the current context


thank you Nicholas, you solved my problem.

Closed Thread