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.

Loading .NET objects

17 posts in Objects Last posting was on 2005-02-04 22:53:55.0Z
Moises Mescua Posted on 2005-01-17 02:41:10.0Z
Sender: 5e0a.41eb1e2d.1804289383@sybase.com
From: Moises Mescua
Newsgroups: sybase.public.powerbuilder.objects
Subject: Loading .NET objects
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41eb25c5.5e4f.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Jan 2005 18:41:10 -0800
X-Trace: forums-1-dub 1105929670 10.22.241.41 (16 Jan 2005 18:41:10 -0800)
X-Original-Trace: 16 Jan 2005 18:41:10 -0800, 10.22.241.41
Lines: 102
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8180
Article PK: 735449

Hi Everybody,

Please, I want to use an object called NCCTPowerClnt.dll
made in .NET, I am using PB 9.0 with the script following:
//
int result
OLEobject myobject
myobject = create OLEobject
result =
myobject.ConnectToNewObject("NCCTPowerClnt.SessionManager")
MessageBox("result", result)

I have gotten a result=-2 (Class name not found)


The Disassembler the NCCTPowerClnt.dll object is:

****************************************************
"Assembly NCCTPowerClnt, Version 1.0.1839.17150

<assembly: AssemblyVersion("1.0.1839.17150")>
<assembly: AssemblyTrademark("")>
<assembly: Debuggable(True, True)>
<assembly: Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
<assembly: CLSCompliant(True)>
<assembly: AssemblyProduct("")>
<assembly: AssemblyCopyright("")>
<assembly: AssemblyCompany("")>
<assembly: AssemblyDescription("")>
<assembly: AssemblyTitle("")>

***************************************************

Namespace NCCTPowerClnt.Nortel.Session
Public Class SessionManager
Implements IDisposable

' Events
Public Event ConnectEvent As
ConnectEventEventHandler
Public Event DisconnectEvent As
DisconnectEventEventHandler

' Methods
Public Sub New()
Public Function Connect() As Object
Public Sub Disconnect()
Public Overridable Sub Dispose() Implements
IDisposable.Dispose
Private Sub OnCCTDebugEvent(ByVal sender As
Object, ByVal debugmsg As String)
Private Sub OnDisconnectEvent(ByVal e As
SessionDisconnectedEventArgs)

' Properties
Public ReadOnly Property Addresses As IAddress()
Public Property Credentials As CCTCredentials
Public ReadOnly Property IsConnected As Boolean
Public ReadOnly Property RoutePointAddresses As
IRoutePointAddress()
Public Property Security As CCTSecurityLevel
Public Property Server As ServerSettings
Public ReadOnly Property ServerConnection As
Toolkit
Public ReadOnly Property Session As ISession
Public ReadOnly Property Terminals As
ITerminal()

' Fields
Private _myNormalAddresses As IAddress()
Private _myRouteAddresses As
IRoutePointAddress()
Private ConnectEventEvent As
ConnectEventEventHandler
Private DisconnectEventEvent As
DisconnectEventEventHandler
Private m_curServer As ServerSettings
Private m_DisconnectHandler As
SessionDisconnectedEventHandler
Private m_disposed As Boolean
Private m_mySession As ISession
Private m_myTerminals As ITerminal()
Private m_myToolkit As Toolkit
Private Const MAXADDR As Integer = 2
Private Const MAXTERM As Integer = 5

' Nested Types
Public Delegate Sub ConnectEventEventHandler()

Public Delegate Sub
DisconnectEventEventHandler(ByVal e As EventArgs)
End Class
End Namespace

*******************************************************

Please, Could you help me?

Thank you for any help,


Moises


"Davy De Permentier" <no_spam Posted on 2005-01-17 07:58:10.0Z
From: "Davy De Permentier" <no_spam@my_e_mail>
Newsgroups: sybase.public.powerbuilder.objects
References: <41eb25c5.5e4f.1681692777@sybase.com>
Subject: Re: Loading .NET objects
Lines: 112
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: 194.78.25.49
Message-ID: <41eb700e$4@forums-2-dub>
X-Original-Trace: 16 Jan 2005 23:58:06 -0800, 194.78.25.49
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Jan 2005 23:58:07 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Jan 2005 23:58:10 -0800
X-Trace: forums-1-dub 1105948690 10.22.108.75 (16 Jan 2005 23:58:10 -0800)
X-Original-Trace: 16 Jan 2005 23:58:10 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8181
Article PK: 735445

Hey,

Is the DLL registered under windows?

HTH,
Davy

<Moises Mescua> wrote in message news:41eb25c5.5e4f.1681692777@sybase.com...
> Hi Everybody,
>
> Please, I want to use an object called NCCTPowerClnt.dll
> made in .NET, I am using PB 9.0 with the script following:
> //
> int result
> OLEobject myobject
> myobject = create OLEobject
> result =
> myobject.ConnectToNewObject("NCCTPowerClnt.SessionManager")
> MessageBox("result", result)
>
> I have gotten a result=-2 (Class name not found)
>
>
> The Disassembler the NCCTPowerClnt.dll object is:
>
> ****************************************************
> "Assembly NCCTPowerClnt, Version 1.0.1839.17150
>
> <assembly: AssemblyVersion("1.0.1839.17150")>
> <assembly: AssemblyTrademark("")>
> <assembly: Debuggable(True, True)>
> <assembly: Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
> <assembly: CLSCompliant(True)>
> <assembly: AssemblyProduct("")>
> <assembly: AssemblyCopyright("")>
> <assembly: AssemblyCompany("")>
> <assembly: AssemblyDescription("")>
> <assembly: AssemblyTitle("")>
>
> ***************************************************
>
> Namespace NCCTPowerClnt.Nortel.Session
> Public Class SessionManager
> Implements IDisposable
>
> ' Events
> Public Event ConnectEvent As
> ConnectEventEventHandler
> Public Event DisconnectEvent As
> DisconnectEventEventHandler
>
> ' Methods
> Public Sub New()
> Public Function Connect() As Object
> Public Sub Disconnect()
> Public Overridable Sub Dispose() Implements
> IDisposable.Dispose
> Private Sub OnCCTDebugEvent(ByVal sender As
> Object, ByVal debugmsg As String)
> Private Sub OnDisconnectEvent(ByVal e As
> SessionDisconnectedEventArgs)
>
> ' Properties
> Public ReadOnly Property Addresses As IAddress()
> Public Property Credentials As CCTCredentials
> Public ReadOnly Property IsConnected As Boolean
> Public ReadOnly Property RoutePointAddresses As
> IRoutePointAddress()
> Public Property Security As CCTSecurityLevel
> Public Property Server As ServerSettings
> Public ReadOnly Property ServerConnection As
> Toolkit
> Public ReadOnly Property Session As ISession
> Public ReadOnly Property Terminals As
> ITerminal()
>
> ' Fields
> Private _myNormalAddresses As IAddress()
> Private _myRouteAddresses As
> IRoutePointAddress()
> Private ConnectEventEvent As
> ConnectEventEventHandler
> Private DisconnectEventEvent As
> DisconnectEventEventHandler
> Private m_curServer As ServerSettings
> Private m_DisconnectHandler As
> SessionDisconnectedEventHandler
> Private m_disposed As Boolean
> Private m_mySession As ISession
> Private m_myTerminals As ITerminal()
> Private m_myToolkit As Toolkit
> Private Const MAXADDR As Integer = 2
> Private Const MAXTERM As Integer = 5
>
> ' Nested Types
> Public Delegate Sub ConnectEventEventHandler()
>
> Public Delegate Sub
> DisconnectEventEventHandler(ByVal e As EventArgs)
> End Class
> End Namespace
>
> *******************************************************
>
> Please, Could you help me?
>
> Thank you for any help,
>
>
> Moises


Moises Mescua Posted on 2005-01-17 18:09:18.0Z
Sender: 67c4.41ebfc18.1804289383@sybase.com
From: Moises Mescua
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Loading .NET objects
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41ebff4e.67e2.1681692777@sybase.com>
References: <41eb700e$4@forums-2-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Jan 2005 10:09:18 -0800
X-Trace: forums-1-dub 1105985358 10.22.241.41 (17 Jan 2005 10:09:18 -0800)
X-Original-Trace: 17 Jan 2005 10:09:18 -0800, 10.22.241.41
Lines: 124
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8182
Article PK: 735448

The DLLs files was loaded in the same directory of the
application.
I tried to registered with the command regsvr32, but showed
a message: "I was loaded, but Dll....".
Please, Could you tell me if .NET object is working with
PB90.

Thank you,

Moises

> Hey,
>
> Is the DLL registered under windows?
>
> HTH,
> Davy
>
> <Moises Mescua> wrote in message
> > news:41eb25c5.5e4f.1681692777@sybase.com... Hi Everybody
> , >
> > Please, I want to use an object called NCCTPowerClnt.dll
> > made in .NET, I am using PB 9.0 with the script
> > following: //
> > int result
> > OLEobject myobject
> > myobject = create OLEobject
> > result =
> >
> myobject.ConnectToNewObject("NCCTPowerClnt.SessionManager"
> > ) MessageBox("result", result)
> >
> > I have gotten a result=-2 (Class name not found)
> >
> >
> > The Disassembler the NCCTPowerClnt.dll object is:
> >
> > ****************************************************
> > "Assembly NCCTPowerClnt, Version 1.0.1839.17150
> >
> > <assembly: AssemblyVersion("1.0.1839.17150")>
> > <assembly: AssemblyTrademark("")>
> > <assembly: Debuggable(True, True)>
> > <assembly: Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
> > <assembly: CLSCompliant(True)>
> > <assembly: AssemblyProduct("")>
> > <assembly: AssemblyCopyright("")>
> > <assembly: AssemblyCompany("")>
> > <assembly: AssemblyDescription("")>
> > <assembly: AssemblyTitle("")>
> >
> > ***************************************************
> >
> > Namespace NCCTPowerClnt.Nortel.Session
> > Public Class SessionManager
> > Implements IDisposable
> >
> > ' Events
> > Public Event ConnectEvent As
> > ConnectEventEventHandler
> > Public Event DisconnectEvent As
> > DisconnectEventEventHandler
> >
> > ' Methods
> > Public Sub New()
> > Public Function Connect() As Object
> > Public Sub Disconnect()
> > Public Overridable Sub Dispose() Implements
> > IDisposable.Dispose
> > Private Sub OnCCTDebugEvent(ByVal sender As
> > Object, ByVal debugmsg As String)
> > Private Sub OnDisconnectEvent(ByVal e As
> > SessionDisconnectedEventArgs)
> >
> > ' Properties
> > Public ReadOnly Property Addresses As
> > IAddress() Public Property Credentials As
> > CCTCredentials Public ReadOnly Property
> > IsConnected As Boolean Public ReadOnly
> > Property RoutePointAddresses As IRoutePointAddress()
> > Public Property Security As CCTSecurityLevel
> > Public Property Server As ServerSettings
> > Public ReadOnly Property ServerConnection As
> > Toolkit
> > Public ReadOnly Property Session As ISession
> > Public ReadOnly Property Terminals As
> > ITerminal()
> >
> > ' Fields
> > Private _myNormalAddresses As IAddress()
> > Private _myRouteAddresses As
> > IRoutePointAddress()
> > Private ConnectEventEvent As
> > ConnectEventEventHandler
> > Private DisconnectEventEvent As
> > DisconnectEventEventHandler
> > Private m_curServer As ServerSettings
> > Private m_DisconnectHandler As
> > SessionDisconnectedEventHandler
> > Private m_disposed As Boolean
> > Private m_mySession As ISession
> > Private m_myTerminals As ITerminal()
> > Private m_myToolkit As Toolkit
> > Private Const MAXADDR As Integer = 2
> > Private Const MAXTERM As Integer = 5
> >
> > ' Nested Types
> > Public Delegate Sub
> ConnectEventEventHandler() >
> > Public Delegate Sub
> > DisconnectEventEventHandler(ByVal e As EventArgs)
> > End Class
> > End Namespace
> >
> > *******************************************************
> >
> > Please, Could you help me?
> >
> > Thank you for any help,
> >
> >
> > Moises
>
>


Roy Kiesler [TeamSybase] Posted on 2005-01-17 18:17:04.0Z
From: "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com>
Reply-To: SPAM_FRE_roy.kiesler@teamsybase.com
Organization: TeamSybase
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Loading .NET objects
References: <41eb700e$4@forums-2-dub> <41ebff4e.67e2.1681692777@sybase.com>
In-Reply-To: <41ebff4e.67e2.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: d8fa4570.ptr.dia.nextlink.net
X-Original-NNTP-Posting-Host: d8fa4570.ptr.dia.nextlink.net
Message-ID: <41ec0120@forums-1-dub>
Date: 17 Jan 2005 10:17:04 -0800
X-Trace: forums-1-dub 1105985824 216.250.69.112 (17 Jan 2005 10:17:04 -0800)
X-Original-Trace: 17 Jan 2005 10:17:04 -0800, d8fa4570.ptr.dia.nextlink.net
Lines: 140
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8183
Article PK: 735446

You have to create a COM wrapper for the assembly before you can use it
from PB. Look at regasm.exe utility.

--
Roy

Moises Mescua wrote:
> The DLLs files was loaded in the same directory of the
> application.
> I tried to registered with the command regsvr32, but showed
> a message: "I was loaded, but Dll....".
> Please, Could you tell me if .NET object is working with
> PB90.
>
> Thank you,
>
> Moises
>
>
>>Hey,
>>
>>Is the DLL registered under windows?
>>
>>HTH,
>>Davy
>>
>><Moises Mescua> wrote in message
>>
>>>news:41eb25c5.5e4f.1681692777@sybase.com... Hi Everybody
>>
>>, >
>>
>>>Please, I want to use an object called NCCTPowerClnt.dll
>>>made in .NET, I am using PB 9.0 with the script
>>>following: //
>>>int result
>>>OLEobject myobject
>>>myobject = create OLEobject
>>>result =
>>>
>>
>>myobject.ConnectToNewObject("NCCTPowerClnt.SessionManager"
>>
>>>) MessageBox("result", result)
>>>
>>>I have gotten a result=-2 (Class name not found)
>>>
>>>
>>>The Disassembler the NCCTPowerClnt.dll object is:
>>>
>>>****************************************************
>>>"Assembly NCCTPowerClnt, Version 1.0.1839.17150
>>>
>>><assembly: AssemblyVersion("1.0.1839.17150")>
>>><assembly: AssemblyTrademark("")>
>>><assembly: Debuggable(True, True)>
>>><assembly: Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
>>><assembly: CLSCompliant(True)>
>>><assembly: AssemblyProduct("")>
>>><assembly: AssemblyCopyright("")>
>>><assembly: AssemblyCompany("")>
>>><assembly: AssemblyDescription("")>
>>><assembly: AssemblyTitle("")>
>>>
>>>***************************************************
>>>
>>>Namespace NCCTPowerClnt.Nortel.Session
>>> Public Class SessionManager
>>> Implements IDisposable
>>>
>>> ' Events
>>> Public Event ConnectEvent As
>>>ConnectEventEventHandler
>>> Public Event DisconnectEvent As
>>>DisconnectEventEventHandler
>>>
>>> ' Methods
>>> Public Sub New()
>>> Public Function Connect() As Object
>>> Public Sub Disconnect()
>>> Public Overridable Sub Dispose() Implements
>>>IDisposable.Dispose
>>> Private Sub OnCCTDebugEvent(ByVal sender As
>>>Object, ByVal debugmsg As String)
>>> Private Sub OnDisconnectEvent(ByVal e As
>>>SessionDisconnectedEventArgs)
>>>
>>> ' Properties
>>> Public ReadOnly Property Addresses As
>>> IAddress() Public Property Credentials As
>>> CCTCredentials Public ReadOnly Property
>>> IsConnected As Boolean Public ReadOnly
>>>Property RoutePointAddresses As IRoutePointAddress()
>>> Public Property Security As CCTSecurityLevel
>>> Public Property Server As ServerSettings
>>> Public ReadOnly Property ServerConnection As
>>>Toolkit
>>> Public ReadOnly Property Session As ISession
>>> Public ReadOnly Property Terminals As
>>>ITerminal()
>>>
>>> ' Fields
>>> Private _myNormalAddresses As IAddress()
>>> Private _myRouteAddresses As
>>>IRoutePointAddress()
>>> Private ConnectEventEvent As
>>>ConnectEventEventHandler
>>> Private DisconnectEventEvent As
>>>DisconnectEventEventHandler
>>> Private m_curServer As ServerSettings
>>> Private m_DisconnectHandler As
>>>SessionDisconnectedEventHandler
>>> Private m_disposed As Boolean
>>> Private m_mySession As ISession
>>> Private m_myTerminals As ITerminal()
>>> Private m_myToolkit As Toolkit
>>> Private Const MAXADDR As Integer = 2
>>> Private Const MAXTERM As Integer = 5
>>>
>>> ' Nested Types
>>> Public Delegate Sub
>>
>>ConnectEventEventHandler() >
>>
>>> Public Delegate Sub
>>>DisconnectEventEventHandler(ByVal e As EventArgs)
>>> End Class
>>>End Namespace
>>>
>>>*******************************************************
>>>
>>>Please, Could you help me?
>>>
>>>Thank you for any help,
>>>
>>>
>>>Moises
>>
>>


Moises Mescua Posted on 2005-01-18 05:27:53.0Z
Sender: 6cb4.41ec9e07.1804289383@sybase.com
From: Moises Mescua
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Loading .NET objects
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41ec9e59.6cb9.1681692777@sybase.com>
References: <41ec0120@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 Jan 2005 21:27:53 -0800
X-Trace: forums-1-dub 1106026073 10.22.241.41 (17 Jan 2005 21:27:53 -0800)
X-Original-Trace: 17 Jan 2005 21:27:53 -0800, 10.22.241.41
Lines: 329
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8184
Article PK: 735447

Thank for your response,

I executed the commands in .NET and showed next the
messages:

tlbexp NCCTPowerClnt.dll /out:NCCTPowerClnt.tlb
success!

regasm /tlb:NCCTPowerClnt.tlb NCCTPowerClnt.dll
success!

gacutil /i NCCTPowerClnt.dll
Failure adding assembly to the cache: Attempt to install an
assembly without a strong name

Copied two files(.dll and .tlb) to application directoy too.

Execute Script in PB9.0, again:
//
int li_result
OLEobject myobject
myobject = create OLEobject
li_result =
myobject.ConnectToObject("NCCTPowerClnt.SessionManager")
MessageBox("result", li_result)

I have gotten li_result = -6 (Filename is not valid)


After that, I executed:
regsvr32 NCCTPowerClnt.dll

The message was:
"NCCTPowerClnt.dll was loaded, but the DllRegisterServer
entry point was not found.
This file can not be registered.".


Please, I want to know if PB10 can load DLLs (.NET) without
problems.

Thank for any help.

Moises

> You have to create a COM wrapper for the assembly before
> you can use it from PB. Look at regasm.exe utility.
>
> --
> Roy
>
>
> Moises Mescua wrote:
> > The DLLs files was loaded in the same directory of the
> > application.
> > I tried to registered with the command regsvr32, but
> > showed a message: "I was loaded, but Dll....".
> > Please, Could you tell me if .NET object is working with
> > PB90.
> >
> > Thank you,
> >
> > Moises
> >
> >
> >>Hey,
> >>
> >>Is the DLL registered under windows?
> >>
> >>HTH,
> >>Davy
> >>
> >><Moises Mescua> wrote in message
> >>
> >>>news:41eb25c5.5e4f.1681692777@sybase.com... Hi
> Everybody >>
> >>, >
> >>
> >>>Please, I want to use an object called
> NCCTPowerClnt.dll >>>made in .NET, I am using PB 9.0 with
> the script >>>following: //
> >>>int result
> >>>OLEobject myobject
> >>>myobject = create OLEobject
> >>>result =
> >>>
> >>
> >>myobject.ConnectToNewObject("NCCTPowerClnt.SessionManage
> r" >>
> >>>) MessageBox("result", result)
> >>>
> >>>I have gotten a result=-2 (Class name not found)
> >>>
> >>>
> >>>The Disassembler the NCCTPowerClnt.dll object is:
> >>>
> >>>****************************************************
> >>>"Assembly NCCTPowerClnt, Version 1.0.1839.17150
> >>>
> >>><assembly: AssemblyVersion("1.0.1839.17150")>
> >>><assembly: AssemblyTrademark("")>
> >>><assembly: Debuggable(True, True)>
> >>><assembly:
> Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
> >>><assembly: CLSCompliant(True)> >>><assembly:
> AssemblyProduct("")> >>><assembly: AssemblyCopyright("")>
> >>><assembly: AssemblyCompany("")>
> >>><assembly: AssemblyDescription("")>
> >>><assembly: AssemblyTitle("")>
> >>>
> >>>***************************************************
> >>>
> >>>Namespace NCCTPowerClnt.Nortel.Session
> >>> Public Class SessionManager
> >>> Implements IDisposable
> >>>
> >>> ' Events
> >>> Public Event ConnectEvent As
> >>>ConnectEventEventHandler
> >>> Public Event DisconnectEvent As
> >>>DisconnectEventEventHandler
> >>>
> >>> ' Methods
> >>> Public Sub New()
> >>> Public Function Connect() As Object
> >>> Public Sub Disconnect()
> >>> Public Overridable Sub Dispose() Implements
> >>>IDisposable.Dispose
> >>> Private Sub OnCCTDebugEvent(ByVal sender As
> >>>Object, ByVal debugmsg As String)
> >>> Private Sub OnDisconnectEvent(ByVal e As
> >>>SessionDisconnectedEventArgs)
> >>>
> >>> ' Properties
> >>> Public ReadOnly Property Addresses As
> >>> IAddress() Public Property Credentials As
> >>> CCTCredentials Public ReadOnly Property
> >>> IsConnected As Boolean Public ReadOnly
> >>>Property RoutePointAddresses As IRoutePointAddress()
> >>> Public Property Security As
> CCTSecurityLevel >>> Public Property Server As
> ServerSettings >>> Public ReadOnly Property
> ServerConnection As >>>Toolkit
> >>> Public ReadOnly Property Session As
> ISession >>> Public ReadOnly Property Terminals
> As >>>ITerminal()
> >>>
> >>> ' Fields
> >>> Private _myNormalAddresses As IAddress()
> >>> Private _myRouteAddresses As
> >>>IRoutePointAddress()
> >>> Private ConnectEventEvent As
> >>>ConnectEventEventHandler
> >>> Private DisconnectEventEvent As
> >>>DisconnectEventEventHandler
> >>> Private m_curServer As ServerSettings
> >>> Private m_DisconnectHandler As
> >>>SessionDisconnectedEventHandler
> >>> Private m_disposed As Boolean
> >>> Private m_mySession As ISession
> >>> Private m_myTerminals As ITerminal()
> >>> Private m_myToolkit As Toolkit
> >>> Private Const MAXADDR As Integer = 2
> >>> Private Const MAXTERM As Integer = 5
> >>>
> >>> ' Nested Types
> >>> Public Delegate Sub
> >>
> >>ConnectEventEventHandler() >
> >>
> >>> Public Delegate Sub
> >>>DisconnectEventEventHandler(ByVal e As EventArgs)
> >>> End Class
> >>>End Namespace
> >>>
> >>>*******************************************************
> >>>
> >>>Please, Could you help me?
> >>>
> >>>Thank you for any help,
> >>>
> >>>
> >>>Moises
> >>
> >>

> You have to create a COM wrapper for the assembly before
> you can use it from PB. Look at regasm.exe utility.
>
> --
> Roy
>
>
> Moises Mescua wrote:
> > The DLLs files was loaded in the same directory of the
> > application.
> > I tried to registered with the command regsvr32, but
> > showed a message: "I was loaded, but Dll....".
> > Please, Could you tell me if .NET object is working with
> > PB90.
> >
> > Thank you,
> >
> > Moises
> >
> >
> >>Hey,
> >>
> >>Is the DLL registered under windows?
> >>
> >>HTH,
> >>Davy
> >>
> >><Moises Mescua> wrote in message
> >>
> >>>news:41eb25c5.5e4f.1681692777@sybase.com... Hi
> Everybody >>
> >>, >
> >>
> >>>Please, I want to use an object called
> NCCTPowerClnt.dll >>>made in .NET, I am using PB 9.0 with
> the script >>>following: //
> >>>int result
> >>>OLEobject myobject
> >>>myobject = create OLEobject
> >>>result =
> >>>
> >>
> >>myobject.ConnectToNewObject("NCCTPowerClnt.SessionManage
> r" >>
> >>>) MessageBox("result", result)
> >>>
> >>>I have gotten a result=-2 (Class name not found)
> >>>
> >>>
> >>>The Disassembler the NCCTPowerClnt.dll object is:
> >>>
> >>>****************************************************
> >>>"Assembly NCCTPowerClnt, Version 1.0.1839.17150
> >>>
> >>><assembly: AssemblyVersion("1.0.1839.17150")>
> >>><assembly: AssemblyTrademark("")>
> >>><assembly: Debuggable(True, True)>
> >>><assembly:
> Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
> >>><assembly: CLSCompliant(True)> >>><assembly:
> AssemblyProduct("")> >>><assembly: AssemblyCopyright("")>
> >>><assembly: AssemblyCompany("")>
> >>><assembly: AssemblyDescription("")>
> >>><assembly: AssemblyTitle("")>
> >>>
> >>>***************************************************
> >>>
> >>>Namespace NCCTPowerClnt.Nortel.Session
> >>> Public Class SessionManager
> >>> Implements IDisposable
> >>>
> >>> ' Events
> >>> Public Event ConnectEvent As
> >>>ConnectEventEventHandler
> >>> Public Event DisconnectEvent As
> >>>DisconnectEventEventHandler
> >>>
> >>> ' Methods
> >>> Public Sub New()
> >>> Public Function Connect() As Object
> >>> Public Sub Disconnect()
> >>> Public Overridable Sub Dispose() Implements
> >>>IDisposable.Dispose
> >>> Private Sub OnCCTDebugEvent(ByVal sender As
> >>>Object, ByVal debugmsg As String)
> >>> Private Sub OnDisconnectEvent(ByVal e As
> >>>SessionDisconnectedEventArgs)
> >>>
> >>> ' Properties
> >>> Public ReadOnly Property Addresses As
> >>> IAddress() Public Property Credentials As
> >>> CCTCredentials Public ReadOnly Property
> >>> IsConnected As Boolean Public ReadOnly
> >>>Property RoutePointAddresses As IRoutePointAddress()
> >>> Public Property Security As
> CCTSecurityLevel >>> Public Property Server As
> ServerSettings >>> Public ReadOnly Property
> ServerConnection As >>>Toolkit
> >>> Public ReadOnly Property Session As
> ISession >>> Public ReadOnly Property Terminals
> As >>>ITerminal()
> >>>
> >>> ' Fields
> >>> Private _myNormalAddresses As IAddress()
> >>> Private _myRouteAddresses As
> >>>IRoutePointAddress()
> >>> Private ConnectEventEvent As
> >>>ConnectEventEventHandler
> >>> Private DisconnectEventEvent As
> >>>DisconnectEventEventHandler
> >>> Private m_curServer As ServerSettings
> >>> Private m_DisconnectHandler As
> >>>SessionDisconnectedEventHandler
> >>> Private m_disposed As Boolean
> >>> Private m_mySession As ISession
> >>> Private m_myTerminals As ITerminal()
> >>> Private m_myToolkit As Toolkit
> >>> Private Const MAXADDR As Integer = 2
> >>> Private Const MAXTERM As Integer = 5
> >>>
> >>> ' Nested Types
> >>> Public Delegate Sub
> >>
> >>ConnectEventEventHandler() >
> >>
> >>> Public Delegate Sub
> >>>DisconnectEventEventHandler(ByVal e As EventArgs)
> >>> End Class
> >>>End Namespace
> >>>
> >>>*******************************************************
> >>>
> >>>Please, Could you help me?
> >>>
> >>>Thank you for any help,
> >>>
> >>>
> >>>Moises
> >>
> >>


Roy Kiesler [TeamSybase] Posted on 2005-01-18 22:08:41.0Z
From: "Roy Kiesler [TeamSybase]" <roy.kiesler@teamsybase.com>
Reply-To: SPAM_FRE_roy.kiesler@teamsybase.com
Organization: TeamSybase
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: Loading .NET objects
References: <41ec0120@forums-1-dub> <41ec9e59.6cb9.1681692777@sybase.com>
In-Reply-To: <41ec9e59.6cb9.1681692777@sybase.com>
Content-Type: multipart/mixed; boundary="------------080104000303070906000402"
NNTP-Posting-Host: d8fa4570.ptr.dia.nextlink.net
X-Original-NNTP-Posting-Host: d8fa4570.ptr.dia.nextlink.net
Message-ID: <41ed88e9$1@forums-1-dub>
Date: 18 Jan 2005 14:08:41 -0800
X-Trace: forums-1-dub 1106086121 216.250.69.112 (18 Jan 2005 14:08:41 -0800)
X-Original-Trace: 18 Jan 2005 14:08:41 -0800, d8fa4570.ptr.dia.nextlink.net
Lines: 946
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:8185
Article PK: 735452

You have an unneeded extra step, as well as a missing one:

1. No need to call tlbexp -- regasm already export the tlb and registers
it in one step

2. Set the "Register for COM Interop" project property to TRUE in
VS.NET. This will take care of the strong name issue you're seeing.

--
Roy

Moises Mescua wrote:
> Thank for your response,
>
> I executed the commands in .NET and showed next the
> messages:
>
> tlbexp NCCTPowerClnt.dll /out:NCCTPowerClnt.tlb
> success!
>
> regasm /tlb:NCCTPowerClnt.tlb NCCTPowerClnt.dll
> success!
>
> gacutil /i NCCTPowerClnt.dll
> Failure adding assembly to the cache: Attempt to install an
> assembly without a strong name
>
> Copied two files(.dll and .tlb) to application directoy too.
>
> Execute Script in PB9.0, again:
> //
> int li_result
> OLEobject myobject
> myobject = create OLEobject
> li_result =
> myobject.ConnectToObject("NCCTPowerClnt.SessionManager")
> MessageBox("result", li_result)
>
> I have gotten li_result = -6 (Filename is not valid)
>
>
> After that, I executed:
> regsvr32 NCCTPowerClnt.dll
>
> The message was:
> "NCCTPowerClnt.dll was loaded, but the DllRegisterServer
> entry point was not found.
> This file can not be registered.".
>
>
> Please, I want to know if PB10 can load DLLs (.NET) without
> problems.
>
> Thank for any help.
>
> Moises
>
>
>
>>You have to create a COM wrapper for the assembly before
>>you can use it from PB. Look at regasm.exe utility.
>>
>>--
>>Roy
>>
>>
>>Moises Mescua wrote:
>>
>>>The DLLs files was loaded in the same directory of the
>>>application.
>>>I tried to registered with the command regsvr32, but
>>>showed a message: "I was loaded, but Dll....".
>>>Please, Could you tell me if .NET object is working with
>>>PB90.
>>>
>>>Thank you,
>>>
>>>Moises
>>>
>>>
>>>
>>>>Hey,
>>>>
>>>>Is the DLL registered under windows?
>>>>
>>>>HTH,
>>>>Davy
>>>>
>>>><Moises Mescua> wrote in message
>>>>
>>>>
>>>>>news:41eb25c5.5e4f.1681692777@sybase.com... Hi
>>
>>Everybody >>
>>
>>>>, >
>>>>
>>>>>Please, I want to use an object called
>>
>>NCCTPowerClnt.dll >>>made in .NET, I am using PB 9.0 with
>>the script >>>following: //
>>
>>>>>int result
>>>>>OLEobject myobject
>>>>>myobject = create OLEobject
>>>>>result =
>>>>>
>>>>
>>>>myobject.ConnectToNewObject("NCCTPowerClnt.SessionManage
>>
>>r" >>
>>
>>>>>) MessageBox("result", result)
>>>>>
>>>>>I have gotten a result=-2 (Class name not found)
>>>>>
>>>>>
>>>>>The Disassembler the NCCTPowerClnt.dll object is:
>>>>>
>>>>>****************************************************
>>>>>"Assembly NCCTPowerClnt, Version 1.0.1839.17150
>>>>>
>>>>><assembly: AssemblyVersion("1.0.1839.17150")>
>>>>><assembly: AssemblyTrademark("")>
>>>>><assembly: Debuggable(True, True)>
>>>>><assembly:
>>
>>Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
>>
>>>>><assembly: CLSCompliant(True)> >>><assembly:
>>
>>AssemblyProduct("")> >>><assembly: AssemblyCopyright("")>
>>
>>>>><assembly: AssemblyCompany("")>
>>>>><assembly: AssemblyDescription("")>
>>>>><assembly: AssemblyTitle("")>
>>>>>
>>>>>***************************************************
>>>>>
>>>>>Namespace NCCTPowerClnt.Nortel.Session
>>>>> Public Class SessionManager
>>>>> Implements IDisposable
>>>>>
>>>>> ' Events
>>>>> Public Event ConnectEvent As
>>>>>ConnectEventEventHandler
>>>>> Public Event DisconnectEvent As
>>>>>DisconnectEventEventHandler
>>>>>
>>>>> ' Methods
>>>>> Public Sub New()
>>>>> Public Function Connect() As Object
>>>>> Public Sub Disconnect()
>>>>> Public Overridable Sub Dispose() Implements
>>>>>IDisposable.Dispose
>>>>> Private Sub OnCCTDebugEvent(ByVal sender As
>>>>>Object, ByVal debugmsg As String)
>>>>> Private Sub OnDisconnectEvent(ByVal e As
>>>>>SessionDisconnectedEventArgs)
>>>>>
>>>>> ' Properties
>>>>> Public ReadOnly Property Addresses As
>>>>> IAddress() Public Property Credentials As
>>>>> CCTCredentials Public ReadOnly Property
>>>>> IsConnected As Boolean Public ReadOnly
>>>>>Property RoutePointAddresses As IRoutePointAddress()
>>>>> Public Property Security As
>>
>>CCTSecurityLevel >>> Public Property Server As
>>ServerSettings >>> Public ReadOnly Property
>>ServerConnection As >>>Toolkit
>>
>>>>> Public ReadOnly Property Session As
>>
>>ISession >>> Public ReadOnly Property Terminals
>>As >>>ITerminal()
>>
>>>>> ' Fields
>>>>> Private _myNormalAddresses As IAddress()
>>>>> Private _myRouteAddresses As
>>>>>IRoutePointAddress()
>>>>> Private ConnectEventEvent As
>>>>>ConnectEventEventHandler
>>>>> Private DisconnectEventEvent As
>>>>>DisconnectEventEventHandler
>>>>> Private m_curServer As ServerSettings
>>>>> Private m_DisconnectHandler As
>>>>>SessionDisconnectedEventHandler
>>>>> Private m_disposed As Boolean
>>>>> Private m_mySession As ISession
>>>>> Private m_myTerminals As ITerminal()
>>>>> Private m_myToolkit As Toolkit
>>>>> Private Const MAXADDR As Integer = 2
>>>>> Private Const MAXTERM As Integer = 5
>>>>>
>>>>> ' Nested Types
>>>>> Public Delegate Sub
>>>>
>>>>ConnectEventEventHandler() >
>>>>
>>>>> Public Delegate Sub
>>>>>DisconnectEventEventHandler(ByVal e As EventArgs)
>>>>> End Class
>>>>>End Namespace
>>>>>
>>>>>*******************************************************
>>>>>
>>>>>Please, Could you help me?
>>>>>
>>>>>Thank you for any help,
>>>>>
>>>>>
>>>>>Moises
>>>>
>>>>
>
>
>
>>You have to create a COM wrapper for the assembly before
>>you can use it from PB. Look at regasm.exe utility.
>>
>>--
>>Roy
>>
>>
>>Moises Mescua wrote:
>>
>>>The DLLs files was loaded in the same directory of the
>>>application.
>>>I tried to registered with the command regsvr32, but
>>>showed a message: "I was loaded, but Dll....".
>>>Please, Could you tell me if .NET object is working with
>>>PB90.
>>>
>>>Thank you,
>>>
>>>Moises
>>>
>>>
>>>
>>>>Hey,
>>>>
>>>>Is the DLL registered under windows?
>>>>
>>>>HTH,
>>>>Davy
>>>>
>>>><Moises Mescua> wrote in message
>>>>
>>>>
>>>>>news:41eb25c5.5e4f.1681692777@sybase.com... Hi
>>
>>Everybody >>
>>
>>>>, >
>>>>
>>>>>Please, I want to use an object called
>>
>>NCCTPowerClnt.dll >>>made in .NET, I am using PB 9.0 with
>>the script >>>following: //
>>
>>>>>int result
>>>>>OLEobject myobject
>>>>>myobject = create OLEobject
>>>>>result =
>>>>>
>>>>
>>>>myobject.ConnectToNewObject("NCCTPowerClnt.SessionManage
>>
>>r" >>
>>
>>>>>) MessageBox("result", result)
>>>>>
>>>>>I have gotten a result=-2 (Class name not found)
>>>>>
>>>>>
>>>>>The Disassembler the NCCTPowerClnt.dll object is:
>>>>>
>>>>>****************************************************
>>>>>"Assembly NCCTPowerClnt, Version 1.0.1839.17150
>>>>>
>>>>><assembly: AssemblyVersion("1.0.1839.17150")>
>>>>><assembly: AssemblyTrademark("")>
>>>>><assembly: Debuggable(True, True)>
>>>>><assembly:
>>
>>Guid("29D41578-0019-4293-AD0A-38AAD8C60935")>
>>
>>>>><assembly: CLSCompliant(True)> >>><assembly:
>>
>>AssemblyProduct("")> >>><assembly: AssemblyCopyright("")>
>>
>>>>><assembly: AssemblyCompany("")>
>>>>><assembly: AssemblyDescription("")>
>>>>><assembly: AssemblyTitle("")>
>>>>>
>>>>>***************************************************
>>>>>
>>>>>Namespace NCCTPowerClnt.Nortel.Session
>>>>> Public Class SessionManager
>>>>> Implements IDisposable
>>>>>
>>>>> ' Events
>>>>> Public Event ConnectEvent As
>>>>>ConnectEventEventHandler
>>>>> Public Event DisconnectEvent As
>>>>>DisconnectEventEventHandler
>>>>>
>>>>> ' Methods
>>>>> Public Sub New()
>>>>> Public Function Connect() As Object
>>>>> Public Sub Disconnect()
>>>>> Public Overridable Sub Dispose() Implements
>>>>>IDisposable.Dispose
>>>>> Private Sub OnCCTDebugEvent(ByVal sender As
>>>>>Object, ByVal debugmsg As String)
>>>>> Private Sub OnDisconnectEvent(ByVal e As
>>>>>SessionDisconnectedEventArgs)
>>>>>
>>>>> ' Properties
>>>>> Public ReadOnly Property Addresses As
>>>>> IAddress() Public Property Credentials As
>>>>> CCTCredentials Public ReadOnly Property
>>>>> IsConnected As Boolean Public ReadOnly
>>>>>Property RoutePointAddresses As IRoutePointAddress()
>>>>> Public Property Security As
>>
>>CCTSecurityLevel >>> Public Property Server As
>>ServerSettings >>> Public ReadOnly Property
>>ServerConnection As >>>Toolkit
>>
>>>>> Public ReadOnly Property Session As
>>
>>ISession >>> Public ReadOnly Property Terminals
>>As >>>ITerminal()
>>
>>>>> ' Fields
>>>>> Private _myNormalAddresses As IAddress()
>>>>> Private _myRouteAddresses As
>>>>>IRoutePointAddress()
>>>>> Private ConnectEventEvent As
>>>>>ConnectEventEventHandler
>>>>> Private DisconnectEventEvent As
>>>>>DisconnectEventEventHandler
>>>>> Private m_curServer As ServerSettings
>>>>> Private m_DisconnectHandler As
>>>>>SessionDisconnectedEventHandler
>>>>> Private m_disposed As Boolean
>>>>> Private m_mySession As ISession
>>>>> Private m_myTerminals As ITerminal()
>>>>> Private m_myToolkit As Toolkit
>>>>> Private Const MAXADDR As Integer = 2
>>>>> Private Const MAXTERM As Integer = 5
>>>>>
>>>>> ' Nested Types
>>>>> Public Delegate Sub
>>>>
>>>>ConnectEventEventHandler() >
>>>>
>>>>> Public Delegate Sub
>>>>>DisconnectEventEventHandler(ByVal e As EventArgs)
>>>>> End Class
>>>>>End Namespace
>>>>>
>>>>>*******************************************************
>>>>>
>>>>>Please, Could you help me?
>>>>>
>>>>>Thank you for any help,
>>>>>
>>>>>
>>>>>Moises
>>>>
>>>>

cominterop.png