CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2000
    Posts
    9

    Best way to convert VB program to HTML

    What is the best way to convert my VB program to HTML? (Or inserting in HTML page)
    It will be helpful if you can walk me through converting one of the samples that came with VB6 (like the calc.vbp).
    Thanks in advance



  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Best way to convert VB program to HTML

    Save text file as HTML

    Open "Myhtml.htm" for Output as #1
    print #1,"<html><head><title>"
    print #1, MyTitle 'string variable
    print #1, "</title></head><body>"
    print #1, Text1 'text from textbox
    print #1, "</body></html>"
    Close #1


    '-----
    the following will let you write to html

    <SCRIPT LANGUAGE="VBScript">
    ' This line executes when the script tag is parsed.
    Call PrintWelcome

    Sub PrintWelcome
    Dim h

    h = Hour(Now)
    If h < 12 then
    Document.Write "Good morning! "
    ElseIf h < 17 then
    Document.Write "Good afternoon! "
    Else
    Document.Write "Good evening! "
    End If
    Document.Write "Welcome to the world of VBScript. "
    Document.Write "Just in case you were wondering, it's "
    Document.Write Time() & " on " & Date() & "."
    End Sub
    </SCRIPT>





    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Oct 2000
    Posts
    9

    Re: Best way to convert VB program to HTML

    Thanks for your reply louri.
    What I meant by my question was:
    Is there away to convert (or insert) my existing VB program in a web page so it will appear just as a Java applet does.
    I tried to create an ActiveX control from one of my programs, however it not functional from a remote computer.
    Thanks again




  4. #4
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    59

    Re: Best way to convert VB program to HTML

    I believe that you are looking to use a .dll.
    I am not sure how java applets work but you can take your code and complie it to a activeX.dll that will allow you to call your functions and subs from your ASP or any server side lanugage. There are many examples to develop this.

    If this is what you are looking for just reply.
    Hope this helps
    Raistlin


  5. #5
    Join Date
    Oct 2000
    Posts
    9

    Re: Best way to convert VB program to HTML

    Yes that’s exactly what I am looking for.
    I am not sure how to go about it, I know how to create the Dll but how does the end user access the page (does the user need to install the dll on his/her computer first)?
    I use FrontPage 98 to develop the web page.
    Thanks again



  6. #6
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    59

    Re: Best way to convert VB program to HTML

    I week ago I started to use dll's and I Love it.
    This is what you need to do.
    Develop all your functions in the dll make sure there is no msgbox's and App.path's.(For some reason they don't work in a complied dll)
    Compile the code to a dll.
    Set the dll somewhere on the server in a web directory. Now you need to register the dll on the server so the server knows where to look.
    On the server type regsvr32 [Path and filename]
    of the dll in the run command.
    Now the dll is registered you can access it in your server side code like this.

    Dim obj_dll
    set obj_dll = Server.CreateObject("ProjectName.ClassName")




    The project name is important because you need to declare the projectname and then the classname with all the functions.

    Now you call the functions like this in your ASP.

    obj_dll.Create_PDF() 'Function in the dll




    Make sure that you set the object to NOTHING when you are done.

    set obj_dll = nothing



    I hope this helps
    And to answer the question the clients do not have to have the dll. It sits on the server.

    Fellow programmer
    Raistlin




  7. #7
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Best way to convert VB program to HTML

    As far as I know You cannot include your program on a web page so that somebody else can run off it. Unless you write it in VBScript, JavaScript, or Java or many of the other languages that have been there for this purpose.

    One of the main problems in allowing your program to be run from the web page is that of platform independence. You make your program for Windows, but a user may be browsing your page from Linux. And your program will be incompatible.

    Another problem is that your program will have used DLLs and other files and they may not be available on everyone's computer.

    One workaround, though you may not like it, is to allow the user download all the setup files, install it on his/her computer and run it locally. And doing that is very easy.


  8. #8
    Join Date
    Oct 2000
    Posts
    9

    Re: Best way to convert VB program to HTML

    Thanks for your help
    lou


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured