Fortran-C interaction problem

Fortran-C interaction problem

During use Compaq Visual Fortran I have encounter the following problem:

1. I have created the Windows-application on the Compaq Visual Fortran.
2. I have created the file with a source code on C with the cfile.c name (Win32 API) and have compiled it in the obj-file through the MS Visual C compiler ++ 6.0. The file contains the sole Func1 function.
3. I have created Extension DLL, in which there is an export Func2 function, where with MFC is created and displayed the modal dialog box (CMyDialog dlg; dlg.DoModal()).

The order of interaction of the mentioned above components is such:
I statically link the Fortran application with cfile.c and I call the Func1 function.
In the Func1 function I load Extension DLL and receive the pointer on the export Func2 function (dynamic binding without import)
Further I call Func2 and I expect appearance of the modal dialogue, however instead of it I see ASSERT with the message:

AFXWIN1.INL line 22, ASSERT (afxCurrentResourceHandle! = NULL)

Where an error?

PS. At loading indicated Extension DLL from the application created on Visual C ++ 6.0, such error does not arise.

PPS. At start Extension DLL in the debugger with the Fortran application (in contrast to MSVC application), neither in DllMain, nor in Func2 the stop on breakpoint does not occur, the process is terminated, and in the Output window there is a message, that the base application has completed operation with the code 0x1. Why?

Thanks for any help.
Vladimir Petrov. Moscow, Russia

1 post / novo 0
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.