Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

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

OSession Method

Applies To

OSession

Description

OSession constructor

Usage

OSession(void)

OSession(const OSession &othersess)

OSession(const char *sname)

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);