none
Winsock ActiveX control and ASP.NET RRS feed

  • Question

  •  

    I had  a project group which contains two projects. One of the project is an ASP.NET application, the other one is the type of class library. Both are written in VB.NET.
    The problem is that in the Class library project, I had a form which has the winsock on it.
    AxMSWinsockLib.AxWinsock

    In my project group, the ASP.NET project is the start up project. It makes call to the class library. it immediately crashes when I was trying to createt the instance of the form with winsock control.

    How do I get around the problem?  Does .NET has the alternative to winsock?


    there are some code here:

    ' ASP.NET CODE
    Partial Public Class _Default
        Inherits System.Web.UI.Page
        Public t As TestClassLibrary1.Class1
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            t = New TestClassLibrary1.Class1
     
        End Sub
        End Class
     
     
     
    'Class library code
     
    Public Class Class1
        Private f As Form1
        Public Sub New()
            f = New Form1 'this form has activeX control winsock on it, crash immediately
            f.Show()
        End Sub
    End Class
    
    It would be best if the winsock can work with asp.net. Otherwise I am seeking for the alternative in .NET
     
    the winsock is 
    microsoft winsock control 6.0
     
    Can someone help please??
    Cheers
    Tuesday, March 11, 2008 3:20 AM

All replies

  •  

    Tuesday, March 11, 2008 7:24 PM
  • Since you are using a winsock control and there should be a problem when loading the same winsock control can you try using a winsock variable control as an array control. every time loading a form create a new winsock control but increment the index first. there should be not control embeded in the form. We will try loading the winsock as a variable control.

    e.g.

    Code Snippet

    Public WS() As AxMSWinsockLib.AxWinsock

     

     

    Let me know if you have tried this and what problems you have encountered.

     

    Note that we could have a winsock on different ways as far as I know. this in not official but through my discovery we could have

    AxMSWinsockLib.AxWinsock(variable declration)

    or

    MSWinsockLib.Winsock(variable declration)

    and

    A control winsock directly embeded in the form.

     

    What are you using among these three or have you used other methods.

     

    Thursday, October 2, 2008 9:01 AM