|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Windows Functions
Does AnyBody know how to run windows functions in ASP?
I want to run the function GetSystemMetrics From ASP and i don't know how i can do it. in VB i know to how to declare windows functions and how to use them, but in asp the script didn't work. can you help? |
|
#2
|
|||
|
|||
|
how do i include dlls in asp? is it with the creat object?
and can i use dll i made in VisualBasic? how do i register the dll? |
|
#3
|
|||
|
|||
|
echolalia is right. Here are the basic steps you will need to follow.
In VB (or some other language) you will have to write a com object. When writing it you would give the class a name. For example, WindowsAPI.GetSystemMetrics or something like that. In fact, you may be able to just make a class that extends the existing windows api dll. Then you would build a dll and register it on the server that the ASP is being hosted at. Using ASP you could then create an instance of the object with server.createobject. That is roughly how you would go about it. If you've never written a DLL before it may be quite a daunting task. If you are familiar with VB you can probably do it, though...with a little research. |
|
#4
|
|||
|
|||
|
Thanks for the help, but i didn't quite did it.
here is what i have done, correct me in order to make it work: First I Opend VB 6.0 then open a ActiveX Dll Project. I then Called the class - "GSM" and added a module to the project wich in I declared the windows API function: Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long In the Class Module i added this script: Function GSM(n) As Long GSM = GetSystemMetrics(n) End Function and then I Made the dll that i called "gsm.dll". i located the dll in the root directory of the PWS that is installed on my computer and wrote this ASP: <% set obj = server.CreateObject( "gsm" ) dim cx cx = obj.GSM(0) response.write(cx) set obj = Nothing %> the error i recived was: " Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed /obj2.asp, line 4 800401f3 " what should i do? |
|
#5
|
|||
|
|||
|
Did you regster the dll?
If not, run this command (in the directory that the dll is in) regsvr32 filename.dll |
|
#6
|
|||
|
|||
|
Thanks Alot for the Help Guys! , I finally managed to make it work (thanks to you).
Bentz! |
|
#7
|
|||
|
|||
|
Say, How Can U register the dll on an internet Server Where I upload my ASP's?
I registered the dll on my computer but how can I do it on another server? |
|
#8
|
|||
|
|||
|
So actually there is no way I can run windows API funtions on the internet?!
enlse I have a home server..... what a waste of time...... |
|
#9
|
|||
|
|||
|
Depending on the hosting company, you might be able to get them to install a 3rd party product that does the same thing.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Windows Functions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|