-
It is not always possible to rewrite your C or C++ legacy applications in .NET languages in one shot. Sometimes you have to do it module by module, step by step. In other words, you may have to use unmanaged DLLs in your .NET applications.Suppose you want to an unmanaged… Read more.
-
In one of my C++/CLI projects, I need to use a class exported from a unmanaged DLL. When I build the C++/CLI project, I get two linking errors: LNK2028 and LNK2029. The linker cannot find the GetObject() method of a class. First, I made sure that the export library of… Read more.
-
Found a very nice, concise Scrum Cheat Sheet. Read more.
-
In the C++ CLI Cheat Sheet, I tried to list side by side how to do certain things in C++/CLI and C#. Read more.
-
Published an article on CodeProject, discussing about the issues related to binding ObservableCollection to ListView and ComboBox controls. Please read the article here. Read more.
-
In WPF, we can bind an ObservableCollection<T> object to the ItemsSource property of an ItemsControl, e.g. a ComboBox. When we add or remove an element from the collection, the control bound to the collection will get updated automatically. However, we modify an element of the collection, the control won’t get… Read more.
-
In a WPF application, I have several Button controls each bound to a ICommand property of a ViewModel. In one of the method of a ViewModel, I invoke a method with a worker thread. When the method is done, it will change the value of a property, which would causes… Read more.
-
The Problem Suppose you need to use a legacy C++ class designed in COM style. Some methods of the class return HRESULT, and take a pointer as a parameter that could point to an int, a short, a std::string, an enum, and so on. For example: Solution 1 The most… Read more.
-
In C#, we can check if an event variable is null before firing the event. For example: public class MyClass { public event EventHandler MyEvent; public void FireEvent() { // Check if there is any event handler registered. if (MyEvent != null) { MyEvent(this, new EventArgs()); } } } But… Read more.
-
I was chatting with my colleague the other day about the Liskov Substitution Principle and Design by Contract. We know the rule (copied from Wikipedia) is that Subclasses in an inheritance hierarchy are allowed to weaken preconditions (but not strengthen them) and strengthen postconditions and invariants (but not weaken them).… Read more.