|
Hello folks.
Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs and if yes, how would one go about retrieving this in VC++? Actually what i'd like to do is recognize the disc once it is loaded into an optical drive to e.g. have an autorun function that can be enabled/disabled per disk (program would respond on WM_DEVICECHANGE, query GUID, check against database and if enabled, autorun the disk, if not enabled, then do nothing, just an example).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Code-o-mat wrote:
Do you know if there is anything like a GUID (Globally Unique IDentifier) for optical discs, CDs and DVDs...
Check out:
HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
The key you pointed out holds informations about the CD/DVD drive... What the enquirer seems to ask for is something like an identifier of the disc
|
|
|
|
|
Sauro Viti's right, i meant the medium itself, not the drive.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
HDDs have a unique number stamped on them during manufacturing, but I'm not aware of any such thing existing for CDs and DVDs, especially those that the user creates.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Me neither, but i thought i ask, maybe someone knows better, thanks anyways for your reply.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Somewhat off-topic, but here's an interesting link[^] to a what happens when someone thinks they can come up with a way of uniquely identifying all CD's.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Thanks for the link, just read it, it's instructive. It's easy to be smart afterwards, but i wonder why they didn't originally think of identifying discs, i mean, it's quite obvious it can be useful in certain situations. On the other hand, if i had generated a GUID and written it to a file called "DISC.GUID" in the root of every disc i ever burned then i'd be smarter now, but hey, who would ever think it could be useful sometimes in the future...
I wonder what alternatives there could be...like scanning the first 10 file names + file sizes and generating a hash of those, or somesuch, but such aproaches might turn out to be rather slow. The ID itself doesn't have to be unique on this planet, just around my home.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Code-o-mat wrote: The ID itself doesn't have to be unique on this planet, just around my home.
Try something like one of these[^]
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
That's a good one, and damn the "programmer mind", i even started thinking how one could mount a web camera above the optical disc drive's tray and write a program that recognizes and reads the number stamped onto the disc as it passes...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
This scheme might work for a limited set-up; it basically tries to identify a CD by hashing as few sectors as possible.
1. have a central database that stores one record per CD, holding a unique ID (auto assigned), a sectorCount number, and a CRC number. Also have a table that holds one number: numberOfSectors (it will start at 1, and increase monotonically over time).
2. have an app that allows to add new CDs to the system.
3. have a library that supports the recognition of known CDs.
The add-a-new-CD algorithm would be like so:
1. read first few sectors (as determined by numberOfSectors).
2. for all occurring values of sectorCount, calculate CRC, and search DB for a match.
3. if none found, simply add the new disk, and terminate.
4. if one found with sectorCount<numberOfSectors, flag it as no longer valid; add the new disk; goto 5.
5. for the flagged disks, re-process them (this will yield a new CRC over a larger number of sectors).
The recognize-a-CD algorithm would be like so:
1. read first few sectors (as determined by numberOfSectors).
2. for all occurring values of sectorCount, calculate CRC, and search DB for a match.
3. if one found, that is it.
4. if none found, this is an unknown CD, you can't handle it, you need the aad-a-new-CD algorithm.
Possible refinement:
on top of the above, you could also store the "total CRC" of a CD, so when one isn't recognized according to the above, you could still recognize it by brute force, then suggest the user officially adds it to the DB.
|
|
|
|
|
Sounds reasonable, thanks, will digest it some.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
you're welcome.
|
|
|
|
|
I have an MDI application with CView based on CZoomView , based on CScrollView . In CMyView::OnKeyDown(...) I try follow :
void CMyView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
int x = -1;
switch(nChar)
{
case VK_DOWN:
x = SendMessage(WM_VSCROLL,SB_LINEDOWN,(LPARAM)0);
TRACE("\n %d \n",x);
break;
default:
break;
}
CZoomView::OnKeyDown(nChar, nRepCnt, nFlags);
}
the output of TRACE is 0 , but still the window scroll don't work ... why ?
P.S. Of course , thw window have horizontal and vertical scroll .
|
|
|
|
|
Whether CMyView is derived from CScrollView?
Величие не Бога может быть недооценена.
|
|
|
|
|
Well , this is the project , with CMyView derived from CZoomView ... it will be a difference about this problem ?
|
|
|
|
|
if CZoomView is derived from CScrollView then no problem.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I am trying to set the treeview resemblence in listctrl. Like insert + , - symbol in some item of the listctrl. To have treeview look, i used the following code
HANDLE hTheme = OpenThemeData(m_hWnd, L"TREEVIEW");
But hTheme returns Null.
Kindly give your suggestions on this. Show some samples for using this functions.
Thanks.
|
|
|
|
|
Is m_hWnd valid?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
hello guys... im doing TAPI project as my final year project. I am stuck in it. Well i've been looking for TAPI forums but could't find any. Where can I find these forums where I can post TAPI related questions?? thnx
|
|
|
|
|
First try on MSDN([^]), if not able to solve then ask here. That's what i prefer you do.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi all,
i m using a multiline edit box and use enter for new line .
i want to enter only 10 lines in edit box and each line only have max 320 char.
here SetLimitText available but its set the total length of edit box.
please help for this.
thank in advance.
|
|
|
|
|
Can't you do this with 10 single line edit boxes placed in a column all limited to 320 characters?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Retrieve the line length using LineLength [^] and set the maximum character length of 10 lines, i.e.
CEdit cEdit;
// get the Edit control from the dialog.
cEdit.SetLimitText( 10* cEdit.LineLength );
Величие не Бога может быть недооценена.
|
|
|
|
|
how there may each line have diggrent number of character.
|
|
|
|