HANDLE hThread;
DWORD dwThreadId;
hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
MyThreadFunction, // thread function name
0, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier <--Debugger takes me to this line?
The error specifies the 3rd parameter but when i double click on the error it takes me to the last parameter?
Trying to run the msdn CreateThread example http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx
error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (void)' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
Clicking on the error takes you to the last parameter because the go-to-error function can only go by statements, and the entire function call is one statement.
Basically, your problem is that
MyThreadFunctionhas the wrong signature. It should beunsigned long __stdcall MyThreadFunction(void*)(or the equivalent thereof), but you wrotevoid MyThreadFunction(void)(or the equivalent thereof).