-
May 20th, 2021, 02:39 AM
#1
Thread Starter
Addicted Member
Microsoft retiring Internet Explorer next year
Announcement here
It says in its FAQ section:
What is the MSHTML (Trident) engine? How does that relate to IE mode?
The MSHTML (Trident) engine is the underlying platform for Internet Explorer 11. This is the same engine used by IE mode and it will continue to be supported (in other words, unaffected by this announcement). WebOC will also continue to be supported. If you have a custom or third-party app that relies on the MSHTML platform, you can expect it to continue to work. For future app development, we recommend using WebView2.
I don't understand the implications of this for VB6.
Specifically, I wonder does it mean that the InternetExplorer object ,
Code:
CreateObject("InternetExplorer.Application")
will continue to work?
Will we still be able to display a browser window to the user as well as use VB6 to write to and read from it?
Will the webbrowser control still work as now?
-
May 20th, 2021, 03:59 AM
#2
Re: Microsoft retiring Internet Explorer next year
I would say that if Internet Explorer has been retired and is no longer installed by default, the CreateObject code you posted won't work. I believe Microsoft now wants people to use Microsoft Edge. Perhaps a better question to ask would be:
Can Visual Basic 6.0 interact with more current browsers such as Firefox/Chrome/Edge, and if so how? https://www.google.com/search?q=vb6+...4dUDCBE&uact=5.
Unless you must use IE, I suggest considering another browser.
-
May 20th, 2021, 04:15 AM
#3
Thread Starter
Addicted Member
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
I would say that if Internet Explorer has been retired and is no longer installed by default, the CreateObject code you posted won't work. I believe Microsoft now wants people to use Microsoft Edge. Perhaps a better question to ask would be:
Can Visual Basic 6.0 interact with more current browsers such as Firefox/Chrome/Edge, and if so how? https://www.google.com/search?q=vb6+...4dUDCBE&uact=5.
Unless you must use IE, I suggest considering another browser.
Thanks Peter,
At least we have a year I suppose.
-
May 20th, 2021, 04:18 AM
#4
Re: Microsoft retiring Internet Explorer next year
And considering, that CreateObject("InternetExplorer.Application") actually looks into the Registry, to get all pertinent informations --> "Computer\HKEY_CLASSES_ROOT\InternetExplorer.Application"
i don't think it should be that difficult to port it to another browser
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
May 20th, 2021, 04:32 AM
#5
Re: Microsoft retiring Internet Explorer next year
@zvoni, I considered suggesting that but decided against it. Messing with the registry is best avoided imho. And that migh keep CreateObject working, but what about the rest of the functionallity? If that modern browser doesn't work like IE the vb6 app calling still won't be able to work properly.
-
May 20th, 2021, 05:01 AM
#6
Re: Microsoft retiring Internet Explorer next year
It could be usefull to find a solution to replace the CreateObject("InternetExplorer.Application")
I use it in some projects to retrive and push data in fields and finally retrieveing the result.
Like my automatic Translation routine using DeepL
Private Function Translate_DeepL(sText As String, sLangueFrom As String, sLangueTo As String) As String
' #VBIDEUtils#************************************************************
' * Author :
' * Web Site :
' * E-Mail :
' * Date :
' * Time :
' * Module Name : Translation_Module
' * Module Filename : Translations.bas
' * Procedure Name : Translate_DeepL
' * Purpose :
' * Parameters :
' * sText As String
' * sLangueFrom As String
' * sLangueTo As String
' * Purpose :
' **********************************************************************
' * Comments :
' *
' *
' * Example :
' *
' * See Also :
' *
' * History :
' *
' *
' **********************************************************************
' #VBIDEUtilsERROR#
1 On Error GoTo ERROR_Translate_DeepL
Dim Timeout As Date
2 Const CLASSNAME As String = "lmt__textarea lmt__target_textarea lmt__textarea_base_style"
3 On Error Resume Next
4 If m_objIE Is Nothing Then Set m_objIE = CreateObject("InternetExplorer.Application")
5 m_objIE.Document.getElementsByClassName(CLASSNAME)(0).innerText = vbNullString
6 m_objIE.Navigate "https://www.deepl.com/translator#" & sLangueFrom & "/" & sLangueTo & "/" & Replace(sText, " ", "%20")
7 Timeout = Now + TimeValue("00:00:05")
8 Do
9 Translate_DeepL = m_objIE.Document.getElementsByClassName(CLASSNAME)(0).innerText
10 If Now >= Timeout Then Exit Do
11 Loop While Translate_DeepL = vbNullString
12 On Error GoTo 0
13 EXIT_Translate_DeepL:
14 On Error Resume Next
15 Exit Function
' #VBIDEUtilsERROR#
16 ERROR_Translate_DeepL:
17 Select Case IAErrorHandler(gcError & Err.Number & ": " & Err.Description & vbCrLf & "in Translation_Module.Translate_DeepL" & vbCrLf & gcErrorLine & Erl, vbAbortRetryIgnore + vbCritical, "Error")
Case vbAbort
18 Screen.MousePointer = vbDefault
19 Resume EXIT_Translate_DeepL
20 Case vbRetry
21 Resume
22 Case vbIgnore
23 Resume Next
24 End Select
25 Resume EXIT_Translate_DeepL
End Function
Maybe a work arround ?
I think I oculd find one easily, but when I'll have time to investigate
-
May 20th, 2021, 05:07 AM
#7
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Thierry69
It could be usefull to find a solution to replace the CreateObject("InternetExplorer.Application")
I use it in some projects to retrive and push data in fields and finally retrieveing the result.
Like my automatic Translation routine using DeepL
Maybe a work arround ?
I think I oculd find one easily, but when I'll have time to investigate
For starters they have a published API https://support.deepl.com/hc/en-us/a...g-API-requests that would always be preferable to using a browser to submit and parse results.
-
May 20th, 2021, 05:07 AM
#8
Re: Microsoft retiring Internet Explorer next year
@thierry69:
Line numbers have been obsolete since QBasic/Quick Basic/VBDos, etc. It seems completely unnecessary to number each line. Also, I prefer to use labels if I can't avoid it because of On Error GoTo, for example. Also, I only use On Error Resume Next in very specific cases.
Last edited by Peter Swinkels; May 20th, 2021 at 05:24 AM.
-
May 20th, 2021, 05:12 AM
#9
Re: Microsoft retiring Internet Explorer next year
Peter, Iusing VBIDEUtils, it adds/remove lines number.
I use them A LOT with the IAErrorHandler, in order to track error and the lines where it occurs.
-
May 20th, 2021, 05:15 AM
#10
Re: Microsoft retiring Internet Explorer next year
PlausiblyDamp
it could be a solution, but needs a key etc...
My way is easy, no needs etc...
-
May 20th, 2021, 05:31 AM
#11
Re: Microsoft retiring Internet Explorer next year
@thierry69:
What is IAErrorHandler? I can't find it using Google.
Also, wouldn't it be easier to just enable the option to have vb's ide break during an error? There is option for that. Barring that you could temporarily use search/replace to comment out all "On Error" statements. I am not sure but can line numbers still be used in a compiled exe to trace an errorr's source? Especially when there is no debugging info included?
I think it's better to write case specific error handlers and pass relevant info to an error handler where critical and leave the rest to a generic handler.
Line numbers may once have been the only (practical) way to go about this, but I think you should consider more up to date methods. I wouldn't be at all surprised if line numbers are only included in vb6 to make porting code from earlier BASIC's easier.
Perhaps a question for another thread: why do several programming languages have what appear to be a load of obsolete features? To avoid breaking backward compatiblity? Regarding my remark about porting: I don't think most code for older BASICs would even work in vb without massive refactoring. Even if some obsolete features have been included/retained.
Last edited by Peter Swinkels; May 20th, 2021 at 09:15 AM.
Reason: spelling
-
May 20th, 2021, 05:32 AM
#12
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Thierry69
PlausiblyDamp
it could be a solution, but needs a key etc...
My way is easy, no needs etc...
I have never understood the insistence on HTML scraping when a fully supported alternative exists. In most cases HTML scraping is against the T&Cs and it certainly seems that way looking at the ones present on the site in question. HTML Scrapping is fragile and error prone as changes to the HTML or how the website functions can break things, automating browsers is hit and miss at best.
Registering for a key takes less than a couple of minutes (I have just gone through the process and it was straight forward), generating a basic request was trivial and the response was in a standard format, and the entire process was also in line with the company's T&Cs.
-
May 20th, 2021, 05:48 AM
#13
Re: Microsoft retiring Internet Explorer next year
Peter Swinkels,
IAErrorHandler is my own error handler.
it is to log potential errors on client side (nmore than 1000 clients), so when an error happens somewhere, it is easier to know where and the reason, in order to fix it.
I don't know in VB6 any other way to retrieve the line where the error occured. In /NET, it is easier for that
PlausiblyDamp,
You are right, it is fragile, but this routine is not critical, it is just used internally to translate in other languages automatically. and it is used only from times to times.
Registering a key, yes, easy, I know, I'll investigate when I'll have time.
But HTML scraping is also useful sometimes in some cases.
-
May 20th, 2021, 05:49 AM
#14
Re: Microsoft retiring Internet Explorer next year
@plausiblydamp:
Yeah, I remember reading something on certain websites requiring a key to interact with their API's via scripts. I have never looked into it. Do you know a good beginners guide regarding this subject?
-
May 20th, 2021, 05:55 AM
#15
Re: Microsoft retiring Internet Explorer next year
Peter,
it is quite easy to implement, I al ready do it for several other services (like Google, to sync agenda etc...)
but it depends always on the service, and the way to implement and return.
Managing XML,JSON or other
-
May 20th, 2021, 06:26 AM
#16
Thread Starter
Addicted Member
Re: Microsoft retiring Internet Explorer next year
Originally Posted by PlausiblyDamp
I have never understood the insistence on HTML scraping when a fully supported alternative exists. In most cases HTML scraping is against the T&Cs and it certainly seems that way looking at the ones present on the site in question. HTML Scrapping is fragile and error prone as changes to the HTML or how the website functions can break things, automating browsers is hit and miss at best.
Registering for a key takes less than a couple of minutes (I have just gone through the process and it was straight forward), generating a basic request was trivial and the response was in a standard format, and the entire process was also in line with the company's T&Cs.
Some government departments don't provide an API yet expect small contractors to fill in long forms online where
previously they were able to mail in forms that they could have software autofill.
-
May 20th, 2021, 06:37 AM
#17
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
@plausiblydamp:
Yeah, I remember reading something on certain websites requiring a key to interact with their API's via scripts. I have never looked into it. Do you know a good beginners guide regarding this subject?
Unfortunately there doesn't seem to be any one single way any given API will implement this kind of thing. for example the DeepL API would take a POST Request looking like
Code:
POST /v2/translate?auth_key=[yourAuthKey]> HTTP/1.0
Host: api.deepl.com
User-Agent: YourApp
Accept: */*
Content-Length: 54
Content-Type: application/x-www-form-urlencoded
auth_key=[yourAuthKey]&text=Hello, world&target_lang=DE
often you end up wading through the specific documentation - luckily things are getting better as the above came straight from their website
-
May 20th, 2021, 06:39 AM
#18
Re: Microsoft retiring Internet Explorer next year
Originally Posted by vbrad
Some government departments don't provide an API yet expect small contractors to fill in long forms online where
previously they were able to mail in forms that they could have software autofill.
Which is why I specifically said "when a fully supported alternative exists", if there is no API and the site allows web scraping then needs must etc. however if there is a supported alternative then why not use it?
-
May 20th, 2021, 06:45 AM
#19
Thread Starter
Addicted Member
Re: Microsoft retiring Internet Explorer next year
Originally Posted by PlausiblyDamp
Which is why I specifically said "when a fully supported alternative exists", if there is no API and the site allows web scraping then needs must etc. however if there is a supported alternative then why not use it?
Sorry I didn't see that.
-
May 20th, 2021, 07:18 AM
#20
Thread Starter
Addicted Member
Re: Microsoft retiring Internet Explorer next year
If the application is written in vb.net or c# is there an alternative there that is not available in vb6?
-
May 20th, 2021, 07:43 AM
#21
Thread Starter
Addicted Member
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
@thierry69:
Also, wouldn't it be easier to just enabled to option to have vb's ide break during an error? There is option for that. Barring that you could temporarily use search/replace to comment out all "On Error" statements. I am not sure but can line numbers still be used in a compiled exe to trace an errorr's source? Especially when there is no debugging info included?
MZ tools allows you to have an error handling template that you can easily add to any procedure
It also has a feature to allow for the easy insertion or removal of line numbers.
The two together allow you to easily log the file, procedure and line (Erl) the error occurred in along with the error number and description.
-
May 20th, 2021, 08:22 AM
#22
Re: Microsoft retiring Internet Explorer next year
VBIDEUtils does all that also (I know, I wrote it)
and template for error handling is also in VBIDEUtils.
NB : I wrote it before MZTools, MZTools did a copy
Last edited by Thierry69; May 20th, 2021 at 08:55 AM.
-
May 20th, 2021, 09:19 AM
#23
Re: Microsoft retiring Internet Explorer next year
@Thierry69: it may be easy, but I don't know where to get started. Do you know a tutorial which could get me started? I have to confess when I try to look for it I get the feeling I don't know where to start. Probably because I don't know what exactly it is I am looking for. I know it has to do with keys, API's and websites. That's about it.
-
May 20th, 2021, 10:39 AM
#24
Re: Microsoft retiring Internet Explorer next year
-
May 20th, 2021, 02:35 PM
#25
Re: Microsoft retiring Internet Explorer next year
I read the posting (the citation) in #1 as:
- the IE-Control and the Document-Parser (MSHTML-Typelib) will be available further (ieframe.dll + satellite-libs)
- whereas the IE(11)-Application will be gone (IExplore.exe)
That will still allow InProcess-embedding as a normal Control, or dynamically via:
- Controls.Add("Shell.Explorer.2", "WebBrowser1")
- or for DOM-parsing-stuff without GUI: CreateObject("htmlfile")
Whereas OutOfProcess: CreateObject("InternetExplorer.Application") will not work anymore -
(since the ActiveX-Exe-Host IExplore.exe will be gone).
Olaf
-
May 20th, 2021, 05:05 PM
#26
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
@thierry69:
Line numbers have been obsolete since QBasic/Quick Basic/VBDos, etc. It seems completely unnecessary to number each line.
Not quite sure what you mean by that, since line numbering exists by default in all recent versions of VS (I can't say how far back that goes), and you see line numbering in the source code viewers built into all modern browsers that I'm aware of (which, admittedly, is not all that many, but it IS the big ones). Generally, copying and pasting of the code doesn't include line numbers, though, as seen in the code you were referencing.
My usual boring signature: Nothing
-
May 21st, 2021, 05:39 AM
#27
Re: Microsoft retiring Internet Explorer next year
To my understanding line numbers used to be the only way to "name" a location within your program. In fact they were a mandatory part of the code in very early BASIC dialects. While vb6 and even vb.net still support line numbers I see obsoletely zero reason to still use them. Can you give me one legitimate reason why support for line numbers even still exists? Even as far back as Quick Basic I could avoid line numbers by following a few simple coding practices.
In my mind they seem like some hold over from the past that should be avoided at all cost. But I could be wrong.
Last edited by Peter Swinkels; May 21st, 2021 at 05:40 AM.
Reason: spelling
-
May 21st, 2021, 06:04 AM
#28
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
In my mind they seem like some hold over from the past that should be avoided at all cost. But I could be wrong.
Line numbers are *very* handy for reporting the source line an error occured by using the undocument Erl function. Try it yourself:
Code:
Option Explicit
Private Sub Form_Load()
4: Dim a As Long
5:
6: On Error GoTo EH
7: a = a + 1
8: a = a / 0
9: Exit Sub
EH:
11: MsgBox Err.Description & " on " & Erl & " line", vbCritical
End Sub
At our shop we use a pre-build tool to put line numbers on the source files that coincide with the line numbers in the IDE so that error repoting can collect the source line the error is originating from.
cheers,
</wqw>
Last edited by wqweto; May 21st, 2021 at 06:08 AM.
-
May 21st, 2021, 06:09 AM
#29
Re: Microsoft retiring Internet Explorer next year
I believe there are better ways to trace the source of an error. Early BASIC dialects had built in features to manage line-numbers. I think the very fact you have to resort to external tools these days is a red flag.
-
May 21st, 2021, 06:13 AM
#30
Re: Microsoft retiring Internet Explorer next year
Peter, no other way to do it if you want to know the exact line
-
May 21st, 2021, 06:13 AM
#31
Re: Microsoft retiring Internet Explorer next year
@Peter
Uh, I use also line numbering and the same kind of error handling.
VB6 can use line numbers and has the Erl variable, so what do you mean with resorting to external tool is a red flag?
-
May 21st, 2021, 06:14 AM
#32
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
I believe there are better ways to trace the source of an error.
You mean the source line of the error? Very intrested if you know an alternative.
Mind that in production we also ship PDBs but source lines reported on call-stack using these differ from the exact line in the IDE because of UI designer's "prefix" in the source file and because of the hidden attributes dispersed throughout the source code.
cheers,
</wqw>
-
May 21st, 2021, 06:15 AM
#33
Re: Microsoft retiring Internet Explorer next year
Wouldn't overriding the error handlers work? Vb should break on the exact line causing an issue. But this isn't an option for compiled exe running outside of the development environment I guess. Still, aren't the diagnostic tools that would do the same trick?
-
May 21st, 2021, 06:19 AM
#34
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
Still, aren't the diagnostic tools that would do the same trick?
We do use the IDE with "Break on All Errors" option set so it does stop on the line the error occurs, shows a message box with error text but does *not* populate the Err object (yet).
Not aware of anything similar for compiled executables though.
cheers,
</wqw>
-
May 21st, 2021, 06:23 AM
#35
Re: Microsoft retiring Internet Explorer next year
@wqweto: I have never heard of ERL being undocumented. I have known about for over two decades. I have to admit I don't know enough about professional software engineering to suggest an alternative. I guess it would depend on your company's needs.
@Arnoutdv: ERL is a function. or read-only property. Not a variable. Why did I call using external tools a red flag? Well, I would say the very fact line numbers are no longer mandatory and the commands to manage them have disappeared mean something don't they? Heck, Microsoft even provided a line number removing tool with QBasic/Quick Basic.
-
May 21st, 2021, 06:33 AM
#36
Re: Microsoft retiring Internet Explorer next year
Just for the record: we *don't* use line numbers like in On Error GoTo 1 because we need the line numbering language feature for the build server pre-processing tool to apply correct source line numbers.
cheers,
</wqw>
-
May 21st, 2021, 06:42 AM
#37
Re: Microsoft retiring Internet Explorer next year
@wqweto, I am not sure what you mean in your last post.
@all:
If you really feel line numbers are your best option for what you need, by all means use them. I just have a hard time grasping the fact that in this day and age there is no decent alternative. Especially when I hear about it within the context of professional software engineering.
-
May 21st, 2021, 06:58 AM
#38
Re: Microsoft retiring Internet Explorer next year
@Peter Swinkels: Making production builds is like pipeline of steps and one of these steps is the tool wqweto wrote and posted link to.
This step is to process source files and automatically add line numbers so error management will know (Erl) and log exactly which line was the exception according source code line numbers shown inside VB6 IDE. After that the real compilation is applied. These line numbers are discarded as they are used by the build server only.
If there was exception in the logs then it is easy to track to the exact line where it happened.
Last edited by peterst; May 21st, 2021 at 07:03 AM.
-
May 21st, 2021, 07:20 AM
#39
Re: Microsoft retiring Internet Explorer next year
Originally Posted by Peter Swinkels
@wqweto, I am not sure what you mean in your last post.
It means that I agree with you that line numbers are obsolete and so we refrain from using this language feature at all in our code (and because this language feature is used by the build tools for error reporting purposes).
cheers,
</wqw>
-
May 21st, 2021, 07:59 AM
#40
Re: Microsoft retiring Internet Explorer next year
@peterst:
So this means vb6 code with line numbers is actually part of some intermediate step during compiling?
@wqweto:
So a tool adds them, not the developer?
I thought information to be able to produce stack traces and the like could be added during compilation for debugging.
Is this whole line number thing still present in the product when the end user gets to work with it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|