DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: load method fails

  1. #1
    Mehdi Mousavi Guest

    load method fails

    The following code (shown as P.S.) works perfect when I'm connected to the
    http://whatever.com site and when whatever.com is functioning right but when
    I'm disconnected or the server is down, the load method fails with the
    following message echoed in the output area of VC++:

    First-chance exception in your program.exe (KERNEL32.DLL): 0xE0000001: (no
    name).

    The amazing thing is that the execution control won't jump to the catch(...)
    line!

    How can I solve this problem and what am I doing wrong? Any idea?

    Cheers,
    M.Mousavi
    --
    P.S.: Here's the code:

    CoInitialize(NULL);

    try
    {
    LPCSTR szRequest = "http://whatever.com";

    IXMLDOMDocumentPtr pDoc;

    HRESULT hr = pDoc.CreateInstance(__uuidof(DOMDocument));
    if(FAILED(hr))
    return;

    pDoc->async = false;
    pDoc->load(szRequest);
    }
    catch(...)
    {
    OutputDebugString("Something went wrong!\r\n");
    }

    CoUninitialize();

    --
    MSVC++ Programmer and a web developer
    Do you need to validate a given Credit Card#? Take a look at my latest
    article:
    http://www.codeproject.com/useritems...extensions.asp



  2. #2
    Randy Charles Morin Guest

    Re: load method fails

    Not every first-chance exception will lead to you handling the exception. Most likely the load method or some background thread
    caught that exception. The load method returns a VARIANT_BOOL, that will indicate whether the download failed or succeeded.

    But, I have even doubted the return value of load() from time to time.

    --
    Randy Charles Morin
    http://www.kbcafe.com

    Feel free to contact me by private email or messenger
    randy@kbcafe.com
    morin_randy@hotmail.com

    "Mehdi Mousavi" <webmaster@modemmania.com> wrote in message news:3ce9ca4e@10.1.10.29...
    > The following code (shown as P.S.) works perfect when I'm connected to the
    > http://whatever.com site and when whatever.com is functioning right but when
    > I'm disconnected or the server is down, the load method fails with the
    > following message echoed in the output area of VC++:
    >
    > First-chance exception in your program.exe (KERNEL32.DLL): 0xE0000001: (no
    > name).
    >
    > The amazing thing is that the execution control won't jump to the catch(...)
    > line!
    >
    > How can I solve this problem and what am I doing wrong? Any idea?
    >
    > Cheers,
    > M.Mousavi
    > --
    > P.S.: Here's the code:
    >
    > CoInitialize(NULL);
    >
    > try
    > {
    > LPCSTR szRequest = "http://whatever.com";
    >
    > IXMLDOMDocumentPtr pDoc;
    >
    > HRESULT hr = pDoc.CreateInstance(__uuidof(DOMDocument));
    > if(FAILED(hr))
    > return;
    >
    > pDoc->async = false;
    > pDoc->load(szRequest);
    > }
    > catch(...)
    > {
    > OutputDebugString("Something went wrong!\r\n");
    > }
    >
    > CoUninitialize();
    >
    > --
    > MSVC++ Programmer and a web developer
    > Do you need to validate a given Credit Card#? Take a look at my latest
    > article:
    > http://www.codeproject.com/useritems...extensions.asp
    >
    >




  3. #3
    Mehdi Mousavi Guest

    Re: load method fails

    Of course, but what about the COM rules? what about the "_com_error_ptr" and
    the like?

    "Randy Charles Morin" <rmorin@kbcafe.com> wrote in message
    news:3cea96af$1@10.1.10.29...
    > Not every first-chance exception will lead to you handling the exception.

    Most likely the load method or some background thread
    > caught that exception. The load method returns a VARIANT_BOOL, that will

    indicate whether the download failed or succeeded.
    >
    > But, I have even doubted the return value of load() from time to time.
    >
    > --
    > Randy Charles Morin
    > http://www.kbcafe.com
    >
    > Feel free to contact me by private email or messenger
    > randy@kbcafe.com
    > morin_randy@hotmail.com
    >
    > "Mehdi Mousavi" <webmaster@modemmania.com> wrote in message

    news:3ce9ca4e@10.1.10.29...
    > > The following code (shown as P.S.) works perfect when I'm connected to

    the
    > > http://whatever.com site and when whatever.com is functioning right but

    when
    > > I'm disconnected or the server is down, the load method fails with the
    > > following message echoed in the output area of VC++:
    > >
    > > First-chance exception in your program.exe (KERNEL32.DLL): 0xE0000001:

    (no
    > > name).
    > >
    > > The amazing thing is that the execution control won't jump to the

    catch(...)
    > > line!
    > >
    > > How can I solve this problem and what am I doing wrong? Any idea?
    > >
    > > Cheers,
    > > M.Mousavi
    > > --
    > > P.S.: Here's the code:
    > >
    > > CoInitialize(NULL);
    > >
    > > try
    > > {
    > > LPCSTR szRequest = "http://whatever.com";
    > >
    > > IXMLDOMDocumentPtr pDoc;
    > >
    > > HRESULT hr = pDoc.CreateInstance(__uuidof(DOMDocument));
    > > if(FAILED(hr))
    > > return;
    > >
    > > pDoc->async = false;
    > > pDoc->load(szRequest);
    > > }
    > > catch(...)
    > > {
    > > OutputDebugString("Something went wrong!\r\n");
    > > }
    > >
    > > CoUninitialize();
    > >
    > > --
    > > MSVC++ Programmer and a web developer
    > > Do you need to validate a given Credit Card#? Take a look at my latest
    > > article:
    > > http://www.codeproject.com/useritems...extensions.asp
    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center