CD checker

Started by
22 comments, last by funkman 20 years, 6 months ago
Yikes, that code is years old - I thought I could just copy&paste and all would be happy. But it does deserve a little explanation

I stored a file on the CD called CDINFO.FIL that contained two lines (CR/LF text format):

CD Information FileLucky Luke On The Daltons Trail


The signature is the second line to look for and compare with (so it can be reused with different games). dest is where the code should stick the name of the CD drive (looking back the parameters should be const char*, char* - passing a string literal as a second parameter isn''t a good idea). The code that called it was in a tiny executable stub that chained to the main game:

	// Keep looping until the CD is inserted or cancel is selected	while (!CDInDrive("Lucky Luke On The Daltons Trail", NULL))	{		retval = MessageBox(hWnd, LanguageText[TEXT_CDINDRIVE_DIRECTX], LanguageText[TEXT_WARNING], MB_RETRYCANCEL);		if (retval == IDCANCEL)			exit(-1);	}


I''m sorry I can''t provide help beyond that, I have forgone all my PC programming sins in favour of consoles.
Advertisement
Dont want to seem stupid, but is CR/LF (carriege return/line feed ?)format just a standard text format. Could be created in Wordpad etc?

Thanks again for help
yeah, notepad writes that format (as does DOS edit.com). If you''re unsure just open your text file in a hex editor (edit /78 file.txt ).
All is working sweet now. Million thanks to you all, hope this post will be of use for many other forum members.

Thanks again.

This topic is closed to new replies.

Advertisement