dcsimg
Results 1 to 7 of 7
  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    257

    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,638

    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
    257

    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
    784

    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
    257

    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
    Fanatic Member
    Join Date
    Sep 2012
    Posts
    948

    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
    Lively Member
    Join Date
    Feb 2015
    Posts
    70

    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.

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


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.