Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: Forum program Pin
althamda11-Apr-07 6:16
althamda11-Apr-07 6:16 
AnswerRe: Forum program Pin
Sathesh Sakthivel11-Apr-07 7:05
Sathesh Sakthivel11-Apr-07 7:05 
GeneralRe: Forum program Pin
Danpeking11-Apr-07 8:49
Danpeking11-Apr-07 8:49 
QuestionAbout iTextSharp Pin
Diego F.11-Apr-07 5:48
Diego F.11-Apr-07 5:48 
AnswerRe: About iTextSharp Pin
Diego F.11-Apr-07 6:11
Diego F.11-Apr-07 6:11 
GeneralRe: About iTextSharp Pin
Diego F.11-Apr-07 21:08
Diego F.11-Apr-07 21:08 
QuestionCopying text/contents from browser in Smart device simulator Pin
Neo_Shehpar11-Apr-07 5:36
Neo_Shehpar11-Apr-07 5:36 
QuestionParameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
plokkoville11-Apr-07 5:11
plokkoville11-Apr-07 5:11 
Hello,

I created a C# console application (without GUI) that scrapes information from webpages. This application runs everyday on a unattended computer with Win2003 SP3, including latest security patches and up to date virusscanner, using a scheduled task. It uses the C# System.Windows.Forms.WebBrowser class to navigate the pages.

The application runs fine for weeks but all of a sudden the following error occurs

Win32Exception details: HRESULT=-2147467259 ecode=87 inner=
Failure... System.ComponentModel.Win32Exception: The parameter is incorrect
at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()
at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Application.MarshalingControl..ctor()
at System.Windows.Forms.Application.ThreadContext.get_MarshalingControl()
at System.Windows.Forms.WindowsFormsSynchronizationContext..ctor()
at System.Windows.Forms.WindowsFormsSynchronizationContext.InstallIfNeeded()
at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
at System.Windows.Forms.WebBrowserBase..ctor(String clsidString)
at System.Windows.Forms.WebBrowser..ctor()
at MyNamespace.Scraper.Scrape()

An important code snippet:
public class Scraper
{
private WebBrowser browser;

public void Scrape()
{
using (browser = new WebBrowser())
{
NaviateToPage(browser);
ScrapeContent(browser);
}
}
}

The application is started every hour. It will run OK for days, until the exception occurs. When the exception occurs it keeps occuring. BUT when a user logs into the system and opens a browser and closes it again. The system runs fine for a couple of days again, until the exception shows up again (from that point on it will continue to fail again until somebody logs on... etc).

The exception is "The parameter is incorrect", but because I don't provide any parameters I don't have a clue which parameter might be incorrect and why.

I examed internet explorer settings on the machine and even scanned the registry for strange settings, but couldn't find anything that could point me in the right direction.

I also looked at the running processes. I examined which processes are running when the problem occurs and when the system is running fine, but there are not differences.

I am a kind of desparately looking for good ideas or background info that can point me in the right direction.

Thanx!


Paul
AnswerRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
Luc Pattyn11-Apr-07 13:42
sitebuilderLuc Pattyn11-Apr-07 13:42 
AnswerRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
plokkoville15-Apr-07 23:46
plokkoville15-Apr-07 23:46 
GeneralRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
plokkoville11-May-07 4:16
plokkoville11-May-07 4:16 
GeneralRe: Parameterless Webbrowser-constructor crashes with "The parameter is incorrect" Pin
Luc Pattyn11-May-07 7:14
sitebuilderLuc Pattyn11-May-07 7:14 
QuestionGIS programming Pin
cols291011-Apr-07 5:11
cols291011-Apr-07 5:11 
AnswerRe: GIS programming Pin
Ed.Poore11-Apr-07 6:03
Ed.Poore11-Apr-07 6:03 
GeneralRe: GIS programming Pin
cols291011-Apr-07 20:40
cols291011-Apr-07 20:40 
GeneralRe: GIS programming Pin
Ed.Poore11-Apr-07 23:52
Ed.Poore11-Apr-07 23:52 
GeneralRe: GIS programming Pin
cols291012-Apr-07 0:11
cols291012-Apr-07 0:11 
GeneralRe: GIS programming Pin
Ed.Poore12-Apr-07 0:53
Ed.Poore12-Apr-07 0:53 
GeneralRe: GIS programming Pin
cols291012-Apr-07 1:04
cols291012-Apr-07 1:04 
GeneralRe: GIS programming Pin
Ed.Poore12-Apr-07 1:31
Ed.Poore12-Apr-07 1:31 
QuestionVisual Studio 2003. CVSRepo Pin
123456uio11-Apr-07 4:47
123456uio11-Apr-07 4:47 
QuestionDatagrid sorting Pin
mehmetned11-Apr-07 4:21
mehmetned11-Apr-07 4:21 
AnswerRe: Datagrid sorting Pin
thomasa11-Apr-07 4:42
thomasa11-Apr-07 4:42 
Questionmanual updation in clickonce,Deployment Pin
pashitech11-Apr-07 4:10
pashitech11-Apr-07 4:10 
AnswerRe: manual updation in clickonce,Deployment Pin
Ed.Poore11-Apr-07 23:54
Ed.Poore11-Apr-07 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.