Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ActiveX Allowed or Not

Posted on 2005-05-10
5
Medium Priority
?
366 Views
Last Modified: 2007-12-19
I have a control that uses activeX, but is not completely activeX. dont ask how just believe me.

I want to be able to determine if the user has disabled activeX so i can prevent my control from running.

if activeX is disabled or dis-allowed then the control will start its job and not finish, so i would rather just not start it.

does anyone know of a way to check this?
0
Comment
Question by:Joshua Sprague
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
stengelj earned 400 total points
ID: 13974784
I found this here: http://us.mcafee.com/root/dev/CheckActiveX.htm

<script language=vbscript>
    function checkActiveX()
    '{
        dim myDict

        Err.Clear
        on error resume next

        set myDict = CreateObject("Scripting.Dictionary")

        myDict.Add "test", "test"

        if Err.number > 0 then
            gErrorNo = Err.number
            checkActiveX = false
        else // succeeded
            set myDict = nothing
            checkActiveX = true
        end if
    '}
    end function

</script>
0
 

Author Comment

by:Joshua Sprague
ID: 13978077
i tested the page that you found it on, and that is EXACTLY what i want. unfortunately, the pages i need it on are in C#. could you please tell me how to do this in c#?
new point value is : 100

thank you
0
 
LVL 9

Expert Comment

by:stengelj
ID: 13978856
I'm sorry but I don't know C#, but I'll bet somone here does:
http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/

You could either open a new question in that area or create a pointer question that links to this question and hope that someone from that area comes over to help.  Or, keep this thread open for a while and maybe someone else will see this question who can help convert it.
0
 

Author Comment

by:Joshua Sprague
ID: 13982843
thanx, i figured it out. i based my code on what you showed me.
i used vbscript / javascript.
here is what i did.

VBScript Function:

'
' Function ActiveXEnabled
'
function activexenabled()
  on error resume next
  activex = (NOT IsNull(CreateObject("ScriptBridge.ScriptBridge")))
  activex2 = (NOT IsNull(CreateObject("MSComctlLib.Slider")))
  activex3 = (NOT IsNull(CreateObject("ScriptBridge.ScriptBridge.1")))
  if (activex OR activex2 OR activex3) then
      activexenabled = true
  else
      activexenabled = false
  end if
end function

I used javascript to call the function and test for ActiveX being enabled / disabled.

If it was disabled, i used the javascript     document.writeln     to comment out the ActiveX control.

works perfectly.

thank you.
0
 
LVL 9

Expert Comment

by:stengelj
ID: 13983160
Cool.  That looks like a nice adaptation.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question