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

Conference pamsrc::objectbroker_dtc

Title:ObjectBroker Desktop Connection
Moderator:RECV::STORM
Created:Mon Jan 06 1997
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:40
Total number of notes:125

30.0. "OLE automation interface generation: strange error" by STKAI1::T_ANDERSSON (Tomas Andersson) Wed Mar 05 1997 04:33

 I've been experimenting with interface generation for OLE automation. I tried
 the BANK.IDL from Example 11 in the OBB examples collection, and it worked OK.
 But when I try with one of my own IDL files (very long, unfortunately), I get
 an error message which tells me to look in one log file per interface. Here's
 an example:

	>Microsoft (R) Type Library Generator  Version 2.03.3023
	>Copyright (c) Microsoft Corp. 1993-1995.  All rights reserved.
	>
	>C:\_magnus\obb_new_tools\ole_auto\DItest_CTest1.odl : fatal error
M0004:
	>Error processing type library 'DItest_CTest2.tlb': Error loading type
	>library/DLL.

 I was careful to point out the System32 directory for storing typelibrary
files,
 just like it says in the manual, so I don't understand why I get this error.

 What could I be doing wrong?

==========

 Here's the corresponding ODL file (slightly abbreviated):

==========

[
        helpstring("DItest_CTest1 Library"),
        version(1.0),
        uuid(4700f3cd-5382-0b53-1d52-7b7cfcb58892)
]
library DItest_CTest1Library
{
        importlib("stdole32.tlb");
        importlib("oleosa.tlb");
        importlib("DItest_CTest2.tlb");


        [
                odl,
                dual, oleautomation,
                version(0.0),
                uuid(269a1693-0dff-c809-1de4-f85380f4ce4d)
        ]
        interface test_recObjTest2_recObjTest2 : DICORBAStruct
        {
                [id(128),propget] HRESULT objTest2([out,retval]
DItest_CTest2***
                [id(128),propputref] HRESULT objTest2([in] DItest_CTest2*
value*

        };

        [
                odl,
                dual, oleautomation,
                version(0.0),
                uuid(8ee812e2-2469-8418-1df3-105e21b34a98)
        ]
        interface DItest_CTest1 : IDispatch
        {
                [ id(7), helpstring("Method raises: DItest_errUnknown") ]
                HRESULT hasTest2s(
                        [out] SAFEARRAY(test_recTest2_recTest2*)* seqAttr,
                        [in,out,optional] VARIANT* exceptionInfo,
                        [out,retval] VARIANT* returnValue);



... <some details ommitted here> ...


                [ id(28), propget]
                HRESULT attr([out,retval] test_recTest1_recTest1**
returnValue);

        };


};

==========


T.RTitleUserPersonal
Name
DateLines
30.1CIM::LORENLoren KonkusWed Mar 05 1997 08:383
    Would it be possible for you to post or mail your complex idl to one of
    us so that we can see the kinds of interdependencies that are
    represented in it?
30.2STKAI1::T_ANDERSSONTomas AnderssonFri Mar 14 1997 10:29527
 Here's the IDL file (it's not that long):

====================================================================

module test3
{

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

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


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


  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;

  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
   arg2);
    void           opCVoidTest2 (in CTest2         arg1, out CTest2
   arg2);
    long           opLong       (in long           arg1, out long
   arg2);
    short          opShort      (in short          arg1, out short
   arg2);

    float          opFloat      (in float          arg1, out float
   arg2);
    double         opDouble     (in double         arg1, out double
   arg2);
    string         opString     (in string         arg1, out string
   arg2);

    typTestLong    opTypTestLong   (in typTestLong    arg1, out
typTestLong    arg2);
    typTestShort   opTypTestShort  (in typTestShort   arg1, out
typTestShort   arg2);


    typTestFloat   opTypTestFloat  (in typTestFloat   arg1, out
typTestFloat   arg2);
    typTestDouble  opTypTestDouble (in typTestDouble  arg1, out
typTestDouble  arg2);
    typTestString  opTypTestString (in typTestString  arg1, out
typTestString  arg2);
    typTestUnboundString  opTypTestUnboundString (in
typTestUnboundString  arg1, out typTestUnboundString  arg2);
    enumTest       opEnumTest      (in enumTest       arg1, out enumTest
      arg2);

  };

  interface CTest2 {

    readonly attribute recTest2 attr;

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

    oneway void dispose ();

    seqCTest1 hasTest1s (out seqRecTest1 seqAttr)  // Perf. opt.
      raises (errNotFound, errUnknown);

    // Test-operations for complex-datatypes (ie sequences)
    // Since ISTgodis v0.1 can't handle more than one out-sequence
(PKrec - name - conflict)
    // test-operations are divided into test-operations that return
sequences as return values 
    // and test-operations that return sequences as output-arguments.

    seqCTest1      opSeqCTest1     (in seqCTest1      arg1);
    seqCTest2      opSeqCTest2     (in seqCTest2      arg1);


    void opVoidSeqCTest1     (in seqCTest1       arg1, out seqCTest1
 arg2);

    void opVoidSeqAttrTst1   (in  seqRecTest1   attrArg1,
                              in  seqCTest1      objArg1,
                              out seqRecTest1   attrArg2,
                              out seqCTest1      objArg2);

    void opVoidSeqCTest2     (in  seqCTest2      arg1, out seqCTest2
 arg2);

    void opVoidSeqAttrTst2   (in  seqRecTest2   attrArg1,
                              in  seqCTest2      objArg1,
                              out seqRecTest2   attrArg2,
                              out seqCTest2      objArg2);

  };


  // ------------------------------------
  // Class Utility TechnicalObjects.CInit
  // ------------------------------------
  interface CInit {

    void LoginSysMgm (
                       in typUsername Username,
                       in typPassword Password,
                       out CSys objSys,
                       out CFactory objFactory,
                       out CQuery objQuery,
                       out CSysMgm objSysMgm
                     )
      // ## begin CInit.LoginSysMgm.raises preserve=no
      raises (errNoPriv, errUnknown);
      // ## end CInit.LoginSysMgm.raises

    void Login (
                 in typUsername Username,
                 in typPassword Password,
                 out CSys objSys,
                 out CFactory objFactory,
                 out CQuery objQuery,
                 out CTest1 objTest1
               )
      raises (errNoPriv, errUnknown);

  };


  // -----------------------------------
  // Class Utility TechnicalObjects.CSys
  // -----------------------------------
  interface CSys {

    void Logout ()
      raises (errNoPriv, errUnknown);

    void disposeObjects (
                          in seqCBusinessObject objectsToDispose
                        )
      raises (errNoPriv, errUnknown);

  };



  // ---------------------------------------
  // Class Utility TechnicalObjects.CFactory
  // ---------------------------------------
  interface CFactory {

    void dummyOperation ()
      raises (errNoPriv, errUnknown);

  };


  // -------------------------------------
  // Class Utility TechnicalObjects.CQuery
  // -------------------------------------
  interface CQuery {

    void dummyOperation ()
      raises (errNoPriv, errUnknown);

  };


  // --------------------------------------
  // Class Utility TechnicalObjects.CSysMgm
  // --------------------------------------
  interface CSysMgm {

    void startNewServer ()
      raises (errNoPriv, errUnknown);

    void enableLogLevel (in enumLogLevel logLevel)
      raises (errNoPriv, errUnknown);

    void disableLogLevel (in enumLogLevel logLevel)
      raises (errNoPriv, errUnknown);

    void reopenLog()
      raises (errNoPriv, errUnknown);

    void logoutCurrentUser()
      raises (errNoPriv, errUnknown);

  };


  // --------------------------------------
  // Class TechnicalObjects.CBusinessObject
  // --------------------------------------
  interface CBusinessObject {

    void dummyOperation ()
      raises (errNoPriv, errUnknown);

  };

};
#pragma repository_id( "test3::lenUsername",
"7b578efb9222.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::lenPassword",
"7b578efb9223.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::lenErrMsg",
"7b578efb9224.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typErrMsg",
"7b578efb9225.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typObjectId",
"7b578efb9226.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typUsername",
"7b578efb9227.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typPassword",
"7b578efb9228.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::enumLogLevel",
"7b578efb9229.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::errInvalidLogin",
"7b578efb922a.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::errNoPriv",
"7b578efb922b.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::errNotFound",
"7b578efb922c.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::errAlreadyExist",
"7b578efb922d.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::errUnknown",
"7b578efb922e.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::lenTestString",
"7b578efb922f.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestLong",
"7b578efb9230.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestShort",
"7b578efb9231.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestChar",
"7b578efb9232.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestBoolean",
"7b578efb9233.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestOctet",
"7b578efb9234.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestFloat",
"7b578efb9235.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestDouble",
"7b578efb9236.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestString",
"7b578efb9237.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::typTestUnboundString",
"7b578efb9238.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::enumTest",
"7b578efb9239.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recPKTest1",
"7b578efb923a.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recPKTest2",
"7b578efb923b.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recTest1",
"7b578efb923c.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recTest2",
"7b578efb923d.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recObjTest1",
"7b578efb923e.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recObjTest2",
"7b578efb923f.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::recObjBusinessObject",
"7b578efb9240.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::seqCBusinessObject",
"7b578efb9241.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::seqCTest1",
"7b578efb9242.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::seqRecTest1",
"7b578efb9243.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::seqCTest2",
"7b578efb9244.02.9d.60.dd.a7.00.00.00")
#pragma repository_id( "test3::seqRecTest2",
"7b578efb9245.02.9d.60.dd.a7.00.00.00")
#pragma interface_id( "test3::CTest1",
"7b578efb9246.02.9d.60.dd.a7.00.00.00")
#pragma attribute_id( "test3::CTest1::attr",
"7b578efb9247.02.9d.60.dd.a7.00.00.00", 1,
"7b578efb9248.02.9d.60.dd.a7.00.00.00", 2)
#pragma operation_id( "test3::CTest1::set_attr",
"7b578efb9249.02.9d.60.dd.a7.00.00.00", 3)
#pragma operation_id( "test3::CTest1::hasTest2s",
"7b578efb924a.02.9d.60.dd.a7.00.00.00", 4)
#pragma operation_id( "test3::CTest1::save1",
"7b578efb924b.02.9d.60.dd.a7.00.00.00", 5)
#pragma operation_id( "test3::CTest1::save2",
"7b578efb924c.02.9d.60.dd.a7.00.00.00", 6)
#pragma operation_id( "test3::CTest1::save3",
"7b578efb924d.02.9d.60.dd.a7.00.00.00", 7)
#pragma operation_id( "test3::CTest1::opCTest1",
"7b578efb924e.02.9d.60.dd.a7.00.00.00", 8)
#pragma operation_id( "test3::CTest1::opCTest2",
"7b578efb924f.02.9d.60.dd.a7.00.00.00", 9)
#pragma operation_id( "test3::CTest1::opVoidCTest1",
"7b578efb9250.02.9d.60.dd.a7.00.00.00", 10)
#pragma operation_id( "test3::CTest1::opCVoidTest2",
"7b578efb9251.02.9d.60.dd.a7.00.00.00", 11)
#pragma operation_id( "test3::CTest1::opLong",
"7b578efb9252.02.9d.60.dd.a7.00.00.00", 12)
#pragma operation_id( "test3::CTest1::opShort",
"7b578efb9253.02.9d.60.dd.a7.00.00.00", 13)
#pragma operation_id( "test3::CTest1::opFloat",
"7b578efb9254.02.9d.60.dd.a7.00.00.00", 14)
#pragma operation_id( "test3::CTest1::opDouble",
"7b578efb9255.02.9d.60.dd.a7.00.00.00", 15)
#pragma operation_id( "test3::CTest1::opString",
"7b578efb9256.02.9d.60.dd.a7.00.00.00", 16)
#pragma operation_id( "test3::CTest1::opTypTestLong",
"7b578efb9257.02.9d.60.dd.a7.00.00.00", 17)
#pragma operation_id( "test3::CTest1::opTypTestShort",
"7b578efb9258.02.9d.60.dd.a7.00.00.00", 18)
#pragma operation_id( "test3::CTest1::opTypTestFloat",
"7b578efb9259.02.9d.60.dd.a7.00.00.00", 19)
#pragma operation_id( "test3::CTest1::opTypTestDouble",
"7b578efb925a.02.9d.60.dd.a7.00.00.00", 20)
#pragma operation_id( "test3::CTest1::opTypTestString",
"7b578efb925b.02.9d.60.dd.a7.00.00.00", 21)
#pragma operation_id( "test3::CTest1::opTypTestUnboundString",
"7b578efb925c.02.9d.60.dd.a7.00.00.00", 22)
#pragma operation_id( "test3::CTest1::opEnumTest",
"7b578efb925d.02.9d.60.dd.a7.00.00.00", 23)
#pragma interface_id( "test3::CTest2",
"7b578efb925e.02.9d.60.dd.a7.00.00.00")
#pragma attribute_id( "test3::CTest2::attr",
"7b578efb925f.02.9d.60.dd.a7.00.00.00", 1,
"7b578efb9260.02.9d.60.dd.a7.00.00.00", 2)
#pragma operation_id( "test3::CTest2::set_attr",
"7b578efb9261.02.9d.60.dd.a7.00.00.00", 3)
#pragma operation_id( "test3::CTest2::dispose",
"7b578efb9262.02.9d.60.dd.a7.00.00.00", 4)
#pragma operation_id( "test3::CTest2::hasTest1s",
"7b578efb9263.02.9d.60.dd.a7.00.00.00", 5)
#pragma operation_id( "test3::CTest2::opSeqCTest1",
"7b578efb9264.02.9d.60.dd.a7.00.00.00", 6)
#pragma operation_id( "test3::CTest2::opSeqCTest2",
"7b578efb9265.02.9d.60.dd.a7.00.00.00", 7)
#pragma operation_id( "test3::CTest2::opVoidSeqCTest1",
"7b578efb9266.02.9d.60.dd.a7.00.00.00", 8)
#pragma operation_id( "test3::CTest2::opVoidSeqAttrTst1",
"7b578efb9267.02.9d.60.dd.a7.00.00.00", 9)
#pragma operation_id( "test3::CTest2::opVoidSeqCTest2",
"7b578efb9268.02.9d.60.dd.a7.00.00.00", 10)
#pragma operation_id( "test3::CTest2::opVoidSeqAttrTst2",
"7b578efb9269.02.9d.60.dd.a7.00.00.00", 11)
#pragma interface_id( "test3::CInit",
"7b578efb926a.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CInit::LoginSysMgm",
"7b578efb926b.02.9d.60.dd.a7.00.00.00", 1)
#pragma operation_id( "test3::CInit::Login",
"7b578efb926c.02.9d.60.dd.a7.00.00.00", 2)
#pragma interface_id( "test3::CSys",
"7b578efb926d.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CSys::Logout",
"7b578efb926e.02.9d.60.dd.a7.00.00.00", 1)
#pragma operation_id( "test3::CSys::disposeObjects",
"7b578efb926f.02.9d.60.dd.a7.00.00.00", 2)
#pragma interface_id( "test3::CFactory",
"7b578efb9270.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CFactory::dummyOperation",
"7b578efb9271.02.9d.60.dd.a7.00.00.00", 1)
#pragma interface_id( "test3::CQuery",
"7b578efb9272.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CQuery::dummyOperation",
"7b578efb9273.02.9d.60.dd.a7.00.00.00", 1)
#pragma interface_id( "test3::CSysMgm",
"7b578efb9274.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CSysMgm::startNewServer",
"7b578efb9275.02.9d.60.dd.a7.00.00.00", 1)
#pragma operation_id( "test3::CSysMgm::enableLogLevel",
"7b578efb9276.02.9d.60.dd.a7.00.00.00", 2)
#pragma operation_id( "test3::CSysMgm::disableLogLevel",
"7b578efb9277.02.9d.60.dd.a7.00.00.00", 3)
#pragma operation_id( "test3::CSysMgm::reopenLog",
"7b578efb9278.02.9d.60.dd.a7.00.00.00", 4)
#pragma operation_id( "test3::CSysMgm::logoutCurrentUser",
"7b578efb9279.02.9d.60.dd.a7.00.00.00", 5)
#pragma interface_id( "test3::CBusinessObject",
"7b578efb927a.02.9d.60.dd.a7.00.00.00")
#pragma operation_id( "test3::CBusinessObject::dummyOperation",
"7b578efb927b.02.9d.60.dd.a7.00.00.00", 1)

                                   
30.3CIM::LORENLoren KonkusFri Mar 21 1997 12:277
    Thanks for the idl. 
    
    We have found and resolved the problem. Your idl file loads completely
    now and the com and automation binding files are created. They look
    good visually, but of course the real test is if they work at run time.
    
    I believe this fix will be in the next field test update.