-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Mozilla WebBrowser
Hi,
Is it possible to make a "mozillaBrowser" control in VP7.2 ?
If yes, how ?
I need it because copy and paste functions using execWB (or manually with mouse) with webBrowser control doesn't works.
I've tried to download "Mozilla ActiveX Control 1.7.12" and register like "regsvr32 mozctlx.dll" (as I see in this post http://discuss.visual-prolog.com/viewto ... ht=mozilla), but when I try to create a new Com Package in my project, VP7.2 doesn't want.
Is it possible to make a "mozillaBrowser" control in VP7.2 ?
If yes, how ?
I need it because copy and paste functions using execWB (or manually with mouse) with webBrowser control doesn't works.
I've tried to download "Mozilla ActiveX Control 1.7.12" and register like "regsvr32 mozctlx.dll" (as I see in this post http://discuss.visual-prolog.com/viewto ... ht=mozilla), but when I try to create a new Com Package in my project, VP7.2 doesn't want.
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Hi,
1) Is it normal : after creating the Com package, any activeX sub-folder appeared in my project ?
2) this following code compile fine but what I need to add instead XXX ?
1) Is it normal : after creating the Com package, any activeX sub-folder appeared in my project ?
2) this following code compile fine but what I need to add instead XXX ?
Code: Select all
constants
idc_browser = 1000.
facts
browser : iWebBrowser2_import := uncheckedConvert(iWebBrowser2_import,null).
predicates
onShow : window::showListener.
clauses
onShow(_Source, _Data):-
Rct = vpi::winGetClientRect(This:getVpiWindow()),
Container = activeXContainer::new(This:getVpiWindow()),
Container:attachListener(browserListener),
Obj=Container:createControl(mozillaBrowser::componentClassID,Rct,idc_browser),
if not(Obj=uncheckedConvert(iOleObject_native,null)) then
_=Obj:queryInterface(iWebBrowser2_native::iid,IUnk),
IDisp=uncheckedConvert(iWebBrowser2_native,IUnk),
XXX
end if
.
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
It is an ActiveX control, but the constructors have not marked the component as a control in the type liberary.
During registration it does however seem to be registered as a control anyway.
We have seen this kind of mistakes in other type libraries, so I guess we will have provide some means for manually overruling.
Anyway, it seems that you will have to create the control code manually. If you import some other component you can see how the code looks.
During registration it does however seem to be registered as a control anyway.
We have seen this kind of mistakes in other type libraries, so I guess we will have provide some means for manually overruling.
Anyway, it seems that you will have to create the control code manually. If you import some other component you can see how the code looks.
Regards Thomas Linder Puls
PDC
PDC
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Hi,
This following code generate an error :What's wrong ?
This following code generate an error :
Code: Select all
clauses
onShow(_Source, _Data):-
HomePage="http://discuss.visual-prolog.com/",
M = mozillaBrowser::new(),
M:navigate(HomePage,comDomains::unsigned(0x0),comDomains::null,comDomains::null,comDomains::null)
.
You do not have the required permissions to view the files attached to this post.
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Hi,
I've changing my code and now I've this error :
I've changing my code and now I've this error :
Code: Select all
facts
mb:mozillaBrowser:=erroneous.
clauses
onShow(_Source, _Data):-
mb := mozillaBrowser::new(),
!.
predicates
onBt_navgClick : button::clickResponder.
clauses
onBt_navgClick(_Source) = button::defaultAction:-
HomePage="http://discuss.visual-prolog.com/",
mb:navigate(HomePage,comDomains::unsigned(0x0),comDomains::null,comDomains::null,comDomains::null)
.

========================================
Dump: 2010/02/23 12:31:17
----------------------------------------
Exception: e_unexpected_exception (com/visual-prolog/com/exceptionHandling/exceptionHandling_exception)
Catastrophic failure
HRESULT code = 2147549183
HRESULT hex code = 8000FFFF
hresultDescription = Catastrophic failure
Predicate name = navigate
URL = http://discuss.visual-prolog.com/
raised() 2010/02/23 12:30:54
ThreadId=5228
ClassInfo: iWebBrowser_import
C:\Program Files\Visual Prolog 7.2\pfc\exception\exception.pro(187)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\VIP7Kernel.dll (0x14009854)
C:\Program Files\Visual Prolog 7.2\pfc\exception\exception.pro(187)
C:\Program Files\Visual Prolog 7.2\pfc\com\exceptionHandling\comExceptionCheck.pro(415)
C:\Program Files\Visual Prolog 7.2\pfc\com\exceptionHandling\comExceptionCheck.pro(355)
C:\Program Files\Visual Prolog 7.2\pfc\com\exceptionHandling\comExceptionCheck.pro(339)
d:\1travail\prolog_7_2\tests\mozillabrowser\moz\import\iWebBrowser_import.pro(80)
C:\Program Files\Visual Prolog 7.2\pfc\gui\Controls\button.pro(95)
C:\Program Files\Visual Prolog 7.2\pfc\gui\Window.pro(1106)
C:\Program Files\Visual Prolog 7.2\pfc\gui\drawWindow.pro(423)
C:\Program Files\Visual Prolog 7.2\pfc\gui\Dialog.pro(136)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\VIP7Kernel.dll (0x14009B55)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\vip7vpi.dll (0x153215B0)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\vip7vpi.dll (0x15315527)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\vip7vpi.dll (0x15316D8F)
d:\1travail\prolog_7_2\tests\mozillabrowser\Exe\vip7vpi.dll (0x1531FE5B)
C:\WINDOWS\system32\USER32.dll (0x7E398734)
C:\WINDOWS\system32\USER32.dll (0x7E3A3CE4)
C:\WINDOWS\system32\USER32.dll (0x7E3A3B30)
C:\WINDOWS\system32\USER32.dll (0x7E3A3D5C)
C:\WINDOWS\system32\USER32.dll (0x7E398734)
C:\WINDOWS\system32\USER32.dll (0x7E398816)
C:\WINDOWS\system32\USER32.dll (0x7E3A927B)
C:\WINDOWS\system32\USER32.dll (0x7E3A92E3)
C:\WINDOWS\WinSxS\X86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\COMCTL32.dll (0x773B7354)
C:\WINDOWS\WinSxS\X86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\COMCTL32.dll (0x773B7436)
C:\WINDOWS\WinSxS\X86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\COMCTL32.dll (0x773B973B)
C:\WINDOWS\system32\USER32.dll (0x7E398734)
C:\WINDOWS\system32\USER32.dll (0x7E398816)
C:\WINDOWS\system32\USER32.dll (0x7E3AA013)
C:\WINDOWS\system32\USER32.dll (0x7E3AA039)
----------------------------------------
OS information:
Microsoft Windows XP OS version not supported or bad data. Service Pack 3 (Build 2600)
Number Of Processors: 2 PageSize: 4096 Processor: 586 level: 15 revision: 1025
ProcessorNameString: Intel(R) Pentium(R) 4 CPU 3.20GHz
VendorIdentifier: GenuineIntel
Identifier: x86 Family 15 Model 4 Stepping 1
~MHz: 3211
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
It does not look like you have created Active X wrap code (manually; unfortunately).
The Active X will first of all have to become a control that you can place in a form and show on the screen.
I would not expect the that you can navigate anywhere, until the control is created (i.e. as a window).
The Active X will first of all have to become a control that you can place in a form and show on the screen.
I would not expect the that you can navigate anywhere, until the control is created (i.e. as a window).
Regards Thomas Linder Puls
PDC
PDC
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Hi,
After register my Mozilla WebBrowser (version 1.7.12) mozctl.dll (using regsvr32), I've created a new VP 7.3 project and add the Mozilla COM component.
On the onClick of a button in a form, I use this following code :
And the navigate call generate this error :
After register my Mozilla WebBrowser (version 1.7.12) mozctl.dll (using regsvr32), I've created a new VP 7.3 project and add the Mozilla COM component.
On the onClick of a button in a form, I use this following code :
Code: Select all
facts
browser : iWebBrowser2_import := uncheckedConvert(iWebBrowser2_import,null).
predicates
onBt_start_navigClick : button::clickResponder.
clauses
onBt_start_navigClick(_Source) = button::defaultAction:-
Rct = vpi::winGetClientRect(This:getVpiWindow()),
Container = activeXContainer::new(This:getVpiWindow()),
Container:attachListener(browserListener),
Obj=Container:createControl(mozillaBrowser::componentClassID,Rct,idc_browser),
if not(Obj=uncheckedConvert(iOleObject_native,null)) then
_=Obj:queryInterface(iWebBrowser2_native::iid,IUnk),
IDisp=uncheckedConvert(iWebBrowser2_native,IUnk),
browser := iWebBrowser2_import::new(IDisp),
HomePage="http://www.visual-prolog.com/",
browser:navigate(HomePage,comDomains::null,comDomains::null,comDomains::null,comDomains::null) % !!! this line generate an error
% browser:navigate(HomePage,comDomains::unsigned(0x0),comDomains::null,comDomains::null,comDomains::null)
% browser:navigate(HomePage,comDomains::variant(comDomains::integer(0)),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")))
% browser:navigate(HomePage,comDomains::variant(comDomains::integer(0)),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")))
% browser:navigate(HomePage,comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")))
% browser:navigate2(comDomains::variant(comDomains::string(HomePage)),comDomains::unsigned(0x0),comDomains::null,comDomains::null,comDomains::null)
% browser:navigate2(comDomains::variant(comDomains::string(HomePage)),comDomains::unsigned(0x0),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")))
% browser:navigate2(comDomains::variant(comDomains::string("")),comDomains::unsigned(0x0),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")),comDomains::variant(comDomains::string("")))
end if
.
What's wrong ? Do I forget something ?
========================================
Dump: 2014/08/06 12:41:14
----------------------------------------
Exception: e_fail_exception (com/visual-prolog/com/exceptionHandling/exceptionHandling_exception)
Unspecified error
HRESULT code = 2147500037
HRESULT hex code = 80004005
hresultDescription = Unspecified error
Predicate name = navigate
URL = http://www.visual-prolog.com/
raised() 2014/08/06 12:41:12
ThreadId=7772
ClassInfo: iWebBrowser_import
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
You should import the mozillaBrowserControl from "mozclt.dll"
It makes this code work quite well:
In 7.3 you don't have postAction and anonymous predicates, so you should perform the navigate2 in a show listener.
It makes this code work quite well:
Code: Select all
clauses
new(Parent):-
formWindow::new(Parent),
generatedInitialize(),
mz := mozillaBrowserControl::new(This),
mz:setPosition(10, 10),
mz:setSize(200, 200),
postAction({ :-
HomePage = comDomains::string("http://www.visual-prolog.com"),
mz:get_IWebBrowser2_import():navigate2(HomePage,comDomains::null,comDomains::null,comDomains::null,comDomains::null)
}).
facts
mz : mozillaBrowserControl.
Regards Thomas Linder Puls
PDC
PDC
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01