Thanks be to Leppie! (can't claim i understand it quite yet but google cordebug seems to be the place to look). Again, thanks! ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
TuringTest1
Posts
-
StackFrame -
StackFrameMarc, Colin, thanks. Here is a brazen plug-- anyone reading this thread should read MyXaml-- it's way cool. Responding to Colin's question, if "sender" is only used in very odd cases i want to put the plumbing underground where it belongs. I admit that this is an asthetic judgement, but it makes sense to me. Your code might detect an unusual condition several levels down and want to know the value of something at the top level-- certainly you could percolate this data or create some sort of global variables etc, but in my asthetic sense it's much more appealing to go and grovel for the data in the rare cases when it's needed rather than forcing everybody to look at your dirty laundry all the time. Imho it's exactly analogous the exception handling, you *could* achieve the same effect by passing all kinds of return flags around, but popping the stack is so much more comprehensible. Back to the question, as Marc asks, how does the debugger do it? the debugger has no problem displaying all the local variables etc. I *assume* the values or pointers are simply coming from the stack. It's also clear that the debugger sometimes gets confused, so examining the stack isn't a slam dunk. What i don't know for a fact that external information gotten from compiling "Debug" isn't required. Also as Marc points out, what i really want isn't exactly the class instance but rather the contents of the field instance.Foobar-- i'm assuming that c# internally uses some sort of pointer and that if i'm either in the correct namespace or able to use reflection that given the instance pointer or whatever it should be easy to get the value of Foobar. Anyway why would StackFrame return all the cool type information if it wasn't useful? I have to believe Stackframe is intended for more than just getting the NAMES/ signatures of the methods on the stack. Again, thanks, and thanks in advance for any more hints. _______________________________________________ Go see Shrek2. Tell me if it isnt the best movie ever. Then read the credits at the end of the movie and estimate the animation budget.
-
StackFramedotnet provides a way cool StackFrame class that can be used to get Reflection information about the call stack, the methods and their parameters. however i don't see how to get the actual values of these parameters, for example the instance of the class defining a method on the call stack. is that because interpreting the actual data on the call stack is language dependent, or something like that? suppose i am a method and want to know the instance of the class calling me, can i do that? ((c'mon, no cheating by passing Sender as a parameter!!)) Tia. ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Request help for 2 newbie questionsHeath, why are events in a derived class too slow? First, i'm assuming the fact it's derived is a nonissue, your point is just that OnPaint is exposed directly for that purpose-- let me know if i misunderstand this. But why would events be slow, aren't they just callbacks? TIA. ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
DragDrop to a native window?:-D Heath, thank you for the great references (as usual!). ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
DragDrop to a native window?does anyone know how to implement drag drop events in native windows? there doesn't seem to be any WM_DRAGDROP message! related question, are the dotnet drag drop events into a control implemented by some object or code library that is accessible? TIA! ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Virtual Screenscraper QuestionMazy, thanks. The question i want answered was eloquently stated re the article you sent (see below). Unfortunately there was no answer posted-- does anyone know the answer? TIA! HERE IS stantheman's question (and mine): Greetings all, I dig Agha Ali Raza’s article (Capturing the Screen Image in C#), but what I want to do is capture the image before it hits the screen. How would I do this? In essence, I would like to take a screen-shot (bitmap) of a Form *before* it ever gets to the screen. If you’re interested, - what I want to do is perform a little “graphics-magic” on the image using GDI+ - I want to “dance” the image of the Form around the screen before I present the actual Form. And I don’t know how to do this. I’ve tried overloading the Form.OnPaint method, but I just don’t seem to be getting it right. Anyone? Thanks all, - Stan Shankman http://www.codeproject.com/csharp/csCaptureScreen1.asp?msg=435733#xx435733xx ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Virtual Screenscraper Questionok, so how would you googlefish for an answer to the following screen scraper question: how do i get a bitmap of a "virtual" control, that is what the control would look like but without showing it on the screen? TIA! ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Cryptography questionwonderful piece of code, that Crypto API :):-O;) ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and Attributeyikes! i guess you're right, that probably is the key to a lot of things i wish i knew how they were implemented, but i must admit it sounds fairly daunting!! also brings up a dumb question, is it obvious that the inner loop of the serialization (in BinaryFormatter?) would likely be written in IL not native x86? Thx! ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and Attributethanks, yes i also use BinaryFormatter on pretty big objects and it seems remarkably efficient. Thanks for the suggestion on Reflector (do i also need to learn il?). Thanks for the insights and the Reflector fishing rod!! :-D ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and Attributei hadn't thought about the volatile references, thanks! ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
inelegancei agree in principle with what you're saying, that's why i wrote the post. the problem is that there isn't any good local "scope" for the image, once the pictureBox gets it it should belong to the pictureBox. perhaps i should write PictureBoxEx.. (yecch!!) btw the snippet provided by Philip Fitzsimons "looks" kinda wierd but works great! if we could get EricGu to rename the keyword "using" to "noLongerUsing" the snippet would read: Image tmp; noLongerUsing (tmp = pictureBox.Image) {pictureBox.Image = aBrandNewImage;} :) ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and Attributeok, i guess i see how this is done-- pls correct me if i'm wrong: on invoking Formatter.Serialize, Formatter uses reflection to check whether ISerializable is implemented in the class of the object. if so it calls the interface. If not it uses reflection to serialize all the fields, checking for the NonSerialized as it goes. is that what happens? and if this is, how is that done efficiently enough to not take forever to serialize each two-bit-- i mean two-byte-- object in the graph? does BinaryFormatter perform some sort of run time analysis or "compilation" like regex? ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
ineleganceThe code is real, it describes a common situation: a picture box displays an image for some unspecified duration, then in response to some event the image should change. AFAIK this requires the soon-to-be-old current image be pointed to, the new image be displayed, and the now-old-current image be disposed. Surely this is a common problem. Nes pas? ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and AttributeHeath Stewart wrote: Actually, if you attribute your class with the SerializableAttribute, the default serialization will serialize public and private fields of your class. how does this happen? doesnt it require "somebody" to implement a default ISerializable for the class? or is it just done at runtime via reflection? [[need more smiley flavors for "huh??"!!!) ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and AttributeSo marking class Foo with [Serializable] magically adds expands Foo by implemnting the 2 ISerializable methods ending up with Foo : ISerializable? ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
ineleganceThe snippet below seems to me to reek of inelegance, yet i have no better solution. i can't manage with using {} because the pictureBox barfs if i dispose the image too soon. Is there a better way?? Image disposeOfSoon = pictureBox.Image; pictureBox.Image = newImage; if (disposeOfSoon != null) disposeOfSoon.Dispose (); ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Abstract, Interface, and AttributeMazdak wrote: Serializable word express itself.It means you can seriallize this class. MSDN exapain these things very good,you can start from it. yes, [Serializable] is implemented as an attribute, but it really looks like an Interface, doesn't it? except that for technical reasons (one of the 2 interface "methods" is a constructor) it can't be an interface. Or something like that. What are the similarities and differences between something implemented as an Interface and something like [Serializable] which is implemented via attributes? ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!
-
Embedded DatabaseHey, this is a great thread. If someone were to do an article showing a simple database app in one or multiple flavors (xml, sqllite, jet) that would be a pretty useful article imho. !! :rose: ________________________________________ Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain. Then perhaps I'd deserve ya, and be even worthy of ya.. if I only had a brain!