Using /clr and __declspec(thread)

Sorry I haven’t been writing much lately, but a lot has been going on in Expression land.  I’ve switched over to working on build and setup development so you can expect to see the flavor of my posts change somewhat. Here’s a frustrating bit I ran into playing around with C++/CLI:  __declspec(thread) isn’t supported by…

1

Looking at double buffering and the new BufferedGraphics classes

I started spending some time looking at double buffering with Windows Forms a little while back and noticed that in the 2.0 framework there are a couple of new BufferedGraphics classes.  I toyed around with them a bit and got them to work, but didn’t really understand what was going on.  Looking into things again…

0

Setting up C++ Interop (with Win32) in VS 2005.

I’ve already given the steps necessary to make this happen in an earlier post, but as this will come up so much I decided to pull it into a seperate post with more explicit details.  The basic things you need again are: /clr option set for the project.  (Common Language Runtime support property under General.)…

0

Generic Collections IV

Back again, and as promised… Subclassing Generic Collections The framework provides three basic collections that are intended for derivation.  They are located in System.Collections.ObjectModel: Collection<T> KeyedCollection<TKey, TItem> ReadOnlyCollection<T> They are all intended to provide base implementations of the following interfaces: IList, IList<T> ICollection, ICollection<T> IEnumerable, IEnumerable<T> Collection<T> stores it’s data internally as IList<T> (and also takes IList<T> in…

2

Generic Collections III

So far I’ve gone over the basics of generic collections and moved on to looking at List<T> and Predicate<T>.  As mentioned yesterday, this post will deal with subclassing and the other System delegate types. The “Other” System.Delegates  We’ve already looked at System.Predicate<T>.  Now we can turn our attention to the rest of the System deleagte types: Action<T>…

4

Generic Collections II

In yesterday’s post I went over the very basics of generic collections in the 2.0 .Net framework.  Today I pick up where I left off with… Predicate<T> System.Predicate<T> is a generic delegate that is used to specify a search condition method to pass to the generic collections.  It simply takes an object of type <T>…

7

Generic Collections I

In one of my first posts I briefly mentioned that I would discuss a bit about what I’ve learned about using the new generic collections.  I’ve been putting it off a bit because I knew it would be a bit lengthy, but I really feel this is important so I’m going to push myself to…

10

C# or C++?

I just read C++ vs. C# and thought it might be worthwhile to throw up a few thoughts.  I’ve been ranting and raving about how great the new Managed C++ (C++/CLI) is.  It’s true, it is great, but I still prefer to do most of my work in C#.  Why? C# compiles incredibly fast.  I’m compiling…

0

P/Invoke? No way! (Pt. 2)

[7/20/05: Additional comment added for Marshal::GetFunctionPointerForDelegate()] There are some instances where Win32 requires a callback function pointer.  This frequently comes up in Enumeration APIs, such as EnumWindows.  In this post we’ll look at some code that makes this possible in Managed C++ (2005 — C++/CLI). One could create an unmanaged callback, but we’ll look at…

2

P/Invoke? No way!

[7/20/05: Added an additional comment regarding setting up for Win32] I’ve mentioned in my earlier posts just how nice Managed C++  in 2005 (C++/CLI) is when it comes to interoping with unmanaged code.  It makes P/Invoke downright painful by comparison. I’d rather toss 10,000 lines of P/Invoke code and restart in C++ than maintain it…

4