Click here to Skip to main content
15,920,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: limitting cpu usage for a process Pin
sfeldi19-Jul-05 22:16
sfeldi19-Jul-05 22:16 
GeneralRe: limiting cpu usage for a process Pin
mbulhoes20-Jul-05 8:06
mbulhoes20-Jul-05 8:06 
QuestionHow to retrive users info from a Windows Server Pin
ivax19-Jul-05 5:43
ivax19-Jul-05 5:43 
AnswerRe: How to retrive users info from a Windows Server Pin
David Crow19-Jul-05 6:05
David Crow19-Jul-05 6:05 
GeneralRe: How to retrive users info from a Windows Server Pin
ivax19-Jul-05 6:13
ivax19-Jul-05 6:13 
GeneralRe: How to retrive users info from a Windows Server Pin
David Crow19-Jul-05 9:33
David Crow19-Jul-05 9:33 
GeneralRe: How to retrive users info from a Windows Server Pin
Graham Bradshaw19-Jul-05 12:37
Graham Bradshaw19-Jul-05 12:37 
GeneralNeed help with Worker Thread Code Pin
Freddie Code19-Jul-05 5:16
Freddie Code19-Jul-05 5:16 
I'm a newbee with MFC. I'm following this article on Worker Threads:
http://www.codeproject.com/threads/usingworkerthreads.asp[^]

With the following code I'm getting the following error. Any suggestions as to what is going on here?

: error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'void (void)'

<br />
// getcanmessages.cpp: implementation of the Cgetcanmessages class.<br />
//<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
#include "stdafx.h"<br />
#include "canmon.h"<br />
#include "getcanmessages.h"<br />
<br />
#ifdef _DEBUG<br />
#undef THIS_FILE<br />
static char THIS_FILE[]=__FILE__;<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
//////////////////////////////////////////////////////////////////////<br />
// Construction/Destruction<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
static UINT run(LPVOID p);<br />
void run();<br />
volatile BOOL running;<br />
<br />
Cgetcanmessages::Cgetcanmessages()<br />
{<br />
}<br />
Cgetcanmessages::~Cgetcanmessages()<br />
{<br />
}<br />
void Cgetcanmessages::gogetcan()<br />
    {<br />
     running = TRUE;<br />
     AfxBeginThread(run, this);    //<<<---this is the error line.<br />
    }<br />
 <br />
UINT Cgetcanmessages::run(LPVOID p)<br />
    {<br />
     Cgetcanmessages * me = (Cgetcanmessages *)p;<br />
     me->run();<br />
     return 0;<br />
    }<br />
 <br />
void Cgetcanmessages::run()<br />
   {<br />
      //add worker tasks here.<br />
   }<br />
<br />

GeneralRe: Need help with Worker Tread Code Pin
David Crow19-Jul-05 5:17
David Crow19-Jul-05 5:17 
GeneralRe: Need help with Worker Thread Code Pin
khan++19-Jul-05 20:49
khan++19-Jul-05 20:49 
QuestionWhy does creating a static window from a console app cause havok? Pin
IGx8919-Jul-05 5:10
IGx8919-Jul-05 5:10 
AnswerRe: Why does creating a static window from a console app cause havok? Pin
David Crow19-Jul-05 5:16
David Crow19-Jul-05 5:16 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
IGx8919-Jul-05 5:50
IGx8919-Jul-05 5:50 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
David Crow19-Jul-05 6:10
David Crow19-Jul-05 6:10 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
IGx8919-Jul-05 7:03
IGx8919-Jul-05 7:03 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
David Crow19-Jul-05 7:32
David Crow19-Jul-05 7:32 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
Trollslayer19-Jul-05 6:11
mentorTrollslayer19-Jul-05 6:11 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
IGx8919-Jul-05 7:05
IGx8919-Jul-05 7:05 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
Trollslayer19-Jul-05 7:35
mentorTrollslayer19-Jul-05 7:35 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
David Crow19-Jul-05 7:49
David Crow19-Jul-05 7:49 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
James Brown19-Jul-05 7:56
James Brown19-Jul-05 7:56 
GeneralRe: Why does creating a static window from a console app cause havok? Pin
IGx8919-Jul-05 9:34
IGx8919-Jul-05 9:34 
Generalfread crash Pin
sfeldi19-Jul-05 4:40
sfeldi19-Jul-05 4:40 
GeneralRe: fread crash Pin
David Crow19-Jul-05 5:28
David Crow19-Jul-05 5:28 
GeneralRe: fread crash Pin
Chris Losinger19-Jul-05 6:48
professionalChris Losinger19-Jul-05 6:48 

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.