Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 1 (10.1) Part Number B10119-01 |
|
Applies To
Description
OAdvise constructor
Usage
OAdvise(void)
OAdvise(const OAdvise &otheradvise)
OAdvise(const ODynaset &dyn)
Arguments |
Description |
---|---|
otheradvise |
Another OAdvise object that you are copying. |
dyn |
An ODynaset to which you will attach after construction. |
These methods construct a new OAdvise instance.
The default constructor constructs an unopened OAdvise object. It cannot fail. You must open the object before you can use it.
The copy constructor copies another advisory. If that other advisory is open (attached to a dynaset), the new OAdvise will be attached to the same dynaset object. The new OAdvise object will be a separate advisory on the same dynaset object. The copy constructor allows OAdvise objects to be passed correctly as arguments to routines and to be return values from routines. The copy constructor can fail; check whether the new OAdvise is open after the constructor call.
The constructor that takes an ODynaset as an argument constructs the OAdvise object and attempts to open it with that dynaset. This construct and open can fail; check whether the new OAdvise is open after the constructor call.
Note that instances of the OAdvise class itself can be declared, but they do nothing. To have an interesting advisory you must subclass OAdvise.
Example
Construction of an OAdvise object:
// default constructor
OAdvise adv1;
// open that advisory
adv1.Open(thedynaset);
// construct two other advisories, attaching them to the same dynaset
OAdvise adv2(adv1); // copy constructor
if (!adv2.IsOpen())
{ // there was some error opening the advisory
// error processing
}
OAdvise adv3(thedynaset);
if (!adv3.IsOpen())
{ // there was some error opening the advisory
// error processing
}