Search Tools Links Login

another way of using dll

another way of using dll
generally i used adding a dll from project>references and so on. but that gave a lot of errors wen i take my project to another pc, so using api, i found this new way of using my dll. hope people here like it, plz give comments !!!
base64 dll came from
and resource function from

Original Author: nagesh borate


Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Sub Form_Load()
On Error GoTo erh
FileLen App.Path & "ase64.dll"
lb = LoadLibrary(App.Path & "ase64.dll")
Dim o As Object
Set o = CreateObject("base64.b64")
MsgBox o.encode("nagesh")
Set o = Nothing
FreeLibrary lb
If Err.Number = 53 Then
GetFromRes 101, App.Path & "ase64.dll"
GoTo continue
End If
End Sub

Private Sub GetFromRes(id As Integer, fp As String)
  Dim fn As Integer
  Dim fb() As Byte
  fb = LoadResData(id, "CUSTOM")
  fn = FreeFile
  Open fp For Binary Access Write As #fn
  Put #fn, , fb
  Close #fn
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 141 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.