Click here to Skip to main content
15,895,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Copy the data in List control using ctrl+C Pin
David Crow6-Sep-07 3:19
David Crow6-Sep-07 3:19 
GeneralRe: Copy the data in List control using ctrl+C Pin
ThatsAlok6-Sep-07 5:02
ThatsAlok6-Sep-07 5:02 
GeneralRe: Copy the data in List control using ctrl+C [modified] Pin
shir_k8-Sep-07 19:52
shir_k8-Sep-07 19:52 
QuestionUDP Server Pin
Andy2025-Sep-07 23:01
Andy2025-Sep-07 23:01 
QuestionRe: UDP Server Pin
Mark Salsbery6-Sep-07 5:51
Mark Salsbery6-Sep-07 5:51 
AnswerRe: UDP Server Pin
Andy2026-Sep-07 10:58
Andy2026-Sep-07 10:58 
GeneralRe: UDP Server Pin
Mark Salsbery6-Sep-07 11:33
Mark Salsbery6-Sep-07 11:33 
GeneralRe: UDP Server Pin
Andy2027-Sep-07 4:48
Andy2027-Sep-07 4:48 
Thanks again for your Post Mark, I now get Error = 10057 when the Client is not running and Error = 10093 when the Client is running.
// Setup port addresses<br />
local.sin_family = AF_INET;<br />
local.sin_addr.s_addr = INADDR_BROADCAST;<br />
local.sin_port = htons(port);<br />
<br />
conn_socket = socket(AF_INET, socket_type, 0); /* Open a socket */<br />
<br />
if (setsockopt (conn_socket, SOL_SOCKET, SO_BROADCAST, (char *) &TxBuffer, sizeof (TxBuffer)) == SOCKET_ERROR)<br />
{<br />
	closesocket (conn_socket);<br />
	g_szFormatting.Format("setsockopt() failed: %d\n",WSAGetLastError());<br />
	ReportMessages(g_szFormatting);<br />
	WSACleanup();<br />
	return false;<br />
}<br />
<br />
//Make it so you can attach more than one thing to a socket<br />
if (setsockopt (conn_socket, SOL_SOCKET, SO_REUSEADDR , (char *) &optval, sizeof(optval))  == SOCKET_ERROR)<br />
{				<br />
	g_szFormatting.Format("Couldn't set SO_REUSEADDR %d\n ", WSAGetLastError());<br />
	ReportMessages(g_szFormatting);<br />
	closesocket (conn_socket);<br />
	WSACleanup();<br />
	return false;<br />
}


And in the Writer Thread:-

while(g_bUDP_Socket_Created && g_bUDPStatus)<br />
{<br />
<br />
retval = sendto (conn_socket, (char*)TxBuffer, sizeof(Tx_Data), 0, NULL , 0);<br />
	if (retval == SOCKET_ERROR)<br />
	{	<br />
		g_szFormatting.Format("Couldn't send data, %d",WSAGetLastError());<br />
		::MessageBox((HWND)NULL,g_szFormatting, NULL,MB_ICONEXCLAMATION );<br />
		closesocket (conn_socket);<br />
		WSACleanup();<br />
	}<br />
	Sleep(1000);<br />
}<br />
// Close the Winsock and tidy up<br />
closesocket(conn_socket);<br />
WSACleanup();

GeneralRe: UDP Server Pin
Mark Salsbery7-Sep-07 5:22
Mark Salsbery7-Sep-07 5:22 
GeneralRe: UDP Server Pin
Andy2027-Sep-07 9:13
Andy2027-Sep-07 9:13 
GeneralRe: UDP Server Pin
Moak8-Nov-07 12:37
Moak8-Nov-07 12:37 
Questionhow to establish usb communication in MFC? Pin
ashokbngr5-Sep-07 22:43
ashokbngr5-Sep-07 22:43 
AnswerRe: how to establish usb communication in MFC? Pin
Cedric Moonen5-Sep-07 23:16
Cedric Moonen5-Sep-07 23:16 
Questionnumerical methods Pin
mitsui585-Sep-07 22:00
mitsui585-Sep-07 22:00 
AnswerRe: numerical methods Pin
Russell'5-Sep-07 22:39
Russell'5-Sep-07 22:39 
GeneralRe: numerical methods Pin
mitsui585-Sep-07 22:53
mitsui585-Sep-07 22:53 
GeneralRe: numerical methods Pin
Russell'5-Sep-07 23:13
Russell'5-Sep-07 23:13 
GeneralRe: numerical methods Pin
mitsui587-Sep-07 4:35
mitsui587-Sep-07 4:35 
AnswerRe: numerical methods Pin
David Crow6-Sep-07 3:28
David Crow6-Sep-07 3:28 
AnswerRe: numerical methods Pin
ollydbg239-Sep-07 1:05
ollydbg239-Sep-07 1:05 
QuestionHow can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:06
yaminisridaran5-Sep-07 20:06 
AnswerRe: How can I monitor the cts pin of serial port using dcb Pin
chandu0045-Sep-07 20:26
chandu0045-Sep-07 20:26 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
yaminisridaran5-Sep-07 20:30
yaminisridaran5-Sep-07 20:30 
GeneralRe: How can I monitor the cts pin of serial port using dcb Pin
chandu0045-Sep-07 20:51
chandu0045-Sep-07 20:51 
AnswerRe: How can I monitor the cts pin of serial port using dcb Pin
QuickDeveloper5-Sep-07 20:41
QuickDeveloper5-Sep-07 20:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.