Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Cannot create ActiveX component

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rocio - 17 Jun 2004 23:03 GMT
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 PostPaymentToServer(ByVal
TCMPaymentTransactionID As Long) _
       As PostPayment
       Dim obj As Object
       'Dim objPost As New TCMPostPayments.clsPostPaymentBDS
       Dim blnRet As Boolean
       Dim objRes As New PostPayment

       blnRet = False
       Try
           obj = CreateObject("TCPostPayment.clsPostPaymentBDS")
           blnRet = obj.AcceptPayment(TCMPaymentTransactionID)
           'blnRet = objPost.AcceptPayment(TCMPaymentTransactionID)
           If blnRet = True Then
               objRes.ErrorString = ""
           Else
               objRes.ErrorString = obj.ErrorMessage
           End If
       Catch ex As Exception
           objRes.ErrorString = "Error: " + ex.ToString
       Finally
           obj = Nothing
       End Try

       Return objRes
   End Function

I get this:

Error: System.Exception: Cannot create ActiveX component. at
Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String
ServerName) at TaxCollectionWS_BS.WebService.PostPaymentToServer(Int64
TCMPaymentTransactionID) in
C:\TaxCollectionWeb\TaxCollectionWS\TaxCollectionWS_BS\WebService.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.
Laila F - 27 Aug 2004 11:37 GMT
I have exactly the same problem with my C# web service, which is attempting
to create an ActiveX-component. When I try to call it from within C# as an
ordinary application, it works fine, but when I invoke the web method from
another application, it crashes. I get a
System.Runtime.InteropServices.COMException. I have a catch-clause which
catches the COM-exception when called from within the application, but for
some reason it seems to ignore this when called from another application.
That said, there is no reason why the exception should be thrown in the first
place, as I provide the correct information to the method. I deliberately
sent it null-values from within the application just to test the
catch-clause, which then worked fine.

Did you find out why this happened? Or perhaps a work-around? I would be
very happy to hear from you if you did.

> I have a windows app. written in VB6, now we need to expose some of
> its classes through a web service.
[quoted text clipped - 49 lines]
> 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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.