calling a dll fortran with wxwindows
From: rom (mrom34_at_wanadoo.fr)
Date: 04/29/04
- Next message: Roger Williams: "Re: Fortran memory allocation (stack/heap) issues"
- Previous message: marc mestres: "Re: Dirichlet Tesselation subroutines"
- Next in thread: Jugoslav Dujic: "Re: calling a dll fortran with wxwindows"
- Reply: Jugoslav Dujic: "Re: calling a dll fortran with wxwindows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Apr 2004 02:38:56 -0700
Hi,
I use wxwindows for my application. I need to call a dll in fortran
but I have problem with stings.
My dll has a simple subroutine witch accept :
i (long)
r (real, 4 octets)
d (double précision)
str (string, 128 octets)
It returns a file 'dlltest.out' with the values of i,r,d and str.
I use this code im my program to load the dll:
wxDllType mydll=wxDllLoader::LoadLibrary("test.dll");
typedef void (*inti)(long*,float*,double*,char *,int);
inti pint;
pint = (inti) wxDllLoader::GetSymbol(mydll,"DLLTEST");
long a;
a=12;
float b;
b=123;
double c;
c=1234;
char st[13];
strcpy(st,"Testing...");
pint(&a,&b,&c,st,13);
wxDllLoader::UnloadLibrary(mydll);}
It creates a file 'dlltest.out'. Its ok for a,b and c, but it write st
with many bad characters after "Testing...". I thinks its a problem of
lengh but I don't know how to solve it.
thanks
- Next message: Roger Williams: "Re: Fortran memory allocation (stack/heap) issues"
- Previous message: marc mestres: "Re: Dirichlet Tesselation subroutines"
- Next in thread: Jugoslav Dujic: "Re: calling a dll fortran with wxwindows"
- Reply: Jugoslav Dujic: "Re: calling a dll fortran with wxwindows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|