易截截图软件、单文件、免安装、纯绿色、仅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


相关问答:

Python中的Unicode在Delphi如何还原成Gb2312?

已知Python 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试

在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......

Delphi怎么取返回内容中的指定部分.

返回的内容是如下代码,怎么能渠道2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......

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可以访问visual foxpro的dbf数据库吗

问大家个问题:
现在有一个现成的程序,是visual foxpro做的,数据库是dbf文件,我没有用过foxpro,开始都没找到数据库,终于看明白原来dbf就是数据库,(但这个程序好多个dbf啊!还没安装foxpro,没打开这些数据库 ......

Delphi Thread

主窗体:
Delphi(Pascal) code:

procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
myThread := TClientThread.Create(LeftPart(cbbServer.Text, ':'), StrToInt(RightPart(cbbServer.Text, ':')) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号