Shoutbox

[wtf?!?] Existing file not found - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [wtf?!?] Existing file not found (/showthread.php?tid=85577)

[wtf?!?] Existing file not found by SmokingCookie on 08-24-2008 at 03:53 PM

Hi,

I have a problem with the XML DOM object:

code:
                    Print("  Retrieving windows from \"" + strXmlPath + "\"",PRIOR_SPACE);
                    var xml = new ActiveXObject("Microsoft.XMLDOM");
                    if(FileExists(strXmlPath)) {
                        if(xml.load(MsgPlus.ScriptFilesPath + "\\" + strXmlPath)) {
[some code]                        } else {
                            Print(xml.parseError.reason,PRIOR_ERROR);
                        }
                    } else {
                        Print("Could not find \"" + strXmlPath + "\"",PRIOR_IMPORTANT);
                    }
                    xml = null;
                    Print("  Retrieved windows",PRIOR_SPACE);
    },


parseError.reason says "The system cannot locate the resource specified.", yet FileExists() returns true..

Is there anyone who has (had) this problem too (or better yet: anyone who has the solution)?

EDIT::

Don't mention the Print() function, it's the same as Debug.Trace();
RE: [wtf?!?] Existing file not found by NiteMare on 08-24-2008 at 03:57 PM

have you tried just

if(xml.load(strXmlPath))

since it found it there, shouldn't THAT be where it is?


RE: [wtf?!?] Existing file not found by SmokingCookie on 08-24-2008 at 04:04 PM

No, I only send the file name to the function

EDIT::

In the meantime, I've figured some other method to load the file.

It now works fine (at least, it seems to..).


RE: [wtf?!?] Existing file not found by ShawnZ on 08-24-2008 at 07:12 PM

what's the code behind FileExists?


RE: [wtf?!?] Existing file not found by SmokingCookie on 08-24-2008 at 07:26 PM

uhh.. Well, I've changed it a bit, so I can not remember anymore (trust me, it was a LOT of code).

Now, I make sure the path is not specified, and then I move on.


RE: [wtf?!?] Existing file not found by tribbium on 08-25-2008 at 09:23 AM

Have you tried using the full path in FileExists like you do when you load? So just if (FileExists (MsgPlus.ScriptFilesPath + "\\" + strXmlPath))
{
[etc.]
}