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 call a Windows DLL in PK?

6 posts in Pocket PowerBuilder Last posting was on 2011-10-05 14:20:37.0Z
Chris Craft Posted on 2011-09-27 16:06:19.0Z
From: "Chris Craft" <NOChrisATfamoussoftwareDOTcom>
Newsgroups: sybase.public.pocketpowerbuilder
Subject: How to call a Windows DLL in PK?
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e81f47b$1@forums-1-dub>
Date: 27 Sep 2011 09:06:19 -0700
X-Trace: forums-1-dub 1317139579 10.22.241.152 (27 Sep 2011 09:06:19 -0700)
X-Original-Trace: 27 Sep 2011 09:06:19 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12482
Article PK: 262350

PK 2.5.2 Build 1273

I am trying to duplicate some functionality I have in a PowerBuilder
application on a Windows mobile handheld. There is a dll I created that I
need to use in the PK world. Is this possible?

Thanks,
Chris Craft


Chris Craft Posted on 2011-09-27 18:57:52.0Z
From: "Chris Craft" <NOChrisATfamoussoftwareDOTcom>
Newsgroups: sybase.public.pocketpowerbuilder
References: <4e81f47b$1@forums-1-dub>
Subject: Re: How to call a Windows DLL in PK?
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e821cb0$1@forums-1-dub>
Date: 27 Sep 2011 11:57:52 -0700
X-Trace: forums-1-dub 1317149872 10.22.241.152 (27 Sep 2011 11:57:52 -0700)
X-Original-Trace: 27 Sep 2011 11:57:52 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12483
Article PK: 262349

OK - I found a post by Reed and I think I got it going BUT I am haveing an
odd thing happening. I have a DW with a Compute. This compute has a global
function call which returns a string. The Global Function call makes the
call to the DLL. Here is the weird part - If I scroll the window the
compute value is changeing even though the data being passed in has not.
What is going on? Something with the Blob conversion?

Code
====
String lsCode
Blob lbbCode

lsCode = Space(10)
lbbCode = Blob(lsCode)

// Make call to DLL!
ComputeVoiceCode(Blob(as_GTIN), Blob(as_GS1Lot), Blob(as_GS1Date), lbbCode)

lsCode = FromANSI(lbbCode)

RETURN lsCode

"Chris Craft" <NOChrisATfamoussoftwareDOTcom> wrote in message
news:4e81f47b$1@forums-1-dub...
> PK 2.5.2 Build 1273
>
> I am trying to duplicate some functionality I have in a PowerBuilder
> application on a Windows mobile handheld. There is a dll I created that I
> need to use in the PK world. Is this possible?
>
> Thanks,
> Chris Craft
>


"Reed Shilts [Sybase]" Posted on 2011-09-30 14:17:26.0Z
From: "Reed Shilts [Sybase]" <reed dot shilts at sybase dot com>
Newsgroups: sybase.public.pocketpowerbuilder
Subject: Re: How to call a Windows DLL in PK?
Message-ID: <9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com>
References: <4e81f47b$1@forums-1-dub> <4e821cb0$1@forums-1-dub>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 30 Sep 2011 07:17:26 -0700
X-Trace: forums-1-dub 1317392246 10.22.241.152 (30 Sep 2011 07:17:26 -0700)
X-Original-Trace: 30 Sep 2011 07:17:26 -0700, vip152.sybase.com
Lines: 51
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12489
Article PK: 262356

I generally try to stick with simple types, like STRING and LONG.
Using BLOB may be confusing the DLL (well, the PB/PK layer
which calls the DLL).

Take a look at the Code Examples packaged with PK.
Especially the NetConnect, WM5_Notifications, and
even the kitchen sink "Reeds Tests".

HTH,
Reed Shilts
<Standard-Disclaimers-Apply/>

On 27 Sep 2011 11:57:52 -0700, "Chris Craft"

<NOChrisATfamoussoftwareDOTcom> wrote:

>OK - I found a post by Reed and I think I got it going BUT I am haveing an
>odd thing happening. I have a DW with a Compute. This compute has a global
>function call which returns a string. The Global Function call makes the
>call to the DLL. Here is the weird part - If I scroll the window the
>compute value is changeing even though the data being passed in has not.
>What is going on? Something with the Blob conversion?
>
>Code
>====
>String lsCode
>Blob lbbCode
>
>lsCode = Space(10)
>lbbCode = Blob(lsCode)
>
>// Make call to DLL!
>ComputeVoiceCode(Blob(as_GTIN), Blob(as_GS1Lot), Blob(as_GS1Date), lbbCode)
>
>lsCode = FromANSI(lbbCode)
>
>RETURN lsCode
>
>
>"Chris Craft" <NOChrisATfamoussoftwareDOTcom> wrote in message
>news:4e81f47b$1@forums-1-dub...
>> PK 2.5.2 Build 1273
>>
>> I am trying to duplicate some functionality I have in a PowerBuilder
>> application on a Windows mobile handheld. There is a dll I created that I
>> need to use in the PK world. Is this possible?
>>
>> Thanks,
>> Chris Craft
>>
>


Chris Craft Posted on 2011-10-03 19:50:22.0Z
From: "Chris Craft" <NOChrisATfamoussoftwareDOTcom>
Newsgroups: sybase.public.pocketpowerbuilder
References: <4e81f47b$1@forums-1-dub> <4e821cb0$1@forums-1-dub> <9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com>
Subject: Re: How to call a Windows DLL in PK?
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e8a11fe@forums-1-dub>
Date: 3 Oct 2011 12:50:22 -0700
X-Trace: forums-1-dub 1317671422 10.22.241.152 (3 Oct 2011 12:50:22 -0700)
X-Original-Trace: 3 Oct 2011 12:50:22 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12491
Article PK: 262357

Thanks Reed for the Reply.

I thought I am forced to use Blob if the DLL is not Unicode. Isn't PK all
unicode?

Chris Craft

"Reed Shilts [Sybase]" <reed dot shilts at sybase dot com> wrote in message
news:9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com...
>I generally try to stick with simple types, like STRING and LONG.
> Using BLOB may be confusing the DLL (well, the PB/PK layer
> which calls the DLL).
>
> Take a look at the Code Examples packaged with PK.
> Especially the NetConnect, WM5_Notifications, and
> even the kitchen sink "Reeds Tests".
>
> HTH,
> Reed Shilts
> <Standard-Disclaimers-Apply/>
>
> On 27 Sep 2011 11:57:52 -0700, "Chris Craft"
> <NOChrisATfamoussoftwareDOTcom> wrote:
>
>>OK - I found a post by Reed and I think I got it going BUT I am haveing an
>>odd thing happening. I have a DW with a Compute. This compute has a
>>global
>>function call which returns a string. The Global Function call makes the
>>call to the DLL. Here is the weird part - If I scroll the window the
>>compute value is changeing even though the data being passed in has not.
>>What is going on? Something with the Blob conversion?
>>
>>Code
>>====
>>String lsCode
>>Blob lbbCode
>>
>>lsCode = Space(10)
>>lbbCode = Blob(lsCode)
>>
>>// Make call to DLL!
>>ComputeVoiceCode(Blob(as_GTIN), Blob(as_GS1Lot), Blob(as_GS1Date),
>>lbbCode)
>>
>>lsCode = FromANSI(lbbCode)
>>
>>RETURN lsCode
>>
>>
>>"Chris Craft" <NOChrisATfamoussoftwareDOTcom> wrote in message
>>news:4e81f47b$1@forums-1-dub...
>>> PK 2.5.2 Build 1273
>>>
>>> I am trying to duplicate some functionality I have in a PowerBuilder
>>> application on a Windows mobile handheld. There is a dll I created that
>>> I
>>> need to use in the PK world. Is this possible?
>>>
>>> Thanks,
>>> Chris Craft
>>>
>>
>


Chris Pollach Posted on 2011-10-04 11:18:01.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.pocketpowerbuilder
References: <4e81f47b$1@forums-1-dub> <4e821cb0$1@forums-1-dub> <9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com> <4e8a11fe@forums-1-dub>
Subject: Re: How to call a Windows DLL in PK?
Lines: 82
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e8aeb69$1@forums-1-dub>
Date: 4 Oct 2011 04:18:01 -0700
X-Trace: forums-1-dub 1317727081 10.22.241.152 (4 Oct 2011 04:18:01 -0700)
X-Original-Trace: 4 Oct 2011 04:18:01 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12493
Article PK: 262360

Hi Chris;

Yes, PK was built from the PB 10.0 code base and thus fully Unicode from
day 1. :-)

--
Regards ... Chris
Blog: http://chrispollach.blogspot.com
PBDJ: http://chrispollach.sys-con.com
SourceForge: http://sourceforge.net/projects/stdfndclass

"Chris Craft" <NOChrisATfamoussoftwareDOTcom> wrote in message
news:4e8a11fe@forums-1-dub...
> Thanks Reed for the Reply.
>
> I thought I am forced to use Blob if the DLL is not Unicode. Isn't PK all
> unicode?
>
> Chris Craft
>
> "Reed Shilts [Sybase]" <reed dot shilts at sybase dot com> wrote in
> message news:9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com...
>>I generally try to stick with simple types, like STRING and LONG.
>> Using BLOB may be confusing the DLL (well, the PB/PK layer
>> which calls the DLL).
>>
>> Take a look at the Code Examples packaged with PK.
>> Especially the NetConnect, WM5_Notifications, and
>> even the kitchen sink "Reeds Tests".
>>
>> HTH,
>> Reed Shilts
>> <Standard-Disclaimers-Apply/>
>>
>> On 27 Sep 2011 11:57:52 -0700, "Chris Craft"
>> <NOChrisATfamoussoftwareDOTcom> wrote:
>>
>>>OK - I found a post by Reed and I think I got it going BUT I am haveing
>>>an
>>>odd thing happening. I have a DW with a Compute. This compute has a
>>>global
>>>function call which returns a string. The Global Function call makes the
>>>call to the DLL. Here is the weird part - If I scroll the window the
>>>compute value is changeing even though the data being passed in has not.
>>>What is going on? Something with the Blob conversion?
>>>
>>>Code
>>>====
>>>String lsCode
>>>Blob lbbCode
>>>
>>>lsCode = Space(10)
>>>lbbCode = Blob(lsCode)
>>>
>>>// Make call to DLL!
>>>ComputeVoiceCode(Blob(as_GTIN), Blob(as_GS1Lot), Blob(as_GS1Date),
>>>lbbCode)
>>>
>>>lsCode = FromANSI(lbbCode)
>>>
>>>RETURN lsCode
>>>
>>>
>>>"Chris Craft" <NOChrisATfamoussoftwareDOTcom> wrote in message
>>>news:4e81f47b$1@forums-1-dub...
>>>> PK 2.5.2 Build 1273
>>>>
>>>> I am trying to duplicate some functionality I have in a PowerBuilder
>>>> application on a Windows mobile handheld. There is a dll I created
>>>> that I
>>>> need to use in the PK world. Is this possible?
>>>>
>>>> Thanks,
>>>> Chris Craft
>>>>
>>>
>>
>
>


"Reed Shilts [Sybase]" Posted on 2011-10-05 14:20:37.0Z
From: "Reed Shilts [Sybase]" <reed dot shilts at sybase dot com>
Newsgroups: sybase.public.pocketpowerbuilder
Subject: Re: How to call a Windows DLL in PK?
Message-ID: <vipo87dbemlhu3kbgoqpkup6np3ol07b4l@4ax.com>
References: <4e81f47b$1@forums-1-dub> <4e821cb0$1@forums-1-dub> <9ljb8757ggn2lk6lrfj35b270bm59poiue@4ax.com> <4e8a11fe@forums-1-dub>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 5 Oct 2011 07:20:37 -0700
X-Trace: forums-1-dub 1317824437 10.22.241.152 (5 Oct 2011 07:20:37 -0700)
X-Original-Trace: 5 Oct 2011 07:20:37 -0700, vip152.sybase.com
Lines: 37
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.pocketpowerbuilder:12497
Article PK: 262362

This is where the fun comes in...
Yes - PK is totally Unicode (and does not
have the fancy ";ANSI" modifier we put
into PB...)

The fun is that the Blob type not a standard C data
type that you can use for marshalling (well, the
driver TRIES to marshal things, but that is fraught
with danger when using as an _input_ variable).

Using a pre-allocated STRING is always the safest,
but you're right - it is a lie (it's not Unicode).
Some dancing around with the FromAnsi and ToUnicode fixes
that all up.

I had to do stuff like that with the "NetConnect" sample in
the code examples - the NetBios API's are ANSI only...

HTH,
Reed Shilts
<Standard-Disclaimers-Apply/>

P.S.
My memory may be getting hazy - PK was TWO products ago...
++rls;


On 3 Oct 2011 12:50:22 -0700, "Chris Craft"

<NOChrisATfamoussoftwareDOTcom> wrote:

>Thanks Reed for the Reply.
>
>I thought I am forced to use Blob if the DLL is not Unicode. Isn't PK all
>unicode?
>
>Chris Craft