Solved

ActiveX control not accepting parameters

Posted on 2002-06-18
6
206 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Accepted Solution

by:
xaviesh earned 200 total points
Comment Utility
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
Comment Utility
Is Export.CAB available to the user?  In the same folder as the rest of the code?

Anthony
0
 

Author Comment

by:Ashen_69
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

18 Experts available now in Live!

Get 1:1 Help Now