Click here to Skip to main content
16,005,038 members
Home / Discussions / C#
   

C#

 
AnswerRe: XML but with different extension Pin
Dr.Walt Fair, PE23-Mar-10 13:45
professionalDr.Walt Fair, PE23-Mar-10 13:45 
QuestionCheck clipboard for a URL Pin
Jassim Rahma23-Mar-10 12:33
Jassim Rahma23-Mar-10 12:33 
AnswerRe: Check clipboard for a URL Pin
AspDotNetDev23-Mar-10 12:59
protectorAspDotNetDev23-Mar-10 12:59 
AnswerRe: Check clipboard for a URL Pin
Eslam Afifi23-Mar-10 13:02
Eslam Afifi23-Mar-10 13:02 
Questionref typecast between form derived from Form class and Form class Pin
Karismatic23-Mar-10 9:47
Karismatic23-Mar-10 9:47 
AnswerRe: ref typecast between form derived from Form class and Form class Pin
DaveyM6923-Mar-10 10:19
professionalDaveyM6923-Mar-10 10:19 
AnswerRe: ref typecast between form derived from Form class and Form class Pin
Tim Weckx23-Mar-10 10:32
Tim Weckx23-Mar-10 10:32 
GeneralRe: ref typecast between form derived from Form class and Form class Pin
Ian Shlasko23-Mar-10 11:26
Ian Shlasko23-Mar-10 11:26 
Member 2463256 wrote:
However, since FormX is a reference type, your foo method doesn't even need the ref parameter keyword. c# passes it as a reference by default.


Not quite the same thing. The difference is this:

foo(ref Form obj)
{
  // The caller's variable is changed to a new
  // Form instance.
  obj = new Form();
}


foo(Form obj)
{
  // Our LOCAL variable 'obj' is set to a new form, but
  // the calling function will see no change.
  obj = new Form();
}


The "ref" keyword is similar to the "out" keyword, except that "out" only works in one direction, while "ref" both provides a value and allows it to be changed.

Of course, in either case, using "ref" or not, changing a property of 'obj' will affect the caller's instance.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

GeneralRe: ref typecast between form derived from Form class and Form class Pin
AspDotNetDev23-Mar-10 11:35
protectorAspDotNetDev23-Mar-10 11:35 
GeneralRe: ref typecast between form derived from Form class and Form class Pin
Ian Shlasko23-Mar-10 12:00
Ian Shlasko23-Mar-10 12:00 
GeneralRe: ref typecast between form derived from Form class and Form class Pin
Karismatic23-Mar-10 17:47
Karismatic23-Mar-10 17:47 
QuestionIntegrating C#/VB.NET with ORKUT Pin
Marco225023-Mar-10 8:48
Marco225023-Mar-10 8:48 
AnswerRe: Integrating C#/VB.NET with ORKUT Pin
Not Active23-Mar-10 9:06
mentorNot Active23-Mar-10 9:06 
GeneralRe: Integrating C#/VB.NET with ORKUT Pin
Marco225023-Mar-10 12:26
Marco225023-Mar-10 12:26 
GeneralRe: Integrating C#/VB.NET with ORKUT Pin
Not Active23-Mar-10 13:33
mentorNot Active23-Mar-10 13:33 
JokeRe: Integrating C#/VB.NET with ORKUT Pin
Mycroft Holmes23-Mar-10 14:57
professionalMycroft Holmes23-Mar-10 14:57 
JokeRe: Integrating C#/VB.NET with ORKUT Pin
DaveyM6923-Mar-10 15:21
professionalDaveyM6923-Mar-10 15:21 
QuestionC# process.start and problem with argument [modified] Pin
sapsaPL23-Mar-10 7:50
sapsaPL23-Mar-10 7:50 
AnswerRe: C# process.start and problem with argument Pin
Ian Shlasko23-Mar-10 8:35
Ian Shlasko23-Mar-10 8:35 
GeneralRe: C# process.start and problem with argument Pin
sapsaPL23-Mar-10 9:49
sapsaPL23-Mar-10 9:49 
GeneralRe: C# process.start and problem with argument Pin
Ian Shlasko23-Mar-10 9:52
Ian Shlasko23-Mar-10 9:52 
GeneralRe: C# process.start and problem with argument [modified] Pin
sapsaPL23-Mar-10 10:15
sapsaPL23-Mar-10 10:15 
GeneralRe: C# process.start and problem with argument Pin
Ian Shlasko23-Mar-10 11:05
Ian Shlasko23-Mar-10 11:05 
AnswerRe: C# process.start and problem with argument Pin
Luc Pattyn23-Mar-10 15:27
sitebuilderLuc Pattyn23-Mar-10 15:27 
GeneralRe: C# process.start and problem with argument Pin
Dave Kreskowiak23-Mar-10 17:54
mveDave Kreskowiak23-Mar-10 17:54 

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.