Article | 41019122 |
Type | HowTo |
Product | Engine |
Version | 4.0.1.1019 |
Date Added | 5/19/2003 |
Submitted by | Charles Emerson |
Keywords |
We have a website and we would like to use the viewer. How can we install and distribute the ocx to client machine, to view their cad files from our website?
This can be done with 2 ways.
1. Downloading and running a setup.exe file (similar to ours) that installs Professional/Standard/Viewer Activex in the "client's" system.
2. Making a CAB file. If
you want more information about this see MSDN article "Deploying ActiveX Controls on the Web with the Internet Component Download".
(NOTE: It is better not to use UNICODE versions because it can only work only
with Windows2000 and XP.)
You can also use our tool vdcab. You can dowload it here (vdcab.zip). See also this PDF.
Instructions for making a CAB
Make a temporary Folder and place there the:
vdpro.ocx(or vdstd.ocx,vdview) file
vdxfiles.dll
vdimg.dll
opengl32.dll (ONLY if you are using Professional or Viewer)
glu32.dll (ONLY if you are using Professional or Viewer)
msvcp60.dll
MAKECAB.EXE utility (can be found on MSDN and Microsoft's WebSite)
lpk_tool.exe (can be found on MSDN and Microsoft's WebSite)
NOTE : This example is for vdpro. Don't forget to change vdpro with vdstd or
vdview if you are using Standard or Viewer
Also change the clsid of the product . These are the three keys for clsid
1E96FD33-FCD7-43a9-8CD7-8BA6CA1B83FF for vdview.ocx
EAF8C24C-1AF3-4aca-9EC7-E9159381FD9B for vdstd.ocx
50EFAD92-4089-4653-AFA2-8F3CAFCBCE3A for vdpro.ocx
Create the files below with notepad :
File Name | Add this text with Notepad |
MakeCab.BAT | |
MAKECAB.EXE
/f vdrawnet.ddf pause |
|
vdrawnet.ddf | |
.OPTION
EXPLICIT .Set Cabinet=on .Set Compress=on .Set MaxDiskSize=CDROM .Set ReservePerCabinetSize=6144 .Set DiskDirectoryTemplate= .Set CompressionType=MSZIP .Set CompressionLevel=7 .Set CompressionMemory=21 .Set CabinetNameTemplate="vdrawi4.cab" "vdpro.ocx" "vdxfiles.dll" "vdimg.dll" "OPENGL32.DLL" "GLU32.DLL" "msvcp60.dll" "vdrawnet.inf" NOTE :Remove OPENGL32.DLL and GLU32.DLL if you are using the Standard version |
|
vdrawnet.inf | |
[version] ; version signature (same for both NT and Win95) do not remove signature="$CHICAGO$" AdvancedINF=2.0 [Add.Code] vdpro.ocx=vdpro.ocx vdxfiles.dll=vdxfiles.dll vdimg.dll=vdimg.dll mfc42.dll=mfc42.dll msvcrt.dll=msvcrt.dll olepro32.dll=olepro32.dll Opengl32.dll=Opengl32.dll Glu32.dll=Glu32.dll msvcp60.dll=msvcp60.dll [msvcrt.dll] hook=mfc42installer FileVersion=6,0,8797,0 [mfc42.dll] hook=mfc42installer FileVersion=6,0,8665,0 [olepro32.dll] hook=mfc42installer FileVersion=5,0,4277,1 [Opengl32.dll] file=thiscab FileVersion=4,0,1381,4 DestDir= ;NOTE :Remove OPENGL32.DLL
and GLU32.DLL if you are using the Standard version |
|
test.htm | |
<html> <head> <title>Professional OCX Test Page</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <script language="vbscript"> Function Load() alert("Page Loaded.... Press the Open button to load the drawing") vdpro.Actions.disable3d= True vdpro.redraw ' vdpro.Actions.EnableAutoFocus = True End Function Sub btn1_click() alert("Place the drawing with the name test.vdi in the folder draw in your webserver : http://www.mysite.com/draw/test.vdi") vdpro.activedocument.open "http://www.mysite.com/draw/test.vdi" End sub Sub btn2_click() vdpro.commandAction.LayerControl End sub Sub btn3_click() vdpro.commandaction.pan End sub </script> </head> <body onload="Load()"> <p> <OBJECT id="Object1" classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT> <PARAM NAME="LPKPath" VALUE="vdprolpk.lpk"> </OBJECT> <OBJECT id="vdpro" height="445" width="692" classid="clsid:50EFAD92-4089-4653-AFA2-8F3CAFCBCE3A" codebase="http://www.mysite.com/draw/vdrawi4.cab#version=4,1,6,1029" VIEWASTEXT> <param name="_Version" value="263164"> <param name="_ExtentX" value="18309"> <param name="_ExtentY" value="11774"> <param name="_StockProps" value="0"> <param name="PanWaitTime" value="0"> <param name="BkColor" value="0"> <param name="PickSize" value="10"> <param name="CrossSize" value="20"> <param name="ScrollBar" value="3"> <param name="StatusBar" value="-1"> <param name="LicVAL" value="Contact our Sales department"> <param name="PropFileName" value> <param name="VDrawRes" value> <param name="MousePointer" value="0"> <param name="ActionValidates" value="256"> <param name="EnableToolTips" value="0"> <param name="EnableURLs" value="0"> <param name="WMFSaveSize" value="2000"> <param name="ShowWCSAxis" value="0"> <param name="LoadingInfo" value> </OBJECT> </p> <P> <INPUT id="Button1" type="button" value="Open Drawing www.mysite.com/draw/test.vdi" name="Button1" onclick="btn1_click"> <INPUT id="Button2" type="button" value="Layers" name="Button1" onclick="btn2_click"> <INPUT id="Button3" type="button" value="Pan" name="Button1" onclick="btn3_click"> </body> </html> |
Run the MakeCab.bat. This should produce the vdrawi4.cab file.
Upload this cab file in your server's location : http://www.mysite.com/draw
See the HTML code:
<OBJECT id="vdpro" height="445" width="692" classid="clsid:50EFAD92-4089-4653-AFA2-8F3CAFCBCE3A" codebase="http://www.mysite.com/draw/vdrawi4.cab#version=4,1,6,1029" VIEWASTEXT>
Run the lpk_tool.exe application, choose in the left column the "VectorDRaw
Professional 4.x", Press Add , (in the right column should be only that, and then press
"Save & exit" and give the name (in the temporary directory) "vdprolpk.lpk". This
should produse the vdprolpk.lpk file.
See the code in the HTML :
<OBJECT classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
<PARAM NAME="LPKPath" VALUE="vdprolpk.lpk">
</OBJECT>
!!!!!The vdprolpk.lpk file must be in the same folder in your server as the htm files.
Upload in the http://www.mysite.com/draw directory of your webserver the
test.htm, vdprolpk.lpk, vdrawi4.cab files and the a sample drawing saved as test.vdi.
You also need to update the licval value for your server. Please contact our
sales department about that.
Open the page http://www.mysite.com/draw/test.htm in your IE.