I have a windows app. written in VB6, now we need to expose some of
its classes through a web service.
I am only able to expose the classes using late binding becasue that's
the way the original VB6 was written. I ahve already exposed some of
the original classes, and they work fine. Now, I added a new ActiveX
component to the windows app (in vb6). I am able to call it by late
binding from within the vb6 app. itself, and from a dummy vbs file
(visual basic script), but it crashes when I tried to call it from a
simple <WebMethod> in VB.NET:
<WebMethod()> Public Function PostPaymentToSe rver(ByVal
TCMPaymentTrans actionID As Long) _
As PostPayment
Dim obj As Object
'Dim objPost As New TCMPostPayments .clsPostPayment BDS
Dim blnRet As Boolean
Dim objRes As New PostPayment
blnRet = False
Try
obj = CreateObject("T CPostPayment.cl sPostPaymentBDS ")
blnRet = obj.AcceptPayme nt(TCMPaymentTr ansactionID)
'blnRet = objPost.AcceptP ayment(TCMPayme ntTransactionID )
If blnRet = True Then
objRes.ErrorStr ing = ""
Else
objRes.ErrorStr ing = obj.ErrorMessag e
End If
Catch ex As Exception
objRes.ErrorStr ing = "Error: " + ex.ToString
Finally
obj = Nothing
End Try
Return objRes
End Function
I get this:
Error: System.Exceptio n: Cannot create ActiveX component. at
Microsoft.Visua lBasic.Interact ion.CreateObjec t(String ProgId, String
ServerName) at TaxCollectionWS _BS.WebService. PostPaymentToSe rver(Int64
TCMPaymentTrans actionID) in
C:\TaxCollectio nWeb\TaxCollect ionWS\TaxCollec tionWS_BS\WebSe rvice.vb:line
251
any ideas why?
line 251 is the CreateObject line, from there it goes straight to
Catch ex.
The point is: I can use late binding call on this COM object from
another VB6 app, from a VBS script, but not from my web service app.
its classes through a web service.
I am only able to expose the classes using late binding becasue that's
the way the original VB6 was written. I ahve already exposed some of
the original classes, and they work fine. Now, I added a new ActiveX
component to the windows app (in vb6). I am able to call it by late
binding from within the vb6 app. itself, and from a dummy vbs file
(visual basic script), but it crashes when I tried to call it from a
simple <WebMethod> in VB.NET:
<WebMethod()> Public Function PostPaymentToSe rver(ByVal
TCMPaymentTrans actionID As Long) _
As PostPayment
Dim obj As Object
'Dim objPost As New TCMPostPayments .clsPostPayment BDS
Dim blnRet As Boolean
Dim objRes As New PostPayment
blnRet = False
Try
obj = CreateObject("T CPostPayment.cl sPostPaymentBDS ")
blnRet = obj.AcceptPayme nt(TCMPaymentTr ansactionID)
'blnRet = objPost.AcceptP ayment(TCMPayme ntTransactionID )
If blnRet = True Then
objRes.ErrorStr ing = ""
Else
objRes.ErrorStr ing = obj.ErrorMessag e
End If
Catch ex As Exception
objRes.ErrorStr ing = "Error: " + ex.ToString
Finally
obj = Nothing
End Try
Return objRes
End Function
I get this:
Error: System.Exceptio n: Cannot create ActiveX component. at
Microsoft.Visua lBasic.Interact ion.CreateObjec t(String ProgId, String
ServerName) at TaxCollectionWS _BS.WebService. PostPaymentToSe rver(Int64
TCMPaymentTrans actionID) in
C:\TaxCollectio nWeb\TaxCollect ionWS\TaxCollec tionWS_BS\WebSe rvice.vb:line
251
any ideas why?
line 251 is the CreateObject line, from there it goes straight to
Catch ex.
The point is: I can use late binding call on this COM object from
another VB6 app, from a VBS script, but not from my web service app.
Comment