I get an error each time I use the AddDocument function in the LAPI. The error is a memory error on one machine and the app just bombs with no error on another machine. I've tried different files (TXT & TIFF), but the same error occurs. The doc does get created, but not without the error.
Also, I've tried to use the CreateObjectEx function and get the same problem. But this function does not create the document. I've tried to add to the root of the Enterprise Workspace as well as other sub-folders. Same problem.
What am I missing? Does anyone have an example? Here's the function I created:
Public Function Create_LLDoc(ByVal lParentID As Long, ByVal sName As String, ByVal lType As Long, ByVal sPath As String) As String
Dim status As Long
Dim NodeID As Long
Dim nodeVol As Long
Dim lObjInfo As Long
' Add document
'status = LL_AddDocument(session, parentVol, lParentID, sName, sPath, ObjInfo, 0)
status = LL_CreateObjectEx(session, parentVol, lParentID, LL_OBJECTTYPE, lType, sName, 1, lObjInfo)
If (status = LL_OK) Then
status = LL_AssocGetInteger(ObjInfo, "ID", NodeID)
End If
status = LL_CreateVersion(session, parentVol, NodeID, sPath, 1)
If (status = LL_OK) Then
CreateLLDoc = CStr(NodeID)
Else
CreateLLDoc = ""
End If
End Function
Thanks!
Also, I've tried to use the CreateObjectEx function and get the same problem. But this function does not create the document. I've tried to add to the root of the Enterprise Workspace as well as other sub-folders. Same problem.
What am I missing? Does anyone have an example? Here's the function I created:
Public Function Create_LLDoc(ByVal lParentID As Long, ByVal sName As String, ByVal lType As Long, ByVal sPath As String) As String
Dim status As Long
Dim NodeID As Long
Dim nodeVol As Long
Dim lObjInfo As Long
' Add document
'status = LL_AddDocument(session, parentVol, lParentID, sName, sPath, ObjInfo, 0)
status = LL_CreateObjectEx(session, parentVol, lParentID, LL_OBJECTTYPE, lType, sName, 1, lObjInfo)
If (status = LL_OK) Then
status = LL_AssocGetInteger(ObjInfo, "ID", NodeID)
End If
status = LL_CreateVersion(session, parentVol, NodeID, sPath, 1)
If (status = LL_OK) Then
CreateLLDoc = CStr(NodeID)
Else
CreateLLDoc = ""
End If
End Function
Thanks!