I am not real clear on using structure statements and external function calls. I am getting the following errors when I compile the file below. Can someone hlep? Thanks.
cinterface3.cpp(22) : error C2228: left of '.start' must have class/struct/union type
cinterface3.cpp(24) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (long *)' to 'unsigned long (__stdcall *)(void *)'
cinterface3.cpp(30) : error C2228: left of '.time' must have class/struct/union type
#include
#include
#include
struct io {
char time[10];
int start;
};
struct io cio;
extern "C" __declspec(dllimport) void _stdcall FTREND3
( long * );
void main (void)
{
DWORD tid, cio;
HANDLE hThread;
cio.start = 1;
hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid);
CloseHandle(hThread);
printf("In c after fortran thread started\n\n"
printf("string = %s\n",cio.time);
}
cinterface3.cpp(22) : error C2228: left of '.start' must have class/struct/union type
cinterface3.cpp(24) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'void (long *)' to 'unsigned long (__stdcall *)(void *)'
cinterface3.cpp(30) : error C2228: left of '.time' must have class/struct/union type
#include
#include
#include
struct io {
char time[10];
int start;
};
struct io cio;
extern "C" __declspec(dllimport) void _stdcall FTREND3
( long * );
void main (void)
{
DWORD tid, cio;
HANDLE hThread;
cio.start = 1;
hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid);
CloseHandle(hThread);
printf("In c after fortran thread started\n\n"
printf("string = %s\n",cio.time);
}