Click to See Complete Forum and Search --> : Best way to convert VB program to HTML
lou
March 18th, 2001, 08:59 AM
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
Iouri
March 18th, 2001, 11:07 AM
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
iouri@hotsheet.com
lou
March 18th, 2001, 09:08 PM
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
Raistlin
March 18th, 2001, 10:49 PM
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
lou
March 19th, 2001, 08:21 AM
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
Raistlin
March 19th, 2001, 10:08 AM
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
shree
March 19th, 2001, 08:32 PM
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.
lou
March 20th, 2001, 08:55 AM
Thanks for your help
lou
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.