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.

Need Help calling JagGetUserName

2 posts in General Discussion (old) Last posting was on 2000-03-24 14:29:39.0Z
steve Posted on 2000-03-24 05:56:59.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 23 Mar 2000 21:56:59 -0800
From: steve <stevenwo@earthlink.net>
X-Mailer: Mozilla 4.61 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Need Help calling JagGetUserName
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 15
NNTP-Posting-Host: whv-ca3c-239.rasserver.net 204.32.168.239
Message-ID: <347_38DB03AA.9095CE73@earthlink.net>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25765
Article PK: 155814

Hello,
I am trying to call JagGetUserName() from PBD comonent. The
function is defined as:
JagStatus JAG_PUBLIC JagGetUserName(
SQLPOINTER userName,
SQLINTEGER userNameLen,
SQLINTEGER *returnLen)

I declare a local funciton as

protected function boolean JagGetUserName(REF userName, long
userNameLen, REF returnLen) LIBRARY "libjdispatch.dll"

it doesn't seem to work... how do you pass a pointer in pb? and how to
obtain mem address of a variable? thanks for assistance...

--Steve


Jim O'Neil [Sybase] Posted on 2000-03-24 14:29:39.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 24 Mar 2000 09:29:39 -0500
From: "Jim O'Neil [Sybase]" <joneil@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.7 [en]C-CCK-MCD (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Need Help calling JagGetUserName
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 31
NNTP-Posting-Host: joneil-nt.sybase.com 204.167.42.111
Message-ID: <347_38DB7BD3.DFD21152@sybase.com>
References: <347_38DB03AA.9095CE73@earthlink.net>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:25751
Article PK: 155800


steve wrote:

> Hello,
> I am trying to call JagGetUserName() from PBD comonent. The
> function is defined as:
> JagStatus JAG_PUBLIC JagGetUserName(
> SQLPOINTER userName,
> SQLINTEGER userNameLen,
> SQLINTEGER *returnLen)
>
> I declare a local funciton as
>
> protected function boolean JagGetUserName(REF userName, long
> userNameLen, REF returnLen) LIBRARY "libjdispatch.dll"
>
> it doesn't seem to work... how do you pass a pointer in pb? and how to
> obtain mem address of a variable? thanks for assistance...
>
> --Steve

That declaration seems fine. The *returnLen translates to the REF returnLen
argument in the function declaration. One thing you'll need to make sure
you do is allocate memory ahead of time for the userName parameter. For
instance, your PB code should look something like:

string ls_username
long ll_usernamelen
long ll_returnlen

ll_usernamelen = 255 // not sure what the max allowed here is, check the
doc and use that #
ls_username = Space(ll_usernamelen)
JagGetUserName(ls_username, ll_usernamelen + 1, ll_returnlen)

--
Jim O'Neil
Senior Technical Support Engineer
Sybase, Inc