On the web, how does one solve the error returned when calling COM components?

Source: Internet
Author: User

System. runtime. interopservices. comexception (0x80004005): An error hresult e_fail is returned for calling the COM component.
After more than 10 hours, I finally solved the problem. Because I used the sta mode, I wrote log functions in various functions to replace tracking debugging.

The thread is being aborted at 13:51:12. Initcomobject ()
2002-1-6 13: 51: 52 before starun new webpreviewbase
2002-1-6 13: 51: 52webpreviewbase constructor No problem
13:51:52 go to getwebpreview ().
13:51:52 entering initcomobject () has not hung http://webpic.marlin.com.cn/
13:51:52 an error hresult e_fail was returned for calling COM components. Initcomobject ()
13:51:52 an error hresult e_fail was returned for calling COM components. 213

Finally, it is locked to the initcomobject () function.

Try
{
Commons. errorinfo. Log ("initcomobject () has not been mounted" + this. _ URI );
_ WB. navigate (this. _ URI); //
Commons. errorinfo. Log ("_ WB. navigate ()" + _ URI + "no ");
// This is required because there is no form
While (_ WB. readystate! = Webbrowserreadystate. Complete)
{
// Re-paint now
Application. doevents ();
}
// It is best to comment this sentence. Otherwise, no animation can be captured on the webpage.
// _ WB. Stop ();
If (_ WB. activexinstance = NULL) throw new exception ("instance cannot be blank ");
}
Catch (Exception ex)
{
Commons. errorinfo. Log (ex. Message+ "Initcomobject ()");
ThrowEx;
}

The strange thing is that the above error will be reported if you put it on the server without any problems locally.
The real reason is that I finally got caught at lunch today,
It is a problem with IIS. Just restart IISOK.
This is a simple problem, but it is also a very cold problem.
This problem occurs when the DLL of COM component or system. Windows is called on the web.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.