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.

Calling PB COM object by ref

6 posts in Objects Last posting was on 2004-03-24 14:21:13.0Z
Yossie Steiner Posted on 2004-03-16 23:21:53.0Z
From: "Yossie Steiner" <steinyo@worldnet.att.net>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Calling PB COM object by ref
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: pool-68-237-38-55.ny325.east.verizon.net
X-Original-NNTP-Posting-Host: pool-68-237-38-55.ny325.east.verizon.net
Message-ID: <40578c11$1@forums-1-dub>
Date: 16 Mar 2004 15:21:53 -0800
X-Trace: forums-1-dub 1079479313 68.237.38.55 (16 Mar 2004 15:21:53 -0800)
X-Original-Trace: 16 Mar 2004 15:21:53 -0800, pool-68-237-38-55.ny325.east.verizon.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7825
Article PK: 735098

I have a PB9 COM object which needs to accept args by reference. When
calling from VB or VBA (in Excel) all is well. When calling from VBScript
(WSH or ASP) I get a type mismatch error. The problem is that MS wants the
called COM object's function to accept a variant type for ByRef calls. I
can't use "any" type in PB for COM so what can I do.

(More info: The PB9 COM object encapsulates SOAP calls and needs to pass
back data via args. I could rework things to manually marshal to and from
strings but the client inteface would become a lot more complex than I would
like it to be)


Paul Horan[TeamSybase] Posted on 2004-03-17 04:41:25.0Z
From: "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom>
Newsgroups: sybase.public.powerbuilder.objects
References: <40578c11$1@forums-1-dub>
Subject: Re: Calling PB COM object by ref
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: 67-23-182-204.bflony.adelphia.net
Message-ID: <4057d6f2$1@forums-2-dub>
X-Original-Trace: 16 Mar 2004 20:41:22 -0800, 67-23-182-204.bflony.adelphia.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Mar 2004 20:41:23 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Mar 2004 20:41:25 -0800
X-Trace: forums-1-dub 1079498485 10.22.108.75 (16 Mar 2004 20:41:25 -0800)
X-Original-Trace: 16 Mar 2004 20:41:25 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7826
Article PK: 735099

My PB9 COM object takes arguments by reference (simple string variables) just fine...

It sounds like our objects perform a similar function - the caller instantiates a string variable, and passes it to my
COM object by reference. I generate XML and store it in the reference argument, then return a success/failure error
code. I have a VB, a Delphi, and a PowerBuilder app calling this COM object without issue.

--
Paul Horan[TeamSybase]

"Yossie Steiner" <steinyo@worldnet.att.net> wrote in message news:40578c11$1@forums-1-dub...
> I have a PB9 COM object which needs to accept args by reference. When
> calling from VB or VBA (in Excel) all is well. When calling from VBScript
> (WSH or ASP) I get a type mismatch error. The problem is that MS wants the
> called COM object's function to accept a variant type for ByRef calls. I
> can't use "any" type in PB for COM so what can I do.
>
> (More info: The PB9 COM object encapsulates SOAP calls and needs to pass
> back data via args. I could rework things to manually marshal to and from
> strings but the client inteface would become a lot more complex than I would
> like it to be)
>
>


Yossie Steiner Posted on 2004-03-22 18:26:11.0Z
From: "Yossie Steiner" <steinyo@worldnet.att.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <40578c11$1@forums-1-dub> <4057d6f2$1@forums-2-dub>
Subject: Re: Calling PB COM object by ref
Lines: 70
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: pool-68-237-92-230.ny325.east.verizon.net
X-Original-NNTP-Posting-Host: pool-68-237-92-230.ny325.east.verizon.net
Message-ID: <405f2fc3@forums-1-dub>
Date: 22 Mar 2004 10:26:11 -0800
X-Trace: forums-1-dub 1079979971 68.237.92.230 (22 Mar 2004 10:26:11 -0800)
X-Original-Trace: 22 Mar 2004 10:26:11 -0800, pool-68-237-92-230.ny325.east.verizon.net
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7830
Article PK: 735103

The issue is only relevant to WSH and ASP. See Everything work fine from VB
or VBA or PB itself. The problem is "by design" behavior of VBScript. The
behavior is that ALL byRef calls made from VBS require the called object's
method to define the args as VARIANT
http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;Q197957 .

I have coded a wrapper object in VB to accept the byref args as variants
from VBS. The obvious problem is that as I don't want to create stubs for
all such methods in my PB COM object.

Since MS is not going to change this behavior I am lookig for a native PB
solution or a generic VB (or C/C++ dll) approach. There is a thread on
.ole-ocx-activex (title: Variant Type, author:Thomas Jäckel, Date:
02/02/2000) where Sybase suggests (3rd reply):

>>Here's a novel idea -- create a nice wrapper DLL and an NVO to encapsulate
>> the calls to the DLL -- make it as generic as possible and share it with
the
>> visitors of this forum -- you'll be forever remembered as the "person who
>> gave VARIANT support to PowerBuilder".

>> Good luck,

Has anyone done something along these lines? I would be willing to code
multiple signatures of my PB objects methods but this is not the problem.
VBScripts "wants" to pass a Variant byRef, I don't thinks it is a
convertion/coertion issue. The solution would be for the PB object to accept
ans Any type byRef. Since it is a COM/MTS object, this is not allowed. Any
suggestions would be most appreciated.

P.S. Sorry for the cross-posts. I'll keep the thread here.


"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:4057d6f2$1@forums-2-dub...
> My PB9 COM object takes arguments by reference (simple string variables)
just fine...
>
> It sounds like our objects perform a similar function - the caller
instantiates a string variable, and passes it to my
> COM object by reference. I generate XML and store it in the reference
argument, then return a success/failure error
> code. I have a VB, a Delphi, and a PowerBuilder app calling this COM
object without issue.
>
> --
> Paul Horan[TeamSybase]
>
> "Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
news:40578c11$1@forums-1-dub...
> > I have a PB9 COM object which needs to accept args by reference. When
> > calling from VB or VBA (in Excel) all is well. When calling from
VBScript
> > (WSH or ASP) I get a type mismatch error. The problem is that MS wants
the
> > called COM object's function to accept a variant type for ByRef calls. I
> > can't use "any" type in PB for COM so what can I do.
> >
> > (More info: The PB9 COM object encapsulates SOAP calls and needs to pass
> > back data via args. I could rework things to manually marshal to and
from
> > strings but the client inteface would become a lot more complex than I
would
> > like it to be)
> >
> >
>
>


"Tim Wallace" <reply Posted on 2004-03-22 19:28:42.0Z
From: "Tim Wallace" <reply@this_group.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <40578c11$1@forums-1-dub> <4057d6f2$1@forums-2-dub> <405f2fc3@forums-1-dub>
Subject: Re: Calling PB COM object by ref
Lines: 87
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: mail.pit-magnus.com
X-Original-NNTP-Posting-Host: mail.pit-magnus.com
Message-ID: <405f3e6a$1@forums-1-dub>
Date: 22 Mar 2004 11:28:42 -0800
X-Trace: forums-1-dub 1079983722 206.139.208.13 (22 Mar 2004 11:28:42 -0800)
X-Original-Trace: 22 Mar 2004 11:28:42 -0800, mail.pit-magnus.com
X-Authenticated-User: pbtenbeta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7831
Article PK: 735104

We have a PB COM object that works perfectly well with functions defined as
taking byref string arguments. Have you checked the "Reference Arguments as
Variants" checkbox on the Objects tab of the COM generator property window?

Tim Wallace

"Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
news:405f2fc3@forums-1-dub...
> The issue is only relevant to WSH and ASP. See Everything work fine from
VB
> or VBA or PB itself. The problem is "by design" behavior of VBScript. The
> behavior is that ALL byRef calls made from VBS require the called object's
> method to define the args as VARIANT
> http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;Q197957 .
>
> I have coded a wrapper object in VB to accept the byref args as variants
> from VBS. The obvious problem is that as I don't want to create stubs for
> all such methods in my PB COM object.
>
> Since MS is not going to change this behavior I am lookig for a native PB
> solution or a generic VB (or C/C++ dll) approach. There is a thread on
> .ole-ocx-activex (title: Variant Type, author:Thomas Jäckel, Date:
> 02/02/2000) where Sybase suggests (3rd reply):
>
> >>Here's a novel idea -- create a nice wrapper DLL and an NVO to
encapsulate
> >> the calls to the DLL -- make it as generic as possible and share it
with
> the
> >> visitors of this forum -- you'll be forever remembered as the "person
who
> >> gave VARIANT support to PowerBuilder".
>
> >> Good luck,
>
> Has anyone done something along these lines? I would be willing to code
> multiple signatures of my PB objects methods but this is not the problem.
> VBScripts "wants" to pass a Variant byRef, I don't thinks it is a
> convertion/coertion issue. The solution would be for the PB object to
accept
> ans Any type byRef. Since it is a COM/MTS object, this is not allowed. Any
> suggestions would be most appreciated.
>
> P.S. Sorry for the cross-posts. I'll keep the thread here.
>
>
> "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
> news:4057d6f2$1@forums-2-dub...
> > My PB9 COM object takes arguments by reference (simple string variables)
> just fine...
> >
> > It sounds like our objects perform a similar function - the caller
> instantiates a string variable, and passes it to my
> > COM object by reference. I generate XML and store it in the reference
> argument, then return a success/failure error
> > code. I have a VB, a Delphi, and a PowerBuilder app calling this COM
> object without issue.
> >
> > --
> > Paul Horan[TeamSybase]
> >
> > "Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
> news:40578c11$1@forums-1-dub...
> > > I have a PB9 COM object which needs to accept args by reference. When
> > > calling from VB or VBA (in Excel) all is well. When calling from
> VBScript
> > > (WSH or ASP) I get a type mismatch error. The problem is that MS wants
> the
> > > called COM object's function to accept a variant type for ByRef calls.
I
> > > can't use "any" type in PB for COM so what can I do.
> > >
> > > (More info: The PB9 COM object encapsulates SOAP calls and needs to
pass
> > > back data via args. I could rework things to manually marshal to and
> from
> > > strings but the client inteface would become a lot more complex than I
> would
> > > like it to be)
> > >
> > >
> >
> >
>
>


Yossie Steiner Posted on 2004-03-24 14:21:13.0Z
From: "Yossie Steiner" <steinyo@worldnet.att.net>
Newsgroups: sybase.public.powerbuilder.objects
References: <40578c11$1@forums-1-dub> <4057d6f2$1@forums-2-dub> <405f2fc3@forums-1-dub> <405f3e6a$1@forums-1-dub>
Subject: Re: Calling PB COM object by ref
Lines: 115
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: pool-68-237-47-38.ny325.east.verizon.net
Message-ID: <40619950$1@forums-2-dub>
X-Original-Trace: 24 Mar 2004 06:21:04 -0800, pool-68-237-47-38.ny325.east.verizon.net
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 Mar 2004 06:21:10 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 Mar 2004 06:21:13 -0800
X-Trace: forums-1-dub 1080138073 10.22.108.75 (24 Mar 2004 06:21:13 -0800)
X-Original-Trace: 24 Mar 2004 06:21:13 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7839
Article PK: 735112

The "Reference Arguements as Variants" checkbox was what I was missing.
Everything is fine now. The help file on the property window explains that
this is needed for ASP.(Doh!)

BTW: I couldn't find any reference to this issue in the PB or Compile HTML
help.

Thanks.

"Tim Wallace" <reply@this_group.com> wrote in message
news:405f3e6a$1@forums-1-dub...
> We have a PB COM object that works perfectly well with functions defined
as
> taking byref string arguments. Have you checked the "Reference Arguments
as
> Variants" checkbox on the Objects tab of the COM generator property
window?
>
> Tim Wallace
>
> "Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
> news:405f2fc3@forums-1-dub...
> > The issue is only relevant to WSH and ASP. See Everything work fine from
> VB
> > or VBA or PB itself. The problem is "by design" behavior of VBScript.
The
> > behavior is that ALL byRef calls made from VBS require the called
object's
> > method to define the args as VARIANT
> > http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;Q197957 .
> >
> > I have coded a wrapper object in VB to accept the byref args as variants
> > from VBS. The obvious problem is that as I don't want to create stubs
for
> > all such methods in my PB COM object.
> >
> > Since MS is not going to change this behavior I am lookig for a native
PB
> > solution or a generic VB (or C/C++ dll) approach. There is a thread on
> > .ole-ocx-activex (title: Variant Type, author:Thomas Jäckel, Date:
> > 02/02/2000) where Sybase suggests (3rd reply):
> >
> > >>Here's a novel idea -- create a nice wrapper DLL and an NVO to
> encapsulate
> > >> the calls to the DLL -- make it as generic as possible and share it
> with
> > the
> > >> visitors of this forum -- you'll be forever remembered as the "person
> who
> > >> gave VARIANT support to PowerBuilder".
> >
> > >> Good luck,
> >
> > Has anyone done something along these lines? I would be willing to code
> > multiple signatures of my PB objects methods but this is not the
problem.
> > VBScripts "wants" to pass a Variant byRef, I don't thinks it is a
> > convertion/coertion issue. The solution would be for the PB object to
> accept
> > ans Any type byRef. Since it is a COM/MTS object, this is not allowed.
Any
> > suggestions would be most appreciated.
> >
> > P.S. Sorry for the cross-posts. I'll keep the thread here.
> >
> >
> > "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
> > news:4057d6f2$1@forums-2-dub...
> > > My PB9 COM object takes arguments by reference (simple string
variables)
> > just fine...
> > >
> > > It sounds like our objects perform a similar function - the caller
> > instantiates a string variable, and passes it to my
> > > COM object by reference. I generate XML and store it in the reference
> > argument, then return a success/failure error
> > > code. I have a VB, a Delphi, and a PowerBuilder app calling this COM
> > object without issue.
> > >
> > > --
> > > Paul Horan[TeamSybase]
> > >
> > > "Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
> > news:40578c11$1@forums-1-dub...
> > > > I have a PB9 COM object which needs to accept args by reference.
When
> > > > calling from VB or VBA (in Excel) all is well. When calling from
> > VBScript
> > > > (WSH or ASP) I get a type mismatch error. The problem is that MS
wants
> > the
> > > > called COM object's function to accept a variant type for ByRef
calls.
> I
> > > > can't use "any" type in PB for COM so what can I do.
> > > >
> > > > (More info: The PB9 COM object encapsulates SOAP calls and needs to
> pass
> > > > back data via args. I could rework things to manually marshal to and
> > from
> > > > strings but the client inteface would become a lot more complex than
I
> > would
> > > > like it to be)
> > > >
> > > >
> > >
> > >
> >
> >
>
>


"Tim Wallace" <reply Posted on 2004-03-18 17:20:55.0Z
From: "Tim Wallace" <reply@this_group.com>
Newsgroups: sybase.public.powerbuilder.objects
References: <40578c11$1@forums-1-dub>
Subject: Re: Calling PB COM object by ref
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: mail.pit-magnus.com
Message-ID: <4059da74@forums-2-dub>
X-Original-Trace: 18 Mar 2004 09:20:52 -0800, mail.pit-magnus.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 18 Mar 2004 09:20:53 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 18 Mar 2004 09:20:55 -0800
X-Trace: forums-1-dub 1079630455 10.22.108.75 (18 Mar 2004 09:20:55 -0800)
X-Original-Trace: 18 Mar 2004 09:20:55 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:7829
Article PK: 735102

Show us your PB-side signatures and your client-side calls.

Tim Wallace

"Yossie Steiner" <steinyo@worldnet.att.net> wrote in message
news:40578c11$1@forums-1-dub...
> I have a PB9 COM object which needs to accept args by reference. When
> calling from VB or VBA (in Excel) all is well. When calling from VBScript
> (WSH or ASP) I get a type mismatch error. The problem is that MS wants the
> called COM object's function to accept a variant type for ByRef calls. I
> can't use "any" type in PB for COM so what can I do.
>
> (More info: The PB9 COM object encapsulates SOAP calls and needs to pass
> back data via args. I could rework things to manually marshal to and from
> strings but the client inteface would become a lot more complex than I
would
> like it to be)
>
>