Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the Win API in VBScript?

Status
Not open for further replies.

somenerd

Programmer
Oct 29, 2002
1
DE
My Question:
Can I use the Windows API in VBScript?
If so:
HOw do I do that?

Would be nice, if you could give me a link
Or an example, how I generally do it.
 
I allready tried that and couldn't do it directly because to use an API in VB, you need to declare it with a statement that looks like this :
Code:
Public Declare Function AddPrinterConnection Lib "winspool.drv" Alias "AddPrinterConnectionA" (ByVal pName As String) As Long
Vbscript doesn't allow this kind of external declaration. The only way, to my mind, to achieve what you want is to create an ActiveX (with VB for exemple) that will encapsulate your API call and then instanciate this activeX in VBScript using CreateObject method.
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top