Click here to Skip to main content
15,904,288 members
Home / Discussions / C#
   

C#

 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#9-Jul-07 19:54
Martin#9-Jul-07 19:54 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar9-Jul-07 17:50
Vikram A Punathambekar9-Jul-07 17:50 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#9-Jul-07 19:35
Martin#9-Jul-07 19:35 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#9-Jul-07 19:52
Martin#9-Jul-07 19:52 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar9-Jul-07 20:16
Vikram A Punathambekar9-Jul-07 20:16 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#9-Jul-07 20:25
Martin#9-Jul-07 20:25 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar9-Jul-07 22:08
Vikram A Punathambekar9-Jul-07 22:08 
GeneralRe: unable to cast object of type 'X' to type 'X' [modified] Pin
Martin#9-Jul-07 22:49
Martin#9-Jul-07 22:49 
Hello,

Vikram A Punathambekar wrote:
I'm sure you know this; it's probably just that you weren't using the correct terminology.

YEP!

Vikram A Punathambekar wrote:
Don't worry, your English is far better than my German

But I'm sure your German is much better than my Hindi. So the point goes to you! Big Grin | :-D

Vikram A Punathambekar wrote:
Second, when you say
Type1 reference1 = new Type2();

Did I?

Vikram A Punathambekar wrote:
Therefore, assuming Type2 inherits from Type1 (directly or indirectly, it doesn't matter), a subsequent cast like
Type1 reference2 = reference1;
will always work. (You don't even need a cast!)

I hope I never suggested something else!
I just wanted to find a possible explanation for the original problem, and tried to proof it with a project which is not working (means the project throws an exception, therefor the proof was ok).
Too bad that the one who had the problem seems not to care any more.


-- modified at 5:05 Tuesday 10th July, 2007

All the best,

Martin

GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar10-Jul-07 0:47
Vikram A Punathambekar10-Jul-07 0:47 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#10-Jul-07 1:18
Martin#10-Jul-07 1:18 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Vikram A Punathambekar10-Jul-07 4:30
Vikram A Punathambekar10-Jul-07 4:30 
GeneralRe: unable to cast object of type 'X' to type 'X' Pin
Martin#10-Jul-07 4:39
Martin#10-Jul-07 4:39 
AnswerRe: unable to cast object of type 'X' to type 'X' Pin
AFSEKI10-Jul-07 6:31
AFSEKI10-Jul-07 6:31 
QuestionSend a string to another program Pin
suntromantralalalala9-Jul-07 5:08
suntromantralalalala9-Jul-07 5:08 
AnswerRe: Send a string to another program Pin
Luc Pattyn9-Jul-07 6:51
sitebuilderLuc Pattyn9-Jul-07 6:51 
QuestionIterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 5:05
Shy Agam9-Jul-07 5:05 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 5:39
Martin#9-Jul-07 5:39 
AnswerRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 7:08
sitebuilderLuc Pattyn9-Jul-07 7:08 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
PhilDanger9-Jul-07 7:20
PhilDanger9-Jul-07 7:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:12
Shy Agam9-Jul-07 8:12 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:20
sitebuilderLuc Pattyn9-Jul-07 8:20 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 8:44
sitebuilderLuc Pattyn9-Jul-07 8:44 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Shy Agam9-Jul-07 8:51
Shy Agam9-Jul-07 8:51 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Martin#9-Jul-07 9:06
Martin#9-Jul-07 9:06 
GeneralRe: Iterating through all values of an ORed enum variable... Pin
Luc Pattyn9-Jul-07 9:18
sitebuilderLuc Pattyn9-Jul-07 9:18 

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.