views:

17

answers:

2

Hi,

Visual Studio 2008 C XP SP3

I am reading a book by Hoglund and he uses:

 HANDLE hThread = fOpenThread(
               THREAD_ALL_ACCESS,
               FALSE,
               dbg_evt.dwThreadId);

Anybody know anything about fOpenThread as I can't find any details and I am getting the error message error C3861: 'fOpenThread': identifier not found.

Thanks, R.

A: 

Not part of the C standard library. Or, any library I have used. Check if he provides a definition somewhere earlier in that very book or not.

dirkgently
Yeah that was what I was afraid of, looking for clarification... I'll start going back over the pages to see if I can find it, where is my microscope...
flavour404
I actually found the definition in the 'accompanying' text, though the author, nor anybody else said that this was the accompanying text, which was nice...
flavour404
+1  A: 

Looking here: http://groups.google.com/group/microsoft.public.vc.language/browse_thread/thread/f592e476b0f70d01 and here: https://connect.microsoft.com/VisualStudio/feedback/details/449513/freopen-and-fopen-not-thread-safe it looks like fOpenThread() is a function call the author of your book has defined. Certainly, as far as I am aware there are two ways to create threads on windows:

  • _beginthreadex - crt
  • CreateThread - WinAPI.

I've always used the latter. I'd suggest the author is perhaps wrapping one of these functions?

Ninefingers