Jump to content
Sign in to follow this  
PresFox

_ie questions

Recommended Posts

PresFox

Hello,

I have the following code, but it doesnt show a IE window, just runs to the exit and stops, what is wrong here?

Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0)
    If Not IsObj($o_object) Then
        __IEErrorNotify("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType")
        SetError($_IEStatus_InvalidDataType, 1)
        Return 0
    EndIf
    ;
    If Not __IEIsObjType($o_object, "browserdom") Then
        __IEErrorNotify("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType")
        SetError($_IEStatus_InvalidObjectType, 1)
        Return 0
    EndIf
    ;
    Local $i_found = 0
    ;
    $o_tags = _IETagNameAllGetCollection($o_object)
    For $o_tag In $o_tags
        If String($o_tag.className) = $s_Class Then
            If ($i_found = $i_index) Then
                SetError($_IEStatus_Success)
                Return $o_tag
            Else
                $i_found += 1
            EndIf
        EndIf
    Next
    ;
    __IEErrorNotify("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class)
    SetError($_IEStatus_NoMatch, 2)
    Return 0
 EndFunc   ;==>_IEGetObjByClass

 Local $oIE1 = _IECreate("someurl",0,0,0,0)
$obj = _IEgetobcbyclass($oIE1,"btn_download",1);
msgbox(1,"1",$obj);
exit

Share this post


Link to post
Share on other sites
water

Because the second 0 in _IECreate stands for "Browser Window is hidden"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
PresFox

i know that, i added a line now:

 msgbox(0,"2",$oIE1)

but that just shows a msgbox, no object id, so it is as if the IE window is not attached properly

The second messagebox, triggered by:

$obj = _IEgetobcbyclass($oIE1,"btn_download",1);

msgbox(1,"1",$obj);

Doesnt show at all :(

Share this post


Link to post
Share on other sites
water

What I mean is:

Replace

Local $oIE1 = _IECreate("someurl",0,0,0,0)

with

Local $oIE1 = _IECreate("someurl")

and it will "show a IE window".


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
PresFox

i know that, and i already got it to work when changing that to 1 but, my object id remains empty, and the 2nd messagebox never shows

Share this post


Link to post
Share on other sites
water

msgbox(0,"2",$oIE1)

but that just shows a msgbox, no object id, so it is as if the IE window is not attached properly

$oIE1 is a reference to a COM object not a variable containing an object ID. You always get an empty output.

To check for an object use

MsgBox(0, "2", IsObj($oIE1))

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×