Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionNot able to connect to database when logging as as Standard User (Non- Administrative user) in Vista Pin
V K 23-Sep-08 20:33
V K 23-Sep-08 20:33 
QuestionCSocket threading issue Pin
tony_Udz3-Sep-08 20:32
tony_Udz3-Sep-08 20:32 
Hello,

I have written a client server application using sockets.
In this application, server will send data to client. I have used CSocket(MFC) for this purpose.

Server side application is working fine but problems start as soon as i had intoduced threading inside it.

Below is my code:

///////////////////////////////////////////////////////////
UINT __cdecl ThreadProc( LPVOID pParam ); // Signature of thread proc

AfxSocketInit(NULL);

CSocket sockSrvr;
sockSrvr.Create(PORT);

BOOL bListen = sockSrvr.Listen();

while (1)
{
CSocket sockRecv;
sockSrvr.Accept(sockRecv);
AfxBeginThread(ThreadProc, &sockRecv);
Sleep(5000);
}

///////////////////////////////////////////////////////////

I pass address of CSocket as parameter of 'ThreadProc' and as soon as control enters 'ThreadProc'
iget a debug assertion faliure from sockcore.cpp at the following line:
ASSERT(pState->m_hSocketWindow != NULL);

Can anybody of you please help me i am not able to understan wats wrong to this code?

Thanks in Advance!!

Regards
Tony
AnswerRe: CSocket threading issue [modified] Pin
SandipG 3-Sep-08 21:04
SandipG 3-Sep-08 21:04 
AnswerRe: CSocket threading issue Pin
Roger Stoltz3-Sep-08 22:25
Roger Stoltz3-Sep-08 22:25 
GeneralRe: CSocket threading issue Pin
SandipG 3-Sep-08 23:00
SandipG 3-Sep-08 23:00 
GeneralRe: CSocket threading issue Pin
Roger Stoltz3-Sep-08 23:04
Roger Stoltz3-Sep-08 23:04 
GeneralRe: CSocket threading issue Pin
tony_Udz4-Sep-08 1:43
tony_Udz4-Sep-08 1:43 
Questionsetup package creation Pin
AnithaSubramani3-Sep-08 20:30
AnithaSubramani3-Sep-08 20:30 
AnswerRe: setup package creation Pin
Cedric Moonen3-Sep-08 20:38
Cedric Moonen3-Sep-08 20:38 
GeneralRe: setup package creation Pin
AnithaSubramani3-Sep-08 20:41
AnithaSubramani3-Sep-08 20:41 
GeneralRe: setup package creation Pin
Rajesh R Subramanian3-Sep-08 20:49
professionalRajesh R Subramanian3-Sep-08 20:49 
GeneralRe: setup package creation Pin
AnithaSubramani3-Sep-08 20:58
AnithaSubramani3-Sep-08 20:58 
Questionproblem in connection to serial port Pin
manju23reddy3-Sep-08 20:07
manju23reddy3-Sep-08 20:07 
AnswerRe: problem in connection to serial port Pin
Cedric Moonen3-Sep-08 20:26
Cedric Moonen3-Sep-08 20:26 
GeneralRe: problem in connection to serial port Pin
manju23reddy3-Sep-08 21:28
manju23reddy3-Sep-08 21:28 
GeneralRe: problem in connection to serial port Pin
Cedric Moonen3-Sep-08 21:37
Cedric Moonen3-Sep-08 21:37 
GeneralRe: problem in connection to serial port Pin
manju23reddy3-Sep-08 21:50
manju23reddy3-Sep-08 21:50 
QuestionCOM type name Pin
George_George3-Sep-08 19:58
George_George3-Sep-08 19:58 
QuestionStatic text as a link. Pin
Le@rner3-Sep-08 19:57
Le@rner3-Sep-08 19:57 
AnswerRe: Static text as a link. Pin
_AnsHUMAN_ 3-Sep-08 20:04
_AnsHUMAN_ 3-Sep-08 20:04 
GeneralRe: Static text as a link. Pin
Le@rner3-Sep-08 20:27
Le@rner3-Sep-08 20:27 
AnswerRe: Static text as a link. Pin
enhzflep3-Sep-08 20:12
enhzflep3-Sep-08 20:12 
GeneralRe: Static text as a link. Pin
Le@rner3-Sep-08 20:49
Le@rner3-Sep-08 20:49 
GeneralRe: Static text as a link. Pin
ThatsAlok3-Sep-08 21:09
ThatsAlok3-Sep-08 21:09 
GeneralRe: Static text as a link. Pin
Le@rner3-Sep-08 21:36
Le@rner3-Sep-08 21:36 

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.