Click here to Skip to main content
15,905,232 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: i'm dumb Pin
Smith#16-Dec-05 0:29
Smith#16-Dec-05 0:29 
GeneralRe: i'm dumb Pin
Russell'16-Dec-05 0:33
Russell'16-Dec-05 0:33 
GeneralRe: i'm dumb Pin
Smith#16-Dec-05 0:37
Smith#16-Dec-05 0:37 
GeneralRe: i'm dumb Pin
Cedric Moonen16-Dec-05 0:42
Cedric Moonen16-Dec-05 0:42 
GeneralRe: i'm dumb Pin
Smith#16-Dec-05 2:33
Smith#16-Dec-05 2:33 
GeneralRe: i'm dumb Pin
Russell'16-Dec-05 0:48
Russell'16-Dec-05 0:48 
GeneralRe: i'm dumb Pin
Ravi Bhavnani16-Dec-05 10:51
professionalRavi Bhavnani16-Dec-05 10:51 
QuestionCreating a thread Pin
laiju15-Dec-05 23:54
laiju15-Dec-05 23:54 
Following is a funciton where I am calling a thread
void CMyView::OnInitialUpdate()
{
...
AfxBeginThread(Thread_ScanConnectionState, m_sComPort, THREAD_PRIORITY_NORMAL, NULL, NULL, NULL);
...
}

//Foll is the thread definition
UINT CMyView::Thread_ScanConnectionState(LPVOID pParam)
{
CString sComPort;
sComPort = static_cast<lpcstr> (pParam);
return 1;
}
The declaration of the thread in the class header of CMyView is as below.
UINT Thread_ScanConnectionState( LPVOID pParam );

I get the compilation error as given below
error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'UINT (LPVOID)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(4105): could be 'CWinThread *AfxBeginThread(AFX_THREADPROC,LPVOID,int,UINT,DWORD,LPSECURITY_ATTRIBUTES)'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(4108): or 'CWinThread *AfxBeginThread(CRuntimeClass *,int,UINT,DWORD,LPSECURITY_ATTRIBUTES)'
while trying to match the argument list '(overloaded-function, CString)'
Please let me know the error.


laiju
AnswerRe: Creating a thread Pin
Arman S.16-Dec-05 0:11
Arman S.16-Dec-05 0:11 
GeneralRe: Creating a thread Pin
Arman S.16-Dec-05 0:21
Arman S.16-Dec-05 0:21 
GeneralRe: Creating a thread Pin
toxcct16-Dec-05 0:35
toxcct16-Dec-05 0:35 
GeneralRe: Creating a thread Pin
Arman S.16-Dec-05 1:02
Arman S.16-Dec-05 1:02 
GeneralRe: Creating a thread Pin
laiju16-Dec-05 1:02
laiju16-Dec-05 1:02 
GeneralRe: Creating a thread Pin
Arman S.16-Dec-05 1:08
Arman S.16-Dec-05 1:08 
GeneralRe: Creating a thread Pin
toxcct16-Dec-05 1:49
toxcct16-Dec-05 1:49 
QuestionActiveX programming Pin
a_david12315-Dec-05 23:24
a_david12315-Dec-05 23:24 
Questionbmp's Pin
V.15-Dec-05 22:28
professionalV.15-Dec-05 22:28 
AnswerRe: bmp's Pin
ThatsAlok15-Dec-05 23:54
ThatsAlok15-Dec-05 23:54 
GeneralRe: bmp's Pin
V.16-Dec-05 0:01
professionalV.16-Dec-05 0:01 
Questionhow to use &quot;resource only dll&quot; Pin
kotiramkoteswararao15-Dec-05 22:23
kotiramkoteswararao15-Dec-05 22:23 
AnswerRe: how to use &amp;amp;quot;resource only dll&amp;amp;quot; Pin
David Crow16-Dec-05 3:05
David Crow16-Dec-05 3:05 
QuestionProcess-wide API spying - Source Code? Pin
devvvy15-Dec-05 22:01
devvvy15-Dec-05 22:01 
Questionhelp me pls Pin
Petiao15-Dec-05 21:56
Petiao15-Dec-05 21:56 
JokeRe: help me pls Pin
toxcct15-Dec-05 22:45
toxcct15-Dec-05 22:45 
JokeRe: help me pls Pin
Eytukan16-Dec-05 2:24
Eytukan16-Dec-05 2:24 

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.