- This topic is empty.
-
AuthorPosts
-
January 7, 2005 at 8:54 am #2528sistemiMember
I’ve a windows 2000 PC’s SP4 and winfax PRO 10.0.
I’ve developed a faxserver application, which start every X minutes every day. This works fine, except that every 2-3 days, the application hangs on the window (“Converting fax into image”…). So, the next time my application starts, the winfax object is still locked, the word object can’t create a new fax, and all application crash. This is my code for sending:‘**********************************
Private Function SpedisciFax(rs As Recordset, PrenStr As String) As BooleanDim t As Integer
Dim OBJwinFAX As Object
Dim hregkey As Long ‘ receives handle to the newly created or opened registry key
Dim secattr As SECURITY_ATTRIBUTES ‘ security settings of the key
Dim subkey As String ‘ name of the subkey to create
Dim neworused As Long ‘ receives 1 if new key was created or 2 if an existing key was opened
Dim Ntel As String ‘ the string to put into the registry
Dim ID As Long ‘ the string to put into the registry
Dim retval As Long ‘ return valueOn Error GoTo ErrExit
‘ Writing registry
secattr.nLength = Len(secattr) ‘ size of the structure
secattr.lpSecurityDescriptor = 0 ‘ default security level
secattr.bInheritHandle = True ‘ the default value for this setting
Ntel = Trim(ConvNull(rs!NUMERO_FAX))ID = Trim(rs!ID)
Debug.Print IDnamefile = “c:temp” & Trim(rs!ID) & “_” & Trim(rs!NUMERO_SINISTRO) & “.doc”
WDoc.SaveAs FileName:=namefile, FileFormat:=wdFormatDocument, LockComments:=False, Password:=””, AddToRecentFiles:=True, WritePassword:=””, ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
‘inserted by WinFaxPro
Set OBJwinFAX = CreateObject(“WINFAX.SDKSEND8.0”)OBJwinFAX.SetNumber (Ntel)
OBJwinFAX.setsubject (ID)
OBJwinFAX.SetCompany (“Casa di cura”)
OBJwinFAX.AddRecipient
OBJwinFAX.AddAttachmentFile namefile
OBJwinFAX.Send (0)‘inserito dal WinFaxPro
WDoc.Close wdDoNotSaveChanges
WApp.Quit wdDoNotSaveChangesSet OBJwinFAX = Nothing
Set WDoc = Nothing
Set WApp = Nothing
SpedisciFax = False
Exit FunctionErrExit:
Call ScriviLog(“Errore nell’invio a WinFax: ” + Str$(Err))
SpedisciFax = TrueEnd Function
‘**********************************
I’ve searched in the forum for topics like this, and I hadn’t found nothing exaustive about (i.e.: I release the objwinfax after used; I don’t use in this PC Outlook, cause I know that this could generate problems…)
Thank in advance for any help/suggestions
ByeJanuary 12, 2005 at 6:46 pm #4249AnonymousMemberTry using Send(1) instead and wait until the attachment has been created in WinFax before you set the object=nothing.
-
AuthorPosts
- You must be logged in to reply to this topic.