[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference pamsrc::objectbroker_development

Title:ObjectBroker Development - BEA Systems' CORBA
Notice:See note 2 for kit locations; note 4 for training
Moderator:RECV::GUMBELd
Created:Thu Dec 27 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2482
Total number of notes:13057

2430.0. "QuickStart C++ generator problem" by STKAI1::T_ANDERSSON (Tomas Andersson) Mon Feb 10 1997 10:00

 One of our customers is experiencing some problems using OBB v2.7-11
 Quickstart to generate source code with C++ bindings (no problems
 with C bindings). When compiling the C++ source code, they get a lot
 of errors such as the following:


 	D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(819) : error
	C2039: '.PAVObject@CORBA@@' : is not a member of 'CTest2_var'


 The corresponding source code is:


            for( int k1 = 0 ; k1 < 5 ; k1++ ) {
            OBB_QUICK_LOGTXT ("        struct test::recObjTe��O");
line 819    if (CORBA::is_nil ((*ret_test_seqCTest2)[k1].
		objTest2.operator CORBA::Object_ptr(), ev))
                {
                OBB_QUICK_PRINTF((logfile,
		"ret_test_seqCTest2[%d].objTest2 : CORBA_OBJECT_NIL\n" , k1));
                }


 The compilation errors occur both on Windows95 and Windows NT4. Note also
 the error in the OBB_QUICK_LOGTXT message, which appears to be specific
 to Windows95. Otherwise, there are no differences in the code.

 Could this be a bug in the Quickstart C++ generator?

 The error log from VC++ follows (lines slightly truncated...):

                                                                         
--------------------Configuration: cxx_client - Win32 Debug--------------------
Compiling...
TESTClient.cxx
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(819) : error C2039:
'.PAVO*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(825) : error C2039:
'.PAVO*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(837) : error C2039:
'.PAVO*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(843) : error C2039:
'.PAVO*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2069) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2075) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2087) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2093) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2148) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2154) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2204) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2210) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2261) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2267) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2323) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2329) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2343) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2349) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2400) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2406) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2462) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2468) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2485) : error C2039:
'.PAV*
D:\_magnus\projekt\newTools\win95\Cxx\TESTClient.cxx(2491) : error C2039:
'.PAV*
Error executing cl.exe.
testClient.obj - 24 error(s), 0 warning(s)


 I'm trying to get a copy of the IDL file and the complete cxx file, too.

 Regards,

 Tomas Andersson

T.RTitleUserPersonal
Name
DateLines
2430.1IDL and cxxSTKAI1::T_ANDERSSONTomas AnderssonTue Feb 11 1997 05:18827
Here is the IDL file and parts of the cxx file.

========================================
IDL file
========================================

module test

// Constants
// ---------
//
// SQL$PRE FIX. Res. space for the null char, ie add one to the actual length.
   const short lenUsername = 41;
   const short lenPassword = 41;
   const short lenErrMsg   = 81;
   typedef string typErrMsg;
   typedef long   typObjectId;
   typedef string typUsername;
   typedef string typPassword;
   enum enumLogLevel
 {     logLevelMethod, 
       logLevelUser,
       logLevelPerformance, 
       logLevelSrvAttr
                        };

  exception errInvalidLogin {}; // invalid login
  exception errNoPriv {};       // no privilege for attempted operation
  exception errNotFound {};     // no information found
  exception errAlreadyExist {}; // new (insert) failed, already exist
  exception errUnknown          // unknown user exception
  {
    typErrMsg errMsg;
  };

  const short lenTestString = 41; 

  typedef long            typTestLong;
  typedef short           typTestShort;
  typedef char            typTestChar;
  typedef boolean         typTestBoolean;
  typedef octet           typTestOctet;
  typedef float           typTestFloat;
  typedef double          typTestDouble;
  typedef string          typTestString;
  typedef string          typTestUnboundString;
//  typedef Object          typTestObject;
//  typedef unsigned long   typTestULong;
//  typedef unsigned short  typTestUShort;

  enum    enumTest {v1, v2, v3};

  interface CTest1;
  interface CTest2;
  interface CInit;
  interface CSys;
  interface CFactory;
  interface CQuery;
  interface CSysMgm;
  interface CBusinessObject;

  struct recPKTest1
  {
    typObjectId objectId;
  };

  struct recPKTest2
  {
    typObjectId objectId;
  };

  struct recTest1
  {
    CTest2            testObjTest2;
    long              testLong;
    short             testShort;
    float             testFloat;
    double            testDouble;
    string            testUnboundString;

//    ML FIX. Vanta lite med CORBA-datatypen Object
//    Object            testObject;
// ML FIX. Fortfarande problem med char, boolean och octet...
//    unsigned long     testULong;
//    unsigned short    testUShort;
//    char              testChar;
//    boolean           testBoolean;
//    octet             testOctet;

  };



  struct recTest2
                   {
    CTest1         testObjTest1;
    typTestLong    testLong;
    typTestShort   testShort;
    typTestFloat   testFloat;
    typTestDouble  testDouble;
    typTestString  testString;    enumTest       testEnum;
    typTestUnboundString testUnboundString;

//    ML FIX. Vanta lite med CORBA-datatypen Object
//    typTestObject  testObject;
// ML FIX. Fortfarande problem med char, boolean och octet...
//    typTestULong   testULong;
//    typTestUShort  testUShort;
//    typTestChar    testChar;
//    typTestBoolean testBoolean;
//    typTestOctet   testOctet;

  };


  struct recObjTest1
  {
    CTest1         objTest1;
  };

  struct recObjTest2
  {
    CTest2         objTest2;
  };

  struct recObjBusinessObject
  {
    CBusinessObject         objBusinessObject;
  };

  typedef sequence <recObjBusinessObject> seqCBusinessObject;

  typedef sequence <recObjTest1>   seqCTest1;
  typedef sequence <recTest1> seqRecTest1;

  typedef sequence <recObjTest2>   seqCTest2;
  typedef sequence <recTest2> seqRecTest2;


//  typedef sequence <long>              seqLong;
//  typedef sequence <short>             seqShort;
//  typedef sequence <float>             seqFloat;
//  typedef sequence <double>            seqDouble;
//  typedef sequence <string>            seqString;
//
//  typedef sequence <typTestLong>          seqTestLong;
//  typedef sequence <typTestShort>         seqTestShort;
//  typedef sequence <typTestFloat>         seqTestFloat;
//  typedef sequence <typTestDouble>        seqTestDouble;
//  typedef sequence <typTestString>        seqTestString;
//  typedef sequence <typTestUnboundString> seqTestString;
//  typedef sequence <enumTest>             seqTestEnum;
//
//
//  ML FIX. Vanta lite med CORBA-datatypen Object
//  typedef sequence <Object>            seqObject;
//  typedef sequence <unsigned long>     seqULong;
//  typedef sequence <unsigned short>    seqUShort;
// ML FIX.  typedef sequence <char>              seqChar;
// ML FIX.  typedef sequence <boolean>           seqBoolean;
// ML FIX.  typedef sequence <octet>             seqOctet;
//  ML FIX. Vanta lite med CORBA-datatypen Object
//  typedef sequence <typTestObject>   seqTestObject;
//  typedef sequence <typTestULong>    seqTestULong;
//  typedef sequence <typTestUShort>   seqTestUShort;
// ML FIX.  typedef sequence <typTestChar>     seqTestChar;
// ML FIX.  typedef sequence <typTestBoolean>  seqTestBoolean;
// ML FIX.  typedef sequence <typTestOctet>    seqTestOctet;


  interface CTest1 {
    readonly attribute recTest1 attr;

    void set_attr (in recTest1 attr)
      raises (errNoPriv, errAlreadyExist, errUnknown);

    seqCTest2 hasTest2s (out seqRecTest2 seqAttr)  // Perf. opt.
      raises (errNotFound, errUnknown);

    /* Used to update the relation "hasTest2" 
    ** and the children-objects
    ** in a single transaction. */
    void save1 (in seqCTest2    objSeqTest2New,
                in seqRecTest2 attrSeqTest2New,
                in seqCTest2    objSeqTest2Update,
                in seqRecTest2 attrSeqTest2Update,
                in seqCTest2    objSeqTest2Delete,
                in seqRecTest2 attrSeqTest2Delete)  
      raises (errNoPriv, errUnknown);

    /* Used to update the relation "hasTest2",
    ** the children-objects
    ** and the objects own attribute
    ** in a single transaction. */
    void save2 (in recTest1     attr,
                in seqCTest2    objSeqTest2New,
                in seqRecTest2 attrSeqTest2New,
                in seqCTest2    objSeqTest2Update,
                in seqRecTest2 attrSeqTest2Update,
                in seqCTest2    objSeqTest2Delete)
      raises (errNoPriv, errUnknown);

    /* Used to only update the relation "hasTest2" 
    ** and not the state of any objects
    ** in a single transaction. */
    void save3 (in seqCTest2    objSeqTest2New,

  in seqCTest2    objSeqTest2Delete)
      raises (errNoPriv, errUnknown);

    // Test-operations for simple-datatypes
    // Since ISTgodis v0.1 can't handle more than one out-object of the same
    // class (PKrec - name - conflict)
    // test-operations are divided into test-operations that return an object
    // as a return value    
    // and test-operations that return an object as a output-argument.
    CTest1         opCTest1     (in CTest1         arg1);
    CTest2         opCTest2     (in CTest2         arg1);
    void           opVoidCTest1 (in CTest1         arg1, out CTest1        
arg*
                                                                              
*
                                                                              
*
                                                                              
*

                                                                              
*
                                                                              
*
                                                                              
*
      opString     (in string         arg1, out string         arg2);

;

     raises (errNoPriv, errUnknown);

                                      };

                                          //
----------------------------------*
                                                                              
*
                                                                              
*
                                                                              
*

                                                                              
*
                                                                              
*

                                                                              
*

                                                                              
*
                                                                              
*
#pragma repository_id( "test::lenPassword",
"7ac331fd0df4.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::lenErrMsg",
"7ac331fd0df5.02.9d.60.cf.51.00.00.00*
#pragma repository_id( "test::typErrMsg",
"7ac331fd0df6.02.9d.60.cf.51.00.00.00*
#pragma repository_id( "test::typObjectId",
"7ac331fd0df7.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::typUsername",
"7ac331fd0df8.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::typPassword",
"7ac331fd0df9.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::enumLogLevel",
"7ac331fd0dfa.02.9d.60.cf.51.00.00*
#pragma repository_id( "test::errInvalidLogin",
"7ac331fd0dfb.02.9d.60.cf.51.00*
#pragma repository_id( "test::errNoPriv",
"7ac331fd0dfc.02.9d.60.cf.51.00.00.00*
#pragma repository_id( "test::errNotFound",
"7ac331fd0dfd.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::errAlreadyExist",
"7ac331fd0dfe.02.9d.60.cf.51.00*
#pragma repository_id( "test::errUnknown",
"7ac331fd0dff.02.9d.60.cf.51.00.00.0*
#pragma repository_id( "test::lenTestString",
"7ac331fd0e00.02.9d.60.cf.51.00.0*
#pragma repository_id( "test::typTestLong",
"7ac331fd0e01.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::typTestShort",
"7ac331fd0e02.02.9d.60.cf.51.00.00*
#pragma repository_id( "test::typTestChar",
"7ac331fd0e03.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::typTestBoolean",
"7ac331fd0e04.02.9d.60.cf.51.00.*
#pragma repository_id( "test::typTestOctet",
"7ac331fd0e05.02.9d.60.cf.51.00.00*
#pragma repository_id( "test::typTestFloat",
"7ac331fd0e06.02.9d.60.cf.51.00.00*
#pragma repository_id( "test::typTestDouble",
"7ac331fd0e07.02.9d.60.cf.51.00.0*
#pragma repository_id( "test::typTestString",
"7ac331fd0e08.02.9d.60.cf.51.00.0*
#pragma repository_id( "test::typTestUnboundString",
"7ac331fd0e09.02.9d.60.cf.*
#pragma repository_id( "test::enumTest",
"7ac331fd0e0a.02.9d.60.cf.51.00.00.00")
#pragma repository_id( "test::recPKTest1",
"7ac331fd0e0b.02.9d.60.cf.51.00.00.0*
#pragma repository_id( "test::recPKTest2",
"7ac331fd0e0c.02.9d.60.cf.51.00.00.0*
#pragma repository_id( "test::recTest1",
"7ac331fd0e0d.02.9d.60.cf.51.00.00.00")
#pragma repository_id( "test::recTest2",
"7ac331fd0e0e.02.9d.60.cf.51.00.00.00")
#pragma repository_id( "test::recObjTest1",
"7ac331fd0e0f.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::recObjTest2",
"7ac331fd0e10.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::recObjBusinessObject",
"7ac331fd0e11.02.9d.60.cf.*
#pragma repository_id( "test::seqCBusinessObject",
"7ac331fd0e12.02.9d.60.cf.51*
#pragma repository_id( "test::seqCTest1",
"7ac331fd0e13.02.9d.60.cf.51.00.00.00*
#pragma repository_id( "test::seqRecTest1",
"7ac331fd0e14.02.9d.60.cf.51.00.00.*
#pragma repository_id( "test::seqCTest2",
"7ac331fd0e15.02.9d.60.cf.51.00.00.00*
#pragma repository_id( "test::seqRecTest2",
"7ac331fd0e16.02.9d.60.cf.51.00.00.*
#pragma interface_id( "test::CTest1", "7ac331fd0e17.02.9d.60.cf.51.00.00.00")
#pragma attribute_id( "test::CTest1::attr",
"7ac331fd0e18.02.9d.60.cf.51.00.00.*
#pragma operation_id( "test::CTest1::set_attr",
"7ac331fd0e1a.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest1::hasTest2s",
"7ac331fd0e1b.02.9d.60.cf.51.0*
#pragma operation_id( "test::CTest1::save1",
"7ac331fd0e1c.02.9d.60.cf.51.00.00*
#pragma operation_id( "test::CTest1::save2",
"7ac331fd0e1d.02.9d.60.cf.51.00.00*
#pragma operation_id( "test::CTest1::save3",
"7ac331fd0e1e.02.9d.60.cf.51.00.00*
#pragma operation_id( "test::CTest1::opCTest1",
"7ac331fd0e1f.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest1::opCTest2",
"7ac331fd0e20.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest1::opVoidCTest1",
"7ac331fd0e21.02.9d.60.cf.5*
#pragma operation_id( "test::CTest1::opCVoidTest2",
"7ac331fd0e22.02.9d.60.cf.5*
#pragma operation_id( "test::CTest1::opLong",
"7ac331fd0e23.02.9d.60.cf.51.00.0*
#pragma operation_id( "test::CTest1::opShort",
"7ac331fd0e24.02.9d.60.cf.51.00.*
#pragma operation_id( "test::CTest1::opFloat",
"7ac331fd0e25.02.9d.60.cf.51.00.*
#pragma operation_id( "test::CTest1::opDouble",
"7ac331fd0e26.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest1::opString",
"7ac331fd0e27.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest1::opTypTestLong",
"7ac331fd0e28.02.9d.60.cf.*
#pragma operation_id( "test::CTest1::opTypTestShort",
"7ac331fd0e29.02.9d.60.cf*
#pragma operation_id( "test::CTest1::opTypTestFloat",
"7ac331fd0e2a.02.9d.60.cf*
#pragma operation_id( "test::CTest1::opTypTestDouble",
"7ac331fd0e2b.02.9d.60.c*
#pragma operation_id( "test::CTest1::opTypTestString",
"7ac331fd0e2c.02.9d.60.c*
#pragma operation_id( "test::CTest1::opTypTestUnboundString",
"7ac331fd0e2d.02.*
#pragma operation_id( "test::CTest1::opEnumTest",
"7ac331fd0e2e.02.9d.60.cf.51.*
#pragma interface_id( "test::CTest2", "7ac331fd0e2f.02.9d.60.cf.51.00.00.00")
#pragma attribute_id( "test::CTest2::attr",
"7ac331fd0e30.02.9d.60.cf.51.00.00.*
#pragma operation_id( "test::CTest2::set_attr",
"7ac331fd0e32.02.9d.60.cf.51.00*
#pragma operation_id( "test::CTest2::dispose",
"7ac331fd0e33.02.9d.60.cf.51.00.*
#pragma operation_id( "test::CTest2::hasTest1s",
"7ac331fd0e34.02.9d.60.cf.51.0*
#pragma operation_id( "test::CTest2::opSeqCTest1",
"7ac331fd0e35.02.9d.60.cf.51*
#pragma operation_id( "test::CTest2::opSeqCTest2",
"7ac331fd0e36.02.9d.60.cf.51*
#pragma operation_id( "test::CTest2::opVoidSeqCTest1",
"7ac331fd0e37.02.9d.60.c*
#pragma operation_id( "test::CTest2::opVoidSeqAttrTst1",
"7ac331fd0e38.02.9d.60*
#pragma operation_id( "test::CTest2::opVoidSeqCTest2",
"7ac331fd0e39.02.9d.60.c*
#pragma operation_id( "test::CTest2::opVoidSeqAttrTst2",
"7ac331fd0e3a.02.9d.60*
#pragma interface_id( "test::CInit", "7ac331fd0e3b.02.9d.60.cf.51.00.00.00")
#pragma operation_id( "test::CInit::LoginSysMgm",
"7ac331fd0e3c.02.9d.60.cf.51.*
#pragma operation_id( "test::CInit::Login",
"7ac331fd0e3d.02.9d.60.cf.51.00.00.*
#pragma interface_id( "test::CSys", "7ac331fd0e3e.02.9d.60.cf.51.00.00.00")
#pragma operation_id( "test::CSys::Logout",
"7ac331fd0e3f.02.9d.60.cf.51.00.00.*
#pragma operation_id( "test::CSys::disposeObjects",
"7ac331fd0e40.02.9d.60.cf.5*
#pragma interface_id( "test::CFactory", "7ac331fd0e41.02.9d.60.cf.51.00.00.00")
#pragma operation_id( "test::CFactory::dummyOperation",
"7ac331fd0e42.02.9d.60.*
#pragma interface_id( "test::CQuery", "7ac331fd0e43.02.9d.60.cf.51.00.00.00")
#pragma operation_id( "test::CQuery::dummyOperation",
"7ac331fd0e44.02.9d.60.cf*
#pragma interface_id( "test::CSysMgm", "7ac331fd0e45.02.9d.60.cf.51.00.00.00")
#pragma operation_id( "test::CSysMgm::startNewServer",
"7ac331fd0e46.02.9d.60.c*
#pragma operation_id( "test::CSysMgm::enableLogLevel",
"7ac331fd0e47.02.9d.60.c*
#pragma operation_id( "test::CSysMgm::disableLogLevel",
"7ac331fd0e48.02.9d.60.*
#pragma operation_id( "test::CSysMgm::reopenLog",
"7ac331fd0e49.02.9d.60.cf.51.*
#pragma operation_id( "test::CSysMgm::logoutCurrentUser",
"7ac331fd0e4a.02.9d.6*
#pragma interface_id( "test::CBusinessObject",
"7ac331fd0e4b.02.9d.60.cf.51.00.*
#pragma operation_id( "test::CBusinessObject::dummyOperation",
"7ac331fd0e4c.02*



========================================
CXX
========================================

#if defined(OBB_QUICK)
/*******************************************************************
 * Created Sun Feb 09 00:10:05 1997 by OBB V2.7-11 (COMPILE/GENERATE)
 *******************************************************************
 */

//
//
// Client Main
// -----------
//
// This module contains the main() for a Client based on TEST.idl
// and TEST.iml that was generated by Digital Equipment Corporation's
// ObjectBroker.
//
// This module was generated using ObjectBroker's QuickStart commands.
//
//

#include <obbquick.hxx>
#include "TEST.hxx"

static CORBA::Boolean test_CTest1Invoke (void);
static CORBA::Boolean testCTest1set_attr (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1hasTest2s (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1save1 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1save2 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1save3 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opCTest1 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opCTest2 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opVoidCTest1 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opCVoidTest2 (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opLong (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opShort (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opFloat (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opDouble (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opString (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestLong (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestShort (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestFloat (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestDouble (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestString (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1opTypTestUnboundString (test::CTest1_var &
CTes*
static CORBA::Boolean testCTest1opEnumTest (test::CTest1_var & CTest1Obj);
static CORBA::Boolean testCTest1attr (test::CTest1_var & CTest1Obj);
static CORBA::Boolean test_CTest2Invoke (void);
static CORBA::Boolean testCTest2set_attr (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2dispose (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2hasTest1s (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2opSeqCTest1 (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2opSeqCTest2 (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2opVoidSeqCTest1 (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2opVoidSeqAttrTst1 (test::CTest2_var &
CTest2Obj*
static CORBA::Boolean testCTest2opVoidSeqCTest2 (test::CTest2_var & CTest2Obj);
static CORBA::Boolean testCTest2opVoidSeqAttrTst2 (test::CTest2_var &
CTest2Obj*
static CORBA::Boolean testCTest2attr (test::CTest2_var & CTest2Obj);
static CORBA::Boolean test_CInitInvoke (void);
static CORBA::Boolean testCInitLoginSysMgm (test::CInit_var & CInitObj);
static CORBA::Boolean testCInitLogin (test::CInit_var & CInitObj);
static CORBA::Boolean test_CSysInvoke (void);
static CORBA::Boolean testCSysLogout (test::CSys_var & CSysObj);
static CORBA::Boolean testCSysdisposeObjects (test::CSys_var & CSysObj);
static CORBA::Boolean test_CFactoryInvoke (void);
static CORBA::Boolean testCFactorydummyOperation (test::CFactory_var &
CFactory*
static CORBA::Boolean test_CQueryInvoke (void);
static CORBA::Boolean testCQuerydummyOperation (test::CQuery_var & CQueryObj);
static CORBA::Boolean test_CSysMgmInvoke (void);
static CORBA::Boolean testCSysMgmstartNewServer (test::CSysMgm_var &
CSysMgmObj*
static CORBA::Boolean testCSysMgmenableLogLevel (test::CSysMgm_var &
CSysMgmObj*
static CORBA::Boolean testCSysMgmdisableLogLevel (test::CSysMgm_var &
CSysMgmOb*
static CORBA::Boolean testCSysMgmreopenLog (test::CSysMgm_var & CSysMgmObj);
static CORBA::Boolean testCSysMgmlogoutCurrentUser (test::CSysMgm_var &
CSysMgm*
static CORBA::Boolean test_CBusinessObjectInvoke (void);
static CORBA::Boolean testCBusinessObjectdummyOperation
(test::CBusinessObject_*
static void gen_seq1 (test::seqCTest2 & objSeqTest2New);
static void gen_seq2 (test::seqRecTest2 & attrSeqTest2New);
static void gen_seq3 (test::seqCTest2 & objSeqTest2Update);
static void gen_seq4 (test::seqRecTest2 & attrSeqTest2Update);
static void gen_seq5 (test::seqCTest2 & objSeqTest2Delete);
static void gen_seq6 (test::seqRecTest2 & attrSeqTest2Delete);
static void gen_seq7 (test::seqCTest2 & objSeqTest2New);
static void gen_seq8 (test::seqRecTest2 & attrSeqTest2New);
static void gen_seq9 (test::seqCTest2 & objSeqTest2Update);
static void gen_seq10 (test::seqRecTest2 & attrSeqTest2Update);
static void gen_seq11 (test::seqCTest2 & objSeqTest2Delete);
static void gen_seq12 (test::seqCTest2 & objSeqTest2New);
static void gen_seq13 (test::seqCTest2 & objSeqTest2Delete);
static void gen_seq14 (test::seqCTest1 & arg1);
static void gen_seq15 (test::seqCTest2 & arg1);
static void gen_seq16 (test::seqCTest1 & arg1);
static void gen_seq17 (test::seqRecTest1 & attrArg1);
static void gen_seq18 (test::seqCTest1 & objArg1);
static void gen_seq19 (test::seqCTest2 & arg1);
static void gen_seq20 (test::seqRecTest2 & attrArg1);
static void gen_seq21 (test::seqCTest2 & objArg1);
static void gen_seq22 (test::seqCBusinessObject & objectsToDispose);

//
//  ROUTINE NAME: Main
//
//  FUNCTIONAL DESCRIPTION:
//
//      This is a platform independent main.
//
//

OBB_QUICK_MAIN

{
    OBB_QUICK_CLIENT_INIT;

    OBB_QUICK_OPENLOGFILE;

    OBB_QUICK_LOGTXT ("\n***** Client Started Execution *****\n");


    if (!test_CTest1Invoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CTest1 Interface *****");

    if (!test_CTest2Invoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CTest2 Interface *****");

    if (!test_CInitInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CInit Interface *****");

    if (!test_CSysInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CSys Interface *****");

    if (!test_CFactoryInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CFactory Interface *****");

    if (!test_CQueryInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CQuery Interface *****");

    if (!test_CSysMgmInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CSysMgm Interface *****");

    if (!test_CBusinessObjectInvoke())
     OBB_QUICK_LOGTXT ("\n***** Failure in CBusinessObject Interface *****");

    OBB_QUICK_LOGTXT ("\n***** Client Completed Execution *****");

    OBB_QUICK_CLOSELOGFILE;

    OBB_QUICK_EXIT;

}


//
//  ROUTINE NAME: test_CTest1Invoke
//
//  FUNCTIONAL DESCRIPTION:
//
//      Routine to invoke the operations on the CTest1 interface.
//
//

static CORBA::Boolean test_CTest1Invoke (void)

{
    // Local Data Declaration 
    test::CTest1_var M_test_CTest1Obj;
    CORBA::Object_ptr CTest1Obj;
    CORBA::Object_var CTest1ObjVar;

        //
    // This is a quick way of getting an object reference. The ideal way
    // is to find the object advertised in the advertisement registry.
    //

    CORBA::Char * CTest1Obj_str = "\
DEC::~100101515efc27afb6b0000029d60cf5100000000000fd31c37a17\
0e0000029d60cf5100000000023100000000023fd31c37a1a0e0000029d6\
0cf5100000000003fd31c37a1b0e0000029d60cf5100000000004fd31c37\
a1c0e0000029d60cf5100000000005fd31c37a1d0e0000029d60cf510000\
0000006fd31c37a1e0e0000029d60cf5100000000007fd31c37a1f0e0000\
029d60cf5100000000008fd31c37a200e0000029d60cf5100000000009fd\
31c37a210e0000029d60cf5100000000010fd31c37a220e0000029d60cf5\
100000000011fd31c37a230e0000029d60cf5100000000012fd31c37a240\
e0000029d60cf5100000000013fd31c37a250e0000029d60cf5100000000\
014fd31c37a260e0000029d60cf5100000000015fd31c37a270e0000029d\
60cf5100000000016fd31c37a280e0000029d60cf5100000000017fd31c3\
7a290e0000029d60cf5100000000018fd31c37a2a0e0000029d60cf51000\
00000019fd31c37a2b0e0000029d60cf5100000000020fd31c37a2c0e000\
0029d60cf5100000000021fd31c37a2d0e0000029d60cf5100000000022f\
d31c37a2e0e0000029d60cf5100000000023fd31c37a180e0000029d60cf\
5100000000001fd31c37a190e0000029d60cf510000000000200000fd31c\
37a170e0000029d60cf51000000020100023bffffe~~~~%00000%|";

    if (!StringifiedObjToRealObj (CTest1Obj_str,
                                  &CTest1Obj))
        return (CORBA_FALSE);

    // Assigned CTest1Obj to CTest1ObjVar to facilitate implicit release when 
    //       the variable goes out of scope.
    CTest1ObjVar = CTest1Obj;
        CORBA::Environment ev;
    if ( CORBA::is_nil(CTest1Obj, ev) )
        {
        OBB_QUICK_LOGTXT ("\n\n CTest1Obj : NIL Object");
        return (CORBA_FALSE);

        }

    M_test_CTest1Obj = test::CTest1::_narrow(CTest1Obj);
    // Invoke operations on the CTest1 interface 
    if (!testCTest1set_attr (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1set_attr failure *****");

    if (!testCTest1hasTest2s (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1hasTest2s failure *****");

    if (!testCTest1save1 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1save1 failure *****");

    if (!testCTest1save2 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1save2 failure *****");

    if (!testCTest1save3 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1save3 failure *****");

    if (!testCTest1opCTest1 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opCTest1 failure *****");

    if (!testCTest1opCTest2 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opCTest2 failure *****");

    if (!testCTest1opVoidCTest1 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opVoidCTest1 failure *****");

    if (!testCTest1opCVoidTest2 (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opCVoidTest2 failure *****");

    if (!testCTest1opLong (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opLong failure *****");

    if (!testCTest1opShort (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opShort failure *****");

    if (!testCTest1opFloat (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opFloat failure *****");

    if (!testCTest1opDouble (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opDouble failure *****");

    if (!testCTest1opString (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opString failure *****");

    if (!testCTest1opTypTestLong (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestLong failure *****");

    if (!testCTest1opTypTestShort (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestShort failure *****");

    if (!testCTest1opTypTestFloat (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestFloat failure *****");

    if (!testCTest1opTypTestDouble (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestDouble failure *****");

    if (!testCTest1opTypTestString (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestString failure *****");

    if (!testCTest1opTypTestUnboundString (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opTypTestUnboundString failure
*****");

    if (!testCTest1opEnumTest (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1opEnumTest failure *****");

    if (!testCTest1attr (M_test_CTest1Obj))
    OBB_QUICK_LOGTXT ("\n***** testCTest1attr failure *****");

    return (CORBA_TRUE);
}



<...some code omitted here...>



//
//
//  ROUTINE NAME: testCTest1hasTest2s
//
//  FUNCTIONAL DESCRIPTION:
//
//      This is a jacket routine for hasTest2s.
//
//

static CORBA::Boolean testCTest1hasTest2s (test::CTest1_var & CTest1Obj)

{
    // Local Data Declaration 
    CORBA::Environment ev;
    test::seqCTest2 * ret_test_seqCTest2 ;
    test::seqRecTest2 * seqAttr;



    OBB_QUICK_LOGTXT ("\n\n***** Invoking CTest1Obj->hasTest2s *****");
    ret_test_seqCTest2 = CTest1Obj -> hasTest2s (seqAttr,
        ev);
    // Handle any errors 
    if (IsException (ev,
        (CORBA::Char *)"test_CTest1_hasTest2s failed\n"))
        {
            return(CORBA_FALSE);
        }


    
    OBB_QUICK_LOGTXT ("unbound sequence ret_test_seqCTest2");
    OBB_QUICK_LOGPARAM (format_ulong, OBB_QUICK_INDENT * 4,
"ret_test_seqCTest2*
    OBB_QUICK_LOGPARAM (format_ulong, OBB_QUICK_INDENT * 4,
"ret_test_seqCTest2*
    for( int k1 = 0 ; k1 < 5 ; k1++ ) {
    OBB_QUICK_LOGTXT ("        struct test::recObjTe��O");
    if (CORBA::is_nil ((* ret_test_seqCTest2)[k1].objTest2.operator
CORBA::Obje*
        {
        OBB_QUICK_PRINTF((logfile, "               
ret_test_seqCTest2[%d].objT*
        }
    else
        {
        if (!PrintStringifiedObj ((* ret_test_seqCTest2)[k1].objTest2.operator
*
            return (CORBA_FALSE);
        }
    } // for( k1 )

    delete ret_test_seqCTest2;
    
    OBB_QUICK_LOGTXT ("unbound sequence seqAttr");
    OBB_QUICK_LOGPARAM (format_ulong, OBB_QUICK_INDENT * 4,
"seqAttr->_maximum"*
    OBB_QUICK_LOGPARAM (format_ulong, OBB_QUICK_INDENT * 4,
"seqAttr->_length",*
    for( int k2 = 0 ; k2 < 5 ; k2++ ) {
    OBB_QUICK_LOGTXT ("        struct test::recTe��O");
    if (CORBA::is_nil ((* seqAttr)[k2].testObjTest1.operator
CORBA::Object_ptr(*
        {
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testObjTest1 :
*
        }
    else
        {
        if (!PrintStringifiedObj ((* seqAttr)[k2].testObjTest1.operator
CORBA::*
            return (CORBA_FALSE);
        }
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testLong: "
OBB*
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testShort: "
OB*
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testFloat: "
OB*
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testDouble: "
O*
        OBB_QUICK_PRINTF((logfile, "                seqAttr[%d].testString: "
O*
    OBB_QUICK_LOGTXT ("                enum enumTest");
    OBB_QUICK_LOGPARAM (format_ulong, OBB_QUICK_INDENT * 12, "enumTest", (*
seq*
        OBB_QUICK_PRINTF((logfile, "               
seqAttr[%d].testUnboundStri*
    } // for( k2 )

    delete seqAttr;


    return (CORBA_TRUE);
}

<...etc...sorry about the poor format...>

2430.2PTR 16-3-235REQUE::BOWERPeter Bower, ObjectBrokerSat Feb 15 1997 08:3036
    The whole idl file does not appear to be in the note and long lines
    are truncated. However, I believe I reproduced the problem and 
    it appears the problem occurs in a sequence of struct with an interface 
    in the struct.
    
    I have entered a problem report on this. 
    
    The .operator CORBA::Object_ptr lines should be CTest2_ptr as
    follows:
    
************
File $USER2:[BOWER]BCLIENT.CXX;3
  157       if (CORBA::is_nil ((* ret_seqCTest2)[k1].objTest2.operator CTest2_ptr(), ev))
  158           {
******
File $USER2:[BOWER]BCLIENT.CXX;2
  157       if (CORBA::is_nil ((* ret_seqCTest2)[k1].objTest2.operator CORBA::Object_ptr(), ev))
  158           {
************
************
File $USER2:[BOWER]BCLIENT.CXX;3
  163           if (!PrintStringifiedObj ((* ret_seqCTest2)[k1].objTest2.operator CTest2_ptr()))
  164               return (CORBA_FALSE);
******
File $USER2:[BOWER]BCLIENT.CXX;2
  163           if (!PrintStringifiedObj ((* ret_seqCTest2)[k1].objTest2.operator CORBA::Object_ptr()))
  164               return (CORBA_FALSE);
************

Number of difference sections found: 2
Number of difference records found: 2

DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=$USER2:[BOWER]A.TMP;10-
    $USER2:[BOWER]BCLIENT.CXX;3-
    $USER2:[BOWER]BCLIENT.CXX;2
    
2430.3Additional info/questionSTKAI1::T_ANDERSSONTomas AnderssonWed Mar 05 1997 03:50153
 One of our customers is experimenting with this, and he claims that
 removing the object references from the sequences of structs which
 he originally tried to use (since the manual says that sequences
 of object references are not supported), and replacing them with
 a variable of type long, works much better. There was a small problem
 with this which he could solve, and then the whole C++ thing worked
 with both client and server. 

 The problem he encountered was in the server code for operations
 having more than one object reference out argument.

 For example (IDL):


	void Login (in typUsername Username, in typPassword Password,
             out CSys objSys, out CFactory objFactory, out CQuery objQuery);


 gives a compilation error, such as:


	D:\_magnus\projekt\newTools\win95\Cxx\testMethod.cxx(2688) : error
	C2374: 'temp_object' : redefinition; multiple initialization


 The erroneous source code looks like this:

==========

/*
 *
 *  ROUTINE NAME:       CInitImpl::CInitImpl_Login
 *
 *  FUNCTIONAL DESCRIPTION:
 *
 *      Method routine for Login.
 *       (Implementation : CInitImpl)
 *
 */


 void CInitImpl::CInitImpl_Login (
     const test::typUsername Username,
     const test::typPassword Password,
    test::CSys_ptr & objSys,
    test::CFactory_ptr & objFactory,
    test::CQuery_ptr & objQuery,
    test::CTest1_ptr & objTest1,
    CORBA::Environment & ev)

{

#if defined(OBB_QUICK)
    CORBA::ReferenceData_ptr  ref_data = 0;
    CORBA::Char *             ref_buf;
    CORBA::ImplementationDef_ptr impl_def;
    CORBA::Long          len;
    OBB_QUICK_LOGTXT ("\n\n***** Login Method *****");

    OBB_QUICK_LOGPARAM (format_string, OBB_QUICK_INDENT * 0, "Username",
(const char *)Username);
    OBB_QUICK_LOGPARAM (format_string, OBB_QUICK_INDENT * 0, "Password",
(const char *)Password);

    //  Initialize this method's OUT arguments 
    impl_def = CSysImpl_ptr->_OBB__registered_impl();
    len = strlen ("This is test_CSys__OBJ")+1;
    ref_buf = (CORBA::Char *) CORBA::ReferenceData::allocbuf (len);
    if ( !ref_buf )
        {
        OBB_QUICK_LOGTXT("Unable to allocbuf for
CORBA::ReferenceData\n");
        return ;
        }
    strcpy (ref_buf, "This is test_CSys__OBJ" );
   ref_data = new CORBA::ReferenceData (len,
                                         (CORBA::Octet *)ref_buf,
                                          CORBA_TRUE);
    if (!ref_data)
      {
        OBB_QUICK_LOGTXT("Unable to allocate memory for
CORBA::ReferenceData\n");
        return ;
      }
    CORBA::Object_ptr temp_object = OBB::DEC_BOA->create (*ref_data,
                            test_CSys__OBJ,
                            impl_def,
                            ev);
    // Handle any errors 
    if (IsException (ev,
        (CORBA::Char *)"OBB::DEC_BOA->create failed\n"))
          return ;

    objSys = test::CSys::_narrow(temp_object);

    CORBA::Object_ptr temp_object = OBB::DEC_BOA->create (*ref_data,
                            test_CFactory__OBJ,
                            impl_def,
                            ev);
    // Handle any errors 
    if (IsException (ev,
        (CORBA::Char *)"OBB::DEC_BOA->create failed\n"))
          return ;

    objFactory = test::CFactory::_narrow(temp_object);

    CORBA::Object_ptr temp_object = OBB::DEC_BOA->create (*ref_data,
                            test_CQuery__OBJ,
                            impl_def,
                            ev);
    // Handle any errors 
    if (IsException (ev,
        (CORBA::Char *)"OBB::DEC_BOA->create failed\n"))
          return ;

    objQuery = test::CQuery::_narrow(temp_object);

    CORBA::Object_ptr temp_object = OBB::DEC_BOA->create (*ref_data,
                            test_CTest1__OBJ,
                            impl_def,
                            ev);
    // Handle any errors 
    if (IsException (ev,
        (CORBA::Char *)"OBB::DEC_BOA->create failed\n"))
          return ;

    objTest1 = test::CTest1::_narrow(temp_object);

    // Free memory allocated locally 
    delete ref_data;


#endif   /* OBB_QUICK */

/* OBB_PRESERVE_BEGIN(CInitImpl::CInitImpl_Login) */
    /* Insert code that you want preserved here */
/* OBB_PRESERVE_END(CInitImpl::CInitImpl_Login) */


    return;
}

==========

 He solved the problem by renaming temp_object, giving it a unique name.

 It would be interesting to know if there are there any plans for fixing
 the limitations with object references in sequences (with or without
 structs) in future releases of ObjectBroker.

 - Tomas A -

2430.4REQUE::BOWERPeter Bower, ObjectBrokerSat Apr 19 1997 08:172
    This is PTR 16-3-256