Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem using MFC to create multiple CDialog threads Pin
Spawn@Melmac23-Feb-10 1:59
Spawn@Melmac23-Feb-10 1:59 
QuestionBase64 and VC++ Pin
burslem200121-Feb-10 6:08
burslem200121-Feb-10 6:08 
AnswerRe: Base64 and VC++ Pin
Rajesh R Subramanian21-Feb-10 6:12
professionalRajesh R Subramanian21-Feb-10 6:12 
AnswerRe: Base64 and VC++ Pin
CPallini21-Feb-10 7:49
mveCPallini21-Feb-10 7:49 
AnswerRe: Base64 and VC++ Pin
Graham Breach21-Feb-10 9:57
Graham Breach21-Feb-10 9:57 
Questiondynamic variable argument list C/C++ Pin
yakabmarci21-Feb-10 4:06
yakabmarci21-Feb-10 4:06 
AnswerRe: dynamic variable argument list C/C++ Pin
Chris Losinger21-Feb-10 6:11
professionalChris Losinger21-Feb-10 6:11 
QuestionConnect to all LAN servers Pin
Manmohan2920-Feb-10 22:36
Manmohan2920-Feb-10 22:36 
i want to connect my application to all servers on LAN using TCP sockets.

UINT CD1MessageDlg::ScanLAN(LPVOID pParam)
{
	unsigned int tf0, tf1, tf2, tf3;
	CString tip = "";

	CD1MessageDlg *t;
	t=(CD1MessageDlg*)pParam;
	BOOL x = 1;
	// Loop for scanning LAN
	for (tf0 = 192; tf0 <= 192; tf0++)
	{
		for (tf1 = 168; tf1 <= 168; tf1++)
		{
			for (tf2 = 109; tf2 <= 117; tf2++)
			{
				for (tf3 = 1; tf3 <= 255; tf3++)
				{
					tip.Format("%u.%u.%u.%u", tf0, tf1, tf2, tf3);
					t->m_sConnectSocket.Connect(tip, 50000);
//.
//.
//.
// I will detach the socket and pass to seperate thread after it finds a server on LAN
//this line is not working even if i set my ip to 192.168.109.2 
//t->m_sConnectSocket.Connect(tip, 50000);
				}
				// reset tf3 to default value
				tf3 = 0;
			}
			// reset tf2 to default value
			tf2 = 109;
		}
		// reset tf1 to default value
		tf1 = 168;
	}
	return 0;
}


one more ques. can i reuse the same socket again and again for finding server as i'm doing in my this code.
Future Lies in Present.
Manmohan Bishnoi

AnswerRe: Connect to all LAN servers Pin
Garth J Lancaster20-Feb-10 23:28
professionalGarth J Lancaster20-Feb-10 23:28 
GeneralRe: Connect to all LAN servers Pin
Manmohan2921-Feb-10 0:46
Manmohan2921-Feb-10 0:46 
GeneralRe: Connect to all LAN servers Pin
Garth J Lancaster21-Feb-10 9:44
professionalGarth J Lancaster21-Feb-10 9:44 
AnswerRe: Connect to all LAN servers Pin
Emilio Garavaglia22-Feb-10 2:38
Emilio Garavaglia22-Feb-10 2:38 
GeneralRe: Connect to all LAN servers Pin
Manmohan2922-Feb-10 3:52
Manmohan2922-Feb-10 3:52 
QuestionVS 2003/2008 or GCC Need To Choose! Pin
Trevor Johansen20-Feb-10 13:02
Trevor Johansen20-Feb-10 13:02 
AnswerRe: VS 2003/2008 or GCC Need To Choose! Pin
Nemanja Trifunovic20-Feb-10 16:06
Nemanja Trifunovic20-Feb-10 16:06 
QuestionAgain KeyBoar dll Pin
devidmorton20-Feb-10 10:59
devidmorton20-Feb-10 10:59 
AnswerRe: Again KeyBoar dll Pin
CPallini20-Feb-10 11:16
mveCPallini20-Feb-10 11:16 
AnswerRe: Again KeyBoar dll Pin
Trevor Johansen20-Feb-10 12:51
Trevor Johansen20-Feb-10 12:51 
GeneralRe: Again KeyBoar dll Pin
devidmorton21-Feb-10 5:26
devidmorton21-Feb-10 5:26 
GeneralRe: Again KeyBoar dll Pin
Trevor Johansen3-Mar-10 19:04
Trevor Johansen3-Mar-10 19:04 
QuestionC code in VC Pin
Punima Sen20-Feb-10 5:34
Punima Sen20-Feb-10 5:34 
AnswerRe: C code in VC Pin
David Crow20-Feb-10 6:12
David Crow20-Feb-10 6:12 
AnswerRe: C code in VC Pin
CPallini20-Feb-10 11:15
mveCPallini20-Feb-10 11:15 
AnswerRe: C code in VC Pin
Rajesh R Subramanian21-Feb-10 1:02
professionalRajesh R Subramanian21-Feb-10 1:02 
Questionmfc receive sms [modified] Pin
saneevil20-Feb-10 3:16
saneevil20-Feb-10 3:16 

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.