Browse by Tags

Tagged Content List
  • Blog Post: Human sacrifice, dogs and cats living together, mass hysteria! and thread model errors!

    Reader Shaka comments on my post about error messages that "catastrophic failure" really does take the cake as being a terrible error message. I fondly remember the first time I saw "catastrophic failure" as an error message. I was an intern, running the build lab for Visual Basic for Applications...
  • Blog Post: Chained user-defined explicit conversions in C#, Part Three

    Jeroen Frijters knew the answer to my challenge of last time: how is it that Foo foo = new Foo(); can cause a runtime conversion failure? And how is it that Bar bar = (Bar)(new Baz()); can succeed even if there is no user-defined conversion or built-in implicit conversion between Baz and Bar ? The...
  • Blog Post: Do Not Call IsBadFooPtr, Indeed

    Here’s a story that I said a long time ago that I was going to tell you all , and then promptly forgot about it. Raymond Chen’s blog entry today reminded me of it, because this is the story of how I found out the hard way that IsBadFooPtr is bad, bad, bad. Those of you who have been following releases...
  • Blog Post: Checking For Script Syntax Errors, This Time With Code

    A number of people asked me to clarify yesterday's entry. Rather than try to talk you through it, I think the code is straightforward enough to speak for itself. Here's a little skeleton that I just whipped up. #include <stdio.h> #include <activscp.h> #include <new> const GUID...
  • Blog Post: Implementing Event Handling, Part Two

    It's been an insanely busy month for me, between having multiple out-of-town guests, throwing a party for the people who couldn't make it to the wedding, and oh yeah, getting up to speed on the C# compiler and trying to understand the implications that LINQ features are going to have on the current implementation...
  • Blog Post: Implementing Event Handling, Part One

    Back in February I posted a bit about how script hosts such as Windows Script Host dynamically hook up event sources (objects) to event sinks (chunks of script that run when the event fires.) It has become apparent from some questions I've received recently that it would be helpful to have a more detailed...
  • Blog Post: VBScript Default Property Semantics

    Here’s a question I recently got about VBScript, where by "recently" I mean August 28th, 2003. This code works just fine: Set myObject = CreateObject("myObject") myObject.myName = "Eric" WScript.Echo myObject ' myName is the default property, so prints "Eric" But myObject = "Robert" doesn't set...
  • Blog Post: Caching Dispatch Identifiers Is A Bad Idea

    About two years ago I wrote a bit about when it was legal to cache a dispatch identifier so that you didn’t have to look it up a second time . I was reminded of this today because the scripting sustaining engineering team was working on a bug that involved a customer incorrectly caching a dispatch identifier...
  • Blog Post: How Do Script Engines Implement Object Identity?

    I've talked a few times in this blog about the semantics of the equality operators in various languages. (Such as here , and here .) Recently a reader asked me how JScript implements object identity. That is, given two objects, how do we know if they are "the same object" or not? For the remainder...
  • Blog Post: Why does WScript.ConnectObject not always work?

    I've had a tiny handful of entries in my VBScript quiz . I know from my logs that 2600+ people have read it. Come on people, there are fabulous prizes at stake here! Go for it! I'm going to keep the contest open until Friday morning, at which point I'll start posting answers and analysis. **********...
  • Blog Post: VBScript Terminators, Part Two

    You guys came up with good answers to three of my four questions, which is about what I expected; question 2 was pretty hard. To sum up: QUESTION #1: Why does the termination logic go terminate, terminate, terminate, clear, clear, clear, instead of terminate and clear, terminate and clear, terminate...
  • Blog Post: T4: VBScript and the Terminator

    I had some free time on the flight to Canada and my laptop with me, so maybe I will do a little blogging on my vacation after all. A week ago or so a reader asked me to talk a bit about how class termination works in VBScript. Let’s start by looking at a simple case: Class Foo Public Name Public Other...
  • Blog Post: Why do built-in JScript functions not appear in the typeinfo?

    A reader sent me an email over the weekend asking about some odd behaviour in the guts of the JScript engine. Unfortunately, they didn't include an email address that worked; I just got a bounce message back, Ben. Therefore I'll just answer the question here. To briefly describe the problem: the user...
  • Blog Post: Wherefore IDispatchEx?

    Quite a while back I said that I'd write a post describing why we invented IDispatchEx . I already covered the part about using it to probe the stack for security reasons, but what other reasons did we implement that thing? The documentation is pretty much accurate, but sparse in places. (According to...
  • Blog Post: Use vs. Mention in JScript Doesn't Come For Free

    Before today's entry, a quick note. Work has just gotten insanely busy as we push towards getting VSTO ready for the Whidbey release. I likely won't have much time to blog over the next couple weeks, so the blog refresh rate is going to go down for a while. I have a collection of pre-written articles...
  • Blog Post: Solution to Spot the Defect Part Two

    There were l ots of good responses to my challenge of yesterday. There are two major defects in this code: that it leaks memory, and that it passes an incorrect variant type to Invoke. There are also a considerable number of minor defects and questionable design decisions. Let's go through that code...
  • Blog Post: Spot the Defect, Part Two

    Some fun for a Monday -- for some definition of fun, I suppose. Here's a recent posting to Microsoft's internal Spot The Defect mailing list. HRESULT CInvokeHelper::InvokeHelper(IDispatch *pDisp, long dispid, SAFEARRAY **param1) { HRESULT hr; DISPPARAMS params; EXCEPINFO hrInfo; VARIANTARG args[1]; params...
  • Blog Post: Aargh! Part Eight, plus Boring Metablogging

    Q: What's a pirate's second favourite mode of transportation? A: A caaaaargh! Preferably a Jaguaaaaargh, but an early Oldsmobile Cutlass will do. Q: Very amusing -- but what's a pirate's favourite mode of transportation? A: A pirate ship, silly. Gripe #10: Don't use _alloca _alloca allocates...
  • Blog Post: Eric's Complete Guide To Type Signatures Of Scriptable Object Models

    Moving away from the problems of junior high school … Here's a question I've gotten many times over the years: how do you design an object so that it can be easily called from both VBScript and JScript? COM defines a fairly complex type system, and the script engines by design...
  • Blog Post: Aargh! Part Seven

    Q: How do pirates keep their socks from falling down? A: Thumbtacks. I am insanely busy with bug fixing and performance testing today, so once more I'll dip into my endless archive of rants about irksome coding practices I've seen one time too many. Gripe #8: Assert the truth, the whole truth...
  • Blog Post: You Can't Convert Data Structures To Strings In VBScript Without Breaking A Few Eggs

    Here's a question I get every now and then: I've written a VBScript program which calls a method on an object that returns an array of bytes containing a GUID. VBScript only supports arrays of variants. How can I turn this into a human-readable string? Good question. It is...
  • Blog Post: Some LΘ℃αℓization Questions

    A reader asked me a few questions about localization the other day. That's not a subject that I have a lot of experience on, but I can speak to it a bit. (I know that I've seen a blog from a Microsoft localization PM somewhere in the last six months, but cannot for the life of me remember who, and my...
  • Blog Post: Aaargh, Part Six: One More Thing About Comments

    Gripe #7: Use The Right Struct For The Job I meant to include this one in yesterday's gripe about comments, as this illustrates a time when I found a comment that should never have been there. The person who wrote the comment should have realized that the very fact that they needed to put a comment...
  • Blog Post: SimpleScript Part Seven: Binder Skeleton

    In Part Five I was discussing modules: there is a "global module" and any number of additional modules. Each module is associated with a named item, and the only module which is associated with more than one named item is the global module. This means that each module is going to need its own name table...
  • Blog Post: SimpleScript Part Four: Finite State Machines and Script Engines

    Last time I said that I'd discuss finite state machines (also sometimes called finite state automata, same thing.) The FSM is a fundamental idea in theoretical computer science because it models computing machinery in a very simple, abstract and general way. Basically it goes like this: an FSM has a...
Page 1 of 3 (57 items) 123