Click here to Skip to main content
15,894,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Starting a GUI app with a windows service in C# Pin
Heath Stewart29-Jul-04 6:23
protectorHeath Stewart29-Jul-04 6:23 
Questionhow to get cd information Pin
civc28-Jul-04 13:23
civc28-Jul-04 13:23 
QuestionHow to enumerate windows belong to an instance? Pin
Old Gun28-Jul-04 13:04
Old Gun28-Jul-04 13:04 
AnswerRe: How to enumerate windows belong to an instance? Pin
Dave Kreskowiak28-Jul-04 14:17
mveDave Kreskowiak28-Jul-04 14:17 
Generalusing ref in C# for reference types Pin
vista2728-Jul-04 12:48
vista2728-Jul-04 12:48 
GeneralRe: using ref in C# for reference types Pin
Heath Stewart28-Jul-04 13:00
protectorHeath Stewart28-Jul-04 13:00 
GeneralRe: using ref in C# for reference types Pin
vista2728-Jul-04 13:58
vista2728-Jul-04 13:58 
GeneralRe: using ref in C# for reference types Pin
Heath Stewart29-Jul-04 4:17
protectorHeath Stewart29-Jul-04 4:17 
Yes, that is correct. Consider the following example:
using System;

class Test
{
  static void Main()
  {
    Exception e = new Exception("From Main()");
    Console.WriteLine(e.Message);

    A(e);
    Console.WriteLine(e.Message);

    B(ref e);
    Console.WriteLine(e.Message);
  }

  static void A(Exception e)
  {
    e = new Exception("From A()");
  }

  static void B(ref Exception e)
  {
    e = new Exception("From B()");
  }
}
The output would be:
From Main()
From Main()
From B()
Exception was just the first object that came to mind, but any reference type - and in this case, value types - would do.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: using ref in C# for reference types Pin
MKlucher28-Jul-04 18:12
MKlucher28-Jul-04 18:12 
GeneralRe: using ref in C# for reference types Pin
Heath Stewart29-Jul-04 4:28
protectorHeath Stewart29-Jul-04 4:28 
GeneralIDispDataVwDataConn => casting Server Explorer node to this interface Pin
mikker_12328-Jul-04 12:18
mikker_12328-Jul-04 12:18 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
Heath Stewart28-Jul-04 12:41
protectorHeath Stewart28-Jul-04 12:41 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
mikker_12329-Jul-04 5:14
mikker_12329-Jul-04 5:14 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
Heath Stewart29-Jul-04 6:03
protectorHeath Stewart29-Jul-04 6:03 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
mikker_12329-Jul-04 6:34
mikker_12329-Jul-04 6:34 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
Heath Stewart29-Jul-04 8:58
protectorHeath Stewart29-Jul-04 8:58 
GeneralRe: IDispDataVwDataConn => casting Server Explorer node to this interface Pin
mikker_12329-Jul-04 9:20
mikker_12329-Jul-04 9:20 
Generalread-only Pin
Anonymous28-Jul-04 12:17
Anonymous28-Jul-04 12:17 
GeneralRe: read-only Pin
mikker_12328-Jul-04 12:22
mikker_12328-Jul-04 12:22 
GeneralRe: read-only Pin
Anonymous28-Jul-04 12:40
Anonymous28-Jul-04 12:40 
GeneralRe: read-only Pin
Heath Stewart28-Jul-04 12:43
protectorHeath Stewart28-Jul-04 12:43 
GeneralRe: read-only Pin
Anonymous28-Jul-04 12:52
Anonymous28-Jul-04 12:52 
GeneralRe: read-only Pin
Heath Stewart28-Jul-04 12:56
protectorHeath Stewart28-Jul-04 12:56 
GeneralRe: read-only Pin
Anonymous28-Jul-04 13:00
Anonymous28-Jul-04 13:00 
GeneralDynamically adding textbox's Pin
Adam °Wimsatt28-Jul-04 11:35
Adam °Wimsatt28-Jul-04 11:35 

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.