tcalp 07-19-2003, 08:43 AM I've been trying to figue this out for a long time now and it's gotten pretty aggrivating :( .. in anycase I've designed an activex control that I want to use on a webpage. The control loads up fine when I'm debuging the project but as soon as I use the P&D wizard to create the ocx / htm files to deploy/use it on the web it doesn't work. What am i doing wrong ? ... here is an example of the html code ... am I missing something ? ... *sigh*
<HTML>
<HEAD>
<TITLE>MView.CAB</TITLE>
</HEAD>
<BODY>
<OBJECT WIDTH=800 HEIGHT=600
CLASSID="CLSID:95A879D4-E264-43D5-8336-3B84F8A52FB0"
CODEBASE="MView.CAB#version=1,0,0,0">
</OBJECT>
</BODY>
</HTML>
Thinker 07-19-2003, 08:55 AM The CODEBASE must point to the url where the cab file can be found.
The way you have it, the cab file would have to be in the same directory
as the web page. Also, I have found that it is necessary with some
versions of IE to include two more params in the OBJECT tag.
<OBJECT WIDTH=800 HEIGHT=600
CLASSID="CLSID:95A879D4-E264-43D5-8336-3B84F8A52FB0"
CODEBASE="MView.CAB#version=1,0,0,0">
<param name="_ExtentY" value=3000>
<param name="_ExtentX" value=4000>
</OBJECT>
The 3000 and 4000 above are just made up values - you would need to
use the number of twips that matched the size of the control.
The last possibility is that security settings aren't allowing the ActiveX
control to be loaded and run on the web page. Make sure you have set
the component save for scripting and initialization in the P&DW internet
package creation.
tcalp 07-19-2003, 09:48 AM the cab file is in the same directory so the codebase should we working properly ... I tried throwing in those params to no avail, also the browser security is set to lowest to ensure that the browser security isn't getting in the way. Also the P&DW is set safe for scripting and initialization ....
any other ideas ? :)
Thinker 07-19-2003, 10:02 AM Do you get any visual signal of the OCX on the page?
Here is something that I have in an example OCX on webpage I did. It
might apply here too.
<!-- If any of the controls on this page require licensing, you must
create a license package file. Run LPK_TOOL.EXE to create the
required LPK file. LPK_TOOL.EXE can be found on the ActiveX SDK,
http://www.microsoft.com/intdev/sdk/sdk.htm. If you have the Visual
Basic 6.0 CD, it can also be found in the \Tools\LPK_TOOL directory.
The following is an example of the Object tag:
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<PARAM NAME="LPKPath" VALUE="LPKfilename.LPK">
</OBJECT>
-->
Take a look here...
http://msdn.microsoft.com/library/en-us/vccore98/html/_core_upgrading_an_existing_activex_control_to_be_used_on_the_internet .asp
http://msdn.microsoft.com/library/default.asp?url=/workshop/components/activex/licensing.asp
tcalp 07-19-2003, 11:54 AM Yup I get visual signs that the control is there ... and it all looks good I checked out the first link that you gave me, the other is for stuff that needs licensing which doesn't apply here. I'm really not sure what the problem is :( ...
Thinker 07-19-2003, 04:32 PM Ok, that red x box is a sign that it is trying to load the object and can't.
It could be anything from not being able to download the cab file to not
being able to register the ocx and instantiate it to there being missing
dependencies. I can get that if I rename the cab to something else (like
ca1) and make sure the .ocx isn't already registered on the system. You
should try to download the cab file alone and check that all the needed
dependencies are in the cab or already installed.
tcalp 07-19-2003, 05:35 PM if the ocx is already on the system and registered doesn't it just mean that it doesn't need to be downloaded ? ...
In anycase the cab file is named correctly and all required dependencies are in the cab or set to download from MS. Although I have all dependencies on my system.
When I run the project from VB it loads up into IE just fine.
Thinker 07-19-2003, 05:46 PM Right, it doesn't. But if it is already installed/registered on the system,
you sure shouldn't be getting this red x box. It is sounding more and
more like a permissions problem but I really don't know enough to guess
where.
You got the Object tag GUID from the sample html file it generated when
you packaged the cab, right? Have you recompiled the OCX since then
and if so, did you have binary compatibility set? If not, your GUID might
be hopelessly out of date. When you run in the VB IDE, it creates a
temporary GUID and registers it and creates a temp web page with the
correct object tag.
tcalp 07-19-2003, 05:55 PM yup the GUID is from the sample html file ... well I'm actually using the sample html file on the website. I haven't re-compiled the ocx without unregistering the ocx on the system and re-making the cab fileset. Although I never set the project for binary compatibility ... should I try that just to see if it makes a difference ? ..
btw .. thanks for your help with this Thinker.
Thinker 07-19-2003, 06:03 PM Sounds like you have done just about everything right. Wish I had
some other suggestion. I do know that others here have had similar
problems and never got them worked out so I am not really hopeful.
tcalp 07-19-2003, 06:11 PM are there restrictions to activex controls when used over the web ? ... like X controls cannot be used in the app ?
tcalp 07-19-2003, 06:23 PM Just thought of something ... not sure if it will really help.
I tried just opening the local html file in IE and see if the control would load up then, it didn't load. There must be something I'm doing wrong / or something that I think I'm doing right that I"m doing wrong....
I also just had a buddy of mine try it out over the web and he has the same problem as I do.
Thinker 07-19-2003, 06:28 PM The only restriction I can think of is if you used ActiveX controls inside
your ActiveX control you might need to include the license file for those
embedded controls. I can't find anything about this in msdn however.
tcalp 07-19-2003, 06:34 PM I've just been searching through my registry for the CLSID .. and all was going along well and then I came across a few entries in ..
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsa ge\C:/WINNT/Downloaded Program Files/CONFLICT.1/MDBView.ocx
... CONFLICT.2 ... CONFLICT.3
I'd imagine these are from failed install attempts ? ...
Thinker 07-19-2003, 07:04 PM It does appear that way although the normal registration entries are
stored elsewhere. Perhaps even though you did unregister the OCX file
between compiles it stores extra information/files that would need to be
deleted also for a web download and install.
|