Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fiber - Threads (#include problem?) 1

Status
Not open for further replies.

IonelBurtan

Programmer
May 25, 2001
601
RO
Hello,

I have the following unexplained problem:
This is the cpp file of a Win32 Console Project from VC++ with SP3.

#include "stdafx.h"
#include <windows.h>
#include <winbase.h>
#include <string>

using namespace std;

long WINAPI TestThreadProcedure(long lParameter);

int main(int argc, char* argv[])
{
HANDLE hThread, hEvent;
DWORD dwThreadId;

hEvent = CreateEvent(NULL, FALSE, FALSE, &quot;Event1&quot;);
hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)
TestThreadProcedure,
hEvent,0,&dwThreadId);
printf(&quot;Hello World!\n&quot;);
SetEvent(hEvent);
return 0;
}

long WINAPI TestThreadProcedure(long lParameter)
{
string s=&quot;test&quot;;
printf(&quot;Hello World from thread!\n&quot;);
ConvertThreadToFiber((LPVOID)&s);
return 0L;
}

At compile time I get the error &quot;
&quot;ConvertThreadToFiber undeclared identifier&quot;
I have included &quot;winbase.h&quot; where this function header is declare, no change. I can'd explain myself what's wrong. (I have looked in winbase and windows.h for #include, #ifdef and #ifndef and I am out of ideeas)

Please help me with this,
Thanx s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
try to put before #include<windows>
#define _WIN32_WINNT 0x0400 John Fill
1c.bmp


ivfmd@mail.md
 
Yes, finally.
It works, thank you.

Is this a rule to include this #define when you are using commands that are newer to NT or what? s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top