Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

External API call initiates 11 threads I can't get rid of

Status
Not open for further replies.

SigridC

Programmer
Mar 18, 2001
5
NO
Hi,

I'm new to this forum, and to VB. I've written a small application meant to integrate Lotus Notes databases with the Document Managment system Domino.doc which runs on a Domino server on NT platform. My problem is the following:

The Application works, but does not terminate when run as an exe. Run in the debugger all is fine and it terminates as it should. I've monitored the process, and on setting a variable to a property using OLE automation against the Domino.Doc API, 11 new threads are started. If I cancel the application before running this line of code, it terminates as it should. I'm dead sure I've set all objects to nothing, and in the opposite order of creating them.

The property I call caches a lot of other objects - I've explicitely uncached them before setting the collection object to nothing.

I've checked the log that the API produces - it creates 3 output files, runs 4 agents on the Domino server and opens 3 sessions on the server. But there's no record of any errors.

I've tried running the code as Lotus Script inside the notes Client - works great.

In the debugger I've checked every step of the closing procedure to make sure all objects and forms are gone by the time I run unload me. I tried leaving an object to see if the debugger would react, and sure enough - it went into not responding. Setting the object back to nothing, and the application terminates in the debugger.

Is there a way I could force the property to run on one thread? I think that's what happens in the debugger, as vb6.exe gets no increase in threads when the app runs in the debugger.

I'm at my wits end how to continue debugging this - any suggestions would be appreciated. I've been at this for 4 days - deadline is tomorrow morning...

regards,
Sigrid

 
maybe this helps :

Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End
Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Hi,

Thank you for responding so fast, but that code is already in my unload event for the main form. As I said in my main post, I'm sure all forms are unloaded, and ALL object are set to nothing. I have narrowed the problem down to this one part of the code containing the external API calls, if I skip that part with a goto statement and continue without those objects, all is well. Only those calls are the core of my program, so I have got to find out why those objects won't go away.

Hoping for more ideas,
regards from Sigrid
 
Hi,

I'm calling the Domino.doc API - A Lotus Product that comes with Domino.Doc 3.0

regards,
Sigrid
 
Hi,
I never said it was windows API - there are lots of other API's around :)? (or maybe :( right now... the other API's are usually for writing integration software between applications, which is what I deal with.

Here's the part of my code that fail - the trouble line in bold (sorry it's a lot):

Code for the form that fail once I've run the LoadLibraryStructure sub

General - Declarations:
'Variables for getting Notesobjects
Dim session As Object
Dim ws As Object
Dim uidb As Variant
Dim uiview As Variant
Dim view As Variant
Dim db As Variant
Dim collection As Variant
Dim uidoc As Variant
Dim doc As Variant
Dim theDocumentDatabase As Variant
Dim theNotesDocument As Variant
Dim theRichTextItem As Variant
Dim theCabinetDatabase As Variant
Dim binderLookupID As Variant
Dim binderEntry As Variant
Dim binderID As String

Dim subject As Variant
Dim namecount As Integer
Dim dbcount As Integer
Dim c As Integer
Dim viewID As String
Dim libNameMembers() As String
Dim libDbMembers() As String
Dim libDbUrlPath() As String
Dim serverurl As String
Dim servername As String
Dim slashpos As Integer
Dim libPath() As String

'function to center dialogs
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

'Declare all api objects as Variants
Dim theApi As Object
Dim theLibrary As Object
Dim theRooms As Object
Dim theCabinets As Object
Dim theCategories As Object
Dim theBinders As Object
Dim theDocuments As Object
Dim theProfiles As Object
Dim theProfile As Object
Dim theCabinet As Object
Dim theBinder As Object
Dim theNewDocument As Object



'Additional properties to the form
Public UserName As String
Public Password As String
Public HostDocHandle As HostDocHandle
Public LoginFailed As Long



'variables for building table for structure display
Private Type RoomInfo
type As String
theRooms As Variant
roomTitle As String
roomIndex As Integer
End Type
Dim Rooms() As RoomInfo

Private Type CabinetInfo
type As String
theCabinets As Variant
cabinetTitle As String
cabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Cabinets() As CabinetInfo

Private Type CategoryInfo
type As String
theCategories As Variant
categoryTitle As String
categoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Categories() As CategoryInfo

Private Type BinderInfo
type As String
theBinders As Variant
binderTitle As String
binderIndex As Integer
parentCategoryTitle As String
parentCategoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Binders() As BinderInfo

Private Type DocumentInfo
type As String
theDocuments As Variant
documentTitle As String
documentIndex As Integer
parentBinderTitle As String
parentBinderIndex As Integer
parentCategoryTitle As String
parentCategoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Documents() As DocumentInfo

Private Type DocumentTypes
CabinetName As String
DocTypeName As String
End Type
Dim doctypes() As DocumentTypes

Private Type Buffer
Name As String
type As String
Index As Integer
End Type


'Dim theBinders() As Variant
'Dim theDocuments() As Variant

Dim NumberOfRooms As Integer
Dim NumberOfCabinets As Integer
Dim NumberOfCategories As Integer
Dim NumberOfBinders As Integer
Dim NumberOfDocuments As Integer
Dim maxRooms As Integer
Dim maxCabinets As Integer
Dim maxCategories As Integer
Dim maxBinders As Integer
Dim maxDocuments As Integer

Dim libraryName As String
Dim roomNames() As String
Dim cabNames() As String
Dim categoryNames() As String
Dim binderNames() As String
Dim documentNames() As String

'Declare Array
Dim listArray(1, 1, 1, 1, 1) As String

Dim nodeitem As Node
Dim nodekey As String
Dim nodetext As String
Dim selectednode As Node


Public Sub LoadLibraryStructure()
On Error GoTo LoadLibError

'----------------
Me.MousePointer = vbHourglass
Me.StartText1.Visible = 0
Me.StartText2(0).Visible = 0
Me.StartText3(1).Visible = 0
Me.StartText4.Visible = 0
Me.StartText5.Visible = 0
Me.StartText6.Visible = 0
Me.StartText7.Visible = 0
Me.Progress1.Visible = 1
Me.Progress2.Visible = 1
pgteller = 10
Me.Progress1.Value = pgteller
pgteller2 = 1
Me.Progress2.Value = pgteller2
Me.Label1.Caption = "Retrieving Domino.doc Rooms: "
Me.Label1.Visible = 1

'---------------

Me.Refresh

ReDim Rooms(0)
ReDim Cabinets(0)
ReDim Categories(0)
ReDim Binders(0)
ReDim Documents(0)
ReDim doctypes(0)

'MsgBox "Starting to grap theAPI"
'Create the Api object
Set theApi = CreateObject("DominoDoc.API")
'MsgBox "theApi is set"
pgteller2 = 5
Me.Progress2.Value = pgteller2
'MsgBox "Progressbar set to 5, login is next"

Call theApi.SetHttpLogin(Me.UserName, Me.Password)
'MsgBox "Have set login with an API method"
pgteller2 = 10
Me.Progress2.Value = pgteller2
'MsgBox "Updated progressbar, will grab lib object"

'Get the Library object from the Api
Set theLibrary = theApi.GetLibrary(Me.OpenLib.Text)
'MsgBox "Have grabbed lib object"
pgteller2 = 15
Me.Progress2.Value = pgteller2
'MsgBox "Updated progressbar, will grab throoms"

'Objects to clear: theAPI,theLibrary


'Get the Rooms from the library
'Redim theRooms(theLibrary.Rooms.Count)
Set theRooms = theLibrary.Rooms
'MsgBox "grabbed theRooms, will run therooms.count"
' GoTo LoadLibError
maxRooms = 0
maxRooms = theRooms.Count
' GoTo DebugJump1

'debug - release theRooms object and recreate it
Call theRooms.UncacheRoomsAndCabinets
Set theRooms = Nothing
Set theRooms = theLibrary.Rooms
' MsgBox "executed resetting theRooms object after count method called"
'end debugcode

'MsgBox "Have grabbed theRooms.Count"
Do While maxRooms = 0
MsgBox "still not done getting rooms count"
Loop

NumberOfRooms = maxRooms
Erase Rooms
ReDim Rooms(NumberOfRooms - 1)


For a = 0 To NumberOfRooms - 1
'MsgBox "Assigning first room to Rooms array"
Set Rooms(a).theRooms = theRooms.ItemByIndex(a)
Rooms(a).roomTitle = Rooms(a).theRooms.Title
Rooms(a).roomIndex = a
Rooms(a).type = "Room"
pgteller2 = Round((90 / NumberOfRooms), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 20
pgteller2 = 130
Me.Progress1.Value = pgteller
Me.Progress2.Value = pgteller2

Me.Label1.Caption = "Retrieving Domino.doc Cabinets: "
Me.Refresh
'Objects to clear: theRooms,Rooms(n).theRooms

'Get the Cabinets object from the Rooms
NumberOfCabinets = 0
maxCabinets = 0
c = 0
pgteller2 = 10
Me.Progress2.Value = pgteller2
g = 0
Erase Cabinets
For a = 0 To NumberOfRooms - 1
'MsgBox "Grabbing the Cabinets of the room"
Set theCabinets = Rooms(a).theRooms.Cabinets
NumberOfCabinets = NumberOfCabinets + theCabinets.Count
ReDim Preserve Cabinets(NumberOfCabinets - 1)
For b = 0 To theCabinets.Count - 1
'MsgBox "Assigning first cabinet to Cabinets array"
Set Cabinets(c).theCabinets = theCabinets.ItemByIndex(b)
Cabinets(c).cabinetTitle = Cabinets(c).theCabinets.Title
Cabinets(c).cabinetIndex = c
Cabinets(c).parentRoomTitle = Rooms(a).theRooms.Title
Cabinets(c).parentRoomIndex = a
Cabinets(c).type = "Cabinet"

'MsgBox "grabbing theProfiles"
Set theProfiles = Cabinets(c).theCabinets.DocumentProfiles
If Not (theProfiles Is Nothing) Then
Erase doctypes
For m = 0 To theProfiles.Count - 1
'MsgBox "Getting profile from theProfiles"
Set theProfile = theProfiles.ItemByIndex(m)
ReDim Preserve doctypes(g)
doctypes(g).CabinetName = Cabinets(c).cabinetTitle
doctypes(g).DocTypeName = theProfile.Name
g = g + 1
Next
End If
'MsgBox "using theCabinets.Count method twice"
If theCabinets.Count > maxCabinets Then
maxCabinets = theCabinets.Count
End If
c = c + 1
pgteller2 = Round((90 / NumberOfRooms), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
Next
pgteller = 35
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2

'Objects to clear: theCabinets,Cabinets(n).theCabinets,theProfiles,theProfile


Me.Label1.Caption = "Retrieving Domino.doc Categories: "

Me.Refresh


'Get the Binders from the Cabinets
NumberOfCategories = 0
maxCategories = 0
c = 0

pgteller2 = 10
Me.Progress2.Value = pgteller2
Erase Categories
For a = 0 To NumberOfCabinets - 1
Set theCategories = Cabinets(a).theCabinets.Categories
NumberOfCategories = NumberOfCategories + theCategories.Count
ReDim Preserve Categories(NumberOfCategories - 1)
For b = 0 To theCategories.Count - 1
Set Categories(c).theCategories = theCategories.ItemByIndex(b)
Categories(c).categoryTitle = Categories(c).theCategories.Title
Categories(c).categoryIndex = c
Categories(c).parentCabinetTitle = Cabinets(a).theCabinets.Title
Categories(c).parentCabinetIndex = a
Categories(c).type = "Category"

If theCategories.Count > maxCategories Then
maxCategories = theCategories.Count
End If
c = c + 1
Next
pgteller2 = Round((90 / NumberOfCabinets), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 60
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2
'Redim Preserve theBinders(NumberOfBinders)


'Objects to clear: theCategories, Categories(n).theCategories


Me.Label1.Caption = "Retrieving Domino.doc Binders: "

Me.Refresh

'Get the Binders from the Cabinets
NumberOfBinders = 0
maxBinders = 0
c = 0

pgteller2 = 10
Me.Progress2.Value = pgteller2
Erase Binders
For a = 0 To NumberOfCategories - 1
Set theBinders = Categories(a).theCategories.Binders
NumberOfBinders = NumberOfBinders + theBinders.Count
ReDim Preserve Binders(NumberOfBinders - 1)
For b = 0 To theBinders.Count - 1
Set Binders(c).theBinders = theBinders.ItemByIndex(b)
Binders(c).binderTitle = Binders(c).theBinders.Title
Binders(c).binderIndex = c
Binders(c).parentCategoryTitle = Categories(a).theCategories.Title
Binders(c).parentCategoryIndex = a
Binders(c).parentCabinetTitle = Categories(a).parentCabinetTitle
Binders(c).parentCabinetIndex = Categories(a).parentCabinetIndex
Binders(c).type = "Binder"

If theBinders.Count > maxBinders Then
maxBinders = theBinders.Count
End If
c = c + 1
Next
pgteller2 = Round((90 / NumberOfCategories), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 60
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2

'Objects to Clear: theBinders, Binders(n).theBinders

'START FOR CODE TO ACTIVATE WHEN NEEDINT TO DISPLAY DOCUMENTS IN TREEVIEW

' Me.Label1.Caption = "Retrieving Domino.doc Documents: "

' Me.Refresh

'Get the Documets from the Binders
' NumberOfDocuments = 0
' maxDocuments = 0
' c = 0

' pgteller2 = 10
' Me.Progress2.Value = pgteller2
' Erase Documents
' For a = 0 To NumberOfBinders - 1
' set theDocuments = Binders(a).theBinders.Documents
' NumberOfDocuments = NumberOfDocuments + theDocuments.Count
' If NumberOfDocuments > 0 Then
' ReDim Preserve Documents(NumberOfDocuments - 1)
' End If
' For b = 0 To theDocuments.Count - 1
' Set Documents(c).theDocuments = theDocuments.ItemByIndex(b)
' Documents(c).documentTitle = Documents(c).theDocuments.Title
' Documents(c).documentIndex = c
' Documents(c).parentBinderTitle = Binders(a).theBinders.Title
' Documents(c).parentBinderIndex = a
' Documents(c).parentCategoryTitle = Binders(a).parentCategoryTitle
' Documents(c).parentCategoryIndex = Binders(a).parentCategoryIndex
' Documents(c).parentCabinetTitle = Binders(a).parentCabinetTitle
' Documents(c).parentCabinetIndex = Binders(a).parentCabinetIndex
' Documents(c).parentRoomTitle = Cabinets(Documents(c).parentCabinetIndex).parentRoomTitle
' Documents(c).parentRoomIndex = Cabinets(Documents(c).parentCabinetIndex).parentRoomIndex
' Documents(c).type = "Document"

' If theDocuments.Count > maxDocuments Then
' maxDocuments = theDocuments.Count
' End If
' c = c + 1
' Next
' pgteller2 = Round((98 / NumberOfBinders), 0) + pgteller2
' Me.Progress2.Value = pgteller2
' Next
' Call theDocuments.Uncache
' Set theDocuments = Nothing
' pgteller2 = 130
' Me.Progress2.Value = pgteller2
' pgteller = 95
' Me.Progress1.Value = pgteller
' Me.Label1.Caption = "Done"
' pgteller2 = 1

'END CODE TO GRAB THE DOCUMENTS FOR PUTTING IN THE DISPLAY




c = 0
Me.Progress2.Visible = 0
Me.Progress1.Value = 100
stopWatch = Timer
While ((Timer - stopWatch) < 1)
Wend
Me.Progress1.Visible = 0
Me.Label1.Visible = 0
' GoTo DebugJump1



'Building the nodes for the Treeview control
nodekey = &quot;Lib&quot;
If Me.OpenLib.Text = &quot; Then
nodetext = &quot;HTP Library&quot;
Else
nodetext = theLibrary.Database
End If
nodeimage = &quot;library&quot;
parentkey = &quot;&quot;
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(, , nodekey, nodetext, nodeimage)
nodeitem.Expanded = True

For a = 0 To NumberOfRooms - 1
nodekey = Rooms(a).type & Rooms(a).roomIndex
nodetext = Rooms(a).roomTitle
nodeimage = &quot;fileroom&quot;
parentkey = &quot;Lib&quot;
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
roomkey = nodekey
For d = 0 To NumberOfCabinets - 1
parentkey = roomkey
If Cabinets(d).parentRoomTitle = Rooms(a).roomTitle Then
nodekey = Cabinets(d).type & Cabinets(d).cabinetIndex
nodetext = Cabinets(d).cabinetTitle
nodeimage = &quot;cabinet&quot;
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
cabkey = nodekey
For e = 0 To NumberOfCategories - 1
parentkey = cabkey
If Categories(e).parentCabinetTitle = Cabinets(d).cabinetTitle Then
nodekey = Categories(e).type & Categories(e).categoryIndex
If Not (Categories(e).categoryTitle = &quot;&quot;) Then
nodetext = Categories(e).categoryTitle
Else
nodetext = &quot;Not Categorized&quot;
End If
nodeimage = &quot;category&quot;
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
catkey = nodekey
For f = 0 To NumberOfBinders - 1
parentkey = catkey
If Binders(f).parentCategoryTitle = Categories(e).categoryTitle Then
nodekey = Binders(f).type & Binders(f).binderIndex
nodetext = Binders(f).binderTitle
nodeimage = &quot;binder&quot;
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
End If
Next
End If
Next
End If
Next
Next
firstcab = doctypes(0).CabinetName
For z = 0 To UBound(doctypes)
If doctypes(z).CabinetName = firstcab Then
Me.DocType.AddItem doctypes(z).DocTypeName, z
End If
Next

DebugJump1:
'kill the objects not needed when loaded
'API & library
LoginDomdoc.LoginSucceeded = True

'objects in userdefined datatypes
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
' MsgBox &quot;Binders Is Cached&quot;
End If
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
' Set theBinders = Nothing
End If
If Not (theCategories Is Nothing) Then
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Erase Categories
Set theCategories = Nothing
End If
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
Set theProfile = Nothing
End If
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
End If
'Clear the memory of DDocAPI cached objects
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox &quot;Binders Is still Cached&quot;
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing




Me.DocType.Text = Me.DocType.List(0)
Me.Height = 9600
Me.LibStructureTreeView.Visible = True
Me.DocTitleLabel.Visible = True
Me.Title.Visible = True
Me.DocTypeLabel.Visible = True
Me.DocType.Visible = True
Me.DocIDLabel.Visible = True
Me.DocID.Visible = True
Me.AttachmentsOnly.Visible = True
Me.CompoundDoc.Visible = True
Me.NumGen.Visible = True
Me.DocFrame.Visible = True
Me.MapFrame.Visible = True
Me.EditProperties.Visible = True
Me.MapFields.Visible = True
Me.TransferProperties.Visible = True
Me.PresetMapConfig.Visible = True
Me.ShowMapping.Visible = True
Me.Save.Enabled = True
Me.MousePointer = vbDefault
' Me.Title.SetFocus
Me.Refresh

Exit Sub





LoadLibError:
If Err.Number = 40007 Then
If Me.LoginFailed < 3 Then
Err.Clear
Me.LoginFailed = Me.LoginFailed + 1
MsgBox &quot;Access Denied. Check your username and password and try again or cancel&quot;
If Not (theRooms Is Nothing) Then
Call theRooms.UncacheRoomsAndCabinets
Set theRooms = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
'MsgBox &quot;have killed theAPI and theLibrary, resetting progressbar&quot;
pgteller2 = 5
Me.Progress2.Value = pgteller2
Me.Label1.Caption = &quot;Ready&quot;
'MsgBox &quot;progress reset,setting loginsuccess boolean&quot;
LoginDomdoc.LoginSucceeded = True
'MsgBox &quot;giving control back to login box&quot;
LoginDomdoc.Show
Exit Sub
Else
MsgBox &quot;Access Denied. Terminating program&quot;
Err.Clear
Set HostDoc = Nothing

'objects in userdefined datatypes
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
MsgBox &quot;Binders Is Cached&quot;
End If
' Set theBinders = Nothing
End If
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Set theProfile = Nothing
Erase Categories
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
End If
Set theCategories = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
End If
'Clear the memory of DDocAPI cached objects
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox &quot;Binders Is still Cached&quot;
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing

LoginDomdoc.LoginSucceeded = False
Unload Me
Exit Sub
End If
Else
MsgBox &quot;Error &quot; & CStr(Err.Number) & &quot;. &quot; & Err.Description
Set nodeitem = Nothing
For Each Node In LibStructureTreeView.Nodes
Set Node = Nothing
Next Node
Erase doctypes

'objects in userdefined datatypes
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
MsgBox &quot;Binders Is Cached&quot;
End If
' Set theBinders = Nothing
End If
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Set theProfile = Nothing
Erase Categories
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
End If
Set theCategories = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
End If
'Clear the memory of DDocAPI cached objects
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox &quot;Binders Is still Cached&quot;
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
LoginDomdoc.LoginSucceeded = False
Unload SaveDialog
Unload Me
Exit Sub

End If

End Sub


Private Sub Cancel_Click()
' Call Me.ShutDown
Set HostDoc = Nothing
' Me.HostDocHandle = Nothing
' Me.UserName = &quot;&quot;
' Me.Password = &quot;&quot;


' Set theProfiles = Nothing
' Set theProfile = Nothing
Set nodeitem = Nothing
For Each Node In LibStructureTreeView.Nodes
Set Node = Nothing
Next Node
' Erase doctypes
Unload LoginDomdoc
' Unload Me
' Set SaveDialog = Nothing

Unload SaveDialog
Set SaveDialog = Nothing
Unload Me
' End
End Sub

LoginDomdoc - form code:
Option Explicit

Public LoginSucceeded As Boolean

Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub

Private Sub cmdOK_Click()
'MsgBox &quot;setting username&quot;
SaveDialog.UserName = Me.UserNameInput
'MsgBox &quot;setting password&quot;
SaveDialog.Password = Me.PasswordInput
Me.Hide
' Unload Me
'MsgBox &quot;giving control to save dialog&quot;
Call SaveDialog.LoadLibraryStructure
If Me.LoginSucceeded = False Then
Unload SaveDialog
Unload Me
End If
End Sub
 
Hi Eric,

How do you mean Quit? The Domino.doc API object has no quit method. In vb I can only find the Quit method related to an Application object from the Office or Smartsuite products, or on add-ins in the vb designer. The method exist for the vbe object, but I thought that was related to the designer environment?

I may be dumb here, but could you elaborate a bit? I sure hope this is the solution!

regards,
Sigrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top