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 中:
s = unicode("测试", "gb2312")
s = u'\u6d4b\u8bd5'
print s
测试
在Delphi里面如何将\u6d4b\u8bd5这样的还原成Gb2312的汉字呢?
找到个方法
......
返回的内容是如下代码,怎么能渠道2b?
<p class="text1">1a </p>
<p class="text1">2b </p>
<p class="text1">3c </p>
<p cl ......
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 ......
问大家个问题:
现在有一个现成的程序,是visual foxpro做的,数据库是dbf文件,我没有用过foxpro,开始都没找到数据库,终于看明白原来dbf就是数据库,(但这个程序好多个dbf啊!还没安装foxpro,没打开这些数据库 ......
主窗体:
Delphi(Pascal) code:
procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
myThread := TClientThread.Create(LeftPart(cbbServer.Text, ':'), StrToInt(RightPart(cbbServer.Text, ':')) ......