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!

Errors in createThread file. Need Help!

Status
Not open for further replies.

pecan204

Programmer
Jan 25, 2001
24
0
0
US
Hello, I am getting syntax errors in this file upon compile but I can't figure out what is wrong. Can someone comment?
Thanks.

The errors are:
cinterface3.cpp(17) : error C2065: 'DWORD' : undeclared identifier
cinterface3.cpp(17) : error C2146: syntax error : missing ';' before identifier 'tid'
cinterface3.cpp(17) : error C2065: 'tid' : undeclared identifier
cinterface3.cpp(19) : error C2065: 'HANDLE' : undeclared identifier
cinterface3.cpp(19) : error C2146: syntax error : missing ';' before identifier 'hThread'
cinterface3.cpp(19) : error C2065: 'hThread' : undeclared identifier
cinterface3.cpp(21) : error C2065: 'CreateThread' : undeclared identifier
cinterface3.cpp(23) : error C2146: syntax error : missing ';' before identifier 'CloseHandle'
cinterface3.cpp(23) : error C2065: 'CloseHandle' : undeclared identifier


#include <stdio.h>
#include <string.h>

struct io {
char time[10];
int start;
};

struct io cio;

extern &quot;C&quot; __declspec(dllimport) void _stdcall FTREND3
( long * );

void main (void)
{
DWORD tid, cio;

HANDLE hThread;

hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid)

CloseHandle(hThread);

printf(&quot;In c after fortran thread started\n\n&quot;);

printf(&quot;string = %s\n&quot;,cio.time);
}
 
Your app does not use MFC. Create a new app, console or dialog and have it use mfc. You will get all the stuff you need (or most of it) in stdafx.h. If you are missing anything, look at MSDN and include the appropriate files.

Matt
 
I think you may wnat to include &quot;Windows.h&quot; and maybe even more include files.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top