So I ran across two interesting language foibles today. Both of them are easy to work around, and I haven't determined whether they're really even bugs or not.
1) Variant can't hold Ptr. Which means a Dictionary can't hold a Ptr. The only way to do it is to cast as an Int32 on the way in and out. I suspect that this is just a simple oversight.
2) RaiseEvent cannot work with qualified names (such as Foo.Bar). This is sensible -- otherwise you could do something like RaiseEvent someSameClassInstanceVariable.SomeEvent. However, it does have a drawback: you can raise an event from within a shared class method or shared computed property. In this case, you have to make an instance method which does the RaiseEvent for you.
I happened to run into both of these today while monkeying around with some basic threading ideas. Neither was a major obstacle, but both caught me off-guard.
Leave a comment