DLL's kan bruges til meget... jeg plejer kun at bruge dem til funktioner.. fx følgende:
Option Explicit ' Variablen testFunc kan laves om til det du vil, ' men hvor der står testFunction.testFunc er det ' forudset at DLL filen hedder testFunction og ' class'en i DLL filen hedder testFunc
Dim testFunc As New testFunction.testFunc
Private Sub Command1_Click() On Error GoTo errorhandler Call testFunc.testFunction(Text1.Text, Text2.Text) Exit Sub errorhandler: If (Err.Number = 13) Then MsgBox "Du skal skrive et nummer i den næste boks", vbCritical, "Fejl" Else MsgBox "Der opstod en fejl: " & Err.Description, vbCritical, "Fejl" End If End Sub
Private Sub Form_Load() Text1.Text = "Skriv din string" Text2.Text = "Skriv dit nummer" Command1.Caption = "Afprøv funktionen" End Sub
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.