Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

VB & compiled HTML

How can I create a compiled HTML file ?
What do I need to open such file from my VB program ?
0
shvetsov
Asked:
shvetsov
  • 8
  • 8
  • 8
  • +3
1 Solution
 
caraf_gCommented:
Compiled HTML? Is there such a thing? HTML files are just text files and AFAIK you can simply open them with the standard File IO functions:

Just an example:

Dim intFile As Integer
intFile = FreeFile

Open "X:\Y\Z\SomeHtmlFile.Html" For Input As #intFile

'loop through the file
Do While Not EOF(#intFile)
.....


'or...
Line Input #intFile, strSomeStringVariable

etc...
0
 
pmwoodCommented:
I think you'll find there's no such thing as compiled HTML.  The idea of HTML is that it is plain text in a standard format and as a result can be read by any browser on any platform.  Compiling results in faster, more compact code by converting a program into a format which can be loaded directly into memory by a particular platform and operating system.  It will generally then only run on that platform, which is obviously no good on the internet.  So there is no option to compile HTML.

However, there are two ways to write "compiled" applications for your browser. 1) to write an activeX (Microsoft) or Java applet which can be loaded into the browser window by the HTML.  These are run on the client machine by the web browser;  or 2) ASP pages/Webclasses (Microsoft) or CGI scripts (the rest) which can be compiled depending on what language they are written it.  These are run by the web server which the browser is calling, and basically create standard HTML pages which are sent to the browser for display.

This is a huge topic!  I wouldn't know where to start going into more detail, more info, and there's no room here... hope this helps.
0
 
riduceCommented:
shvetsov do you mean a *.chm file?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GordonpCommented:
Sorry Guys,
there is such a thing as compiled HTML, better known as HTML Help (.chm files).

Theres a help compiler you can download from microsofts web site, (just search for 'HTML Help' in the developers area.

as for calling it from VB!!

you can set the project help file to be a HTML help file, in the project properties window.

you can then assign HelpContextIDs to all your controls, menus and even erros

as for just opening it you can use the WinHelp API Call


Private Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any) as long


'To open contents page
WinHelp(Me.hwnd, App.HelpFile, 3, 0)

Hope this answers your questions


0
 
GordonpCommented:
oops missed a bit.

App.Helpfile is the filename for the helpfile, this is set when you enter a helpfile in the project properties dialog, or it can be set at runtime.

Look in MSDN for the WinHelp function for more details on how to open the help file to the index or a specific page.

As for the help compiler, the Microsoft ones pretty poor, but its free, I'm not sure what other free ones are available, but the latest version of RoboHelp does HTML help ( we're using it on our latest project ) not sure about cost, but I beleive you can get a trial version to check if you think its any good.

if you need any more info just ask!

Gordon
0
 
caraf_gCommented:
Gordon, thanks for that explanation, but I don't recall shvetsov talking about "help". If that is what shvetsov is talking about then yes you could be right, but as you cannot be sure that it is you shouldn't really have posted your suggestion as an answer. Would you mind withdrawing it until we've cleared that up? After all, shvetsov can always accept your comment as an answer.
0
 
pmwoodCommented:
I think you'll find there's no such thing as compiled HTML.  The idea of HTML is that it is plain text in a standard format and as a result can be read by any browser on any platform.  Compiling results in faster, more compact code by converting a program into a format which can be loaded directly into memory by a particular platform and operating system.  It will generally then only run on that platform, which is obviously no good on the internet.  So there is no option to compile HTML.

However, there are two ways to write "compiled" applications for your browser. 1) to write an activeX (Microsoft) or Java applet which can be loaded into the browser window by the HTML.  These are run on the client machine by the web browser;  or 2) ASP pages/Webclasses (Microsoft) or CGI scripts (the rest) which can be compiled depending on what language they are written it.  These are run by the web server which the browser is calling, and basically create standard HTML pages which are sent to the browser for display.

This is a huge topic!  I wouldn't know where to start going into more detail, more info, and there's no room here... hope this helps.
0
 
GordonpCommented:
caraf_g>

HTML Help is compiled html.

even if he doesnt want a help file,

he can still use this method to access a compiled html file.

Gordon
0
 
pmwoodCommented:
Nice answer, didn't think of that.  It's not what "HTML" brings to mind!  I'd like to point out that it's Microsoft-specific (IE4 or greater) and not a technology that should be used for web development, since shvetsov hasn't made it clear what he's trying to achieve with this.  If it's creating help files, that's it.
Peter
0
 
caraf_gCommented:
since shvetsov hasn't made it clear what he's trying to achieve with this

Exactly. I repeat my request to GordonP
0
 
GordonpCommented:
caraf_g>

shvestov wants to know how to create Compile HTML, and call it from VB (hence microsoft specific, pmwood)

I have told him how to create compiled HTML, and how to call it from VB. Hence it is an answer.

Gordon
0
 
caraf_gCommented:
"how to call it from VB"
Nope. How to *open* it.

Hence my suggestion, which is just as valid considering none of us know what shvestov wants exactly.

Therefore, I could have just as validly locked the question with *my* half answer. I didn't, and I'm asking you to do the same.
0
 
GordonpCommented:
If I had only had hald an answer , i would have made it a comment.

However, I had an ANSWER to both parts of the question, so I ANSWERED the question.

if there had been more than one interpretation of compiled HTML then I would have made it a comment and start it it along the line

"IF you mean compiled HTML as in HTML Help then ..."

But there is only one type of compiled HTML, unless you know different, and I provided all the details on how to get a compiler, and on how to open it.

If its not what shvetsov was asking for then fairy nuff, he/she can reject my answer.

I have provided what is in my opinion a FULL answer, that wasnt just a rehash of previous comments, so I made it an answer, simple.

Anyway this is not the place to debate the merits of comments v answers.

Gordon
0
 
pmwoodCommented:
Nice answer, didn't think of that.  It's not what "HTML" brings to mind!  I'd like to point out that it's Microsoft-specific (IE4 or greater) and not a technology that should be used for web development, since shvetsov hasn't made it clear what he's trying to achieve with this.  If it's creating help files, that's it.
Peter
0
 
pmwoodCommented:
Nice answer, didn't think of that.  It's not what "HTML" brings to mind!  I'd like to point out that it's Microsoft-specific (IE4 or greater) and not a technology that should be used for web development, since shvetsov hasn't made it clear what he's trying to achieve with this.  If it's creating help files, that's it.
Peter
0
 
GordonpCommented:
pmwood, is there something wrong with your browser.
Thats three times you've posted the one comment, while you posted your first comment twice.

If your keeping the page open and refreshing, make sure your not refreshing the original question page and not the page you get after adding a comment.

Gordon
0
 
pmwoodCommented:
Relax everyone, this is a discussion, not a war.

Gordon is right as far as I can see.  He has an answer which is very likely to be what's wanted, and should post it.  If it is not what's wanted, or not detailed enough, shvetsov can reject it, and accept a comment if he wants to.

There is some ettiquette where answers are posted as comments if there is doubt about them.  The poster has to decide about that.
0
 
caraf_gCommented:
Aw.... awright then :-)
0
 
pmwoodCommented:
Apologies for the double comments.  Std IE5.  I've restarted, so this is a test.
0
 
pmwoodCommented:
Apologies for the double comments.  Std IE5.  I've restarted, so this is a test.
0
 
caraf_gCommented:
<g>
0
 
shvetsovAuthor Commented:
Wow !
What a large discussion :)

Yes, I mean windows .chm files.
But I don't want to use it as help.
I want to have a MSIE ActiveX (or some else) control on my VB form and show the compiled HTML in it.

Thanx to gordonp for the idea about MS site as a source of the compiler.

But MSIE as a standalone browser or as a ActiveX control doesn't want to show me the compiled HTML. It tries to download it as a binary file :(

So that's the question: how can I show the compiled HTML in my application, not as Help.

0
 
caraf_gCommented:
So you're looking for what basically boils down to a .chm decompiler?
0
 
GordonpCommented:
Sounds like your looking for a control which displays the contents of a .chm, just like the help viewer but actual displays it withing your form??

I'm not sure there is such a control, or a way of doing it.

I'll look around for you though.

Gordon

0
 
GordonpCommented:
"But MSIE as a standalone browser or as a ActiveX control doesn't want to show me the compiled HTML. It tries to download it as a binary file :( "

..chm files, are binary files.

I beleive it is possible to customize the HTML Help Viewer and distribute it compiled into your .chm files.

look here for more details

http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/tools/htmlhelp/chm/hh1start.htm

shvestsov, what do you intend to use the .chm files for?



0
 
shvetsovAuthor Commented:
Oh, yeah!

But, Gordonp, you told me where to get the compiler. So I'll create a question especially for you. Please answer it.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 8
  • 8
  • 8
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now