易截截图软件、单文件、免安装、纯绿色、仅160KB

VC调用DELPHI DLL乱码

Delphi(Pascal) code:

library HealthDocDll;

uses
SysUtils,
Classes,
Forms,
Dialogs,
Windows,
HealthDoc in 'HealthDoc.pas' {frmHealthDoc},
pub in 'pub.pas';

{$R *.res}


procedure ShowForm(DoctorName,UserName:string);
begin
sDoctorName:=DoctorName;
sUserName:=UserName;
showmessage(sdoctorname);
showmessage(susername);
end;

exports
ShowForm;

begin



C/C++ code:

HINSTANCE hDll;
hDll=LoadLibrary( _T("HealthDocDLL.DLL") );
typedef int(*func)(const char*,const char*);

func SmartWord= (func)GetProcAddress( hDll , "ShowForm" );
SmartWord( "aaaaaa" , "b" );



show出来的为什么是乱码?

thiscall是啥?

这不还是那个问题吗,你把两边都改成 stdcall,听我的
刚才打错了,

stdcall出错

delphi侧:
procedure ShowForm(DoctorName,UserName:string);stdcall;
vc侧:
typedef int(_stdcall *func)(const char*,const char*);



依然出错,依然乱码

可以了,谢谢,个人犯的错误,劳烦大家了

能把你的dll发到我邮箱吗,lxqiang123321@163.com


相关问答:

VC Delphi 内存速度比较 - VC/MFC / 非技术类

VC 控制台程序:
#include <iostream>
using namespace std;
int main()
{
const int def_buffer = 1024 * 4;
DWORD t;
BYTE b[def_buffer];
memset(b, 0, sizeof(b));
PBYTE p;
t = GetTickC ......

请教下,用DELPHI做SOHU的 - Delphi / 非技术区

一般都是怎么接活的?
收入怎么样
sohu?soho?

sohu 可能是small office house unit
小办公室,把家变成单位。

去威客网啊,很多个呢,还有外包的网站

学习学习。

现在Delphi做东西不行了,处于淘汰状 ......

xml创建后如何销毁? - Delphi / 网络通信/分布式开发

xml := CreateOleObject('Microsoft.XMLHTTP');
  xml.Open('GET','http://www.google.com', False);
  xml.Send;
  xml.responseText;
使用xml.responseText可以获取网页源码,但是再次 ......

会delphi又会c#的进来帮个忙。。。。。

把这段代码翻译为c#是什么样的麻烦帮帮忙
Delphi(Pascal) code:

unit SMSHTTP;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
GetInMessa ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号