Solved

JScript / VBscript and UDT

Posted on 1998-10-13
7
507 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
Comment Utility
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
Comment Utility
Edited text of question
0
 

Author Comment

by:gdg60
Comment Utility
Adjusted points to 20
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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