Autor Beitrag
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 24.11.11 17:14 
Moin moin.

Nach Jahren mal wieder ein Posting.

Wir sitzen gerade an einem tollen Problem: Zugriff auf SAP über die librfc32.dll (neueste Version aus dem Marketplace).

Unser Handle ist immer 0, Fehlermeldung gibt es auch nicht. Wir sind mit dem Latein am Ende oder einfach nur blind

Gibt es bei der Deklaration einen Fehler?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
unit main;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  Tfrm_main = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
    myConStr: PCHAR;
  public
    { Public-Deklarationen }
  end;

type
    PRfcErrorInfoEx = ^TRfcErrorInfoEx;
    TRfcErrorInfoEx = record
      group : integer;
      key : array[0..32of char;
      amessage : array[0..512of char;
    end;

function RfcOpenEx(ConString: PCHAR; RFC_ERROR: PRfcErrorInfoEx): THandle; stdcallexternal 'D:\_Entwicklung\SAPmitLIBRFC32_App\Win32\Debug\librfc32.dll';

var
  frm_main: Tfrm_main;


implementation

{$R *.dfm}



procedure Tfrm_main.Button1Click(Sender: TObject);
var myHandle: Long;
    data: PRfcErrorInfoEx;
    myError: TRfcErrorInfoEx;
    blubb: integer;
begin
 myConStr:= 'ASHOST=1xxx SYSNR=0 CLIENT=xxx USER=xxx PASSWD=sxxx LANG=DE';
 myHandle:= rfcOpenEx(pchar(myConStr), @myError);
 blubb:= myError.group;
end;

end.


Über Hilfe wären wir sehr froh,

Die zwei Verzweifelten.

Crossposting: www.delphipraxis.net...dll.html#post1137719

Entwicklungssystem:

Windows 7 Ultimate x64, neuester Stand
Delphi XE2 Professional, neuester Stand

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.