Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: Oject memory adress. Pin
leppie26-Jun-03 7:01
leppie26-Jun-03 7:01 
GeneralRe: Object memory adress. Pin
GriffonRL26-Jun-03 7:28
GriffonRL26-Jun-03 7:28 
GeneralRe: Object memory adress. Pin
leppie26-Jun-03 7:44
leppie26-Jun-03 7:44 
GeneralRe: Object memory adress. Pin
GriffonRL26-Jun-03 8:31
GriffonRL26-Jun-03 8:31 
GeneralRe: Object memory adress. Pin
leppie26-Jun-03 9:02
leppie26-Jun-03 9:02 
GeneralRe: Object memory adress. Pin
leppie26-Jun-03 9:05
leppie26-Jun-03 9:05 
GeneralRe: Object memory adress. Pin
leppie26-Jun-03 11:02
leppie26-Jun-03 11:02 
GeneralRe: Oject memory adress. Pin
leppie26-Jun-03 11:21
leppie26-Jun-03 11:21 
Here is a full sample, see the comments:
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
  .ver 1:0:3300:0
}
.assembly Testing
{
  .hash algorithm 0x00008004
  .ver 1:0:1272:38245
}
.module Testing.exe
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) 
.imagebase 0x00400000
.subsystem 0x00000003
.file alignment 512
.corflags 0x00000001

.namespace Testing
{
  .class private auto ansi beforefieldinit Class1
         extends [mscorlib]System.Object
  {
    .method private hidebysig static void 
            Main(string[] args) cil managed
    {
      .entrypoint
      .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) 
      .maxstack  1
      .locals ([0] object c1,
               [1] void* h,
               [2] int32 i)
      newobj     instance void Testing.Class1::.ctor()
      stloc.0
      ldloc.s    c1 //ldloca will box ref type
      call       void* Testing.Class1::GetAddr(object&)
      stloc.1
      ldc.i4.5
      stloc.2
      ldloca     2 //note ldloca for value types
      call       void* Testing.Class1::GetAddr(object&)
      stloc.1
      ret
    }

    .method private hidebysig static void* 
            GetAddr(object& o) cil managed
    {
      .maxstack  1
      ldarg.0
      conv.u
      ret
    }

    .method public hidebysig specialname rtspecialname 
            instance void  .ctor() cil managed
    {
      .maxstack  1
      ldarg.0
      call       instance void [mscorlib]System.Object::.ctor()
      ret
    }
  }
}

I dont know how one would call a ref object without adding the ref keyword in C#???

leppie::AllocCPArticle(Generic DFA State Machine for .NET);
GeneralRe: Oject memory adress. Pin
GriffonRL26-Jun-03 13:22
GriffonRL26-Jun-03 13:22 
QuestionConvert Word to XML? Pin
theJazzyBrain26-Jun-03 6:44
theJazzyBrain26-Jun-03 6:44 
AnswerRe: Convert Word to XML? Pin
Kant26-Jun-03 7:21
Kant26-Jun-03 7:21 
AnswerRe: Convert Word to XML? Pin
Kant26-Jun-03 7:31
Kant26-Jun-03 7:31 
GeneralC# and Exceptions Pin
theJazzyBrain26-Jun-03 5:48
theJazzyBrain26-Jun-03 5:48 
GeneralRe: C# and Exceptions Pin
leppie26-Jun-03 7:11
leppie26-Jun-03 7:11 
GeneralRe: C# and Exceptions Pin
theJazzyBrain26-Jun-03 12:27
theJazzyBrain26-Jun-03 12:27 
GeneralCalling a webservice from a windows service problem Pin
BigAndy26-Jun-03 4:11
BigAndy26-Jun-03 4:11 
General[Q]TabControl,TabPage and Context Menu. Pin
colormex26-Jun-03 3:57
colormex26-Jun-03 3:57 
GeneralDataBinding in C# Pin
Itanium26-Jun-03 1:56
Itanium26-Jun-03 1:56 
GeneralAccess a panel with shortcuts Pin
Anonymous26-Jun-03 0:29
Anonymous26-Jun-03 0:29 
GeneralAccess toolbar with shortcuts Pin
Anonymous26-Jun-03 0:26
Anonymous26-Jun-03 0:26 
GeneralCustom control not getting focus Pin
paulb25-Jun-03 13:51
paulb25-Jun-03 13:51 
Generalhelp with db connection... Pin
.gonad25-Jun-03 10:00
.gonad25-Jun-03 10:00 
GeneralRe: help with db connection... Pin
.gonad25-Jun-03 17:33
.gonad25-Jun-03 17:33 
GeneralLocationChanged and Move events Pin
Arun Bhalla25-Jun-03 9:54
Arun Bhalla25-Jun-03 9:54 
GeneralWhere to START Pin
isriniv25-Jun-03 9:08
isriniv25-Jun-03 9:08 

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.