Thursday 24 July 2014

How to Capture “Friendly Name” from a Camera

Hi, Today am back with a mindblowing,method to tell you how you can capture or get a Friendly name of a camera.

What is a Friendly Name??
Any devices, will have some kind of ID for identification, some of them are
Device ID:
Vendor ID: etc...
Since all these are numbers, it is hard to be remembered by the user, so therefore a short name to recognize the type of camera , is called the friendly name.

Ex:USB 2.0

Things Required:
1.Visual Studio
2.Platform SDK
3.A Camera
So lets get started,into our journey of capturing Friendly names of a camera

STEP 1:
Install,the platform SDK,properly.You can have a look into my previous chapters where I would have discussed that.

STEP 2:
Open Visual Studio 2005, and then open a new Win32 Project,hope you are familiar with building Win32 Apps.For those who are not, dont worry, in a week or so I will post tutorials on win32 programming

STEP 3:
Just make a simple dialog box with an button,add a list box for viewing the enumerated Device. Just see the screen shot  below.
                                
STEP 4:
This is a crucial step as I am going do  a brief explanation of some of the concepts. I have commented my program ,to an extend where you can easily understand.

Here We are going to use a concept called COM(Component Object Model) which is a binary interface standard for software modules. It’s an interface between two program modules, one of them is an OS or a library.

System Device Enumerator
It returns a collection of device Monikers, selected by a device category.It enumerates Filters and hardware installed on the system.

Monikers
It contains information that uniquely identifies a component object model.
There is two important properties of it
1. Can be saved and later retrieved.
2. Support an operation called binding, which is a process of locating object named by a Moniker, activating and loading it, if it is not already active.

Iproperty Bag
This is a kind of variable ,or you can assume it as a bag as the name suggests, from which we can read the values. The Imonikers saves the object properties on it.
  Just see the program ,try building it and running it and then explore your own ideas with it.

If all step is  properly done then you can see an  window , as shown below


And here we come to the end of this tutorial ,hope you liked it.
Author
Vivek Gr
Embedded Project Engineeer




No comments:

Post a Comment