////////////////////////////////////////////////////////////////////// // PUT THE FOLLOWING DECLARATIONS IN THE HEADER FILE ////////////////////////////////////////////////////////////////////// HINSTANCE FFLibDllHandle; bool ( __stdcall *pfnFFAspiStart )( HWND ); void ( __stdcall *pfnFFSCSIBusScan )( HWND ); void ( __stdcall *pfnFFAspiStop )( void ); ////////////////////////////////////////////////////////////////////// // THIS IS THE C++ PROGRAM CODE ////////////////////////////////////////////////////////////////////// // load the DLL FFLibDllHandle = 0; FFLibDllHandle = LoadLibrary ( "FFLIB.DLL" ); if ( FFLibDllHandle == 0 ) { MessageBox ( NULL, "LoadLibrary:\nFFLIB.DLL not found.", "Error FS 001", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFAspiStart address pfnFFAspiStart = ( bool ( __stdcall *)( HWND ) ) GetProcAddress ( FFLibDllHandle, "FFAspiStart" ); if ( pfnFFAspiStart == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStart not found.", "Error FS 002", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // check ASPI support if ( pfnFFAspiStart ( Application -> Handle ) == false ) { MessageBox ( NULL, "No ASPI support.", "Error FS 005", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFSCSIBusScan address pfnFFSCSIBusScan = ( void ( __stdcall *)( HWND ) ) GetProcAddress ( FFLibDllHandle, "FFSCSIBusScan" ); if ( pfnFFSCSIBusScan == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFSCSIBusScan not found.", "Error FS 003", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // load FFAspiStop address pfnFFAspiStop = ( void ( __stdcall *)( void ) ) GetProcAddress ( FFLibDllHandle, "FFAspiStop" ); if ( pfnFFAspiStop == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFAspiStop not found.", "Error FS 004", MB_SYSTEMMODAL ); PostQuitMessage ( 0 ); } // scan the SCSI2 bus pfnFFSCSIBusScan ( Application -> Handle ); // stop ASPI support pfnFFAspiStop ( ); // free the DLL if ( FFLibDllHandle != 0 ) FreeLibrary ( FFLibDllHandle );