Jump to content
Sign in to follow this  

ObjCreate HTTP vs. HTTPS

Recommended Posts



A site that I was accessing here locally as HTTP was recently changed over to HTTPS. With the change came a change in the behavior of some code I was running. I was hoping someone who was familiar with this usage could provide insight as to if this would cause a "navigation canceled" to appear in the IE window that is created. The "If $HereLittlePiggy = "80" Then" section is what I am looking at. As I said the window is created and the edit control that was in that location in my GUI is hidden as expected. The variable supplying the URL was updated. I can access the URL by opening internet explorer and pasting the URL into the address bar.

Func _Post2Studio()
    ;$HereLittlePiggy = 80 or 160 (80) edit control is visible and enabled where as (160) is disabled and hidden.
    $HereLittlePiggy = GUICtrlGetState($hEdit)
    If $HereLittlePiggy = "80" Then
        ;Grab the edit control text
        $Tmp1 = _GUICtrlEdit_GetText($hEdit)
        ;Hide the edit control
        GUICtrlSetState($hEdit, $GUI_DISABLE + $GUI_HIDE)
        ;Replace the edit control with IE window of same dimensions
        $SoIE = ObjCreate("Shell.Explorer.2")
        $GUIActiveX = GUICtrlCreateObj($SoIE, 2, 2, 1414, 468)
        ;Navigate to the temp Wiki page
        ;This is the hard coded path to the edit URL for the temp Wiki page I setup for this process.
        ;Since I have only 5 end-users one page should suffice for all. No permanent data is stored here.
        ;It is just used to see what a given set of marked up data would look like when published as a Wiki page.
        ;Wait for it to load
        $SoForm = _IEFormGetObjByName($SoIE, "wikieditform")
        $SoQuery = _IEFormElementGetObjByName($SoForm, "text")
        ;Pass the contents of the edit control that were captured to the Wiki page that was opened in edit mode
        _IEFormElementSetValue($SoQuery, $Tmp1)
        ;Submit the change to the temp Wiki page so that it is viewable as if in production
        $SoSubmit = _IEGetObjByName($SoIE, "post")
        _IEAction($SoSubmit, "click")
        ;Change the button text for fun so that end-users will know that clicking it again will bring back the edit control
        _GUICtrlButton_SetText($Post2Studio, "Return to Edit")
        ;Set the variable to control when the If/Then statement is run for a button so that inappropriate code isn't executed against the disabled/hidden edit control
        $Mormonism = 1
        ;When button is pressed a second time kill of the IE object and redisplay the edit control
        GUICtrlSetState($hEdit, $GUI_ENABLE + $GUI_SHOW + $GUI_FOCUS)
        ;Again change the button text back to what it initially was
        _GUICtrlButton_SetText($Post2Studio, "Preview in Studio")
        $Mormonism = 0
EndFunc   ;==>_Post

If I right click in the IE Window and select properties I see the address URL starts with "res://ieframe.dll/navcancl.htm#https://". It also states that it is an unknown protocol. Now I am aware of an IE security feature that causes the transition from a site that is in the Internet Zone to a site that is in the "Trusted Sites Zone" to spawn a new instance of IE. I am not sure if this is the problem, or just HTTPS, or some other issue I can't put my finger on. Just wondering if there was anything glaringly wrong here.

Edit: When run from within SciTE I see the following appear in the bottom pane. I have never really noticed this before so I will have to do some further research I guess.

--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: post, Index: 0)
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType
Edited by Casey

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.