Skip Headers
Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 2 (10.2)

Part Number B14308-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

OSession Method

Applies To

OSession

Description

OSession constructor

Usage

OSession(void)

OSession(const OSession &othersess)

OSession(const char *sname)

Arguments

Arguments
Description
othersess
The OSession object to copy.
sname
The name to give to this session

Remarks

These methods construct a new OSession instance.

The default constructor constructs an unopened OSession object. It cannot fail. You must open the object before you can use it.

The copy constructor copies another OSession object. If that other OSession object is open - which means that it is a handle on an implementation session object - the new OSession object becomes a handle to that same session object. The copy constructor copies the reference to the session object but does not copy any strings that the source OSession may own. The copy constructor can fail; check whether the new OSession is open after the constructor call.

The constructor that takes an argument of sname constructs the OSession and then attempts to open it. It will be opened with the name sname. Sname can be NULL, in which case the default OSession is returned. This construct and open constructor can fail; check whether the new OSession is open after the constructor call.

Example

Construct and open the application's default session:

OSession sess(0);