在创建DLL文件的时候,我的导出函数是这样定义的#define DLLExport _declspec(dllexport)
extern "C" DLLExport int HaveGranted(CString yourtext); 然后在VC中使用没有问题,可是当用在VB中时,一运行到调用的这个函数,窗体就自动关闭了.
请高手告知怎么在VB和Delphi中调用dll的导出函数!
谢谢了!
extern "C" DLLExport int HaveGranted(CString yourtext); 然后在VC中使用没有问题,可是当用在VB中时,一运行到调用的这个函数,窗体就自动关闭了.
请高手告知怎么在VB和Delphi中调用dll的导出函数!
谢谢了!
#define DLLExport _declspec(dllexport)
extern "C" DLLExport int HaveGranted(LPSTR yourtext);但是请问在VB和Delphi中怎么调用和传进参数去呢??
谢谢
这样才能传递
#define DLLExport _declspec(dllexport)
extern "C" DLLExport int __stdcall HaveGranted(LPSTR yourtext);
生成Granted.dll文件,在VC中调用一切正常然后在delphi中声明
function HaveGranted(YourText:pchar):integer ;External'DLLExport.dll';然后在程序中使用
var
text:string;
value:integer; value:=HaveGranted(pchar(text))结果编译的时候出现 无法定位程序入口点HaveGranted于Granted.dll上,
请问怎么 解决他呢,是由什么引起的呢???谢谢!!
function LSI_InitNTDbi: Boolean; cdecl; external 'dbapi.dll' name '?LSI_InitNTDbi@@YA_NXZ';像这样子的声明凡是才能解决问题。其中name后面的字符串用VC中的工具Depends查看。
然后在delphi中声明
function HaveGranted(YourText:pchar):integer;cdecl;External'Granted.dll';经调试已经ok