PC Review


Reply
Thread Tools Rate Thread

Bizarre error with Invoke()

 
 
Luk Vloemans
Guest
Posts: n/a
 
      11th Sep 2003
Hey,

I'm writing software for the Compact .NET framework.

I'm trying to use the Invoke() function, wich takes one paramater: a
delegate function.

The program compiles, but on execution throws an exception.
(ArgumentException)

According to MSDN, this exception means that the 2nd parameter of the
Invoke() function isn't compatible with the delegate function.

However, there doesn't exist an Invoke() function with 2 parameters in
the .NET compact framework. (only in the .NET framework)

I'm sure it's propably something I overlooked..
Anybody got a clue ?


Thx a lot!

Luk Vloemans
IT student

 
Reply With Quote
 
 
 
 
Alex Yakhnin [eMVP]
Guest
Posts: n/a
 
      11th Sep 2003
If you could show us your code it'be a chance to help you..

--
Alex Yakhnin, eMVP
IntelliProg, Inc.
http://www.intelliprog.com

>-----Original Message-----
>Hey,
>
>I'm writing software for the Compact .NET framework.
>
>I'm trying to use the Invoke() function, wich takes one

paramater: a
>delegate function.
>
>The program compiles, but on execution throws an

exception.
>(ArgumentException)
>
>According to MSDN, this exception means that the 2nd

parameter of the
>Invoke() function isn't compatible with the delegate

function.
>
>However, there doesn't exist an Invoke() function with 2

parameters in
>the .NET compact framework. (only in the .NET framework)
>
>I'm sure it's propably something I overlooked..
>Anybody got a clue ?
>
>
>Thx a lot!
>
>Luk Vloemans
>IT student
>
>.
>

 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      11th Sep 2003
Declare your Invoke target as
void fnTarget(object sender, EventArgs args)

call it like this:
Form1.Invoke.(new EventHandler(fnTarget));


"Luk Vloemans" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hey,
>
> I'm writing software for the Compact .NET framework.
>
> I'm trying to use the Invoke() function, wich takes one paramater: a
> delegate function.
>
> The program compiles, but on execution throws an exception.
> (ArgumentException)
>
> According to MSDN, this exception means that the 2nd parameter of the
> Invoke() function isn't compatible with the delegate function.
>
> However, there doesn't exist an Invoke() function with 2 parameters in
> the .NET compact framework. (only in the .NET framework)
>
> I'm sure it's propably something I overlooked..
> Anybody got a clue ?
>
>
> Thx a lot!
>
> Luk Vloemans
> IT student
>



 
Reply With Quote
 
Jeremy Hance [MSFT]
Guest
Posts: n/a
 
      12th Sep 2003
This is an MSDN documentation issue that we are trying to get fixed.

The desktop version of Invoke which accepts only a single delegate
parameter can accept EventHandler delegates, MethodInvoker delegates, or
any delegate that takes no arguments.

However, the CF version can only accept EventHandler delegates..

Jeremy Hance
NET Compact Framework

This posting is provided "As Is" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bizarre error with cmd.CreateParameter audleman@quasika.net Microsoft ASP .NET 0 18th Apr 2006 08:15 PM
Re: Bizarre Error Wayne Morgan Microsoft Access Forms 2 15th Jul 2004 02:16 PM
Bizarre Excel error Chris Dunigan Microsoft Excel Programming 2 10th Mar 2004 04:35 PM
very bizarre error Michael Windows XP General 2 7th Aug 2003 11:29 AM
bizarre VBA compilation error jfp Microsoft Access Getting Started 0 2nd Jul 2003 02:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:01 AM.