// GETTING INFO ABOUT THE CD-R DISC INSERTED INTO THE CD-R/CD-RW WRITER DEVICE // A) PROTOTYPES TO PUT INTO THE HEADER: HINSTANCE MMC1DllHandle; bool ( __stdcall *pfnFFAspiStart )( HWND ); char* ( __stdcall *pfnFFDiscInfo )( HWND, int, int, int ); void ( __stdcall *pfnFFAspiStop )( void ); // B) SOURCE CODE TO PUT INTO CPP FILE: // load MMC1DLL.DLL MMC1DllHandle = LoadLibrary ( "MMC1DLL.DLL" ); if ( MMC1DllHandle == 0 ) { MessageBox ( NULL, "LoadLibrary:\nMMC1DLL.DLL not found.", "Error FS 001", MB_SYSTEMMODAL ); return; } // load FFAspiStart address pfnFFAspiStart = ( bool ( __stdcall *)( HWND ) ) GetProcAddress ( MMC1DllHandle, "FFAspiStart" ); if ( pfnFFAspiStart == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStart not found.", "Error FS 002", MB_SYSTEMMODAL ); return; } // load FFDiscInfo address pfnFFDiscInfo = ( char* ( __stdcall *)( HWND, int, int, int ) ) GetProcAddress ( MMC1DllHandle, "FFDiscInfo" ); if ( pfnFFDiscInfo == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFDiscInfo not found.", "Error FS 003", MB_SYSTEMMODAL ); return; } // load FFAspiStop address pfnFFAspiStop = ( void ( __stdcall *)( void ) ) GetProcAddress ( MMC1DllHandle, "FFAspiStop" ); if ( pfnFFAspiStop == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStop not found.", "Error FS 004", MB_SYSTEMMODAL ); return; } // check ASPI support if ( pfnFFAspiStart ( Application -> Handle ) == false ) { MessageBox ( NULL, "No ASPI support.", "Error FS 005", MB_SYSTEMMODAL ); return; } // get disc info // -- parameters: // -- 1st parm: handle to the window of the calling program // -- 2nd parm: host adapter Id (usually 0) // -- 3rd parm: CD-R writer SCSI Id // -- 4th parm: CD-R writer SCSI LUN (usually 0) char* info; info = pfnFFDiscInfo ( Application -> Handle, 0, 2, 0 ); MessageBox ( 0, info, "Disc Information Block:", MB_SYSTEMMODAL ); // stop ASPI support pfnFFAspiStop ( ); // unload the DLL FreeLibrary ( MMC1DllHandle );