1 Attachment(s)
Re: Suggestions to resolve Runtime Error 75 path/file access denied
Thanks Doogle.
I know you alluded to the timing issue before. I should have invoked it back then. I have it set now. Also, the pop3 connect will now fire at 5 min intervals.
Attached is the latest update and fully usable project. Please go through the Readme.txt file to get it up and running.
I'll get the test started once I get home in a couple of hours.
Re: Suggestions to resolve Runtime Error 75 path/file access denied
Re: Suggestions to resolve Runtime Error 75 path/file access denied
ok, test started...
Ditto!
Re: Suggestions to resolve Runtime Error 75 path/file access denied
late last night after the 6 day mark, the "10055 no buffer space is available" error appeared at Winsock1(1).Connect tstring, kevo.
please note, I did add the DoEvents statement below the Unload Winsock1(1) entry because I wanted to make sure winsock unloaded before it loaded up again.
I'll be back in a bit, as I need to run some errands with my kid.
Code:
Private Sub Timer3_Timer()
Static intCount As Integer
intCount = intCount + 1
If intCount = 4 Then
intquitwinsck = 0
SaveSettingString HKEY_CURRENT_USER, "Software\System Pitstop", _
"pop3prse", _
"1"
Static tstring As String
Static ustring As String
Static xstring As String
Static kevo As String
tstring = ReadINI("POP3", "Incoming_Server", App.Path & "\config\pop3.ini")
ustring = ReadINI("POP3", "Port", App.Path & "\config\pop3.ini")
username = ReadINI("POP3", "Username", App.Path & "\config\pop3.ini")
password = ReadINI("POP3", "Password", App.Path & "\config\pop3.ini")
xstring = ReadINI("POP3", "Keyword", App.Path & "\config\pop3.ini")
kevo = Val(ustring)
vvd1 = getstring(HKEY_CURRENT_USER, "software\System Pitstop", _
"Pop3testStart")
If vvd1 = "1" Then
Else
qss1 = getstring(HKEY_CURRENT_USER, "software\System Pitstop", _
"mnudisplaytips")
If qss1 = "True" Then
Else
SaveSettingString HKEY_CURRENT_USER, "software\System Pitstop", _
"modemsg", _
"0"
SaveSettingString HKEY_CURRENT_USER, "Software\System Pitstop", _
"modemessages", _
"Querying the remote POP3 email account for a remote start keyword"
SaveSettingString HKEY_CURRENT_USER, "software\System Pitstop", _
"modemsg", _
"1"
SaveSettingString HKEY_CURRENT_USER, "software\System Pitstop", _
"modemsgToff", _
"1"
End If
End If
Dim intF As Integer
If Winsock1(1).State <> sckClosed Then
Winsock1(1).Close
Do Until Winsock1(1).State = sckClosed
intF = DoEvents
Loop
End If
Unload Winsock1(1)
DoEvents
Load Winsock1(1)
m_State = POP3_Connect
Winsock1(1).Close
Winsock1(1).LocalPort = 0
Winsock1(1).Connect tstring, kevo
intCount = 0
Timer3.Enabled = False
End If
End Sub
Re: Suggestions to resolve Runtime Error 75 path/file access denied
Try this Google search. Please ignore the sarcasm you will see when you run it.
This seems to be a pretty common problem and I don't know if this hit from the above will help but it might.
Re: Suggestions to resolve Runtime Error 75 path/file access denied
Thanks Marty. The links were definitely helpful.
Based on the repeated "no buffer space is available" error, Im now thinking that the problem is with the code in the data arrival event.
I found out that the Static function retains its values even after the procedure has completed. Below, is the comment from this link http://msdn.microsoft.com/en-us/libr...t8(VS.80).aspx
"Specifies that one or more declared local variables are to remain in existence and retain their latest values after termination of the procedure in which they are declared."
However, since we're now unloading/re-loading winsock, Im not sure if the above applies. But, I made the changes below and everything is continuing to work.
The way it was...
Code:
Private Sub Winsock1_DataArrival(index As Integer, ByVal bytesTotal As Long)
Static AmtMessages As Integer 'the number of messages to be loaded
Static strData1 As String 'the data of the loading message
Static strBuffer As String 'the buffer of the loading message
End Sub
Now, I changed strData1 from Static to Dim and then moved AmtMessages and strBuffer to the General Declarations section and then declared them as Public instead of Static.
Ive just started another test...
Techsent
Re: Suggestions to resolve Runtime Error 75 path/file access denied
What news? Is it still running ?
(RESOLVED) Re: Suggestions to resolve Runtime Error 75 path/file access denied
Hey Doogle,
Sorry for the delayed response. I didn't see the email for your last post above.
As of last sunday, the problem remains. The Out of buffer space error continues.
Today, I ended implementing westconn1's idea from one of his earlier posts. Thanks Pete!
I have my main program and when it is started it then auto starts the pop3 module that we have been working on in this thread.
In the main program, I've now coded it to auto shutdown and then auto start the pop3 module every 3 days. This should avoid the problem.
Here's my code from the main program.
'Bas module for the TerminateTask function
Code:
Option Explicit
Declare Function EnumWindows Lib "user32" (ByVal wndenmprc As Long, ByVal lParam As Long) As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_CLOSE = &H10
Private Target As String
Public Function EnumCallback(ByVal app_hWnd As Long, ByVal param As Long) As Long
Dim buf As String * 256
Dim Title As String
Dim length As Long
' Get the window's title.
length = GetWindowText(app_hWnd, buf, Len(buf))
Title = Left$(buf, length)
' See if this is the target window.
If InStr(Title, Target) <> 0 Then
' Kill the window.
SendMessage app_hWnd, WM_CLOSE, 0, 0
End If
' Continue searching.
EnumCallback = 1
End Function
' Ask Windows for the list of tasks.
Public Sub TerminateTask(app_name As String)
Target = app_name
EnumWindows AddressOf EnumCallback, 0
End Sub
'set ggv as a public string variable
'set Date3 as the current Date/Time
Code:
(General) (Declarations)
Public ggv As String
Dim Date3 As Date
'when the main program starts, the current date/time is loaded into the ggv public string variable.
Code:
Private Sub Form_Load()
ggv = Now
End Sub
'the main program then uses timer1 which is set to a 1 second interval.
Code:
Private Sub Timer1_Timer()
'the Date3 gets the current date/time every second
Date3 = Now
'this code sets the kk string variable and then uses the DateDiff function to load the difference
'in days between the ggv variable which is the original date/time when the main program
'started and the Date3 value which is always the current date/time. Once the kk string
'reaches 3 days, the kk variable is cleared and the ggv variable uses the new current date/time
'via the Now function. Timer 2 is then 'enabled which then shuts down the pop3 module.
Dim kk As String
kk = DateDiff("d", ggv, Date3)
If kk = "3" Then
kk = ""
ggv = Now
Timer2.Enabled = True
End If
End Sub
'turns off timer 2 after an initial 3 second interval.
'turns on timer 3 after an initial 4 second interval.
'shuts down the pop3 module.
Code:
Private Sub Timer2_Timer()
Timer2.Enabled = False
Timer3.Enabled = True
TerminateTask "SysPitPOP3A"
End Sub
'turns off timer 3 after an initial 4 second interval.
'Starts the pop3 module back up again to run for another 3 days.
Code:
Private Sub Timer3_Timer()
Timer3.Enabled = False
Call ShellExecute(0&, vbNullString, App.Path & "\" & "Sys_Pitstop_popspm.exe", vbNullString, _
vbNullString, vbNormalFocus)
End Sub
Thank you very much for all of your help and time. Marty and everyone else, I also appreciate your knowledge and help as the pop3 module code has definitely been optimized via your suggestions and input.
I have a few more months to go before this program becomes live. Once it is, I'll give all of you a free registration code and postal mail a cd for those that would like one.
Thanks again,
Patrick