Click here to Skip to main content
15,921,694 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Easy question: Pin
georgiek507-Feb-03 6:00
georgiek507-Feb-03 6:00 
GeneralRe: Easy question: Pin
Harold Bamford7-Feb-03 6:18
Harold Bamford7-Feb-03 6:18 
GeneralRe: Easy question: Pin
georgiek507-Feb-03 7:38
georgiek507-Feb-03 7:38 
Generalbitmaps in statusbar Pin
Crash Operator6-Feb-03 13:20
Crash Operator6-Feb-03 13:20 
GeneralRe: bitmaps in statusbar Pin
-Dy6-Feb-03 23:04
-Dy6-Feb-03 23:04 
GeneralNot to Get Black background image Pin
mkashifkkj6-Feb-03 13:06
mkashifkkj6-Feb-03 13:06 
Generalavaoiding flicker on CUSTOMDRAW Pin
User 98856-Feb-03 12:39
User 98856-Feb-03 12:39 
GeneralRe: avaoiding flicker on CUSTOMDRAW Pin
Moak7-Feb-03 1:09
Moak7-Feb-03 1:09 
GeneralCHeaderCtrl Pin
User 98856-Feb-03 12:30
User 98856-Feb-03 12:30 
GeneralRe: CHeaderCtrl Pin
OBRon7-Feb-03 4:17
OBRon7-Feb-03 4:17 
GeneralRe: CHeaderCtrl Pin
User 98857-Feb-03 4:31
User 98857-Feb-03 4:31 
GeneralCoding database ! Pin
Hadi Rezaee6-Feb-03 11:50
Hadi Rezaee6-Feb-03 11:50 
GeneralRe: Coding database ! Pin
Anonymous6-Feb-03 11:57
Anonymous6-Feb-03 11:57 
GeneralRe: Coding database ! Pin
Hadi Rezaee6-Feb-03 12:21
Hadi Rezaee6-Feb-03 12:21 
GeneralRe: Coding database ! Pin
Willem B7-Feb-03 2:18
Willem B7-Feb-03 2:18 
QuestionGet Network namnes and there IP ? Pin
Larsson6-Feb-03 11:36
Larsson6-Feb-03 11:36 
AnswerRe: Get Network namnes and there IP ? Pin
palbano6-Feb-03 15:20
palbano6-Feb-03 15:20 
GeneralRe: Get Network namnes and there IP ? Pin
Larsson12-Feb-03 5:48
Larsson12-Feb-03 5:48 
GeneralGDI+ and DirectX/direct video output Pin
Roman Nurik6-Feb-03 11:04
Roman Nurik6-Feb-03 11:04 
Question__ftol2 ?? where did it come from? .NET? Pin
Jared Allen6-Feb-03 10:24
Jared Allen6-Feb-03 10:24 
AnswerRe: __ftol2 ?? where did it come from? .NET? Pin
Joaquín M López Muñoz6-Feb-03 10:37
Joaquín M López Muñoz6-Feb-03 10:37 
GeneralRe: __ftol2 ?? where did it come from? .NET? Pin
Chris Losinger6-Feb-03 10:50
professionalChris Losinger6-Feb-03 10:50 
GeneralRe: __ftol2 ?? where did it come from? .NET? Pin
Jared Allen6-Feb-03 11:51
Jared Allen6-Feb-03 11:51 
GeneralRe: __ftol2 ?? where did it come from? .NET? Pin
Chris Losinger6-Feb-03 12:20
professionalChris Losinger6-Feb-03 12:20 
QuestioncreateThread , Prototype, and extren call correctness? Pin
Pecan2046-Feb-03 7:42
Pecan2046-Feb-03 7:42 
My last attempt at launching a fortran dll with
createThread resulted in the following error.

error LNK2001: unresolved external symbol "unsigned long
__stdcall FTREND3(void *)" (?FTREND3@@YGKPAX@Z)
Debug/cinterface3.exe : fatal error LNK1120: 1 unresolved
externals

I am not sure if the extern and DWORD prototypes are
correct? If I comment out the DWORD function prototype it
compiles and links but does not start the integer function.

Does the createThread actually pass the integer argument of 1 or just start the function and then it sees the shared memory?

Can someone comment? Thanks.

Code below:
#include <stdio.h>
#include <string.h>
#include <windows.h>

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

/* prototype for function */
DWORD WINAPI FTREND3(LPVOID);
//DWORD WINAPI FTREND3(LPVOID pvoid);

//extern "C" long _stdcall FTREND3 ( long );
// declspec(dllimport) for DLL's
extern "C" __declspec(dllimport) long _stdcall FTREND3 (
long );

void main (void)
{
DWORD tid;
HANDLE hThread;
cio.start = 1;

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

printf("In c after fortran thread started\n\n");
printf("string = %s\n",cio.time);
}


INTEGER FUNCTION FTREND3 (TIO)
USE DFPORT
IMPLICIT NONE
!DEC$ ATTRIBUTES DLLEXPORT :: FTREND3
TYPE IO
INTEGER START ! if 1 start timer
CHARACTER*10 timeIs
END TYPE IO

TYPE(io):: tio
DO WHILE ( tio%START .EQ. 1)
tio%timeIs = CLOCK ( ) ! Uses DFPORT
tio%timeIs = tio%timeIs // char(0)
write (6,*) 'In fortran after time call'
write (6,*) ' Time = ', tio%timeIs
FTREND3 = 1
ENDDO
FTREND3 = 0
RETURN
END FUNCTION FTREND3

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.