Wednesday, April 25, 2007

Sri Lanka in the finals again...

We thrashed NewZealand in the Semi-Finals of the Cricket World Cup yesterday/today. It was really worth being up till 4 AM in the morning to see our boys just bashing the hell out of the hapless NewZealand team. The score doesn't really reflect how much of a bashing it was. The death over batting of Mahela and the first spell of fiery fast bowling from Malinga was a treat to watch.

I'll probably stay awake tonight too to watch what happens in the other Semi-Final between Australia & SouthAfrica.

Yesterdays game was a terrible game for both umpires (Rudy & Taufffel) who gave dreadful decisions one after the other. I hope things don't go so bad in the finals. 

Although Australia are still the favourites we feel comfortable being the underdogs, underdogs who could very well prove to be fierce lions in the finals.

Friday, April 20, 2007

Debugging VC++ dlls from .Net

In my current project we have to use a legacy VC++ dll to be called from our .Net assemblies. In addition I needed to be able to debug the C++ code from my .Net assembly project.

I found out that there are certain simple steps to carry out in order to achieve this.

1. Make the necessary functions in C++ exportable.

2. Make your C++ dll debuggable. You have to build the project on DEBUG configuration in order to that. There will be debug symbol files like .pdb being generated.

3. Now declare the calling method signature in your .Net code as follows inside the class.

[DllImport ../VCPlusProject/bin/Debug/VCPlus.dll", EntryPoint = "VCPlusMethodToCall", SetLastError = true)]
public static extern bool IsMethodCalled(int param)

4. The implemented method will be a normal .Net method as follows.

bool sucess = VCPlusMethodToCall(10);

Now everything is ready to let the cat out of the bag!

5. Start the VS.Net project in debug mode and try to debug in to the "VCPlusMethodToCall" method. The VC++ code will be debuggable inside VS.Net.

Neat...huh????