Other Language DLL

Reply

Join Date: Nov 2008
Posts: 18
Reputation: poilkjmnb is an unknown quantity at this point 
Solved Threads: 0
poilkjmnb poilkjmnb is offline Offline
Newbie Poster

Other Language DLL

 
0
  #1
Nov 13th, 2008
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.
------------------------------------------------------------------------------
visualbasic Syntax (Toggle Plain Text)
  1. library Project2;
  2.  
  3.  
  4. uses
  5. SysUtils,
  6. Classes,
  7. Dialogs;
  8.  
  9. {$R *.res}
  10.  
  11. const
  12. C1 = 43941;
  13. C2 = 16302;
  14.  
  15. var
  16. Result : string;
  17.  
  18. function BorlandEncrypt(const S: String; Key: Word): String;
  19. var
  20. I: byte;
  21. begin
  22. SetLength(Result,Length(S));
  23. for I := 1 to Length(S) do begin
  24. Result[i] := char(byte(S[i]) xor (Key shr 8));
  25. Key := (byte(Result[i]) + Key) * C1 + C2;
  26. end;
  27. end;
  28.  
  29. const
  30. Alphabet : string[64] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  31.  
  32. function Encode64(st : string) : string;
  33.  
  34. var
  35. i,idx : integer;
  36. begin
  37. Result := '';
  38. i := 1;
  39. while i <= length(st) do
  40. begin
  41. // 1st char
  42. idx := ord(st[i]) and $FC shr 2;
  43. Result := Result + Alphabet[idx+1];
  44. // 2nd char
  45. idx := (ord(st[i]) and $3 shl 4);
  46. if i+1 <= length(st) then idx := idx + (ord(st[i+1]) and $F0 shr 4);
  47. Result := Result + Alphabet[idx+1];
  48. // 3rd char
  49. if i+1 <= length(st) then
  50. begin
  51. idx := (ord(st[i+1]) and $F shl 2);
  52. if i+2 <= length(st) then idx := idx + (ord(st[i+2]) and $C0 shr 6);
  53. Result := Result + Alphabet[idx+1];
  54. end
  55. else
  56. Result := Result + '=';
  57. // 4th char
  58. if i+2 <= length(st) then
  59. begin
  60. idx := (ord(st[i+2]) and $3F);
  61. Result := Result + Alphabet[idx+1];
  62. end
  63. else
  64. Result := Result + '=';
  65. // next source char
  66. Inc(i,3);
  67. end;
  68. end;
  69.  
  70. function Encrypt(password : string) : string; StdCall;
  71.  
  72. begin
  73. { ----old encrypt ----
  74. result := '';
  75. for i := 1 to length(password) do
  76. result := result + char( (ord(password[i]) xor 43) + 11 ); }
  77.  
  78. // new encrypt
  79. password := BorlandEncrypt(password,17732);
  80. Result := '<' + Encode64(password) + '>';
  81. //Result := '<' + Encode64(password) + '>';
  82. end;
  83.  
  84. Exports
  85. Encrypt;
  86.  
  87. Begin
  88. end.
Last edited by cscgal; Nov 13th, 2008 at 4:28 pm. Reason: Added code tags
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,068
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 123
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Other Language DLL

 
0
  #2
Nov 13th, 2008
1.compile the dll.
2.copy the dll to system32 folder
3.register the component with windows using REGSVER32.
4.Then call the dll from vb from Project--references menu.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 18
Reputation: poilkjmnb is an unknown quantity at this point 
Solved Threads: 0
poilkjmnb poilkjmnb is offline Offline
Newbie Poster

Re: Other Language DLL

 
0
  #3
Nov 14th, 2008
Originally Posted by debasisdas View Post
1.compile the dll.
2.copy the dll to system32 folder
3.register the component with windows using REGSVER32.
4.Then call the dll from vb from Project--references menu.
but when register the DLL it show the message entry point not found.
what can i do for this?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC