Groups | Blog | Home
all groups > inetserver asp components > august 2003 >

inetserver asp components : Vb ocx with asp file in client side



ty_yenny NO[at]SPAM yahoo.com
8/25/2003 3:36:48 AM
Hi all..


I have made ocx with vb6, and I embedded with asp file.
When I am running this asp in server side windows 2000, the ocx is
working fine, but when I call from client side with windows 2000 too,
it's only small blank box.
I have tried using this line :
<HTML><body topmargin="0" leftmargin="0" bgcolor="#F8F4DD">
<OBJECT ID ="data" classid="clsid:FAA5F185-0363-44C3-9A5E-CEC949385B7B"
codebase="http://server/path/data.ocx"></OBJECT></BODY></HTML>


but it's still doesn't work..
I also have added runat ="server" it's still same.

Rob MacFadyen
8/27/2003 10:42:56 AM
Tammy,

You need to package the .OCX in a .CAB file. You will also need to create a
..INF to provide the client pc with instructions on how to install the files.

Here's a sample .INF
[version]
signature="$CHICAGO$"
AdvancedINF=2.0

[Add.Code]
MyOCX.ocx=MyOCX.ocx
MSVBVM60.DLL=MSVBVM60.DLL

[MyOcx.ocx]
file-win32-x86=thiscab
clsid={A171AA73-2F00-4523-A7C6-17C4CF821245}
FileVersion=1,3,0,17
RegisterServer=yes

[MSVBVM60.DLL]
hook=MSVBVM60.cab_Installer
FileVersion=5,1,43,19

[MSVBVM60.cab_Installer]
file-win32-x86=http://activex.microsoft.com/controls/vb6/MSVBVM60.cab
InfFile=MSVBVM60.inf

You will have to adjust the MyOcx stuff to fit your control (eg. the clsid
and file version).

To build a cabfile you need the cabarc command (see link below). The command
should be something like:
cabarc.exe n MyOcx.cab MyOcx.ocx MyOcx.inf

That creates your .CAB file with your .OCX and .INF. The required support
files are downloaded from Microsoft. You then reference the .CAB from you
web page using the codebase attribute:
<OBJECT ID ="data" classid="clsid:FAA5F185-0363-44C3-9A5E-CEC949385B7B"
codebase=http://server/path/MyOcx.cab#version=1,3,0,17></OBJECT>

A couple of things you need to concern yourself about managing updates to
your control. As you make changes to the control you need to update it's
version number and the .INF and the .CAB file itself. IE likes to cache cab
files so you have to be careful about your version numbers (that why there
is a version number in the codebase attribute now

The following on MSDN might help:
http://msdn.microsoft.com/library/default.asp?url=/workshop/components/activ
ex/packaging.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/htm
l/vbconinternetcomponentdownload.asp

Hope this helps,

Rob
--
RMTrack a new bug tracking tool. Available now from www.rmtrack.com (watch
for our new 1.2 release!)


[quoted text, click to view]

AddThis Social Bookmark Button