Computing.Net > Forums > Programming > Weird Visual Studio Problem

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Weird Visual Studio Problem

Reply to Message Icon

Original Message
Name: rammsteinfuerimmer
Date: October 24, 2004 at 12:28:58 Pacific
Subject: Weird Visual Studio Problem
OS: Windows Xp
CPU/Ram: XP 2000+ 512MB
Comment:

I am attempting to compile a multitasking program, exactly following the example given in the MSDN Library Visual Studio 6.0, under "Multithreading: Creating Worker Threads." However, the compiler gives the following: "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert papameter 1 from type 'unsigned int (void *)'. Yet this is exactly the type recommended; even the compiler's macro, AFX_THREADPROC, is a conversion to this same type. What type does it want; what is it trying to convert TO? Thanks in advance.


Report Offensive Message For Removal


Response Number 1
Name: BlueRaja
Date: October 24, 2004 at 20:15:27 Pacific
Reply: (edit)

I dunno; I always thought it was
unsigned int func(void* pParam);
I doublechecked the MSDN reference; sure enough:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_afxbeginthread.asp


"pfnThreadProc
Points to the controlling function for the worker thread. Cannot be NULL. This function must be declared as follows:
UINT MyControllingFunction( LPVOID pParam );


AKhalifman@hotmail.com


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software