Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetDIBits Problem need help!!! Pin
John R. Shaw28-Aug-05 22:19
John R. Shaw28-Aug-05 22:19 
GeneralRe: GetDIBits Problem need help!!! Pin
viva_neu28-Aug-05 22:26
viva_neu28-Aug-05 22:26 
GeneralRe: GetDIBits Problem need help!!! Pin
John R. Shaw28-Aug-05 23:04
John R. Shaw28-Aug-05 23:04 
QuestionCSocket Pin
sunit525-Aug-05 22:07
sunit525-Aug-05 22:07 
AnswerRe: CSocket Pin
dharani25-Aug-05 22:22
dharani25-Aug-05 22:22 
GeneralRe: CSocket Pin
sunit525-Aug-05 22:47
sunit525-Aug-05 22:47 
GeneralRe: CSocket Pin
sunit526-Aug-05 0:08
sunit526-Aug-05 0:08 
AnswerRe: CSocket Pin
MailtoGops26-Aug-05 3:05
MailtoGops26-Aug-05 3:05 
Sunit,

This is repetetive problem when you use Windows Socket programing in Windows Operating system. As you know, MFC use asyncronous connection calls and request for scoket processing, MFC uses windows messagess for every new requests, data received etc...

Your problem is, you are created Windows socket in one thread, but using it on another thread. Bascially they will send messages which is irrelavant to another thread, hence assertion.

They are two appraches to solve this problem...

1. Create your server socket on UINT fnMainThread(LPVOID p) function. If you look at your function, there is no message handling is done. So you have to create a socket then you need to implement the message loop also for that thread.

2. When you use different thread for socket handling and creation,

first detach your socket handle from the main thread using Detach() method, copy that reference of socket and attach that reference to the new server socket object in another thread...



Please let me know if you need more help....




" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "

- Words from Nelson Mandela

Thanks & Regards,

Gopalakrishnan
GeneralRe: CSocket Pin
sunit526-Aug-05 3:41
sunit526-Aug-05 3:41 
GeneralRe: CSocket Pin
MailtoGops26-Aug-05 3:52
MailtoGops26-Aug-05 3:52 
GeneralRe: CSocket Pin
sunit526-Aug-05 4:17
sunit526-Aug-05 4:17 
AnswerRe: CSocket Pin
Moak (not logged in)27-Aug-05 22:27
sussMoak (not logged in)27-Aug-05 22:27 
QuestionExcel Automation Pin
Identity Undisclosed25-Aug-05 21:52
Identity Undisclosed25-Aug-05 21:52 
AnswerRe: Excel Automation Pin
Steve S25-Aug-05 23:44
Steve S25-Aug-05 23:44 
AnswerRe: Excel Automation Pin
Rage26-Aug-05 0:33
professionalRage26-Aug-05 0:33 
QuestionHow to Hide WindowName and Rectangle From Taskbar Pin
Amarelia25-Aug-05 20:55
Amarelia25-Aug-05 20:55 
AnswerRe: How to Hide WindowName and Rectangle From Taskbar Pin
dharani25-Aug-05 22:26
dharani25-Aug-05 22:26 
GeneralRe: How to Hide WindowName and Rectangle From Taskbar Pin
Amarelia26-Aug-05 2:57
Amarelia26-Aug-05 2:57 
QuestionCan you tell me how can I control speeds of IIS. Pin
10244225-Aug-05 20:09
10244225-Aug-05 20:09 
QuestionHiding characters in text file Pin
m_shezy25-Aug-05 19:35
m_shezy25-Aug-05 19:35 
QuestionAbout CMonthCalCtrl : Plz Help. Pin
parims25-Aug-05 18:48
parims25-Aug-05 18:48 
QuestionHelp Really need!! Pin
cue_ball25-Aug-05 17:14
cue_ball25-Aug-05 17:14 
AnswerRe: Help Really need!! Pin
dharani25-Aug-05 17:33
dharani25-Aug-05 17:33 
AnswerRe: Help Really need!! Pin
Weiye Chen25-Aug-05 17:58
Weiye Chen25-Aug-05 17:58 
GeneralRe: Help Really need!! Pin
cue_ball25-Aug-05 18:04
cue_ball25-Aug-05 18:04 

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.