Link to home
Start Free TrialLog in
Avatar of gdg60
gdg60

asked on

JScript / VBscript and UDT

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
Avatar of Mirkwood
Mirkwood

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)
Avatar of gdg60

ASKER

Edited text of question
Avatar of gdg60

ASKER

Adjusted points to 20
The answer is NO. Vbscript only knows variant types.
Sorry about the misunderstanding. I thought that you wanted to know how to use VBscript.
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
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.
ASKER CERTIFIED SOLUTION
Avatar of Mirkwood
Mirkwood

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial