Link to home
Start Free TrialLog in
Avatar of issamtaher
issamtaher

asked on

OCX in web page

hi
when i creat my own ocx by Vb and compilet it
than i use it in wab page and when i try to brows my
page appear to me (there is activex with be running are you sure you want to contino).
how i can make my own ocx or activex safty.
Avatar of bppraveen001
bppraveen001

hello issamtaher,
    First you need to create a .cab file by including your Ocx file by using Package and Deployment Wizard or by using Wise Set up, then write your code to display that ActiveX control in Html page or ASP page by using Object tag. So what will this do is when ever you are about to view your ASP page or HTML page which has your ocx Control first your browser will see whether you have that particular ocx in the client system if not it will download that ocx file from the WebServer and it will register in the system then that ocx control will be shown to the user over the browser.
    I have tried this for the Scroll bar control. Here i am sending you the code it may help you
<OBJECT CLASSID="clsid:79176FB0-B7F2-11CE-97EF-00AA006D2776" ID="spnTest" CODEBASE="../controls/ActivxCtr.cab" VIEWASTEXT>
</OBJECT>

bpp
There are several ways to fix this problem.  All of them have their short commings:

1) You can change the browser security settings to allow the .ocx to load without issueing a warning.

2) You can register the control as Web Safe (but should be done if it is truely websafe!) See MSDN for details.

3) You can build a distribution .cab file marking it websafe as previously mentioned.

4) You can use code in the .ocx to mark it safe for scripting and initialization.

5) You can licience your control and reference the licience directly in your HTML.

My suggestion - search MSDN and pick from the various options that best meet your needs.

I ran into this very problem a couple months ago and ended up writing my control in C++ using ATL.  Admittedly, it was a pretty radical solution but I chose it because it was so well documented by Microsoft.

Good luck.
ASKER CERTIFIED SOLUTION
Avatar of Dave_Greene
Dave_Greene

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
Hi issamtaher,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Dave_Greene's comment(s) as an answer.

issamtaher, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

Computer101
E-E Moderator