呵呵呵呵呵

萝莉有三好,柔体 轻音 易推倒。女神有三宝,干嘛 呵呵 去洗澡。宅男有三好:Dota 基友 破电脑。


C++ Builder 2010 创建DLL动态库的方法

C++ Builder 2010 创建DLL动态库的方法

Creating DLLs in C++Builder is the same as in standard C++:

    Choose File > New > Other to display the New Items dialog box.
    Double-click the DLL Wizard icon.
    Choose the Source type (C or C++) for the main module.
    If you want the DLL entry point to be DllMain, MSVC++style, check the VC++style option. Otherwise, DllEntryPoint is used for the entry point.
    If you want the DLL to be multi-threaded, check the Multi-threaded option.
    Click OK.

Exported functions in the code should be identified with the __declspec(dllexport) modifier as they must be in Embarcadero C++ or Microsoft Visual C++.

For example, the following code is legal in C++Builder and other Windows C++ compilers:

// MyDLL.cpp
double dblValue(double);
double halfValue(double);
extern "C" __declspec(dllexport) double changeValue(double, bool);
 
double dblValue(double value) {
    return value * value;
};
 
double halfValue(double value) {
    return value / 2.0;
}
 
double changeValue(double value, bool whichOp) {
    return whichOp ? dblValue(value) : halfValue(value);
}

In the code above, the function changeValue is exported, and therefore made available to calling applications. The functions dblValue and halfValue are internal, and cannot be called from outside of the DLL. 

更多内容:

五类CAT5、超五类CAT5E、六类CAT6和超六类CAT6A四种布线方式系统性能差异
VC/BCB 获取其它进程HANDLE的三种方法
VC 获取PC的CPU,内存等信息示例代码
VC/BCB中system、WinExec、ShellExecute、CreateProcess示例
BCB 获取当前程序所占用的内存信息

本文链接地址:http://www.hehehehehe.cn/i/697.html