VC:
.h
extern "C" _declspec(dllexport) bool GetUrl( const char *url, const char *savepath );
Delphi:
function GetUrl( Url:PChar; SavePath:PChar ):Boolean;cdecl external 'http.dll' name 'GetUrl';
本文介绍了一个跨语言调用DLL的例子,演示了如何在VC++与Delphi中实现相同的URL获取功能。通过extern C和_declspec(dllexport)在C++中定义导出函数,并在Delphi中使用cdecl调用约定来外部调用该函数。
VC:
.h
extern "C" _declspec(dllexport) bool GetUrl( const char *url, const char *savepath );
Delphi:
function GetUrl( Url:PChar; SavePath:PChar ):Boolean;cdecl external 'http.dll' name 'GetUrl';

被折叠的 条评论
为什么被折叠?