dll问题请教

sharklee 2001-06-08 11:35:00
我用BCB做了一个包含VCL的dll文件,但是在pb下调用时总是提示"错误的外部程序调用",请问各位是何原因?
附:部分dll程序代码
#include "Unit2.h"
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
extern "C" __declspec(dllexport) bool testform();
bool testform()
{
TForm2 testit=new TForm2(NULL);
testit->ShowModel();
delete testit;
}
...全文
66 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lg12net 2001-06-08
  • 打赏
  • 举报
回复

extern "C" __declspec(dllexport) bool testform();
改成
extern "C" __declspec(dllexport) __stdcall bool testform();
即可
加分加分加分
BCB 2001-06-08
  • 打赏
  • 举报
回复
TForm2 testit=new TForm2(NULL);
^___
应改成:
TForm2 *testit=
少了 *
xycleo 2001-06-08
  • 打赏
  • 举报
回复
在主程序你是如何调用的??
sharklee 2001-06-08
  • 打赏
  • 举报
回复
sharklee 2001-06-08
  • 打赏
  • 举报
回复
谢谢各位,马上加分

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧