I have an ActiveX DLL that I am calling from and ASP page. The ActiveX DLL code is one that is found on the web for being able to use the MsgBox function from within ASP. The code all works fine when I run a test Standard EXE from VB6, but the dll just hangs when it calls the GetMsgBox from ASP. All the properties get set without error. Any suggestions?
ActiveX DLL Code:
==========================
Option Explicit
Private internalMsgPrompt As String
Private internalMsgIcon As Integer
Private internalTitle As String
Private internalStyle As Integer
Public Property Let msgPrompt(ByVal pMsgPrompt As String)
internalMsgPrompt = pMsgPrompt
End Property
Public Property Let msgTitle(ByVal pMsgTitle As String)
internalTitle = pMsgTitle
End Property
Public Property Let msgStyle(ByVal pMsgStyle As String)
Select Case pMsgStyle
Case " "
internalStyle = vbOKOnly
Case 0
internalStyle = vbAbortRetryIgnore
Case 1
internalStyle = vbOKCancel
Case 2
internalStyle = vbOKOnly
Case 3
internalStyle = vbRetryCancel
Case 4
internalStyle = vbYesNo
Case 5
internalStyle = vbYesNoCancel
End Select
End Property
Public Property Let msgIcon(ByVal pMsgIcon As String)
Select Case pMsgIcon
Case 0
internalMsgIcon = vbCritical
Case 1
internalMsgIcon = vbInformation
Case 2
internalMsgIcon = vbQuestion
Case 3
internalMsgIcon = vbExclamation
End Select
End Property
Public Function getMsgBox() As VbMsgBoxResult
getMsgBox = MsgBox(internalMsgPrompt, internalMsgIcon + internalStyle, internalTitle)
End Function
ASP Code:
================================
dim x
dim msgresult
set x = server.createobject("netmsgboxlib.netmsgbox1"
x.msgtitle = "Hello"
x.msgprompt = "Propmt"
x.msgicon = 2
x.msgstyle = 1
msgresult = x.getmsgbox
if msgresult = vbyes then
response.write("You clicked yes"
else
response.write("You clicked no"
end if
Thanks,
Bobby
ActiveX DLL Code:
==========================
Option Explicit
Private internalMsgPrompt As String
Private internalMsgIcon As Integer
Private internalTitle As String
Private internalStyle As Integer
Public Property Let msgPrompt(ByVal pMsgPrompt As String)
internalMsgPrompt = pMsgPrompt
End Property
Public Property Let msgTitle(ByVal pMsgTitle As String)
internalTitle = pMsgTitle
End Property
Public Property Let msgStyle(ByVal pMsgStyle As String)
Select Case pMsgStyle
Case " "
internalStyle = vbOKOnly
Case 0
internalStyle = vbAbortRetryIgnore
Case 1
internalStyle = vbOKCancel
Case 2
internalStyle = vbOKOnly
Case 3
internalStyle = vbRetryCancel
Case 4
internalStyle = vbYesNo
Case 5
internalStyle = vbYesNoCancel
End Select
End Property
Public Property Let msgIcon(ByVal pMsgIcon As String)
Select Case pMsgIcon
Case 0
internalMsgIcon = vbCritical
Case 1
internalMsgIcon = vbInformation
Case 2
internalMsgIcon = vbQuestion
Case 3
internalMsgIcon = vbExclamation
End Select
End Property
Public Function getMsgBox() As VbMsgBoxResult
getMsgBox = MsgBox(internalMsgPrompt, internalMsgIcon + internalStyle, internalTitle)
End Function
ASP Code:
================================
dim x
dim msgresult
set x = server.createobject("netmsgboxlib.netmsgbox1"
x.msgtitle = "Hello"
x.msgprompt = "Propmt"
x.msgicon = 2
x.msgstyle = 1
msgresult = x.getmsgbox
if msgresult = vbyes then
response.write("You clicked yes"
else
response.write("You clicked no"
end if
Thanks,
Bobby