Restored from previous forum. Originally posted by Franco.
Oh guys, I thik franco missed something.
I studied the PowerBasic-Sourcecode and found that something is missing.
There is no call to the DLL.
Normally THIS library works without any calls. Well it does under Win98SE and WinXP!
THIS library reacts with the SendMessage command. That's why there is:
SendMessage_(QhtmCtrl,#QHTM_LOAD_FROM_FILE, 0, HtmlFile$ )
But there are some calls in the library like:
"QHTM_Initialize"
"QHTM_EnableCooltips"
"QHTM_MessageBox"
"QHTM_PrintCreateContext"
"QHTM_PrintDestroyContext"
"QHTM_PrintGetHTMLHeight"
"QHTM_PrintLayout"
"QHTM_PrintPage"
"QHTM_PrintSetText"
"QHTM_PrintSetTextFile"
"QHTM_PrintSetTextResource"
I have also the Cooltips WITHOUT calling "QHTM_EnableCooltips".
Siggi, you didn't tell if the code works for you.
At Paul's resource site you will find a zip file with the dll and PureB source.
PB, try this, it uses the DLL library of Mr.Skunk and I call the "QHTM_Initialize" command.
Maybe this works for you.
I can't really test your problem because both versions work fine for me!!!
Code: Select all
; (c) 2002 - Franco's template - absolutely free
; Simple HTML viewer example file
; This Version uses Mr.Skunk DLL library.
; QHTML Light is a free Win32 DLL (184KB) by Russ Freeman that
; Allows you to easily incorporate HTML in your program.
; Uses WinAPI but I don't know if IE must be installed or not... sorry.
; Homepage: [url]http://www.gipsysoft.com/qhtm/index.shtml[/url]
; This piece of code works on WinXP and on Win98SE
#QHTM_LOAD_FROM_FILE = #WM_USER + 2
Dll_hWnd=OpenDLL(0,"qhtmlite.dll")
If DLLFunction(0,0,"QHTM_Initialize") : CallDLL0(0) : Else : MessageRequester("Sorry","No DLL Function",0) : End : EndIf ; Register function
HtmlFile$=OpenFileRequester("Open an HTML file",".\","HTML file |*.htm;*.html",0)
If HtmlFile$
MainForm=OpenWindow(0, 200, 200, 320, 240, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "HTML DLL")
QhtmCtrl = CreateWindowEx_(0,"QHTM_Window_Class_001","",#WS_CHILD | #WS_VISIBLE, 0, 0, 310, 208, MainForm,ID_QhtmCtrl,Dll_hWnd,#NULL)
SendMessage_(QhtmCtrl,#QHTM_LOAD_FROM_FILE, 0, HtmlFile$ )
Repeat
Event=WaitWindowEvent()
Until Event=#PB_EventCloseWindow
EndIf
End
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.