Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionHow to determine the Type of a null-Reference ? Pin
MarkPhB13-Oct-08 23:32
MarkPhB13-Oct-08 23:32 
AnswerRe: How to determine the Type of a null-Reference ? Pin
SeMartens13-Oct-08 23:37
SeMartens13-Oct-08 23:37 
GeneralRe: How to determine the Type of a null-Reference ? Pin
MarkPhB13-Oct-08 23:44
MarkPhB13-Oct-08 23:44 
AnswerRe: How to determine the Type of a null-Reference ? Pin
#realJSOP14-Oct-08 0:04
professional#realJSOP14-Oct-08 0:04 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Colin Angus Mackay14-Oct-08 0:07
Colin Angus Mackay14-Oct-08 0:07 
GeneralRe: How to determine the Type of a null-Reference ? Pin
DaveyM6914-Oct-08 0:51
professionalDaveyM6914-Oct-08 0:51 
GeneralRe: How to determine the Type of a null-Reference ? Pin
MarkPhB14-Oct-08 0:18
MarkPhB14-Oct-08 0:18 
AnswerRe: How to determine the Type of a null-Reference ? Pin
Simon P Stevens14-Oct-08 0:39
Simon P Stevens14-Oct-08 0:39 
You can't.

A null object doesn't have a type, that's why it throws an exception. Reflection is for viewing the runtime state of objects and during runtime a null object is null and has no type.

If you need a Type object, you can use typeof(MyClass).

It's like asking if a pen is made from plastic or metal before it's been made. You can't. You can ask afterwards. But before, all you can do is look at the construction materials in the blueprint for a PlasticPen or a MetalPen (the classes), you don't know which it is until after you've created it.

Simon

GeneralRe: How to determine the Type of a null-Reference ? Pin
Mark Churchill14-Oct-08 2:35
Mark Churchill14-Oct-08 2:35 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Simon P Stevens14-Oct-08 2:50
Simon P Stevens14-Oct-08 2:50 
GeneralRe: How to determine the Type of a null-Reference ? Pin
Mark Churchill14-Oct-08 2:57
Mark Churchill14-Oct-08 2:57 
AnswerRe: How to determine the Type of a null-Reference ? Pin
Scott Dorman14-Oct-08 8:23
professionalScott Dorman14-Oct-08 8:23 
Questionusing lparam parameter of SendMessage function Pin
Sandeep Kalra13-Oct-08 22:37
Sandeep Kalra13-Oct-08 22:37 
AnswerRe: using lparam parameter of SendMessage function Pin
Simon P Stevens13-Oct-08 23:12
Simon P Stevens13-Oct-08 23:12 
GeneralRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra13-Oct-08 23:47
Sandeep Kalra13-Oct-08 23:47 
GeneralRe: using lparam parameter of SendMessage function Pin
Simon P Stevens14-Oct-08 0:30
Simon P Stevens14-Oct-08 0:30 
GeneralRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra14-Oct-08 0:52
Sandeep Kalra14-Oct-08 0:52 
GeneralRe: using lparam parameter of SendMessage function Pin
Simon P Stevens14-Oct-08 2:47
Simon P Stevens14-Oct-08 2:47 
QuestionRe: using lparam parameter of SendMessage function Pin
Mark Salsbery14-Oct-08 4:42
Mark Salsbery14-Oct-08 4:42 
AnswerRe: using lparam parameter of SendMessage function Pin
Sandeep Kalra14-Oct-08 18:23
Sandeep Kalra14-Oct-08 18:23 
AnswerRe: using lparam parameter of SendMessage function [modified] Pin
#realJSOP13-Oct-08 23:49
professional#realJSOP13-Oct-08 23:49 
QuestionAjax modal pop extender query Pin
dsaikrishna13-Oct-08 22:18
dsaikrishna13-Oct-08 22:18 
QuestionInvalid character while using xmldocument.load? Pin
.NetRams13-Oct-08 20:32
.NetRams13-Oct-08 20:32 
AnswerRe: Invalid character while using xmldocument.load? Pin
Guffa13-Oct-08 20:34
Guffa13-Oct-08 20:34 
AnswerRe: Invalid character while using xmldocument.load? Pin
Brij13-Oct-08 22:56
mentorBrij13-Oct-08 22:56 

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.