Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

how to use pb load fortran's dll?

2 posts in Objects Last posting was on 2007-04-27 04:35:09.0Z
golyou Posted on 2007-04-27 03:22:17.0Z
From: "golyou" <golyou@yahoo.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: how to use pb load fortran's dll?
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 222.33.75.220
X-Original-NNTP-Posting-Host: 222.33.75.220
Message-ID: <46316c69@forums-1-dub>
Date: 26 Apr 2007 20:22:17 -0700
X-Trace: forums-1-dub 1177644137 222.33.75.220 (26 Apr 2007 20:22:17 -0700)
X-Original-Trace: 26 Apr 2007 20:22:17 -0700, 222.33.75.220
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9331
Article PK: 736492

hi,i was made a dll by fortran,and now,i define a string data type in pb
program ,and i want to tans this parameter to fortran's dll ,and same data
type is character in fortran ,when i excute it ,it all always report as
follow:

error:
"specified argument tyoe differs form required argument type at runtime in
dll function fuel_airpath(invalid stack pointer on return from function
call)"

in global external functions :
SUBROUTINE fuel_airpath(ref real s ,ref string p)library "fuel_airpath.dll"

in powerbuilder click event code:

"real s=10.0
string p
p="old"
fuel_airpath(s,p)
"

in fortran source code:
" subroutine fuel_airpath(s,P)

!MS$ATTRIBUTES DLLEXPORT::fuel_airpath
!MS$ATTRIBUTES ALIAS:'fuel_airpath'::fuel_airpath


implicit none
real*4 s
character*(5) P
s=1.5*s**2

P='good'
END SUBROUTINE
"

pls tell me what can i do? thanks a lot


Bruce Armstrong [TeamSybase] Posted on 2007-04-27 04:35:09.0Z
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: how to use pb load fortran's dll?
Organization: TeamSybase
Reply-To: NOCANSPAM_bruce.armstrong@teamsybase.com
Message-ID: <qav233pih9p76u0jr6vg8p3m8t658qjnag@4ax.com>
References: <46316c69@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 68-190-226-38.static.lsan.ca.charter.com
X-Original-NNTP-Posting-Host: 68-190-226-38.static.lsan.ca.charter.com
Date: 26 Apr 2007 21:35:09 -0700
X-Trace: forums-1-dub 1177648509 68.190.226.38 (26 Apr 2007 21:35:09 -0700)
X-Original-Trace: 26 Apr 2007 21:35:09 -0700, 68-190-226-38.static.lsan.ca.charter.com
Lines: 47
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9332
Article PK: 736489

In order for PB to use exported functions from a DLL, they have to be
exported in _STDCALL format. The error message indicates that the
fortran DLL doesn't have the functions exported in that format.

On 26 Apr 2007 20:22:17 -0700, "golyou" <golyou@yahoo.com> wrote:

>hi,i was made a dll by fortran,and now,i define a string data type in pb
>program ,and i want to tans this parameter to fortran's dll ,and same data
>type is character in fortran ,when i excute it ,it all always report as
>follow:
>
>error:
>"specified argument tyoe differs form required argument type at runtime in
>dll function fuel_airpath(invalid stack pointer on return from function
>call)"
>
>in global external functions :
>SUBROUTINE fuel_airpath(ref real s ,ref string p)library "fuel_airpath.dll"
>
>in powerbuilder click event code:
>
>"real s=10.0
>string p
>p="old"
>fuel_airpath(s,p)
>"
>
>in fortran source code:
> " subroutine fuel_airpath(s,P)
>
> !MS$ATTRIBUTES DLLEXPORT::fuel_airpath
> !MS$ATTRIBUTES ALIAS:'fuel_airpath'::fuel_airpath
>
>
> implicit none
> real*4 s
> character*(5) P
> s=1.5*s**2
>
> P='good'
> END SUBROUTINE
>"
>
>pls tell me what can i do? thanks a lot
>