Solved

ActiveX control not accepting parameters

Posted on 2002-06-18
6
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

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…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
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…

752 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