Archive for May 2003

 
 

Visual Studio .NET Extensibility

I’m writing a VS .NET add-in and I’ve hit a wall trying to add a menu item to the Debug menu. The docs are pretty bad compared to the what I usually get from Microsoft, and the interfaces all use VARIANTs so I can’t infer anything from the types. All the sample code I’ve seen adds menu items to the Tools menu, but when I replace “Tools” with “Debug” in the sample code the command gets added to the Debug toolbar instead. Can anybody help?

Modern Parser Generators

Eric Meijer has a nice weblog entry on parser generators. No need to suffer the pain of using Yacc he says – modern parser generators accept arbitrary context free grammars.

Questions for Chris Brumme

Chris has asked for topics for his weblog. I sent him an e-mail yesterday with the following list of questions:

1. Why are delegates classes and not value types? As classes they slower as there is always a layer of indirection involved when making a call. As value types they could be represented as simple function pointer for static and module methods, and a pointer to a small shim that adds an object reference to the parameters and then calls the target method for instance methods.

2. Why was the decission made to support only single inheritance in the CLR?

3. Why doesn’t the CLR allow delegates with the same signature to be treated as same types? After all, that’s the only thing we care about when using delegates.

4. Why does the C# compiler require that we explicitly create a delegate when it can infer what delegate needs to be created and do it implicitly?