Click here to Skip to main content
15,929,653 members
Home / Discussions / C#
   

C#

 
GeneralRe: Drawing over controls Pin
MoustafaS16-Apr-05 12:02
MoustafaS16-Apr-05 12:02 
GeneralRe: Drawing over controls Pin
Ista16-Apr-05 12:27
Ista16-Apr-05 12:27 
GeneralRe: Drawing over controls Pin
MoustafaS16-Apr-05 14:35
MoustafaS16-Apr-05 14:35 
GeneralRe: Drawing over controls Pin
Ista16-Apr-05 16:30
Ista16-Apr-05 16:30 
GeneralRe: Drawing over controls Pin
MoustafaS17-Apr-05 14:32
MoustafaS17-Apr-05 14:32 
GeneralInvalid Cast exception Pin
tantiboh16-Apr-05 9:53
tantiboh16-Apr-05 9:53 
GeneralRe: Invalid Cast exception Pin
Heath Stewart16-Apr-05 10:15
protectorHeath Stewart16-Apr-05 10:15 
GeneralRe: Invalid Cast exception Pin
Heath Stewart16-Apr-05 10:20
protectorHeath Stewart16-Apr-05 10:20 
I meant to add that you can learn a lot about your assemblies - and solve problems like this - by using ildasm.exe that ships with the .NET Framework SDK, which is installed by default with Visual Studio and downloadable separately from http://msdn.microsoft.com/netframework[^]. Finding the method in the tree and looking at the implementation would've reveals something like the following example I threw together quickly (does nothing):
.method private hidebysig instance void  Example() cil managed
{
  // Code size       69 (0x45)
  .maxstack  2
  .locals init (valuetype [mscorlib]System.Collections.DictionaryEntry V_0,
           class [mscorlib]System.Collections.IDictionaryEnumerator V_1,
           class [mscorlib]System.IDisposable V_2)
  IL_0000:  ldarg.0
  IL_0001:  ldfld      class [mscorlib]System.Collections.Hashtable Test::table
"color: rgba(255, 0, 0, 1)">  IL_0006:  callvirt   instance class [mscorlib]System.Collections.IDictionaryEnumerator [mscorlib]System.Collections.Hashtable::GetEnumerator()
  IL_000b:  stloc.1
  .try
  {
    IL_000c:  br.s       IL_0029
    IL_000e:  ldloc.1
"color: rgba(255, 0, 0, 1)">    IL_000f:  callvirt   instance object [mscorlib]System.Collections.IEnumerator::get_Current()
    IL_0014:  unbox      [mscorlib]System.Collections.DictionaryEntry
    IL_0019:  ldobj      [mscorlib]System.Collections.DictionaryEntry
    IL_001e:  stloc.0
    IL_001f:  ldstr      "test"
    IL_0024:  call       void [mscorlib]System.Console::WriteLine(string)
    IL_0029:  ldloc.1
    IL_002a:  callvirt   instance bool [mscorlib]System.Collections.IEnumerator::MoveNext()
    IL_002f:  brtrue.s   IL_000e
    IL_0031:  leave.s    IL_0044
  }  // end .try
  finally
  {
    IL_0033:  ldloc.1
    IL_0034:  isinst     [mscorlib]System.IDisposable
    IL_0039:  stloc.2
    IL_003a:  ldloc.2
    IL_003b:  brfalse.s  IL_0043
    IL_003d:  ldloc.2
    IL_003e:  callvirt   instance void [mscorlib]System.IDisposable::Dispose()
    IL_0043:  endfinally
  }  // end handler
  IL_0044:  ret
} // end of method Test::Example
This may look difficult at first, but you learn over time (just like programming).

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
GeneralRe: Invalid Cast exception Pin
tantiboh16-Apr-05 13:59
tantiboh16-Apr-05 13:59 
GeneralCrystal Report Speed Pin
Kyaw Soe Khaing16-Apr-05 9:20
Kyaw Soe Khaing16-Apr-05 9:20 
GeneralDynamic Assemblies Pin
Pepperman500016-Apr-05 4:45
Pepperman500016-Apr-05 4:45 
GeneralRe: Dynamic Assemblies Pin
Heath Stewart16-Apr-05 8:11
protectorHeath Stewart16-Apr-05 8:11 
GeneralRe: Dynamic Assemblies Pin
Pepperman500016-Apr-05 8:33
Pepperman500016-Apr-05 8:33 
GeneralRe: Dynamic Assemblies Pin
Heath Stewart16-Apr-05 8:43
protectorHeath Stewart16-Apr-05 8:43 
GeneralRe: Dynamic Assemblies Pin
Pepperman500016-Apr-05 8:50
Pepperman500016-Apr-05 8:50 
GeneralManaging access in nested classes Pin
matthias s.16-Apr-05 4:17
matthias s.16-Apr-05 4:17 
GeneralRe: Managing access in nested classes Pin
leppie16-Apr-05 5:53
leppie16-Apr-05 5:53 
GeneralRe: Managing access in nested classes Pin
Phil Harding16-Apr-05 14:54
Phil Harding16-Apr-05 14:54 
GeneralCross-Frame access Pin
Anonymous16-Apr-05 4:07
Anonymous16-Apr-05 4:07 
GeneralRe: Cross-Frame access Pin
Heath Stewart16-Apr-05 8:46
protectorHeath Stewart16-Apr-05 8:46 
GeneralRe: Cross-Frame access Pin
Anonymous16-Apr-05 9:33
Anonymous16-Apr-05 9:33 
GeneralRe: Cross-Frame access Pin
Heath Stewart16-Apr-05 9:37
protectorHeath Stewart16-Apr-05 9:37 
GeneralRe: Cross-Frame access Pin
Anonymous16-Apr-05 10:05
Anonymous16-Apr-05 10:05 
GeneralRe: Cross-Frame access Pin
Heath Stewart16-Apr-05 10:32
protectorHeath Stewart16-Apr-05 10:32 
GeneralRe: Cross-Frame access Pin
Anonymous16-Apr-05 10:52
Anonymous16-Apr-05 10:52 

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.