?
Solved

JScript / VBscript and UDT

Posted on 1998-10-13
7
Medium Priority
?
531 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
[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
  • 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
Technology Partners: 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

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