Solved

JScript / VBscript and UDT

Posted on 1998-10-13
7
511 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

813 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

10 Experts available now in Live!

Get 1:1 Help Now