一个用delphi语言做的一个DLL文件,提供了接口,其中一个函数为:
数据库连接
function HCIConnect( hDatabase:THandle; Server:PChar ;Protocol:integer ;Endpoint:PChar ;Username:PChar ;Password:PChar ;Operator:PChar ):integer;stdcall客户端用delphi调用是这样的:
HCIConnect(@Database,pchar(server),protocol,pchar(endpoint),pchar(username),pchar(password),pchar(operator));现在前端改为C#,调用这个DLL.
rv = HCIConnect(ref database , this.textEdit_server.Text , comboBoxEdit_protocol.SelectedIndex  , this.textEdit_endpoint.Text , this.textEdit_dbname.Text , this.textEdit_password.Text , this.textEdit_operator.Text );
但一执行程序就没有反应,我怀疑是参数哪的类型不对。
我的疑问是:
1。DELPHI里的pchar关键字 在C#中有没有对应的东西?
2。我的database是这样定义的:System.IntPtr database = new IntPtr(); 不知道对不对?
3。delphi中的@Database  是否对应 ref database ?