Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1
Problem with Webbrowser1 Problem with Webbrowser1
Problem with Webbrowser1
Go Back  Xtreme Visual Basic Talk > > > Problem with Webbrowser1


Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2008, 03:38 AM
Motortracker Motortracker is offline
Freshman
 
Join Date: Sep 2006
Posts: 42
Default Problem with Webbrowser1


ok here is the problem i am working on a program to grab live links from rapidshare.com without having to put each link in one by one.

it looks ok to me but errors out on me with no debug option.

so here is what i do

first you paste rapidshare.com links into a textbox

http://rapidshare.com/files/80895687/1.txt.html
http://rapidshare.com/files/80895769/2.txt.html
http://rapidshare.com/files/80895876/3.txt.html
http://rapidshare.com/files/80895911/4.txt.html

then you hit go. then it splits the links up and it goes to the first site in the list then hits premium. then it grabs the real link and puts it in a listbox for me. then i have i going to the second one and grabs the link for me.

now here is the wierd part it does this sometimes when starting the 3rd one
run-time error '-1 (ffffffff)'

now for some reason it is getting past that "didn't change any code" and i am getting the thrid link. but when going for the fourth it goes
run-time error '-2 (fffffffe)'

now if i go to debug and just hold F8 through it all it works fine if i press F8 slowly but if i hold it down it will error just as above so i still can't see where it is erroring.

I would like it to be able to handle as many as i paste into that box.

Form1
Code:
 
Dim SecTimer As Integer


Dim findlink() As String
Dim FndLink() As String
Dim i As Integer
Private Sub CmdStart_Click()
VarGetLink = 0
If TxtStartLink = "" Then
MsgBox "You Must Enter Atleast One Rapidshare Link", vbOKOnly, "Error"
TxtStartLink.SetFocus
Exit Sub
End If
SplitOldLinks = Split(TxtStartLink, vbNewLine)
Call StartURL



End Sub

Private Sub Form_Load()
VarGetLink = 0
SecTimer = 0
End Sub

Private Sub LstRealLink_Click()
'LstRealLink.Selected(0) = True
End Sub


Private Sub TxtStartLink_Change()
NumLines = Split(TxtStartLink, vbNewLine)
lblnod.Caption = "Number of Download to Start" & "    " & UBound(NumLines) + 1
End Sub

Private Sub TxtStartLink_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 If Button = vbRightButton Then
        Paste = MsgBox("Past from Clipboard?", vbYesNo, "?")
        If Paste = vbYes Then
        TxtStartLink = ""
        TxtStartLink = Clipboard.GetText
        Else
        End If
    Else
        Exit Sub
    End If
End Sub
Private Sub Timer1_Timer()
If SecTimer = 0 Then
Text1.Text = "Timer On"
End If

If SecTimer = 1 Then

SecTimer = 2
Call PressPremium
End If

If SecTimer = 3 Then
SecTimer = -1
Text1.Text = "Timer Off"
Timer1.Enabled = False
Call GetLink
End If

SecTimer = SecTimer + 1
Text1.Text = SecTimer
End Sub
module1
Code:
Global VarGetLink As Integer
Global SplitOldLinks() As String
Global htmlSearchButton As HTMLButtonElement
Function StartURL()
If VarGetLink <> UBound(SplitOldLinks) + 1 Then
URL = SplitOldLinks(VarGetLink)
Form1.WebBrowser1.Navigate URL
SecTimer = 0
Form1.Timer1.Enabled = True
End If
End Function

Function PressPremium()


Form1.WebBrowser1.Document.All.tags("input")(0).Click


'Set docCurrentHTML = Form1.WebBrowser1.Document.documentElement.All
'For Each Item In docCurrentHTML
'If Item.tagName = "INPUT" Then
'If Item.Value = "PREMIUM" Then
'Set htmlSearchButton = Item
'htmlSearchButton.Click
'Exit For
'End If
'End If
'Next Item
'Step1 = False
End Function

Function GetLink()
Dim spltlink As String
Dim findlink() As String
spltlink = Form1.WebBrowser1.Document.documentElement.outerHTML
findlink = Split(spltlink, "href=")
spltlink = findlink(UBound(findlink) - 1)
findlink = Split(spltlink, Form1.lb.Caption)
Form1.LstRealLink.AddItem findlink(1)
Form1.Text2.Text = findlink(1)
Step1 = True
VarGetLink = VarGetLink + 1
Call StartURL
End Function

Any advice would be great.
Attached Files
File Type: zip Rapidshare Program.zip (3.7 KB, 17 views)
Reply With Quote
  #2  
Old 01-03-2008, 12:45 PM
Motortracker Motortracker is offline
Freshman
 
Join Date: Sep 2006
Posts: 42
Default

Well since nobody got back to me i just kept searching and searching and found a fix for it. i was searching for webbrowser1 and the run-time error '-1 (ffffffff)'
and a microsoft guy said to run this reg file.

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}]
@="Microsoft Web Browser"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\Control]
@=""

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32]
@="C:\\Windows\\system32\\shdocvw.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\MiscStatus]
@="0"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\MiscStatus\1]
@="131473"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\ProgID]
@="Shell.Explorer.2"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\ToolboxBitmap32]
@="C:\\Windows\\system32\\shdocvw.dll, 257"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\TypeLib]
@="{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\Version]
@="1.1"

[HKEY_CLASSES_ROOT\CLSID\{8856F961-340A-11D0-A96B-00C04FD705A2}\VersionIndependentProgID]
@="Shell.Explorer"
that fixed it running that exact same code with no errors i can add as many as i like now.

but my ? is what did that do?
Reply With Quote
  #3  
Old 09-30-2010, 08:41 PM
salC salC is offline
Newcomer
 
Join Date: Sep 2010
Posts: 1
Default

Yes I know it's an old thread but, since this did indeed fix my problem, I just wanted to respond to Motortracker regarding the WHY it worked.
It has to do with ThreadingModel that has to be set to Apartment.
In fact, you are building an activeX in VB then you have a choice to set it (for your program) directly in the IDE. You do not have that option if you are building an EXE.
And anyways, the problem is with shdocvw.dll.
It is kind of explained in this other thread : http://visual-basic.itags.org/visual-basic/381168/

It was a little hard to find the solution to my problem so I tought I would share.
cheers

Last edited by Cerian Knight; 10-01-2010 at 08:48 AM. Reason: Grave-dig OK... Thanks salC!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1 Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1 Problem with Webbrowser1
Problem with Webbrowser1
Problem with Webbrowser1
 
Problem with Webbrowser1
Problem with Webbrowser1
 
-->