Solved

VB & compiled HTML

Posted on 2000-03-30
28
259 Views
Last Modified: 2010-05-02
How can I create a compiled HTML file ?
What do I need to open such file from my VB program ?
0
Comment
Question by:shvetsov
  • 8
  • 8
  • 8
  • +3
28 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668419
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
 

Expert Comment

by:pmwood
ID: 2668451
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
 
LVL 1

Expert Comment

by:riduce
ID: 2668469
shvetsov do you mean a *.chm file?
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668474
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668488
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668494
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
 

Expert Comment

by:pmwood
ID: 2668497
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668505
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
 

Expert Comment

by:pmwood
ID: 2668517
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668527
since shvetsov hasn't made it clear what he's trying to achieve with this

Exactly. I repeat my request to GordonP
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668551
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668575
"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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668612
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668641
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:pmwood
ID: 2668706
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
 

Expert Comment

by:pmwood
ID: 2668747
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2668756
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
 

Expert Comment

by:pmwood
ID: 2668770
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668779
Aw.... awright then :-)
0
 

Expert Comment

by:pmwood
ID: 2668800
Apologies for the double comments.  Std IE5.  I've restarted, so this is a test.
0
 

Expert Comment

by:pmwood
ID: 2668802
Apologies for the double comments.  Std IE5.  I've restarted, so this is a test.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2668810
<g>
0
 

Author Comment

by:shvetsov
ID: 2669022
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
 
LVL 10

Expert Comment

by:caraf_g
ID: 2669041
So you're looking for what basically boils down to a .chm decompiler?
0
 
LVL 3

Expert Comment

by:Gordonp
ID: 2669057
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
 
LVL 3

Expert Comment

by:Gordonp
ID: 2669097
"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
 
LVL 20

Accepted Solution

by:
hes earned 200 total points
ID: 2674269
0
 

Author Comment

by:shvetsov
ID: 2674384
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now