Jump to content
xisto Community
Sign in to follow this  
turbopowerdmaxsteel

Object & Classes Trouble

Recommended Posts

The following is the code that I am testing with.

 

 

Public Class Form1

Private sckCom As New MSWinsockLib.Winsock

Private sckDat As New AxMSWinsockLib.AxWinsock

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

sckCom.Close()

sckDat.Close()

End Sub

End Class

 

 


The sckCom.close() method works fine, but the sckDat.close() method causes the following exception :-

 

Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.

 

I am not sure why this error is being generated. Also what are the differences betweem the two class libraries 'MSWinsockLib' & 'AxMSWinsockLib'.

Share this post


Link to post
Share on other sites

If you are using .NET then I would highly suggest researching the System.Net namespace, specifically the socket class. If you are using VB6 then I would highly suggest downloading a free copy of VB.NET Express from Microsoft. It will make your life much easier.I will additionally make the suggestion that unless you are performing some low level protocol handling, you should use something like httpWebRequest. I have done very little with VB6 but I know that in .NET you still have to make all of your DLL imports. Tell us a little bit more about what you are trying to do and maybe I can make some more suggestions.

Share this post


Link to post
Share on other sites

Actually, I am trying to create a Download Manager (infact I have a sound working one). I want to make a class FTP Engine, which would do all the low level handlings and enable file downloads. For this I have delcated the following objects :-

 

Dim WithEvents FTP0 As New FTPEngine

Dim WithEvents FTP1 As New FTPEngine

Dim WithEvents FTP2 As New FTPEngine

Dim WithEvents FTP3 As New FTPEngine

 

The problem I am facing, is the exception that I mentioned, being genereated whenever I try to Call Methods or Functions of an object of AxMSWinsockLib class. However, working with MSWinsockLib class, seems to be working.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.