Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ActiveX control not accepting parameters

Posted on 2002-06-18
6
Medium Priority
?
224 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:Michel Sakr
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:Michel Sakr
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
xaviesh earned 600 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

876 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