473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Invoke does not exist in the current context

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

Sep 19 '06 #1
2 13434
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]
- mv*@spam.guard.caspershouse.com

<Th***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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

Sep 19 '06 #2
thank you Nicholas, you solved my problem.

Sep 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: CuriousGeorge | last post by:
I've upgraded a .Net 1.1 web app to 2.0 and am having a heck of a time getting resources to work again. From what I understand if I move my strings.resx file into the App_GlobalResources folder I...
2
by: aarepasky | last post by:
I am using ASP Web 2005 express and I have a textbox in a user control. Now when I try to use it in another user control, I get the error that it "does not exist in current context. These 2 user...
3
by: j-in-uk | last post by:
Hi, It seems as though Profiles have replaced session variables in visual studio 2005. The Profile needs to be defined in the web.config : <anonymousIdentification enabled="true" /> <profile...
1
by: Arjen | last post by:
Hi, I do this inside a repeater: <% if ((Boolean)((DataRowView)Container.DataItem) == true) { %> <%} %> I get this message: CS0103: The name 'Container' does not exist in the current...
2
by: Jeff | last post by:
hey asp.net 2.0 (C'#) In the code behind file I have this method: public String AddBR(Object param) { String text = (String) param; return text; }
0
by: Dave | last post by:
I have an ASPX page that I can't seem to do anything with the dropdowns. The error that I'm getting is "The name 'EmployeeDropdownList' does not exist in the current context. I have all the...
2
by: =?Utf-8?B?QyNub3ZpY2U=?= | last post by:
Like my name says I am a total novice at C#. I am trying to following examples in a book that I have but unfortunately they do not provide you with code for the whole project. Up till now I could...
1
by: avecreep | last post by:
Hi, i was trying to find a web application and i found one open source on the internet. i put the code folders on the root folder and when i tried to acces via web browser it all worked fine ( i...
6
by: cbellew | last post by:
G'day, I have encontered what appears to be a common problem, but unfortunately the typical solution i have found has not worked for me. I have just copied the files from an "ASP .NET Web Site"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.