Click here to Skip to main content
15,890,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help Please!!! Pin
Rajesh R Subramanian5-Apr-09 2:49
professionalRajesh R Subramanian5-Apr-09 2:49 
QuestionUSB Drive Pin
MsmVc3-Apr-09 18:23
MsmVc3-Apr-09 18:23 
AnswerRe: USB Drive Pin
Iain Clarke, Warrior Programmer3-Apr-09 23:29
Iain Clarke, Warrior Programmer3-Apr-09 23:29 
QuestionHow can i call a function with a CString variable ? Pin
SNArruda3-Apr-09 16:57
SNArruda3-Apr-09 16:57 
AnswerRe: How can i call a function with a CString variable ? Pin
Divyang Mithaiwala3-Apr-09 21:16
Divyang Mithaiwala3-Apr-09 21:16 
AnswerRe: How can i call a function with a CString variable ? Pin
Iain Clarke, Warrior Programmer3-Apr-09 23:41
Iain Clarke, Warrior Programmer3-Apr-09 23:41 
Question_beginthreadex() conversion error Pin
Killiconn3-Apr-09 15:42
Killiconn3-Apr-09 15:42 
AnswerRe: _beginthreadex() conversion error Pin
sashoalm4-Apr-09 2:17
sashoalm4-Apr-09 2:17 
Hi, from the code you posted I can't be certain if WebServer::HandleRequest is a static function or not. But it must be a static function.

This is because the 3rd argument of _beginthreadex is a pointer to function, which must have exactly the same parameters and return type as the the function that is required.

In this case the function you supply must look like this:

unsigned __stdcall ThreadProc(void * param);

It MUST return an unsigned, and it MUST accept a void* as parameter, and it MUST NOT be a member function. You can still make it part of the class, but as a static function.

Also, never try to fool the compiler by casting the function pointer you pass as your callback - your program is going to try to execute this code, giving it the parameters it expects the function requires. So what if you cast a function that requires more parameters as one that requires less? It will get its arguments from uninitialized memory and will probably crash or cause memory corruption.

There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

AnswerRe: _beginthreadex() conversion error Pin
Stuart Dootson4-Apr-09 2:48
professionalStuart Dootson4-Apr-09 2:48 
QuestionStrategy Question Pin
Parker M cCauley3-Apr-09 13:40
Parker M cCauley3-Apr-09 13:40 
AnswerRe: Strategy Question Pin
Iain Clarke, Warrior Programmer3-Apr-09 22:58
Iain Clarke, Warrior Programmer3-Apr-09 22:58 
QuestionRe: Strategy Question Pin
Parker M cCauley4-Apr-09 13:04
Parker M cCauley4-Apr-09 13:04 
AnswerRe: Strategy Question Pin
Iain Clarke, Warrior Programmer5-Apr-09 22:37
Iain Clarke, Warrior Programmer5-Apr-09 22:37 
GeneralRe: Strategy Question Pin
Parker M cCauley6-Apr-09 2:05
Parker M cCauley6-Apr-09 2:05 
GeneralRe: Strategy Question Pin
Iain Clarke, Warrior Programmer6-Apr-09 2:25
Iain Clarke, Warrior Programmer6-Apr-09 2:25 
GeneralRe: Strategy Question Pin
Parker M cCauley6-Apr-09 2:35
Parker M cCauley6-Apr-09 2:35 
Questiongetting nested groups from AD with win32 API Pin
Jasmine Pomelo3-Apr-09 9:03
Jasmine Pomelo3-Apr-09 9:03 
AnswerRe: getting nested groups from AD with win32 API Pin
David Crow3-Apr-09 10:47
David Crow3-Apr-09 10:47 
GeneralRe: getting nested groups from AD with win32 API Pin
led mike3-Apr-09 11:42
led mike3-Apr-09 11:42 
QuestionUnion Pin
_80863-Apr-09 7:39
_80863-Apr-09 7:39 
AnswerRe: Union Pin
David Crow3-Apr-09 8:10
David Crow3-Apr-09 8:10 
GeneralRe: Union Pin
_80863-Apr-09 8:20
_80863-Apr-09 8:20 
AnswerRe: Union Pin
CPallini3-Apr-09 8:19
mveCPallini3-Apr-09 8:19 
GeneralRe: Union Pin
_80863-Apr-09 8:23
_80863-Apr-09 8:23 
GeneralRe: Union Pin
led mike3-Apr-09 8:27
led mike3-Apr-09 8:27 

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.