vb.net error: 80040154

Hi

I am trying to use the Trial Pro version in vb.net for a demo.
I am using Visual Studio 2005

When I try and use the code

Dim remoteSession As Screenscraper.RemoteScrapingSession
remoteSession = New Screenscraper.RemoteScrapingSession("New Scraping Session", "localhost", 8778)
remoteSession.Scrape()

It tells me there are too many parameters for the RemoteScrapingSession class

So I also tried the code below:

Dim remoteSession As Screenscraper.RemoteScrapingSession
remoteSession = New Screenscraper.RemoteScrapingSession()
remoteSession.Initialize("New Scraping Session", "localhost", 8778)
remoteSession.Scrape()

And it will now compile but I get the error

Retrieving the COM class factory for component with CLSID {249DCB04-2D6E-4B94-B182-9E1275B3088D} failed due to the following error: 80040154.

So I am not sure what I am doing wrong. I have added the screenscraper.dll reference to the project ok but I dont seem to be getting all the classes correctly.

Anyone have any suggestions?

Thanks
gfusion

vb.net error: 80040154

Hmm, no I tried out your code in VB.net 2005 express so it should be fine. I didn't, however, use an import or using statement. I just right clicked on the project in the project explorer, selected 'Add reference', and then browsed to the screenscraper directory and selected the dll under 'misc/dotNet'. After doing that it worked fine.

From the sound of things, it sounds like some of it is getting imported, but not all of it. I can't think of any reasons for why that would happen.

On a different note, you do have screenscraper running as a server, correct? This code will only work if you do, as explained in [url]http://screen-scraper.com/support/docs/invoking_screenscraper_from_csharp.php[/url].
That link does only mention c#, but it will work on any dotNet language.

still having class problems

OK i have made sure my vb.net project is using the RemoteScreenscraping.dll in my project.

However when I try to use :

Dim remoteSession As Screenscraper.RemoteScrapingSession
remoteSession = New Screenscraper.RemoteScrapingSession("New Scraping Session", "localhost", 8778)
remoteSession.Scrape()

Iget alot of errors.

Basically whats happening is.
At the top of my file I reference the DLL by:

Imports Screenscraper

Then whenever I try and use that reference I get an error on the class

Screenscraper.RemoteScrapingSession

The only classes that seem to be available are:
Screenscraper.DataRecord
Screenscraper.DataSet
Screenscraper.RemoteScrapingSession_Dispatch
Screenscraper.RemoteScrapingSessionException

Am I doing something wrong?

Can I not use RemoteScreenscraping.dll in Visual Basic .NET
Do I have to use C# instead?

Thanks for your help

vb.net error: 80040154

Hello gfusion.

I looked into your problem and I can't seem to recreate it. When I try your original code,
[quote] Dim remoteSession As Screenscraper.RemoteScrapingSession
remoteSession = New Screenscraper.RemoteScrapingSession("New Scraping Session", "localhost", 8778)
remoteSession.Scrape() [/quote]
It runs fine for me.

This page [url]http://screen-scraper.com/support/docs/invoking_screenscraper_from_csharp.php[/url] specifies how to set it up. Are you sure you are using the correct dll? It should be located in the screenscraper directory under misc/dotNet.

If you know, please post the exact location of the dll you are using.