Please pay attention! This method can only be applied to the __stdcall call mode of the output of the C format! 1. Use the VC tool Dumpbin to export the export function table in the DLL to a definition (.def) file EXAMPLE: DUMPBIN VIDEODECODECODLL / EXPROTS /OUT :VIDEODECODER.DEF 2. The exported .def file will be constructed as one. DEF function of the number of exported file EXAMPLE: VideoDeCoder.DEF document reads as follows Dump of file VideoDeCoder.dll file Type: DLL Section contains the following exports for VideoDeCoder.dll 0 characteristics 3D49E48F time date stamp Fri Aug 02 09:46:55 2002 0.00 Version 1 Ordinal Base 11 Number of Functions 11 number of names ordinal hint RVA name 1 0 00010F60 _TM_ClearDecoderBuff @ 4 2 1 00010E80 _TM_CloseDecoder @ 4 3 2 00010F00 _TM_DecodePicture @ 4 4 3 00010ED0 _TM_DecodePictureHeader @ 4 5 4 00010FD0 _TM_GetFileEnd @
4 6 5 00011030 _TM_GetUValue @ 4 7 6 00011060 _TM_GetVValue @ 4 8 7 00011000 _TM_GetYValue @ 4 9 8 00010E10 _TM_OpenDecoder @ 8 10 9 00010F30 _TM_ReturnType @ 4 11 A 00010F90 _TM_SetFileEnd @ 8 Summary 2000 .data 1000 .rdata 1000 .reloc 15000 .text Follow the following methods: 1> Add libly ilbrary "videodecoder" "XX" is DLL Name Description "VideoDeocoder Library" 2> Removes content other than the export function indicating that "exprots" instructions in the lib description Export function library "VideoDeodecoder" Description "VideoDecoder Library" Exports Ordinal Hint RVA Name 1 0 00010f60 _tm_cleardecoderbuff @ 4 2 1 00010E80 _TM_CloseDecoder @ 4 3 2 00010F00 _TM_DECodePicture @ 4 3 00020ED0 _TM_DECODEPICTUREH 5 4 00010fd0 _tm_getfilend @
4 6 5 00011030 _TM_GetUValue @ 4 7 6 00011060 _TM_GetVValue @ 4 8 7 00011000 _TM_GetYValue @ 4 9 8 00010E10 _TM_OpenDecoder @ 8 10 9 00010F30 _TM_ReturnType @ 4 11 A 00010F90 _TM_SetFileEnd @ 8 3> all functions put to the beginning of the line, remove the " Hint "and" RVA "data, leaving the serial number" Ordinal "of the function, plus" @ "symbol formation" _ export function name @ parameter byte and @ c 方式 方式 调 调 导 导 导 导 导 导 导symbol is a "function name and parameter bytes @") formed last .DEF file as follows:. LIBRARY "VideoDeCoder" DESCRIPTION "VideoDeCoder library" EXPORTS TM_ClearDecoderBuff @ 4 @ 1 TM_CloseDecoder @ 4 @ 2 TM_DecodePicture @ 4 @ 3 TM_DecodePictureHeader @ 4 @ 4 TM_GETFILEEND @ 4 @ 5TM_GetuValue @ 4 @ 6 TM_Getvvalue @ 4 @ 7 TM_GETYVALUE @ 4 @ 8 TM_Opendecoder @ 8 @ 9 TM_RETURNTYPE @ 4 @ 10 TM_SETFILEEND @ 8 @ 11 3. Using VC Lib Tools, with /def: (.def File Name) / Machine: IX86 (80x86 machine), outputs a lib file in accordance with VC format. Example: lib /def:videoDecoder.def / Machine: IX864. Time to bring the lib file link; note that when some dynamic library DUMPBIN is only function name, there is no "@nn" parameter format, such as C Builder write The DLL, the output is only the function name symbol, and the link will be wrong when the link is: Error LNK2002: Unresolved External Symbol "FunctionName @ nn" prompts that the function symbols in the prompt cannot be identified, then the corresponding function name in the DEF file is changed to FunctionName @ nn mode, re-establish lib, re-link. This makes it successfully in line with the VC call mode! Reference: MSDN2000 is worth mentioning!