![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | DLL typelibs and VBScript G'day everyone Lately I've been writing typelibs to go with standard DLLs for use with VB6. I was wondering how feasible it would be to write an ActiveX/COM DLL that could be given a typelib at run time and expose the methods and properties defined therein to VBScript. Suppose, for example, I have a typelib that exposes GMP functionality to VB6. Could an ActiveX/COM DLL read that typelib, "register" its methods and properties, and make them available to VBScript. Something like this: set o = createobject( "BOTLR.TypeLibReader" ) o.ConnectTo "C:\Typelibs\GMP.TLB" 'which refers to my own DLL with GMP statically linked in set n1 = o.Eval("new_mpz_t") 'my own code to define and return set n2 = o.Eval("new_mpz_t") set res = o.Eval("new_mpz_t") .... etc Possible? Kind regards, Bruce. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: DLL typelibs and VBScript axtens wrote: Quote: > I was wondering how feasible it would be to write an ActiveX/COM DLL > that could be given a typelib at run time and expose the methods and > properties defined therein to VBScript. > Well yes, in two steps. For one, if you use CreateObject (either one), then all the methods and properties will be available to your script -- at least all the PUBLIC methods and properties. That leaves the constants (enumerated and otherwise). You can access them it you write your script as a "wsf" (xml) file, and then use a "reference" tag. The "reference" tag reads through the typelib and makes the constants available to your script as if you had declared them all. cheers, jw ____________________________________________________________ You got questions? WE GOT ANSWERS!!! ..(but, no guarantee the answers will be applicable to the questions) |
My System Specs![]() |
| | #3 (permalink) |
| | Re: DLL typelibs and VBScript First, check this VB6 calculator which can utilize unlimited digits(source code is included): http://www.karenware.com/powertools/ptcalc.asp Second, the tool that you want can be made with C++. VB6 cannot arbitrarily call any function that it's name is determined at run time. There are third party tools that allows you to embed assembly in VB6 code, but I didn't try them. Regardless of which, it's more difficult to make a generic caller or gateway than making a DLL to support the functionality that you want. Finally, check "Type Library Reader / Object Browser" below. The first link is for VB6, the second one for VBScript: http://www.jsware.net/jsware/vbcode.php5#tlbc http://www.jsware.net/jsware/scripts.php5#obbro |
My System Specs![]() |
| | #4 (permalink) |
| | Re: DLL typelibs and VBScript On Thu, 25 Sep 2008 10:02:18 -0700, axtens wrote: Quote: > G'day everyone > > Lately I've been writing typelibs to go with standard DLLs for use with > VB6. > > I was wondering how feasible it would be to write an ActiveX/COM DLL > that could be given a typelib at run time and expose the methods and > properties defined therein to VBScript. Suppose, for example, I have a > typelib that exposes GMP functionality to VB6. Could an ActiveX/COM DLL > read that typelib, "register" its methods and properties, and make them > available to VBScript. This is what Bruce McKinney did, with his book still online http://brucem.mystarband.net/mckinney2a.htm#19 at that URL you can find his WinTLB typelib, which has declares for many of the core Windows standard DLL's. Using a typelib saves you the trouble of writing the declares, but you will still have to write an ActiveX DLL that groups the methods and constants from the typelib into classes and properties, via some object model. There are many examples out there where windows DLL's are treated this way with VB6 ActiveX. -- Mark |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| New to VBscript, Help please! | VB Script | |||
| CSS and VBscript | VB Script | |||
| Where is VBscript now? | VB Script | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| vbscript and HTA help | VB Script | |||