tailieunhanh - Financial Applications using Excel Add-in Development in C/C++ phần 3

và một trong những bạn có nhiều khả năng hội tụ, vượt ra ngoài phạm vi của cuốn sách này. (Excel cung cấp trợ giúp để giải quyết các thông qua các công cụ / Solver. Nút Help thoại của.) Nếu bạn có ý định dựa trên một người giải quyết cho một cái gì đó quan trọng bạn | 92 Excel Add-in Development in C C Expressed slightly differently the C name decoration for Win API calls is Prefix Suffix @n where n bytes stack space for arguments Case change None Table gives some examples Table Name decoration examples for C-compiled exports C source code function definition Decorated function name void example1 char argl _example1@4 void example2 short arg1 _example2@4 void example3 long arg1 _example3@4 void example4 float arg1 _example4@4 void example5 double arg1 _example5@8 void example6 void arg1 _example6@4 void example7 short arg1 double arg2 _example7@12 void example8 short arg1 char arg2 _example8@8 Win32 C compilers use a very different name-decoration scheme which is not described as among other reasons it s complicated. It can be avoided by making the compiler use the standard C convention using the extern C declaration or by the use of DEF files. See below for details of these last two approaches. The extern C declaration The inclusion of the extern C declaration in the definition of a function in a C source file instructs the compiler to externalise the function name as if it were a C function. In other words it gives it the standard C name decoration. An example declaration would be extern C double c_name_function double arg An important point to note is that such a function must also be given an extern C declaration in all occurrences of a prototype for example in a header file. A number of function prototypes and the functions and the code they contain can all be enclosed in a single extern C statement block for convenience. For example a header file might contain Creating a 32-bit Windows Win32 DLL Using Visual C or Visual Studio .NET 93 extern C double c_name_function double arg double another_c_name_function double arg double cplusplus_name_function double arg FUNCTION CALLING CONVENTIONS cdecl _stdcall fastcall The Microsoft-specific keyword modifiers _cdecl _stdcall .

TỪ KHÓA LIÊN QUAN