// prototypes int ( __stdcall *pfnFFDbfOpen )( char* ); char* ( __stdcall *pfnFFDbfGetRecord)( int ); void ( __stdcall *pfnFFDbfClose )( void ); // load FFLIB.DLL HINSTANCE FFLibDllHandle = 0; FFLibDllHandle = LoadLibrary ( "FFLIB.DLL" ); if ( FFLibDllHandle == 0 ) { MessageBox ( NULL, "LoadLibrary:\nFFLIB.DLL not found.", "Error FS 001", MB_SYSTEMMODAL ); return; } // load the address of FFDbfOpen pfnFFDbfOpen = ( int ( __stdcall *)( char* ) ) GetProcAddress ( FFLibDllHandle, "FFDbfOpen" ); if ( pfnFFDbfOpen == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFDbfOpen not found.", "Error FS 003", MB_SYSTEMMODAL ); return; } // load the address of FFDbfGetRecord pfnFFDbfGetRecord = ( char* ( __stdcall *)( int ) ) GetProcAddress ( FFLibDllHandle, "FFDbfGetRecord" ); if ( pfnFFDbfGetRecord == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFDbfGetRecord not found.", "Error FS 003", MB_SYSTEMMODAL ); return; } // load the address of FFDbfClose pfnFFDbfClose = ( void ( __stdcall *)( void ) ) GetProcAddress ( FFLibDllHandle, "FFDbfClose" ); if ( pfnFFDbfClose == NULL ) { MessageBox ( NULL, "GetProcAddress:\nFFDbfClose not found.", "Error FS 003", MB_SYSTEMMODAL ); return; } // open the DBF and get the total number of records int RecCount = pfnFFDbfOpen ( "V:\\NPZB\\LAN_DISK\\BARI\\D_MAIN.DBF" ); // read record number 1536 and get a pointer to the ASCIIZ record char* myrec; myrec = pfnFFDbfGetRecord ( 1536 ); // now myrec points to an ASCIIZ string representing the record; // if the first byte is "*" (0x2A) the record is deleted; // to get the fields extract the substrings according to the structure of the record // close the DBF pfnFFDbfClose ( ); // unload the library FreeLibrary ( FFLibDllHandle );