The application discloses a dynamic link
library reflection method based on a C language
preprocessor, and comprises the following steps: S1, acquiring the file name of a dynamic link
library to be agented and a function
list to be agented, wherein the function
list comprises the function name,
return type and
parameter type of each function; S2, constructing a registerer by using the
macro definition of the C language, wherein the input of the registerer is the file name of the dynamic link
library, the function name to be agented, the
return type and the
parameter type; S3, generating an agent function by using the registerer in the preprocessing process of the
compiler at the compiling stage; S4, registering the function to be agented in the
source code by using the registerer in step S3; and S5, calling the function to be agented in S1 in the business, and compiling and running the
software together with the registration code in step S4. The application solves the compatibility problem caused by using different version library modules or using the same library module in different versions of the same product.