Hallo,
habe heute eine erneute Frage, da ich mal wieder mit einem Problem nicht zurecht komme.
Ich habe hier eine DLL welche mit Delphi 2 geschrieben wurde und folgenden Inhalt hat:
Spoiler anzeigen
Nun habe ich in Visual Basic versucht, jene Dll wie folgt einzubinden:
aber wenn ich mir dann etwas anzeigen lassen möchte, bekomme ich mit z.B.:
Erscheint in der MessageBox dann
Und VB meldet, das da noch ein Ausdruck fehlt.
das gleiche auch mit "sCheckDatabaseFormat" und "sGetCallInfo".
Könnte mir jemand bitte weiter helfen, stehe da auf dem Schlauch.
Danke schön.
habe heute eine erneute Frage, da ich mal wieder mit einem Problem nicht zurecht komme.
Ich habe hier eine DLL welche mit Delphi 2 geschrieben wurde und folgenden Inhalt hat:
Quellcode
- PROGRAM Dlldemo;
- (* TC in 2'97. Delphi2.
- This program demonstrates the usage of the interface dll RAC.DLL,
- 32 bit version).
- IMPORTANT: This project has to be compiled as an console application. Use
- Project|Options (linker page) to instruct your compiler.
- *)
- (* Compiler settings used *)
- (*$DebugInfo On*)
- (*$LocalSymbols On*)
- (*$ReferenceInfo On*)
- (*$Align Off*) (* No word align *)
- (*$Optimization On*)
- (*$SafeDivide On*)
- (*$StackFrames Off*)
- (*$IOChecks Off*)
- (*$RangeChecks Off*)
- (*$StackChecks On*)
- (*$OverflowChecks Off*)
- (*$VarStringChecks Off*)
- (*$OpenStrings On*)
- (*$TypedAddress Off*)
- (*$BoolEval Off*)
- (*$ExtendedSyntax On*)
- (*$WriteableConst Off*)
- (*$LongStrings On*)
- USES
- SysUtils;
- PROCEDURE pGetVersionNr(
- var AVersionNr : word); pascal; external 'rac.dll';
- PROCEDURE pCheckDatabaseFormat(
- ADriveInfo : pointer;
- var AResult : word;
- var AErrorCode : SmallInt); pascal; external 'rac.dll';
- PROCEDURE pGetCallInfo(DriveInfo: pointer; ACall: pointer; AInfo: pointer;
- var AErrorCode: SmallInt); pascal; external 'rac.dll';
- VAR
- Call : ARRAY[0..6] OF char;
- Info : ARRAY[0..500] OF char;
- DriveInfo : ARRAY[0..80] OF char;
- ErrorCode : SmallInt;
- i : SmallInt;
- VersionNr : word;
- CheckResult : word;
- BEGIN
- sGetVersionNr(VersionNr);
- writeln('DLL VersionNr: ', VersionNr);
- write('DriveInfo: ');
- readln(DriveInfo);
- sCheckDataBaseFormat(@DriveInfo, CheckResult, ErrorCode);
- IF (ErrorCode = 0) AND (CheckResult = 0) THEN begin
- writeln('CheckDatabaseFormat: ok.');
- end
- ELSE begin
- IF ErrorCode <> 0 THEN begin
- writeln('ErrorCode: ', ErrorCode);
- end
- ELSE begin
- writeln('CheckDatabaseFormat: DLL does not match with CD');
- end;
- end;
- write('Call: ');
- readln(Call);
- writeln('Call: >' + Call + '<');
- sGetCallInfo(@DriveInfo, @Call, @Info, ErrorCode);
- IF ErrorCode = 0 THEN begin
- writeln('ok.');
- i := 0;
- WHILE Info[i] <> #0 DO begin
- IF byte(Info[i]) < 32 THEN begin
- write(byte(Info[i]), ': >');
- end
- ELSE begin
- write(Info[i]);
- end;
- inc(i);
- IF byte(Info[i]) < 32 THEN begin
- writeln('<');
- end;
- end;
- writeln;
- end
- ELSE begin
- writeln('ErrorCode: ', ErrorCode);
- end;
- write('Press Enter to quit...');
- readln;
- end.
Nun habe ich in Visual Basic versucht, jene Dll wie folgt einzubinden:
VB.NET-Quellcode
- Private Declare Sub sGetVersionNr Lib "E:\win32\rac" (ByRef AVersionNr As Integer)
- Private Declare Sub sCheckDatabaseFormat Lib "E:\win32\rac" (ByVal ADriveInfo As String, ByRef AResult As Integer, ByRef AErrorCode As Integer)
- Private Declare Sub sGetCallInfo Lib "E:\win32\rac" (ByVal ADriveInfo As String, ByVal ACall As String, ByVal AInfo As String, ByRef AErrorCode As Integer)
aber wenn ich mir dann etwas anzeigen lassen möchte, bekomme ich mit z.B.:
Erscheint in der MessageBox dann
Und VB meldet, das da noch ein Ausdruck fehlt.
das gleiche auch mit "sCheckDatabaseFormat" und "sGetCallInfo".
Könnte mir jemand bitte weiter helfen, stehe da auf dem Schlauch.
Danke schön.