Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerCOBOL and MS Winsock Control

Status
Not open for further replies.

kwmjmw

Programmer
Nov 18, 2003
8
0
0
US
Has anyone had any luck using the Microsoft Winsock Control 6.0 in PowerCOBOL? I have written client and server applications to send strings to each other. The data is sent and the events all seem to fire fine but the data I receive is just garbage. The same program written in VB works fine. Fujitsu tech support says its not their problem. I suspect MS tech support would say the same.
 
Actually they would both be probably right.

Winsock is picky with the data types (short integers) and your COBOL is using...what...COMP fields? Make sure they match.

Dimandja
 
Actually I'm just trying to send strings using the SendData and GetData methods of the control. I too thought it could be a data type issue. Could there be an issue with what COBOL and VB consider a string? Strangely enough I always get twice as many characters as I send. Thanks for your input.
 
True again. Although, I can't remember how I fixed that one (it's been a while).

You see, VB may internally define a string in an obscure data type (OLE legacy) called BSTR (Unicode and each character uses 2 bytes). (Search me)

But, you may find more or differing info here:
Dimandja
 
It just occurred to me. Winsock has APIs that end with "A" or "W". The As will handle single bytes while the Ws deal with Unicode. Hope that helps.

Dimandja
 
I think we are talking about 2 different ways to do Winsock. I am actually using the ActiveX Winsock Control not calling the Winsock API directly. I was going to write a custom control in VB to use in PowerCOBOL but now I'm running into a problem in VB. Its seems VB doesn't allow an event and method to have the same name. But the winsock control has both a connect event and a connect method so it won't let me put both on my custom control. This is getting pretty frustrating. Thanks again for your input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top