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.

.Net Windows Control Library

7 posts in Objects Last posting was on 2002-12-19 16:41:28.0Z
Murphy Posted on 2002-12-13 17:44:52.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Murphy
Date: Fri, 13 Dec 2002 12:44:52 -0500
Subject: .Net Windows Control Library
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@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:695
Article PK: 713263

I created a Windows Control Library in C#, but I can't seem to import it
into PB.

My Code is such:
int left
int right
int li_rc
oleObject calc

left = Integer(sle_1.Text)
right = Integer(sle_2.Text)

calc = Create OLEObject
li_rc =
calc.ConnectToObject("C:\D_Drive\experiment\testing.dll","testing.testing")
Messagebox("Test",String(li_rc))
//st_1.Text = String(calc.Add(left,right))

Destroy calc

I keep receiving Class Name not found. So I created a C# Windows
application and no trouble using the DLL.

Any help would be great,
Thanks
Murphy


Roy Kiesler [TeamSybase] Posted on 2002-12-14 00:31:35.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
Subject: Re: .Net Windows Control Library
Date: Fri, 13 Dec 2002 19:31:35 -0500
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: pool-141-154-72-130.bos.east.verizon.net 141.154.72.130
Message-ID: <364_2Up7RqwoCHA.155@forums.sybase.com>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:693
Article PK: 713261

PB does not support .NET controls.

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
Sybase Developer Network (SDN) -- http://sdn.sybase.com

<Murphy> wrote in message
news:F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums...
> I created a Windows Control Library in C#, but I can't seem to import it
> into PB.
>
> My Code is such:
> int left
> int right
> int li_rc
> oleObject calc
>
> left = Integer(sle_1.Text)
> right = Integer(sle_2.Text)
>
> calc = Create OLEObject
> li_rc =
>
calc.ConnectToObject("C:\D_Drive\experiment\testing.dll","testing.testing")
> Messagebox("Test",String(li_rc))
> //st_1.Text = String(calc.Add(left,right))
>
> Destroy calc
>
> I keep receiving Class Name not found. So I created a C# Windows
> application and no trouble using the DLL.
>
> Any help would be great,
> Thanks
> Murphy


Murphy Posted on 2002-12-16 03:40:08.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Murphy
Date: Sun, 15 Dec 2002 22:40:08 -0500
Subject: Re: .Net Windows Control Library
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_558031CF7D7533410014273E85256C91.0006AEDF85256C8F@webforums>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums> <364_2Up7RqwoCHA.155@forums.sybase.com>
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:691
Article PK: 713258

Not even if I use the .NET TlbExp program? This generates a Type Library
which is supposed to be able to be used by VB 6. Will this still not work
in PB?


Murphy Posted on 2002-12-16 21:06:33.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Murphy
Date: Mon, 16 Dec 2002 16:06:33 -0500
Subject: Re: .Net Windows Control Library
Lines: 6
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_CE70DB1AE177F2420073F4E485256C91.0014C80E85256C91@webforums>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums> <364_2Up7RqwoCHA.155@forums.sybase.com> <364_558031CF7D7533410014273E85256C91.0006AEDF85256C8F@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:685
Article PK: 713251

Yes, I got it to work this morning...beautiful.

I had to do some .NET Tricks, but it works in PB 7.03.

Thanks,
Murphy


Roy Kiesler [TeamSybase] Posted on 2002-12-16 23:15:35.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
Subject: Re: .Net Windows Control Library
Date: Mon, 16 Dec 2002 18:15:35 -0500
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: p71.n-nypop05.stsn.com 199.106.92.71
Message-ID: <364_v7536tVpCHA.155@forums.sybase.com>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums> <364_2Up7RqwoCHA.155@forums.sybase.com> <364_558031CF7D7533410014273E85256C91.0006AEDF85256C8F@webforums> <364_CE70DB1AE177F2420073F4E485256C91.0014C80E85256C91@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:684
Article PK: 713250

How 'bout a code sample of those .NET tricks?

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
Sybase Developer Network (SDN) -- http://sdn.sybase.com

<Murphy> wrote in message
news:CE70DB1AE177F2420073F4E485256C91.0014C80E85256C91@webforums...
> Yes, I got it to work this morning...beautiful.
>
> I had to do some .NET Tricks, but it works in PB 7.03.
>
> Thanks,
> Murphy


Murphy Posted on 2002-12-17 16:59:44.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: Murphy
Date: Tue, 17 Dec 2002 11:59:44 -0500
Subject: Re: .Net Windows Control Library
Lines: 38
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <364_FBB2AABEB8A6DFFD005D5C2F85256C92.0083A6E685256C91@webforums>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums> <364_2Up7RqwoCHA.155@forums.sybase.com> <364_558031CF7D7533410014273E85256C91.0006AEDF85256C8F@webforums> <364_CE70DB1AE177F2420073F4E485256C91.0014C80E85256C91@webforums> <364_v7536tVpCHA.155@forums.sybase.com>
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:681
Article PK: 713249

Sure.

Here is my PB Code:
int left
int right

calc = Create OLEObject
li_rc = calc.ConnectToNewObject("MyCalc.Calculator")

left = Integer(sle_1.Text)
right = Integer(sle_2.Text)

st_1.Text = String(calc.Add(left,right))

Destroy calc

For the .NET stuff.
You have to create a Strong Name by (at the VS .NET Command Prompt):
sn -k test.key

Then you have to add the test.key into your AssemblyKeyFile in your
Assembly*.cs. It will look something like this:
[assembly: AssemblyKeyFile("test.key")]

After that, either drag and drop the DLL into your %SystemRoot%\assembly
dir, or at the VS .NET CP run:
gacutil /i MyDLL.dll

and finally:
Regasm MyDLL.dll

You can check your Registry and verify it got registered correctly.

Some things I have not tested are:
If I cut an EXE out of PB, can a computer run it? Or do they need the .NET
Framework? I am pretty sure they will need the .NET Framework to be
installed. They will definitely need the dll copied over and registered on
their computer. That can be accomplished by using a script though.


Roy Kiesler [TeamSybase] Posted on 2002-12-19 16:41:28.0Z
Newsgroups: sybase.public.powerbuilder.objects
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
Subject: Re: .Net Windows Control Library
Date: Thu, 19 Dec 2002 11:41:28 -0500
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: host131.percussion.com 208.252.62.131
Message-ID: <364_o7ekz$3pCHA.198@forums.sybase.com>
References: <364_F3A33DF9F844633F00617DC685256C8E.00617E0585256C8E@webforums> <364_2Up7RqwoCHA.155@forums.sybase.com> <364_558031CF7D7533410014273E85256C91.0006AEDF85256C8F@webforums> <364_CE70DB1AE177F2420073F4E485256C91.0014C80E85256C91@webforums> <364_v7536tVpCHA.155@forums.sybase.com> <364_FBB2AABEB8A6DFFD005D5C2F85256C92.0083A6E685256C91@webforums>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.objects:675
Article PK: 713241

It would be nice if you can package this example with both the PB and .NET
code and send it to SDN. If you would like, I can also post your package in
the downloads section of the teamsybase.com Web site. Send me and e-mail if
interested.

They will need the .NET framework.Microsoft has a redistributable version
you can incorporate into your setup program.

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
Sybase Developer Network (SDN) -- http://sdn.sybase.com

<Murphy> wrote in message
news:FBB2AABEB8A6DFFD005D5C2F85256C92.0083A6E685256C91@webforums...
> Sure.
>
> Here is my PB Code:
> int left
> int right
>
> calc = Create OLEObject
> li_rc = calc.ConnectToNewObject("MyCalc.Calculator")
>
> left = Integer(sle_1.Text)
> right = Integer(sle_2.Text)
>
> st_1.Text = String(calc.Add(left,right))
>
> Destroy calc
>
> For the .NET stuff.
> You have to create a Strong Name by (at the VS .NET Command Prompt):
> sn -k test.key
>
> Then you have to add the test.key into your AssemblyKeyFile in your
> Assembly*.cs. It will look something like this:
> [assembly: AssemblyKeyFile("test.key")]
>
> After that, either drag and drop the DLL into your %SystemRoot%\assembly
> dir, or at the VS .NET CP run:
> gacutil /i MyDLL.dll
>
> and finally:
> Regasm MyDLL.dll
>
> You can check your Registry and verify it got registered correctly.
>
> Some things I have not tested are:
> If I cut an EXE out of PB, can a computer run it? Or do they need the .NET
> Framework? I am pretty sure they will need the .NET Framework to be
> installed. They will definitely need the dll copied over and registered on
> their computer. That can be accomplished by using a script though.