Einzelnen Beitrag anzeigen

tkone

Registriert seit: 2. Okt 2009
Ort: Sachsen
63 Beiträge
 
Delphi 7 Professional
 
#12

AW: Welche Sprache und wie in Delphi implementieren?

  Alt 30. Aug 2010, 19:41
so ich hab mal etwas zeit zu basteln
hab mich zunächst an der DLL versucht, da ich nicht so viel zum orginalprogramm verändern möchte.
die vb deklarationen sahen so aus
Code:
Attribute VB_Name = "Module1"
Declare Function OPENCOM Lib "RSCOM" (ByVal OpenString$) As Integer
Declare Sub TIMEOUTS Lib "RSCOM" (ByVal b%)
Declare Sub BUFFERSIZE Lib "RSCOM" (ByVal b%)
Declare Sub CLOSECOM Lib "RSCOM" ()
Declare Sub SENDBYTE Lib "RSCOM" (ByVal Dat%)
Declare Function READBYTE Lib "RSCOM" () As Integer
Declare Sub SENDSTRING Lib "RSCOM" (ByVal Dat$)
Declare Function READSTRING Lib "RSCOM" () As String
Declare Sub CLEARBUFFER Lib "RSCOM" ()
Declare Function INBUFFER Lib "RSCOM" () As Integer
Declare Function OUTBUFFER Lib "RSCOM" () As Integer
Declare Sub DTR Lib "RSCOM" (ByVal b%)
Declare Sub RTS Lib "RSCOM" (ByVal b%)
Declare Sub TXD Lib "RSCOM" (ByVal b%)
Declare Function CTS Lib "RSCOM" () As Integer
Declare Function DSR Lib "RSCOM" () As Integer
Declare Function RI Lib "RSCOM" () As Integer
Declare Function DCD Lib "RSCOM" () As Integer
Declare Function INPUTS Lib "RSCOM" () As Integer
Declare Sub TIMEINIT Lib "RSCOM" ()
Declare Function TIMEREAD Lib "RSCOM" () As Double
Declare Sub DELAY Lib "RSCOM" (ByVal ms As Double)
Declare Sub REALTIME Lib "RSCOM" ()
Declare Sub NORMALTIME Lib "RSCOM" ()

Declare Function ShellExecuteA Lib "shell32.dll" ( _
    ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long _
  ) As Long
bisher sieht meine unit so aus
Delphi-Quellcode:
unit Controller;

interface

{$L 'RSCOM.dll'}
procedure OPENCOM (OpenString:string); stdcall; external 'RSCOM.dll';
procedure TIMEOUTS (b:integer); stdcall; external 'RSCOM.dll';
procedure BUFFERSIZE (b:integer); stdcall; external 'RSCOM.dll';
procedure CLOSECOM (); stdcall; external 'RSCOM.dll';
procedure SENDBYTE (Dat:string); stdcall; external 'RSCOM.dll';
function READBYTE (): Integer; stdcall; external 'RSCOM.dll';
procedure SENDSTRING (Dat:string); stdcall; external 'RSCOM.dll';
function READSTRING (): String; stdcall; external 'RSCOM.dll';
procedure CLEARBUFFER (); stdcall; external 'RSCOM.dll';
function INBUFFER (): Integer; stdcall; external 'RSCOM.dll';
function OUTBUFFER (): Integer; stdcall; external 'RSCOM.dll';
procedure DTR (b:integer); stdcall; external 'RSCOM.dll';
procedure RTS (b:integer); stdcall; external 'RSCOM.dll';
procedure TXD (b:integer); stdcall; external 'RSCOM.dll';
function CTS (): Integer; stdcall; external 'RSCOM.dll';
function DSR (): Integer; stdcall; external 'RSCOM.dll';
function RI (): Integer; stdcall; external 'RSCOM.dll';
function DCD (): Integer; stdcall; external 'RSCOM.dll';
function INPUTS (): Integer; stdcall; external 'RSCOM.dll';
procedure TIMEINIT (); stdcall; external 'RSCOM.dll';
function TIMEREAD (): Double; stdcall; external 'RSCOM.dll';
procedure DELAY (ms: Double); stdcall; external 'RSCOM.dll';
procedure REALTIME (); stdcall; external 'RSCOM.dll';
procedure NORMALTIME (); stdcall; external 'RSCOM.dll';

function ShellExecuteA (hwnd: Longint; lpOperation: String; lpFile: String;
         lpParameters: String; lpDirectory: String; nShowCmd: Longint): Longint;
         stdcall; external 'shell32.dll';

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
function INBUFFER (): Integer; stdcall;
end;

end.
jetzt mekert mein delphi natürlich herum, dass noch eine deklaration erwartet wird ( vor uses)
hat jemand eine ahnung, wie ich das handhaben kann?
  Mit Zitat antworten Zitat