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.

arrays of structures and dlls

2 posts in Objects Last posting was on 2002-08-23 06:03:57.0Z
txjump Posted on 2002-08-22 19:10:34.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: txjump
Date: Thu, 22 Aug 2002 15:10:34 -0400
Subject: arrays of structures and dlls
Lines: 19
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_6A08B731D1961CA70069566685256C1D.0069568E85256C1D@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.powerbuilder.objects:998
Article PK: 713563

Hi,

I am a C++ programmer trying to create a dll for a powerbuilder
application. im trying to test a dll function that returns an array of c++
structures. (the functions that return standard datatypes work fine.) the
sturcture is duplicated in powerbuilder but i dont know how to declare the
external function.

the c++ header declaration is
XC EXPORTS PairData* FAR API getPairData(char*, int &size);

does anyone know if i need to do anything special in the dll? and does
anyone know if i can even bring this array into powerbuilder? if so, how?
and what does the powerbuilder external function declaration look like? :)

any help/suggestions would be appreciated.

thanks,
stacey


Bruce Armstrong [TeamSybase] Posted on 2002-08-23 06:03:57.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
Organization: TeamSybase [66.214.149.29]
X-Newsreader: AspNNTP 1.50 (C I Host)
Subject: Re: arrays of structures and dlls
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Date: Fri, 23 Aug 2002 02:03:57 -0400
Lines: 47
NNTP-Posting-Host: 66.221.40.1
Message-ID: <364_iz3GermSCHA.183@forums.sybase.com>
References: <364_6A08B731D1961CA70069566685256C1D.0069568E85256C1D@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:996
Article PK: 713558

You have to use the standard calling sequence in your export of the function
you want to call. You then create a structure within PB that matches the
one you want to pass/return, and then declare the local external function call
to pass an array of that structure.

There are a number of technotes on the Sybase web site that go into some detail
on this including:

http://my.sybase.com/detail?id=44474

http://my.sybase.com/detail?id=47626

http://my.sybase.com/detail?id=44648

On Thu, 22 Aug 2002 15:10:34 -0400,
in powersoft.public.powerbuilder.objects

<txjump> wrote:
>Hi,
>
>I am a C++ programmer trying to create a dll for a powerbuilder
>application. im trying to test a dll function that returns an array of c++
>structures. (the functions that return standard datatypes work fine.) the
>sturcture is duplicated in powerbuilder but i dont know how to declare the
>external function.
>
>the c++ header declaration is
>XC EXPORTS PairData* FAR API getPairData(char*, int &size);
>
>does anyone know if i need to do anything special in the dll? and does
>anyone know if i can even bring this array into powerbuilder? if so, how?
>and what does the powerbuilder external function declaration look like? :)
>
>any help/suggestions would be appreciated.
>
>thanks,
>stacey

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

Not 1 - but 2 new books on developing with PowerBuilder
http://www.pb9books.com

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

NOTE: Please do NOT attempt to post to these newsgroups through news services
such as Google, as your messages will NOT appear on the server. Google is great
for searching, but if you want to use a web based newsreader to post, use the
one at my.sybase.com or
www.pfcguide.com.