Hi,

I am writing a network applications to read data from a server. The problem I have encountered is that on abrupt termination of my program, the socket rtemains open so that the next time I execute the program it will return an "Inavlid operation in actual state" error 40020. I am testing on 2 pc´s connected via twisted net cable. I have reset the pc where the problem arose to no success, I have to reset both pc´s to make it work again. My questiosn are :

1. can anybody tell me how to fix this problem programatically?
2. Is there a feasible way to detect network cable remotion. I am using IsNetworkAlive and will return after a certain period cable is disconnected even thougfh they are connected.
3. Due to the abupt termination I also have problems with RegisterClass and UnregisterClass. The first returns an error 1410 (Class already registered) and when the unregisterclassw is executed it will return an error 87. So I can´t get past these problems.

Please help, I am going crazy!!!!!!

Thanks for your help,

JARP

hi does anybody knows how to display an icon in a richtextbox in a chat program

The problem I have encountered is that on abrupt termination of my program, the socket rtemains open so that the next time I execute the program it will return an "Inavlid operation in actual state" error 40020.

I got around my problems with Winsock by checking connection state before attempting to connect. If it is in any state other than closed, it would close the connection first and then attempt to connect.


hi does anybody knows how to display an icon in a richtextbox in a chat program

@Chloevin: This has nothing to do with jarojasp's question, so you'd be better off posting your question in a new thread (ensuring you have tried the search functionality within the forum first!)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.