dcsimg
Results 1 to 13 of 13

Thread: VB6 web interface

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    284

    VB6 web interface

    Had a recent brain storm idea and wanted to run it by you guys for thoughts.

    Has anybody/ or do you think it is possible to parse a vb6 .frm parser to create a webpage that sends json back and forth to create a web interface for any vb6 app.

    1. a class would create a website to render a duplicate of user interface ( the class would need to extract images from frx files and save them into local folder)
    2. when the website is created events are placed into the website code that sends json commands back to vb6 app
    3. each element can be treated as a 'div' and updated accordingly, so if a button changes state the vb6 app sends an update to the website to show new button state
    4. There is an event interpreter on the vb6 app side that interprets the commands coming back and alters the button/slider/etc in the vb6 app according to what is done on website.

    this is an extremely rough idea and I have minimal java script experience, but the concept seems feasible.

    What are your thoughts

    WP

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,956

    Re: VB6 web interface

    Quote Originally Posted by axisdj View Post
    Has anybody/ or do you think it is possible to parse a vb6 .frm parser to create a webpage that sends json back and forth to create a web interface for any vb6 app.
    ...
    What are your thoughts
    VB6-Forms (as they are usually implemented) are not really "Data-Driven" (do not use DataBinding between a "Model" and a "View").

    Whereas modern WebApps are mostly developed "declarative" (describe DataBindings between JSON-Data-Models and HTML-Views).

    So, the fundamental development-paradigms do not really match (WebApps have kind of a "higher isolation" between Data and View -
    and changes in some Controls are often triggered by "changing the plain Data in the JSON-Model"-> which in turn changes the View-representation in a "hidden render-step").

    You can now either force the VB6-App into a more "declarative" style beforehand (for later easier 1:1 porting into a modern WebApp) -
    or alternatively force one of the modern js-Frameworks, to work without databinding (to match the VB6-Form-Model more).

    Though none of the above will feel "right" (or is efficient in terms of development-time, spent before a porting-attempt can be made).

    So it's usually best (in terms of development-efforts and -time) to just implement your new WebForm on a "fresh greenfield"
    (according to the recommended way, the developers of the js-Framework in question considered best-practice).

    What helps with such a "porting-effort" is a look at your Data (what is really "going in" into your Form, data-wise -
    and what shall "come out" of your Form data-wise, in case it is not a "pure presentation-" but an "input-form" instead.

    The DataLayer-Classes of your VB-App (the things which communicate with your DB or Data-Streams or -Files),
    is the parts you can usually keep (at the serverside, in your own VB6-Dlls) - perhaps adapted a bit, to work stateless -
    and enhanced about helper-methods to easier provide the WebApp with properly formatted JSON-Model-Data-Inputs -
    via (incoming from the Client- or Browser-side) http-based RPCs ("ajax-calls").

    Olaf

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    284

    Re: VB6 web interface

    Thanks for the reply Olaf... I am not 100% versed in MVC concepts... and redesinging my apps to follow that pattern would be a huge task (although I guess would be the 'right' way to do it)

    My thought is that the web interface would have each function name for each button and slider etc.. stored and when the users modifies the web button etc.. json would send a 'callByName' message of the string stored to the vb6 app.

    so lets say the button in web ui rendered, it would store the vb6 function name 'button1_click()', then when in the web ui the button is pressed the vb6 json interpreter calls 'button1_click()' using callbyname

    then once state is changed, the vb6 app sends all updated 'divs' to show state change.

    Is that feasible conceptually?

    The idea would be if this can be done, I could run the vb6 app on linux using wine, and the ui could be the generated and served to a web interface.

    I know this concept may go against common practices, I am just wondering if you guys think it may work?

    Thanks
    WP

  4. #4
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    915

    Re: VB6 web interface

    I suspect the amount of effort involved in parsing the .frm and converting it to a workable html representation alone would be an enormous challenge. When you then add in the complexity of converting requests to json, generating the javascript to post them to a back-end, dealing with all of this in reverse it sounds more complicated than just learning to do things the web was designed.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    284

    Re: VB6 web interface

    Quote Originally Posted by PlausiblyDamp View Post
    I suspect the amount of effort involved in parsing the .frm and converting it to a workable html representation alone would be an enormous challenge. When you then add in the complexity of converting requests to json, generating the javascript to post them to a back-end, dealing with all of this in reverse it sounds more complicated than just learning to do things the web was designed.
    I may try to tackle a simple proof on concept and let you know. I am now thinking there is no need to parse the .frm file, I could merely go through the control collection on a form ...

    I just dont think it is that hard, and if we all jointly create a class to do this, it would save alot of time for all.

    The fact that you guys think it wont work could also mean I am not thinking this through and the implementation is much more complicated that I think

    let me talk it through again

    1. Go through all controls on a form and generate a webpage with 'div' for each control.
    2. this is where I am fuzzy.. store the event information for instance ('button1_click') and register the event in the javascript page so that when the image or button in the 'div' gets clicked the javascript send a json command back to the vb6 app
    3. then the vb6 interpreter receives the 'button1_click' from web page and calls the function byname using callByName
    4. once event occurs, the vb6 webserver can update the visual state of the 'div's that need updating ( i guess sockets are required .. I have no clue how that works)

    Olaf any sample links you can post so i can explore websockets would be helpful, could not find on vbrichclient.com

    WP
    Last edited by axisdj; Jun 12th, 2018 at 10:59 PM.

  6. #6
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,242

    Re: VB6 web interface

    This is a very interesting idea. Hope that Olaf's new compiler and IDE will have a complete web development framework.

  7. #7
    Addicted Member
    Join Date
    Feb 2015
    Posts
    140

    Re: VB6 web interface

    NS Basic may be an alternative approach.
    You can't automatically parse VB6 forms. But you can create a form and name it exactly the same as your VB6 form. Then put controls on the form, naming each the same as the VB6 controls. Then you can copy and paste the code from your VB6 form.

    The NS Basic programming language is almost a clone of the VB6 programming language and transpiles to standard JavaScript.
    Last edited by VB6 Programming; Jun 16th, 2018 at 08:42 AM.

  8. #8
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,242

    Re: VB6 web interface

    Quote Originally Posted by axisdj View Post
    Had a recent brain storm idea and wanted to run it by you guys for thoughts.

    Has anybody/ or do you think it is possible to parse a vb6 .frm parser to create a webpage that sends json back and forth to create a web interface for any vb6 app.

    1. a class would create a website to render a duplicate of user interface ( the class would need to extract images from frx files and save them into local folder)
    2. when the website is created events are placed into the website code that sends json commands back to vb6 app
    3. each element can be treated as a 'div' and updated accordingly, so if a button changes state the vb6 app sends an update to the website to show new button state
    4. There is an event interpreter on the vb6 app side that interprets the commands coming back and alters the button/slider/etc in the vb6 app according to what is done on website.

    this is an extremely rough idea and I have minimal java script experience, but the concept seems feasible.

    What are your thoughts

    WP
    Hi axisdj, Is there any progress in your brain storm idea now?

  9. #9
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,493

    Re: VB6 web interface

    Why would you even consider doing this? in effect its (at the very least) three time the effort of just designing a modern web app.

    You would have to firstly write a parser, then write something to turn that into a modern web app, then have a way of bringing back the data back and forth to VB6.

    Also to turn it into a modern web app your still going to have to learn which ever language or framework you decide you want to convert your VB6 screens into.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  10. #10

  11. #11
    Addicted Member
    Join Date
    Feb 2015
    Posts
    140

    Re: VB6 web interface

    There is this "Thinfinity Virtual UI" https://www.cybelesoft.com/thinfinit...isual-basic-6/
    which claims to "move your Visual Basic 6 apps to the web" and is "as simple as adding one line of code to your source code."

    I haven't tried it, and most of the samples look to be for .Net.

    It says it can be used from any HTML5 browser or from Windows.

    There is a free 90 day trial.
    Last edited by VB6 Programming; Oct 23rd, 2018 at 03:31 AM.

  12. #12
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,242

    Re: VB6 web interface

    Quote Originally Posted by NeedSomeAnswers View Post
    Why would you even consider doing this? in effect its (at the very least) three time the effort of just designing a modern web app.

    You would have to firstly write a parser, then write something to turn that into a modern web app, then have a way of bringing back the data back and forth to VB6.

    Also to turn it into a modern web app your still going to have to learn which ever language or framework you decide you want to convert your VB6 screens into.
    Hi NeedSomeAnswers, sorry for the late reply, I missed this post. What you said is very reasonable. I'd like to develop a Website Builder in a way similar to VB-Form Designer. I don't know if this idea is feasible.

  13. #13
    Frenzied Member
    Join Date
    Sep 2012
    Posts
    1,242

    Re: VB6 web interface

    Quote Originally Posted by gibra View Post
    Alternative:

    Basic For Android/iOS (very small price)
    https://www.b4x.com/

    Xojo
    https://www.xojo.com/

    NS Basic

    https://www.nsbasic.com/
    Hi gibra, thank you for the information.


    Quote Originally Posted by VB6 Programming View Post
    There is this "Thinfinity Virtual UI" https://www.cybelesoft.com/thinfinit...isual-basic-6/
    which claims to "move your Visual Basic 6 apps to the web" and is "as simple as adding one line of code to your source code."

    I haven't tried it, and most of the samples look to be for .Net.

    It says it can be used from any HTML5 browser or from Windows.

    There is a free 90 day trial.
    Hi VB6 Programming, thank you for your reply. I'm not trying to convert the VB6 apps to web apps. I'd like to develop a Website Builder in a way similar to VB-Form Designer. The information you provided is very interesting, and I'm curious how VirtualpUI can transform a VB6 app into a web app. I'll continue to research the information on this website. Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width