C++Builder写DLL时,有没有定义文件?(100分)

  • 主题发起人 毛虎林
  • 开始时间

毛虎林

Unregistered / Unconfirmed
GUEST, unregistred user!
C++Builder写DLL时,有没有象VC、SDK那样的DEF文件?
如果没有的话,自己写一个DLL真是太麻烦了。
 
不需要.def文件的,怎么会麻烦呢?在export中直接声明就行了!
 
能不能详细一点?多谢了!
 
我这里也没装C++Builder!我弄了一个小例子给你看看!
#include
#pragma hdrstop
extern "C" __declspec(dllexport) int test();
//声明一个导出函数,采用C的命名方法
//在BCB中默认的CALL方式为__cdecl,所以这名也可这样写
//extern "C" __declspec(dllexport) int __cdecl test();

int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
  return 1;
}//上面代码是BCB创建的
//下面是导出函数体
int test()
{
  return 3;
}
  
 
这个我知道,我是问是不是可以不用
extern "C" __declspec(dllexport) int test();

直接在export 中写
 test 1
这种的C++BUILDER中有没有
 
#define ex extern "C" __declspec(dllexport)
ex int test();
方便了吧
 
多人接受答案了。
 
顶部