Re: WebBrowser control error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Doing a quick Google brought up

http://www.itwriting.com/htmleditor/index.php
http://www.thinktechnologies.com/think_html.asp

I'm not sure why you cannot get past the first chance exception. If you
don't try to trap it, and don't have exceptions break into the debugger (in
the IDE) then the exception should just be ignored. I certainly wouldn't put
a Try ... Catch around the code, because it is in the InitializeComponent
sub, and that will get overwritten by the designer. Go to Debug |
Exceptions, and check that Common Language Runtime Exceptions are set to
Continue "When the exception is thrown". In these conditions, my Windows
form loads without reporting an exception.

HTH

Charles


"Shane Story" <sstoryREMOVETHIS at lburgus dot com> wrote in message
news:urY7LNafFHA.3612@xxxxxxxxxxxxxxxxxxxxxxx
> What alternative is there? Is there another control that would do a simple
> web page rendering?
>
> My problem is in the InitalizeComponent where it does the EndInit for
> webbrowser. I can't seem to trap that error. It happen even if a try
> catch
> is around that line of code.
>
> Any ideas? Links? Controls? Code?
>
> Thanks,
>
> Shane
> "Charles Law" <blank@xxxxxxxxxxx> wrote in message
> news:%23Vh$OrUfFHA.2484@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi Shane
>>
>> I fear you will have to live with this if you use the WebBrowser control.
> If
>> you don't catch first chance exceptions the code will proceed and the
>> control should work correctly. Watch out for MarshalDirectiveException:
>> "Marshaler restriction: Excessively long string" exceptions as well.
>> These
>> will pop up all over the place, but can usually be ignored.
>>
>> Unfortunately the WebBrowser control is pretty flaky when used in .NET.
> That
>> is not to say that it doesn't work (or can't be made to work), but you
> will
>> have to ignore these particular exceptions, and if you want to do
>> anything
>> sophisticated you will have to scour the newsgroups for information, or
> ask
>> here, of course.
>>
>> The way I tackled it was to wrap the WebBrowser control in a user
>> control,
>> and then I could protect the rest of my program from these wild
> exceptions.
>> You are effectively creating your own, well-behaved browser control.
>>
>> You may like to look here as well
>>
>> microsoft.public.inetsdk.programming.webbrowser_ctl
>> microsoft.public.inetsdk.programming.mshtml_hosting
>>
>> although there is less VB.NET specific knowledge there.
>>
>> HTH
>>
>> Charles
>>
>>
>> "Shane Story" <nospam@xxxxxxxxxxxx> wrote in message
>> news:%2320p25QfFHA.3936@xxxxxxxxxxxxxxxxxxxxxxx
>> >I am trying to add the Microsoft Web Browseractive X control to a vb.net
>> >form.
>> >
>> > I always get an error on the EndInit line.
>> >
>> > Parts of the errors says:
>> >
>> > "Unknown error"
>> >
>> > "First Chance exception"
>> >
>> > I tried putting it in a user control but this failed also.
>> >
>> > Anyone have a solution?
>> >
>> > Or is there another control that is free that could be used in place of
>> > it?
>> >
>> > I need a solution now and not a VS 2005 solution.
>> >
>> > Thanks,
>> >
>> > Shane
>> >
>> >
>> >
>>
>>
>
>


.



Relevant Pages

  • Re: Managing a project as it scales
    ... >understanding the appropriate use exceptions. ... You don't identify the control. ... A second keystroke puts the the REQ#, ... I also introduced a bug, an a week or so later, I fixed the ...
    (microsoft.public.vc.mfc)
  • Re: Managing a project as it scales
    ... understanding the appropriate use exceptions. ... or a static control from a thread is a fairly common task I implement. ... use a documentation tool? ... Java, but you know C++ you don't need to know Java in order to follow ...
    (microsoft.public.vc.mfc)
  • Re: Real life cost of using exceptions for control flow?
    ... > I know that my view may seem a bit extreme, but it actually works very well. ... > yourself from using exception for flow control. ... I am not at all against throwing exceptions. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: MP, tools & algs
    ... What did Doug in, one of the things, if you read Markoff was that Doug ... Arrays, array handling and inconsistent array state likely also contributed ... exceptions are just alternate control states associated with data. ... "Exceptions" are only considered exceptions because there's traditionally only one flow of control, ...
    (comp.arch)
  • Re: MP, tools & algs
    ... People like to see control dependences as well. ... are juxtaposed in a program trace are juxtaposed in the code (using one ... I consider this similarity of code and trace the essence of structured programming. ... "Exceptions" are only considered exceptions because there's traditionally only one flow of control, ...
    (comp.arch)