Using WSOCK32.DLL in TD 5.1

Discussions specific to Team Developer 5.1.

Using WSOCK32.DLL in TD 5.1

Postby rudolf.schoebel » Thu Jun 12, 2008 7:37 am

Hi all.

I am using some WSOCK32.DLL functions in a TD application to transmit email messages by smtp protocol. I took the code from version 1.5 to version 5.1. But here I have trouble with the unicode conversion of the WSOCK32 parameters. The receive strings from the server show up as unreadable characters and I believe that the transmitted string are also not transferred to the server correctly.

How do I have to access WSOCK32.DLL functions correctly?

Any help welcome. Thanks.
rudolf.schoebel
 
Posts: 20
Joined: Wed May 07, 2008 1:15 am

Re: Using WSOCK32.DLL in TD 5.1

Postby Jeff Luther » Thu Jun 12, 2008 1:02 pm

These may help you: Look at the TD v5.1 functions SalStrToMultiByte and SalStrToWideChar. They convert Unicode <--> ANSI, back and forth. See TD Help for more info. on these functions. I also have a couple Unicode samples on my page, link shown below. That may help you too.
Jeff Luther
 

Re: Using WSOCK32.DLL in TD 5.1

Postby rudolf.schoebel » Fri Jun 13, 2008 2:35 am

Hi Jeff.

Thanks for your advice. The problem was like that. Now I could solve it.

Bye
rudolf.schoebel
 
Posts: 20
Joined: Wed May 07, 2008 1:15 am

Re: Using WSOCK32.DLL in TD 5.1

Postby chelonet » Tue Sep 24, 2013 1:43 pm

Hi,
Someone could solve the sending SMTP mails via winsock?
chelonet
 
Posts: 38
Joined: Mon Aug 24, 2009 2:24 am
Location: Argentina

Re: Using WSOCK32.DLL in TD 5.1

Postby ProjectionAU » Wed May 07, 2014 9:54 pm

Hi,

I have the same problem in TD6.0-SP2, when calling this WSOCK32 function, Set p_nBufferLen = recv(i_nSocket, p_sBuffer, 0x4000, 0), p_sBuffer is returning unreadable characters and when I try to use the SalStrToMultiByte conversion, it doesn't do any good. Also, I do think the transmitted string is not transferred to the server correctly as well.

Library name: WSOCK32.DLL
Function: recv
Description: see MSDN documentation
Export Ordinal: 0
Returns
! number of bytes received or SOCKET_ERROR (= error)
Number: INT
Parameters
! socket
Number: UINT
! buffer for incoming data
Receive String: LPVOID
! size of buffer
Number: INT
! flags
Number: INT

Let us know if there is a fix to this issue.

Regards,
Rolando
ProjectionAU
 
Posts: 24
Joined: Thu Jun 02, 2011 5:06 pm

Re: Using WSOCK32.DLL in TD 5.1

Postby lrcuess » Tue May 13, 2014 12:15 am

Hi,

try to use SalStrToWideChar instead of SalStrToMultiByte.

Max
Markus Eßmayr
RACON Software GmbH
http://www.racon.at
User avatar
lrcuess
 
Posts: 1163
Joined: Mon May 07, 2007 5:58 am
Location: Linz, Austria


Return to Team Developer 5.1

Who is online

Users browsing this forum: No registered users and 1 guest

cron