Click here to Skip to main content
15,910,797 members
Home / Discussions / C#
   

C#

 
QuestionHow to build reportviewer using existing dynamic dataset without report wizard Pin
roman_s9-Jun-10 8:24
roman_s9-Jun-10 8:24 
QuestionFor Multilingual Application Pin
Andy Rama9-Jun-10 7:59
Andy Rama9-Jun-10 7:59 
AnswerRe: For Multilingual Application Pin
Dimitri Witkowski9-Jun-10 8:50
Dimitri Witkowski9-Jun-10 8:50 
QuestionRe: For Multilingual Application Pin
Andy Rama10-Jun-10 6:07
Andy Rama10-Jun-10 6:07 
AnswerRe: For Multilingual Application Pin
Dimitri Witkowski10-Jun-10 6:16
Dimitri Witkowski10-Jun-10 6:16 
GeneralRe: For Multilingual Application Pin
Andy Rama10-Jun-10 6:18
Andy Rama10-Jun-10 6:18 
QuestionHow to return a collection from a method. Pin
Chiman19-Jun-10 6:28
Chiman19-Jun-10 6:28 
AnswerRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 6:50
sitebuilderLuc Pattyn9-Jun-10 6:50 
AnswerRe: How to return a collection from a method. Pin
Not Active9-Jun-10 6:57
mentorNot Active9-Jun-10 6:57 
GeneralRe: How to return a collection from a method. [modified] Pin
#realJSOP9-Jun-10 7:43
professional#realJSOP9-Jun-10 7:43 
GeneralRe: How to return a collection from a method. Pin
Not Active9-Jun-10 7:47
mentorNot Active9-Jun-10 7:47 
GeneralRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 8:28
sitebuilderLuc Pattyn9-Jun-10 8:28 
GeneralRe: How to return a collection from a method. Pin
DaveyM699-Jun-10 8:59
professionalDaveyM699-Jun-10 8:59 
GeneralRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 9:05
sitebuilderLuc Pattyn9-Jun-10 9:05 
AnswerRe: How to return a collection from a method. Pin
carbon_golem9-Jun-10 7:30
carbon_golem9-Jun-10 7:30 
AnswerRe: How to return a collection from a method. Pin
#realJSOP9-Jun-10 7:47
professional#realJSOP9-Jun-10 7:47 
JokeRe: How to return a collection from a method. Pin
Andrew Rissing9-Jun-10 7:55
Andrew Rissing9-Jun-10 7:55 
GeneralRe: How to return a collection from a method. Pin
#realJSOP9-Jun-10 8:26
professional#realJSOP9-Jun-10 8:26 
AnswerRe: How to return a collection from a method. Pin
dan!sh 9-Jun-10 7:54
professional dan!sh 9-Jun-10 7:54 
AnswerRe: How to return a collection from a method. Pin
srng.net9-Jun-10 20:04
srng.net9-Jun-10 20:04 
QuestionRemoting with XMLSerializable objects Pin
andyknapp9-Jun-10 4:34
andyknapp9-Jun-10 4:34 
AnswerRe: Remoting with XMLSerializable objects Pin
mud779-Jun-10 9:43
mud779-Jun-10 9:43 
QuestionError casting delegate in non-generic class PinPopular
Kalvin @ Work9-Jun-10 4:19
Kalvin @ Work9-Jun-10 4:19 
AnswerRe: Error casting delegate in non-generic class [modified] PinPopular
Dimitri Witkowski9-Jun-10 8:05
Dimitri Witkowski9-Jun-10 8:05 
Very interesting question.
I have an idea why this might happen.

1. Generic class: TestClassGeneric<T>.
GetMe is unknown during the compile-time, because it's defined inside a generic class and the typeparam T may vary at run-time (actually, GetMe in this case will be TestClassGeneric<T>.GetMe).

2. Non-ceneric class: TestClassGeneric.
GetMe is non-generic too, and the compiler may "guess" that the conversion will fail.

Some facts:

  • System.Action is built-in delegate, it's defined as
    public delegate void Action()
    If you replace GetMe with Action, you will get an error in two cases.
  • At the run-time, the conversion will fail, and si will be null.
  • If you replace
    si = _call as System.ComponentModel.ISynchronizeInvoke;
    with
    si = (System.ComponentModel.ISynchronizeInvoke)_call;,
    both generic and non-generic will fail.


Thanks! I'll remember this - it's a very good task and needs understanding of generics in .NET Framework Thumbs Up | :thumbsup:
Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.
modified on Wednesday, June 9, 2010 2:13 PM

QuestionLogin dialog on Page loads Pin
Ramkithepower9-Jun-10 3:59
Ramkithepower9-Jun-10 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.