Archived Visual Fortran (read-only)

WinMain and Dll's

I have a standard windows project I am working on and it works great as an exe. I would like to compile it as a DLL, but I'm not sure how to structure the begining of the main program. As it is now:

integer function WinMain( hInstance, hPrevInstance, lpCmdLine, nCmdShow )
!DEC$ attributes stdcall, alias: '_WinMain@16' :: WinMain
!DEC$ attributes stdcall, alias: 'WinMain' :: WinMain

dll call from excell/vba


Needing some help with excel/vba dll calls. I used the following declare sub and was not sure if the additional records being passed with the BSTR for a string need to be put into the @bytes number? Can someone tell me exactly what bytes number should be specified for this example?

Declare Sub dll_rout Lib "C:dll_rout.dll" _
Alias "_DLL_ROUT@12" (int_arg As Long, ByVal str_in As String, ByVal str_in_len As Long, ByVal str_out As String, ByVal Str_out_len As Long)

Reshape and memory allocation

This is mainly a question from Fortran development team, but you are more than welcome to contribute ...

I am workiing on an application dealing with huge matrices. For some reason, I have to use the reshape function to change the shape of the arrays. It is very critical that no allocation, reallocation of memory is taking place during reshape operation (because of speed considerations). My specific question is whether the Fortran implementation allocates and reallocates memory in order to reshape a matrix, or does it without.


I am running a Thread from my program but on compiling the following code I get some warning.

subroutine XXX
use dfmt
implicit none
integer hThread2,ThreadID3 ,NULL_SECURITY_ATTRIBUTES
hThread2=CreateThread(NULL_SECURITY_ATTRIBUTES,0, &
W_search_entry2, 0, 0, LOC(ThreadID3))

Warning: Variable NULL_SECURITY_ATTRIBUTES is used before its value has been defined:
hThread2=CreateThread(NULL_SECURITY_ATTRIBUTES,0, &

Can you help me,

Passing strings in C-Fortran mixed language programming

Is it possible to pass string arguments from a C calling program to a Fortran subroutine without adding the hidden length argument?

By reading the documentation it would seem that giving the REFERENCE attribute to the string argument, it should be possible, but I haven't been able to make it work.

I would appreciate any example of how this works.

regards, Marcello Cattaneo

VF and OPENGL to save bmp

My ultimate goal is to save the screen that I have created in VF using OpenGL to a bmp file. I have been trying to port the C++ code from the openGL superbible (pg. 260-263) to read and write a bmp from the screen. I have not had a lot of luck. I keep getting hung up in the differences in syntax and how they handle pointers. (my C++ experience is limited) I know I can save a bmp easily using QuickWIN, but I really want to stay away from that, because I will eventually be compiling this as a DLL.

Can I attach a remote process to the debugger?

I'm debugging a Fortran program for use on multiple computers, which involves multiple processes using MPI. When the processes are on the same computer, I can open up a new debugger & attach it to each (local) process. For a remote process I can also do this by opening a debugger on the remote host. Is there any way to attach the VF debugger to a remote process from my local computer, and if so what settings will I need ?
Thanks in advance for any light on this subject.

Black window after error

I have a Win32 application using an OpenGL based window.
Now it happens, when my program ends in an uncontrolled way (e.g. access violation), the next time I run the program the OpenGL window is complete black, while normally my window is white. (The program is executed via the menu the Visual Studio)
The only way I know to get a correct window is to restart Windows.
Can anyone tell me if there is a way to get the correct window without restarting Windows?


Iscriversi a Archived Visual Fortran (read-only)