Harshdeep 2.0

May 30, 2006

DirectShow with Visual Studio 8

Filed under: Uncategorized — harshdeep @ 12:24 pm

Recently I had to upgrade some DirectShow code to VS8. This code was working fine as long as we were using VS7 but started crashing as soon as we switched to VS8.

I’m not really a DirectShow guru – this is the first time I had to dig a little bit in DirectShow code. A little googling and searching on forums indicated that a lot of people have faced problems in moving their DirectShow code to VS8. So, I’m listing my experiences here – it just might help someone save his time.

The first step was to get the latest DirectShow SDK – as I mentioned in the last post, it’s a part of the Platform SDK and Direct X SDK is required to build the samples. The first sample, Baseclasses, is what I needed. I built the static libraries strmbasd.lib (debug) and strmbase.lib (release) through nmake, as DirectShow documentation suggested, and linked them to the corresponding builds of my dll that uses DirectShow. This opened up a Pandora’s box of compiler, linker and run-time errors.

tchar.h was throwing a compiler error – “error C1189: Need to include strsafe.h after tchar.h”. Lots of people have complained about this error in the forums. dshow.h includes strsafe.h, so in this case the error simply reads “include tchar.h before including dshow.h”.

I was getting some “undefined symbols” link errors for functions that I could clearly see in Baseclasses code. It was because I’d used nmake to build the libraries. The default settings that it used were not compatible with the project settings of my DirectShow code.

I created a VS8 project for Baseclasses. All I had to do to fix the link errors was to match the “Character Set” and “Treat wchar_t as a Built-in type” settings in the project properties of Baseclasses and my dll that links to it. But this code was still crashing. Reason – different “Structure alignment” in the two projects. Using the same value in both the projects fixed it.

Moral of the story: Don’t use nmake to build Baseclasses for you – write a VS project and use the right settings.

Advertisements

May 24, 2006

Arbitrary naming by Microsoft

Filed under: Uncategorized — harshdeep @ 2:56 pm
  1. DirectShow SDK is not included in DirectX SDK. It's a part of the Platform SDK instead. (DirectX is however still required to build DirectShow filters). And surprisingly, this information is not so readily available on MSDN. I found it on wikipedia instead (after fruitlessly searching the MSDN for a while)
  2. "Windows® Server 2003 R2 Platform SDK" is not just for Windows Server 2003 as the name would suggest – it is for Windows XP and other flavors as well. Searching for "Platform SDK" will take you to Windows Server 2003 R2 Platform SDK though you are developing for, say, Windows XP. Unless you look closely at that page (and don't try to refine your search keywords to get the Platform SDK for Windows XP specifically) you won't realize that it works for Windows XP too.

How about coming up with less misguiding names?

PS: Did someone say "historical reasons"?

May 16, 2006

News timeline on NDTV.com

Filed under: Uncategorized — harshdeep @ 5:11 pm

There are a lot of reasons why online news score over the traditional newspapers – freshness of content and easy search being the most prominent.

But old habits die hard – I hardly visit a news site for non-technical news – I get them the conventional way, through newspapers. But recently, I visited NDTV.com – it's pretty impressive and there is one feature that I fell in love with.

When you click on a news item, in addition to the text of the story, you get a Timeline panel in which related stories are listed in reverse chronological order. So if you've not been in touch lately, it gives you a good context of the story. 

For example, I clicked on the timeline window for a news story regarding protests against the new reservation policy being proposed (in India) and I got a list of news items from the time this policy was announced to protests in different parts and changing statements from politicians – it definitely gives a better insight into the matter than reading separate pieces of news here and there would.

Kewl

Camping at Saat Tal

Filed under: Uncategorized — harshdeep @ 5:30 am

You need a vacation the most when you've just returned from one. I know because I've just come back from a weekend camping trip at Saat Tal (in Uttaranchal, Nainital district).

Though the tourist brochures say that it's a 7-hour drive from Delhi, it actually took us around 12 hours because of traffic jams on the way. Imagine getting stuck in a traffic jam at 2 am for 3 hours!

The camp that we went to is a lonely place – we had to get down from the bus, walk around a km (the roads are too narrow for heavy vehicles), cross a lake by boat and then walk uphill for another km to reach the camps.

And it's clean – almost completely free from the litter of polybags and plastic bottles that are an eye sore in many North Indian hill stations.

The camps were beautiful. There is no electricity and no phone network coverage. It is a small valley bordered with small hills with tall trees. At night it looked all the more beautiful (in a spooky way) – washed in full moon light. But the camp people didn't let us wander at some distance from our tents – they said there are leopards in that area. We didn’t get to see any 😦

They call it "river crossing", but there wasn't any water flowing down there. With the kind of support they give – the harnesses and all – it feels so safe that I had to look down in the trench to make myself believe that I'm doing something risky or gutsy – actually it's just a joy ride.

Rappling

Also went out on an unguided walk over the surrounding hills with a friend and didn't get lost. Got to see some amazing scenery from there but unfortunately my camera batteries had got completely drained by then, so no pics.

Played antakshari a lot – Diksha was generally in my team, so that didn't require any thinking (or even singing) from my side.

Waiting for the next trip now

Blog at WordPress.com.