Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 2: for DotNetAssembly objects – PB Docs 2021 – PowerBuilder Library

Syntax 2: for DotNetAssembly objects – PB Docs 2021

Syntax 2: for DotNetAssembly objects

Description

Creates an instance of the .NET class and associates it with the
DotNetObject object. The DotNetObject object must be instantiated
first.

The instance of the class can be used to access the
functions/properties in the corresponding .NET class.

Applies to

DotNetAssembly objects

Syntax

Argument

Description

objectname

Reference to the DotNetAssembly object instance.

classname

The name of the .NET class.

It must contain the namespace and the class name:
[namespace].[class], for example,
AppeonSample.StandardTest.

DotNetObject

The name of the DotNetObject object.

{, arg1, arg2,…, argn } (optional)

The .NET constructor argument.

Constructor argument is optional. If no argument is
passed in, the application will automatically call the
constructor that takes no parameter; and if there is no such
parameterless constructor, the instance will fail to
create.

Return value

Integer.

Returns values as follows. If the classname or DotNetObject
argument’s value is null, the method returns null.

1 — Success.

-1 — Unknown error.

-2 — Could not find the assembly.

-6 — Could not find the class name.

Usage

The class name is case insensitive. The application will ignore
the case of the class name and find the first class in the order that
matches.

If there is a nested class, you should use the plus sign (“+”)
instead of the dot (“.”) to access the nested class, in this format:
[namespace].[class]+[nested-class], for example,
AppeonSample.StandardTest+MathTest.

The value of the constructor argument can be of any standard data
type. See the section called “Data types” in Application Techniques.

Passing parameters by reference to a constructor function is
unsupported. The modified data cannot be returned.

For Char data type, it will be passed to .NET as String type by
default; and if there is no constructor function that matches the type,
the instance will fail to create.

If the instance failed to create, the exception message returned
from .NET will be stored in the ErrorText property.

Examples

See also

GetDotNetCoreVersion

LoadWithDotNetCore

LoadWithDotNetFramework


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x