Function is not executed

M

Mikael Nilsson

I've got what I think a mysterious error. On most clients the below function
WebLogin works perfectly, when stepping through the code line by line the
function mMain.GetRequest are executed. But in some cases this function is
never executed instead the next function in the module (function
RelativeToPhysicalPath) are executed although this function is never called
from the function WebLogin!



When execution is paused on the line



arrLoginInfo = mMain.GetRequest(mGlobal.m_strWebSiteAddress &
"client_login_withgroups.asp?user=" & strUserName & "&pwd=" & strPassword)
arrLoginInfo = Split(arrLoginInfo, ";")



I can see that all variables have their correct values. When the execution
reaches the line "strPhysical = strRelative" in function
"RelativeToPhysicalPath" PowerPoint crashes with the standard error
"Microsoft Office PowerPoint has encountered a problem and needs to close.
We are sorry for the inconvenience." The installed version is Office 2003
with all updates installed, MDAC 2.8 is also installed.



Does anyone have an explanation for this strange behaviour???



Function WebLogin(strUserName As String, strPassword As String) As Boolean
On Error Resume Next
Dim arrLoginInfo As Variant

'// Try to log in the user, get userid(0) and group(1-*)
arrLoginInfo = mMain.GetRequest(mGlobal.m_strWebSiteAddress &
"client_login_withgroups.asp?user=" & strUserName & "&pwd=" & strPassword)
arrLoginInfo = Split(arrLoginInfo, ";")

....

End Function



Function GetRequest(URL)
On Error GoTo ErrorHandler
Dim objXMLHttp As New MSXML2.XMLHTTP30

With objXMLHttp
.Open "POST", URL, False
.send
End With
DoEvents

'Get a result from the ASP-page
GetRequest = objXMLHttp.responseText

Set objXMLHttp = Nothing
Exit Function
ErrorHandler:
Call mGlobal.WriteError(Err, "mMain.GetRequest", URL)
End Function



Function RelativeToPhysicalPath(strRelative As String, strPhysical As
String) As String
Dim arrRelative As Variant

If InStr(strRelative, "..") > 0 Then
arrPhysical = Split(strPhysical, "\")
arrRelative = Split(strRelative, "..")

strPhysical = ""
For p = 0 To UBound(arrPhysical) - UBound(arrRelative)
strPhysical = strPhysical & arrPhysical(p) & "\"
Next
Erase arrPhysical, arrRelative

strRelative = Replace(strRelative, "../", "")
strRelative = Replace(strRelative, "..\", "")
strRelative = Replace(strRelative, "/", "\")
strPhysical = mMain.buildPath(strPhysical, strRelative)
Else
strPhysical = strRelative
End If

RelativeToPhysicalPath = mEncoding.URLDecode(strPhysical)
End Function



---

Mikael Nilsson

System Developer

Pyramid Communication
 
P

Perry

arrLoginInfo = mMain.GetRequest(mGlobal.m_strWebSiteAddress &

Am I missing a line continuation mark here (the underscore) ?
If so, add a space and the line continuation mark after this line, leave the
rest of the code as is and retry ...

Krgrds.
Perry

System parameters:
POS: WinXP x64
MSO: MSOffice System
DEV: VS7 (dotnet)
-------------------------------------
 
M

Mikael Nilsson

The below line is actually on a single line so the error is not in this
line. Also I'm not receiving a compilation error, powerpoint just crashes.
But I think I have found a possible solution. I've tried to add a dummy
function just after the function mMain.GetRequest and now everything works!?



I have no explanation for this behaviour but maybe I've used a some kind of
undocumented reserved word which crashes powerpoint? Does anyone have an
explanation for this problem?



Mikael Nilsson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top