Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with OCX 1

Status
Not open for further replies.

Peepain

Programmer
Joined
May 15, 2002
Messages
43
Location
AR
Hi People,

Is it possible to use an OCX from Asp?
Do you know where I can get an example?

Thanks in advance
 
Here is the exemple of a page I wrote that use an OCX (that I wrote too) :
Code:
<SCRIPT Language=&quot;VbScript&quot; FOR=&quot;myhabTreeView&quot; EVENT=&quot;Click&quot;>
  Call AfficherSelection()
</SCRIPT>

<SCRIPT FOR=&quot;myhabTreeView&quot; EVENT=&quot;MenuClicked(item)&quot;>
  Call ExecuterActionOcx(item)
</SCRIPT>

</HEAD>
<BODY bgColor=&quot;#F1F1F1&quot;>
  <OBJECT id=&quot;myHabTreeView&quot; Width=&quot;100%&quot; height=&quot;100%&quot; classid=&quot;clsid:10B19744-957E-4534-BB2B-24E1A75DF5EF&quot; CODEBASE=&quot;[URL unfurl="true"]http://url/where/the/ocx/can/be/found.ocx&quot;></OBJECT>[/URL]
</BODY>
Water is not bad as long as it stays out human body ;-)
 
Hi Targol and thanks for your reply.
Could you tell me please if you see any error here?
Actually I didn't know if was possible to use OCXs but I received this code.

Thanks a lot.

<%
%>
<HTML>
<HEAD>
<TITLE>ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript
ONLOAD=&quot;Initialize()&quot;>

<OBJECT ID=&quot;RpvReport&quot;
CLASSID=&quot;CLSID:6449CBC9-951A-4C82-83F4-45E923D999CA&quot;
WIDTH=100% HEIGHT=95%
CODEBASE=&quot;c:\Program Files\RPV\RpvReport.ocx&quot;>
<PARAM NAME=&quot;EditionEnabled&quot; VALUE=0>
<PARAM NAME=&quot;Dirbuttons&quot; VALUE=1>
<PARAM NAME=&quot;Findbuttons&quot; VALUE=1>
<PARAM NAME=&quot;ExportButton&quot; VALUE=1>
<PARAM NAME=&quot;OpenButton&quot; VALUE=1>
<PARAM NAME=&quot;PrintButtons&quot; VALUE=1>
<PARAM NAME=&quot;SaveButton&quot; VALUE=1>
<PARAM NAME=&quot;SendByEMailButton&quot; VALUE=1>
<PARAM NAME=&quot;SizeButtons&quot; VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
Sub Initialize()
Dim Rpv1 As Object
Set Rpv1 = CreateObject(&quot;RpvReport&quot;)
Rpv1.RpvFileName =
&quot;c:\RPV\InvoiceType5WWF091102[1].39820277.rpv&quot;
Rpv1.ViewRpvReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
 
the problem is that, when writing
Code:
Dim Rpv1 As Object
Set Rpv1 = CreateObject(&quot;RpvReport&quot;)
, you create a new instance of &quot;RpvReport&quot;, you don't link to the object that is contained in your web page.
Try this instead :
Code:
Sub Initialize()
Dim Rpv1 ' as keyword is not used in VBScript.
Set Rpv1 = document.getElementById(&quot;RpvReport&quot;)
Rpv1.RpvFileName =
&quot;c:\RPV\InvoiceType5WWF091102[1].39820277.rpv&quot;
Rpv1.ViewRpvReport
End Sub
Water is not bad as long as it stays out human body ;-)
 
THANKS TARGOL !!!!
It was very helpful!
 
won't you give me a star for my hard stuff [cry] ??? Water is not bad as long as it stays out human body ;-)
 
Sure Targol, you deserve it !!! :)
 
Thanx a lot. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top