[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

21.0. "data type maping for VB" by EMNTAL::STADELMANN (Sepp @ZUO 760-2609) Wed Feb 12 1997 12:33

    When I see in my .ODL file
    
    interface DIBANK_AcctFactory : IDispatch
    {
    	[id(7)]
    	HRESULT CreateAcct(
    	[in] BANK_ACCT_TYPES acctType,
    	[in] float amount,
    	[out] long* acctId,
    	[in,out,optional] VARIANT* exceptionInfo,
    	[out,retval] DIBANK_Account** returnValue);
    }
    
    what DIM statements in VB do I best use for the 
    a) returnValue
    b) exceptionInfo
    c) acctType
    
    How is a data type defined in .ODL made available to a VB program ?
    
    would be nice to have a 1 to 1 maping for types as used in .ODL; i.e.
    
    DIM returnValue As DIBANK_Account	will this work ?
    DIM exceptionInfo As VARIANT	will this work ?
    DIM acctID As long
    DIM amount As single
    DIM acctType as BANK_ACCT_TYPES	will this work ?
    
    where can I best take the types used for my DIM statement
    
    Sepp,
    
T.RTitleUserPersonal
Name
DateLines
21.1Use VB Object Browsericeaxe.zko.dec.com::RosenMichael RosenFri Feb 14 1997 14:4623
>    When I see in my .ODL file
>    
>    interface DIBANK_AcctFactory : IDispatch
>    {
>        [id(7)]
>        HRESULT CreateAcct(
>        [in] BANK_ACCT_TYPES acctType,
>        [in] float amount,
>        [out] long* acctId,
>        [in,out,optional] VARIANT* exceptionInfo,
>        [out,retval] DIBANK_Account** returnValue);
>    }
>    
>    
>    How is a data type defined in .ODL made available to a VB program ?
    
We use the .ODL file to create a type library, the name/location of which
is specified by the -T command line switch or an edit box in the GUI.  From
the VB Tools menu, choose References... and add include that type library
in your VB Project.  Then use the Object Brower (Choose View from the Menu
Bar, or F2) to see the signature and types that VB expects.


21.2object typesEMNTAL::STADELMANNSepp @ZUO 760-2609Tue Feb 18 1997 05:5711
    Thank you that does the trick. To bad to forget it.
    
    1 more question: Can I use 
    
    DIM xyz AS DIBANK_AcctFactory (to say that each DIxyz...
    can be used as object type in a DIM statement after
    the type library generated has ben made available to VB?
    
    Sepp,
    
    
21.3Not sure what you are asking?iceaxe.zko.dec.com::RosenMichael RosenThu Feb 20 1997 16:448
Sepp,

I'm really not sure what you're asking in .2.  Can you give me another example 
of what you want to do?

Thanks,

Mike Rosen
21.4EMNTAL::STADELMANNSepp @ZUO 760-2609Mon Feb 24 1997 04:1514
    Mike,
    
    I want to know, after which steps I can use a VB DIM declaration
    statement of the form
    
    DIM myObj AS DIBANK_CheckAccnt
    
    when latest is DIBANK_CheckAccnt know to VB; My guess, after
    referencing the generated type library.
    
    which pre-required steps will make the DIM statement above work.
    DIBANK_CheckAccnt beeing an example.
    
    Sepp
21.5After referencing the Typelib from VBiceaxe.zko.dec.com::RosenMichael RosenMon Feb 24 1997 16:4318
There are two steps required before you can use the object in VB.

1) Right click on the CORBA IDL file, choose the Generate Code option, select 
the Desktop Views tab and create Automation interfaces and type libraries.

2) Reference the generated typelib in VB by including it using the 
Tools->Reference menu function.

Before you can use the "GetObject" function, you must also register the object 
reference in the object broker advertisement registry using the obbreg -O 
command.

OR

Before you can use the "CreateObject" function, you must register the CORBA 
factory object in the advertisement partition.

Mike
21.6EMNTAL::STADELMANNSepp @ZUO 760-2609Tue Feb 25 1997 04:211
    thanks Mike, this helped. Sepp