| | |
Other Language DLL
![]() |
•
•
Join Date: Nov 2008
Posts: 18
Reputation:
Solved Threads: 0
Hello Friends,
i m using the function to built DLL in delphi but when call it in vb 6.0 application i m not able to use this dll as reference.
Please help me. Following code which i have used to built delphi DLL.
------------------------------------------------------------------------------
i m using the function to built DLL in delphi but when call it in vb 6.0 application i m not able to use this dll as reference.
Please help me. Following code which i have used to built delphi DLL.
------------------------------------------------------------------------------
visualbasic Syntax (Toggle Plain Text)
library Project2; uses SysUtils, Classes, Dialogs; {$R *.res} const C1 = 43941; C2 = 16302; var Result : string; function BorlandEncrypt(const S: String; Key: Word): String; var I: byte; begin SetLength(Result,Length(S)); for I := 1 to Length(S) do begin Result[i] := char(byte(S[i]) xor (Key shr 8)); Key := (byte(Result[i]) + Key) * C1 + C2; end; end; const Alphabet : string[64] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; function Encode64(st : string) : string; var i,idx : integer; begin Result := ''; i := 1; while i <= length(st) do begin // 1st char idx := ord(st[i]) and $FC shr 2; Result := Result + Alphabet[idx+1]; // 2nd char idx := (ord(st[i]) and $3 shl 4); if i+1 <= length(st) then idx := idx + (ord(st[i+1]) and $F0 shr 4); Result := Result + Alphabet[idx+1]; // 3rd char if i+1 <= length(st) then begin idx := (ord(st[i+1]) and $F shl 2); if i+2 <= length(st) then idx := idx + (ord(st[i+2]) and $C0 shr 6); Result := Result + Alphabet[idx+1]; end else Result := Result + '='; // 4th char if i+2 <= length(st) then begin idx := (ord(st[i+2]) and $3F); Result := Result + Alphabet[idx+1]; end else Result := Result + '='; // next source char Inc(i,3); end; end; function Encrypt(password : string) : string; StdCall; begin { ----old encrypt ---- result := ''; for i := 1 to length(password) do result := result + char( (ord(password[i]) xor 43) + 11 ); } // new encrypt password := BorlandEncrypt(password,17732); Result := '<' + Encode64(password) + '>'; //Result := '<' + Encode64(password) + '>'; end; Exports Encrypt; Begin end.
Last edited by cscgal; Nov 13th, 2008 at 4:28 pm. Reason: Added code tags
![]() |
Similar Threads
- DLL and Application (C++)
- how to convert C++ DLL to be compatible with C# (VB.NET)
- Help! What Language is this? (Assembly)
- Windows 98se language problem (Windows 95 / 98 / Me)
- Windows XP and Corel Suite 8 (WP8) errors (Windows NT / 2000 / XP)
- problem with dll file (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB6 ACCESS database Connection Query
- Next Thread: communication protocol for Endress-Hauser recorders
| Thread Tools | Search this Thread |
* 6 2007 access activex add age basic beginner birth bmp calculator cd cells.find click client code college connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit excel excelmacro file filename form header iamthwee image inboxinvb internetfiledownload listbox listview liveperson login looping microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading refresh remotesqlserverdatabase report save search sendbyte sites sql sql2008 sqlserver subroutine tags time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






