Solved

JScript / VBscript and UDT

Posted on 1998-10-13
7
508 Views
Last Modified: 2013-12-25
I'd like to be more precise.

I've written an ActiveX DLL with methods which use user defined types. Is it possible to invoke these methods from VBscript or Jscript embedded in an HTML page?

Thanks
0
Comment
Question by:gdg60
  • 4
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1487631
Take a look at the VBscript control. This allows you to evaluate VBscript code.

If you want to I can give you an example. (But not for 10 points)
0
 

Author Comment

by:gdg60
ID: 1487632
Edited text of question
0
 

Author Comment

by:gdg60
ID: 1487633
Adjusted points to 20
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 13

Expert Comment

by:Mirkwood
ID: 1487634
The answer is NO. Vbscript only knows variant types.
Sorry about the misunderstanding. I thought that you wanted to know how to use VBscript.
0
 
LVL 2

Expert Comment

by:mkmccreary
ID: 1487635
Mirkwood is correct.  You can't pass user defined types from the ASP script.  There is a solution, though.  Instead of using user defined types, pass your data as a variant array instead.  Then, yes, you can invoke the methods from within an ASP page.  All you have to do is adjust your functions to dealing with variant arrays.

Good Luck,
Martin
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1487636
I wasn't thorough in my answer yesterday.
Here is a better answer.
VB script only knows the variant type. The variant type supports the byte array. What you can do it copy the struct as byte array in the variant using RTLMemMove or RTLMemCopy (I always forget the name).  Now you can pass it again to somebody else who can interpret the byte array. As long as both sides understand what the contents of the byte array is there is no problem.
The answer of mkmccreary is also a good one. Just use a variant array, the first entry is the first member of the struct, the second entry, the second member excetra.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 20 total points
ID: 1487637
I wasn't thorough in my answer yesterday.
Here is a better answer.
VB script only knows the variant type. The variant type supports the byte array. What you can do it copy the struct as byte array in the variant using RTLMemMove or RTLMemCopy (I always forget the name).  Now you can pass it again to somebody else who can interpret the byte array. As long as both sides understand what the contents of the byte array is there is no problem.
The answer of mkmccreary is also a good one. Just use a variant array, the first entry is the first member of the struct, the second entry, the second member excetra.
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
vba find the last empty column 10 88
Reading the Contents of a Directory In Access VBA 5 58
Determine Range to Select 5 42
Getting warning: You are about to delete 1 row(s) 9 43
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

912 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

25 Experts available now in Live!

Get 1:1 Help Now