Solved

ActiveX control not accepting parameters

Posted on 2002-06-18
6
209 Views
Last Modified: 2013-11-18
I have an activeX control that I built that has public properties.  The control implements the IObjectSafety for Safe for Scripting and Safe for Initialization.  The control loads properly and everything executes correctly until I try to populate the properties.  I have tried jscript, vbscript,  HTML PARAM tags and the result is the same.  It seems to act as if it is not safe for scripting but I cannot tell why.  Any help would be fantastic!

0
Comment
Question by:Ashen_69
6 Comments
 
LVL 20

Expert Comment

by:Silvers5
ID: 7090078
you need to pass the parameters by value since the vbscript have only 1 data type, variant..
post your activex code chunks..
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 7090093
errata: In my 1st post i meant for server components.. this is how you pass parameters to an active x

Many people go way overboard and try to dream up elaborate ways to have a client-side ActiveX control communicating with the server to retrieve values. As long as these values are not dependent on user activities AFTER the ActiveX control has been loaded, try something like this:
 
<%
    strValue = "some string"
    intValue = 5
    Response.Write("<OBJECT clsid=[blah blah]>")
    Response.Write("<PARAM NAME=INT VALUE=""<%=intValue%>"">")
    Response.Write("<PARAM NAME=INT VALUE=""<%=intValue%>"">")
    Response.Write("</OBJECT>")
%>
 
ANd now in server-side JavaScript:
 
<script language=JavaScript runat=server>
 
    var strValue = "some string";
    var intValue = 5;
    Response.Write("<OBJECT clsid=[blah blah]>");
    Response.Write("<PARAM NAME=INT VALUE=\"<%=intValue%>\">");
    Response.Write("<PARAM NAME=INT VALUE=\"<%=intValue%>\">");
    Response.Write("</OBJECT>");
 
</script>

0
 

Author Comment

by:Ashen_69
ID: 7090273
I have tried the method you suggested to the same result.  Any code that references a PARAM tag or in a script tag such as ExportCtl.ExportData will not execute nor will any code that follows the call to the object properties.  The code is run on the client so I cannot use the response.write script option.  I am accessing the server variables and loading them into the control.  Here is a code snippet:

     sub InitExportCtl()
          dim tmpLocalPath
          on error goto 0
          msgbox "InitExportCtl"
          if laNode => 0 then
               msgbox "Before first Property Access"
               ExportCtl.ExportData1 = oCaseFolder(0)
               msgbox "Before second Property Access"
               ExportCtl.FileExt1 = aFileList(0)
               msgbox oCaseFolder(0)
               msgbox aFileList(0)
          end if
          if laNode => 0 then
               ExportCtl.ExportData2 = oCaseFolder(1)
               ExportCtl.FileExt2 = aFileList(1)
               msgbox oCaseFolder(1)
               msgbox aFileList(1)
          end if
          if laNode => 0 then
               ExportCtl.ExportData3 = oCaseFolder(2)
               ExportCtl.FileExt3 = aFileList(2)
               msgbox oCaseFolder(2)
               msgbox aFileList(2)
          end if
          if laNode => 0 then
               ExportCtl.ExportData4 = oCaseFolder(3)
               ExportCtl.FileExt4 = aFileList(3)
               msgbox oCaseFolder(3)
               msgbox aFileList(3)
          end if
          if laNode => 0 then
               ExportCtl.ExportData5 = oCaseFolder(4)
               ExportCtl.FileExt5 = aFileList(4)
               msgbox oCaseFolder(4)
               msgbox aFileList(4)
          end if
          tmpLocalPath = "<%=Path%>"
          ExportCtl.DefaultDir = tmpLocalPath
          msgbox tmpLocalPath
     end sub

The msgboxes are for debugging to see if the code is executed.  Here is the Object tag:

<OBJECT ID="ExportCtl" CLASSID="CLSID:5FD98568-6543-45C9-83FC-864C29609AF9"  codebase="Export.CAB#version=1,0,0,0" Language=vbscript>
</OBJECT>

The code here is just the latest version.  I have tried Param tags, jscript, vbscript etc...  to no avail.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Accepted Solution

by:
xaviesh earned 200 total points
ID: 7090780
Hi,

Did you try testing the ActiveX Control in VB before putting it in the ASP page?

Try testing the same piece of code in VB.
Add this control to a form and test the code(the snippet you had posted) that passes/accepts values from this Activex Control.

Please try this if you haven't done so, and give your comments. I think i could guide you from that point.

If this helps in any way..

0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7091688
Is Export.CAB available to the user?  In the same folder as the rest of the code?

Anthony
0
 

Author Comment

by:Ashen_69
ID: 7093280
We found out what the issue was. Thanks for all of your help.  There was a server side script tag (%>)embedded within a comment that was causing the issue.  When the line was deleted the control performed correctly.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 182
Copy only dates 3 81
Question about ASP Including Files 6 44
SQL to update characters in table column 6 97
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now