On the File menu, choose Make projectname.dll… You must correct any compile errors before completing this step.
Like any ActiveX DLL, you want your server to be binary compatible, so that future versions of the server can be deployed on a client machine simply by replacing the old file with the new file. To do this:
First, we will test the interval server independent of the PITimeServer.
Private Sub Form_Load() Dim intv As ITimeIntervals Set intv = New Intervals Debug.Print intv.Name Debug.Print intv.Description Debug.Print "Count = "; intv.Count Dim i As Integer, j As Integer Dim ti As ITimeInterval Dim pt As PITime For i = 1 To intv.Count Set ti = intv.Item(i) With ti Debug.Print .Name & " (" & _ .PluralName & ", " & .ShortName & ")" Debug.Print "Ordinals: " & _ .MemberLo & "-" & .MemberHi On Error GoTo NONAME For j = .MemberLo To .MemberHi Debug.Print .MemberName(j) & _ " (" & .MemberShortName(j) & ")" Next NONAME: If Err Then Debug.Print "Members have no names" On Error GoTo 0 Set pt = New PITime pt.SetToCurrent Debug.Print "Current ordinal = " & .Ordinal(pt) Debug.Print "Current start time = " & _ .StartTime(pt) Debug.Print "Plus two intervals = " & _ .AddIntervals(pt, 2) Debug.Print "Minus two intervals = " & _ .AddIntervals(pt, -2) Debug.Print "Next instance of ord " & _ .MemberLo & ": " & _ .FindMember(pt, .MemberLo, fiAfter) Debug.Print "Next instance of ord " & _ .MemberHi & ": " & _ .FindMember(pt, .MemberHi, fiAfter) Debug.Print "Previous instance of ord " & _ .MemberLo & ": " & _ .FindMember(pt, .MemberLo, fiBefore) Debug.Print "Previous instance of ord " & _ .MemberHi & ": " & _ .FindMember(pt, .MemberHi, fiBefore) End With Next End Sub
Run the program. This is not an exhaustive test, but it should pinpoint many problems.
Add your own VB code to exercise any functions you may be concerned about.
To test with the PITimeServer, you must first register your DLL. Follow the instructions given under “Deployment” to do this.
If you use the RegisterIntervalServer utility, it performs several rudimentary tests.
To test further, build a VB project with reference to the PITimeServer, and add code that gets each of your intervals by name. (You won’t be able to see your Intervals collection directly.) Then test as above.
If your independent testing was thorough, there should be little need for integrated testing.