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!

Call Windows APIs from ASP(advanced users)

Status
Not open for further replies.

IonelBurtan

Programmer
May 25, 2001
601
RO
This idea just struck me in the morning and I thought why not give it a try.

There were many questions about how to use Windows APIs from ASP.

Everyone knows that ASP can use the sintax:
Dim myobj
Set myobj=Server.CreateObject("XLibraryName.XClassName").

Now I was thinking to this scenario in VB:
- I create a new ActiveX DLL named APISFromVB.dll
- I add a class called MyAPI in a class module
- In class I add a method (lets say
Public Function ASPGetTickCount() As Long
which will internally call to GetTickCount Windows API)

- Now I register my dll with regsvr32.exe
- I make a dummy ASP page in which I write:
Dim myobj
Set myobj=Server.CreateObject("APISFromVB.MyAPI")
- Then I make a call to my API function like this:
Dim lTick
lTick = myobj.ASPGetTickCount()

(I never tryed, but I don't see why it shouldn't work)
The same scenario can be done using a VC++ COM Component.

Hope this will give you some ideas,

Now the Question is: Can Be something done in order to be able to call ANY Windows API through this scenario. s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top