Using Firefox as a html viewer

Just starting out? Need help? Post your questions and find answers here.
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post by porfirio »

Fred wrote:porfirio: i don't plan to include the activex for several reasons:

1) bug fixes. what if a security hole is found in the mozilla engine ? as the activex is a separate package you can easily update it and all apps based on it will be fixed.

2) maintainance. it will be an hell to follow all the release and include them in PB.

Ii don't think than the activex redistribution and installation is a problem, as it's relatively small (4,7 mb) and got a blind install (almost nothing to do).
Your right and ppl can include it in their install pacage with inno setup ot nsis i think with that they can instal the activex

Or ppl just put it as a 3ª party software
Mabe you could do something to check if ppl have it and if not use ie

just a idea;)
Forgive-me for my english, i'm portuguese!
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post by nrasool »

Hi there

I have simply copied the library from the Mozilla ActiveX folder, uninstalled it, then in my purebasic program simply registered the require variable - mozctlx.dll

When the program ended, i then unregistered the variable.

Works pretty well, although including the whole files will increase your program by 4 mbs

A Short program can be downloaded here:
http://www.nadcom.co.uk/purebasic/mozillahtmlviewer.zip

Warning around 4.9Mb

Uses the following sourcecode for registering dll
viewtopic.php?t=3656

Kind Regards

Nadeem
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post by porfirio »

File not found : register.pb
Forgive-me for my english, i'm portuguese!
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post by nrasool »

Whoops Sorry, create a new .pb file and called it register.pb

Copy and paste the following into this file

Code: Select all

; 
;RegSVR32 Sample 
Procedure RegSVR32(File$,Flag) 

 hLib = LoadLibrary_(File$) ;Load the DLL into memory 
 If hLib =0 
  ProcedureReturn 0 
 EndIf 
  
 If Flag=1 
    RegProcName.s = "DllRegisterServer" 
 Else 
    RegProcName.s = "DllUnregisterServer" 
 EndIf 
  
 ; Find And store the DLL entry point, i.e. obtain the address 
 ; of the “DllRegisterServer” or "DllUnregisterServer" function 
 ; (to register or deregister the server’s components in the registry) 

lpDLLEntryPoint = GetProcAddress_(hLib, RegProcName) ;Find Procedure in DLL 

If lpDLLEntryPoint = 0 
     FreeLibrary_(hLib) 
     ProcedureReturn -1 ;This is not a ActiveX 
EndIf 

;Create a thread To execute within the virtual address space of the calling process 
hThread = CreateThread_(0, 0,lpDLLEntryPoint, 0, 0, lpThreadID) 

If hThread = 0 
    FreeLibrary_(hLib) 
    ProcedureReturn -2 ;failed threading 
EndIf 

;Use WaitForSingleObject To check the Return state (i) when the specified object is in 
;the signaled state Or (ii) when the time-out interval elapses. This function can be 
; used To test Process And Thread. 
mResult = WaitForSingleObject_(hThread, 10000) 
If mResult <> 0 
   FreeLibrary_(hLib) 
   lpExitCode = GetExitCodeThread_(hThread, lpExitCode) 
   ExitThread_(lpExitCode) 
   ProcedureReturn -3 ;failed threading 
EndIf        

;We don't call the dangerous Terminate Thread(); after the last handle to an object 
;is closed, the object is removed from the system. 

CloseHandle_(hThread) 
FreeLibrary_(hLib) 
ProcedureReturn 1 ;failed threading 
EndProcedure 
Save and Exit

Should work now
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post by porfirio »

It work good but mabe you need more thing's
right click menu dont work.....

[edit]

Something interessant when your program end it uninstal the activex so i go try another program and it worked but with ie control and not with mozzila

That is cool we can distribute a program and if ppl dont have mozzila activex it work with ie ;)
Forgive-me for my english, i'm portuguese!
porfirio
Enthusiast
Enthusiast
Posts: 111
Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal

Post by porfirio »

So no more updates on this ??
Forgive-me for my english, i'm portuguese!
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post by nrasool »

Sorry, Haven't had a chance to take a look back into this. Just been busy with other projects at the moment.

Hmm... you could try as well, I have provided the whole source code. It may be another .ocx file needs to be registered.
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

Fred wrote:Cool if it works for you. About the library, the compiler scan the whole directory and load the pb files which are in it, so even if you rename it will load it.

BTW, we will just add a flag to the current WebGadget() to enable mozilla use.
Has this been done ?

If so, the help doesn't have the flags and still states that IE is required......
Paid up PB User !
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Well the webgadget already supports the flags, but i don't know which one to use o_O !!!

Ehehe
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

*bump*

Fred? Beriko? anyone?

What is the #FLAG for using Mozilla/Firefox as the Webgadget engine ?

Pretty Please ;)
Paid up PB User !
MVXA
User
User
Posts: 18
Joined: Tue Feb 22, 2005 11:09 pm
Contact:

Post by MVXA »

i think
1: using FireFox Gecko engine
0: using IE
dontmailme
Enthusiast
Enthusiast
Posts: 537
Joined: Wed Oct 29, 2003 10:35 am

Post by dontmailme »

I did try that.... as it was the most obvious guess.... but it always used ie..... unless latest beta doesn't have the update ?!
Paid up PB User !
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post by utopiomania »

Hope we'll be able to use IE as usual even if this request is granted. ??
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's now added, it will be the #PB_Web_Mozilla flag to use the mozilla engine instead of IE
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Great Fred ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Post Reply