Solved

ActiveX control not accepting parameters

Posted on 2002-06-18
6
213 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

810 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