Hi all,
I've created an ActiveX dll that I call from an .asp page, which is supposed to launch a program on the server such as Internet Explorer. The problem is, that when the .asp is called, only a process for that program (iexplore.exe) gets launched. There is no visible form/window for it! I've tried so many different things, and I can not get it to work. Here's the little code:
Code:
Option Explicit
'Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_NORMAL As Long = 1
Public Sub LaunchIENow()
'Dim pid&
'pid = Shell("C:\Program Files\Internet Explorer\iexplore.exe http://www.amazon.com", vbNormalFocus)
'pid = Shell("C:\launchIE.bat", vbNormalFocus)
'Shell "rundll32.exe url.dll,FileProtocolHandler http://www.google.com"
'ShellExecute Me.hwnd, vbNullString, "http://www.google.com", vbNullString, "C:\", SW_SHOWNORMAL
'pid& = ShellExecute(0, vbNullString, "http://www.google.com", "C:\", SW_SHOWNORMAL)
'Shell "explorer.exe http://www.google.com", vbNormalFocus
ShellExecute vbNull, "open", "C:\winnt\notepad.exe", vbNullString, vbNullString, SW_NORMAL
End Sub
As you can tell, I've tried many different things to get this work including trying to launch just the simple notepad program, but I get the same result every time.
And here's the .asp page that calls this little uncooperating monster .dll:
Code:
<%Option Explicit
Dim oLaunchIE 'Create an object for the component
Set oLaunchIE = CreateObject("Cygnus.LaunchIE")
oLaunchIE.LaunchIENow
Set oLaunchIE = Nothing
%>
Well, actually through some other forums I've been posting in, I found out that there's actually a DLL already created for this specific purpose - ASPExec (but I'm having the same problem - it launches a process, but no interface/form). You can get it at serverobjects.com, but it's unsupported. The reason why I need this functionality is because we have a browser on the server that refreshes every 20 seconds and it processes and sends email out if there is any via some special programs, and it times out sometimes, and we would like the ability to launch a new browser to that URL to get it going again remotely w/out having to use pcAnywhere.