[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

16.0. "what is wrong with this OREF Moniker?" by EMNTAL::STADELMANN (Sepp @ZUO 760-2609) Thu Feb 06 1997 11:40

    
    
    I get an automation error in VB
    I follow the User's Guide
    
    Step 1: was perofmed, selected was ...BANK\EXAMPLE1\BANK.IDL
    all went well, .reg .old and .tlb was generated into \ORB\BIN\
    (see below)
    
    Step 2: Write the Visual Basic Client Application
    
    1. Bug found in the User's Guide (also I need to know whats wrong)
    
    UG sais ...
    DIM DisplayName As Object ... this is OK, but then 
    DisplayName$="\\@Digital.Obb.Bridge\OREF\"DEC::.....
    this is wrong                            ^ can't stay here
    also this assignes a string to DisplayName$ while DIM says DisplayName 
    is of type Object, and this does not fit
    
    2. Also I get an OLE Automation error
    
    3. Step 1: Creating Bindings for the ObjectBroker Object's OMG IDL File
    Point 8. says what all gets created
    
    The docu does not say what I must do after generating with the 
    generated files. I have
    e:\orb\bin\DIBANK_CheckAcct.odl
    e:\orb\bin\DIBANK_CheckAcct.reg
    e:\orb\bin\DIBANK_CheckAcct.tlb
    
    I have doubble cklickt the .reg (to be shure))
    I have loaded (referenced) into VB the .tlb 
    
    what else can I check to overcome my Automation error ?
    
    Is the OREF Moniker a real correct "\\@Digital.Obb.Bridge\OREF\DEC:...
    ...continues with the stringified object from Bank1 Example which was
    previously built an run on this Windows 95 System
    
    ... looking to the release notes, I have the impression that I should
    proceed differently using a name server, but how do I then make OREF
    Monikers work, to not run into an Automation error?
    
    Sepp
    
    
T.RTitleUserPersonal
Name
DateLines
16.1Try thisiceaxe.zko.dec.com::RosenMichael RosenFri Feb 07 1997 13:4619
Sepp,

You are correct, the documentation is wrong for using this function.  The following 
code works for me.

Mike Rosen
-----------

Dim oTest As DITest_SeqofLongs	'Where this is the interface generated by DTC for the 
CORBA module Test, interface SeqofLongs.

Set oTest = 
GetObject("@Digital.Obb.Bridge\OREF\DEC::~10001979d1dae7a1120000002101fa0a500000000000
8a1dae7a971b000002101fa0a5000000000011000000000018a1dae7a981b000002101fa0a500000000001
000008a1dae7a971b000002101fa0a500000002010000180~~~~%00000%|")

The following code also works with an object in the namespace named Test.

Set oTest = GetObject("@Digital.Obb.Bridge\ADAPTER\ObjectBroker\Advertisements\Test")
16.2GetObject(OrefMoniker$) makes VB crashingEMNTAL::STADELMANNSepp @ZUO 760-2609Wed Feb 12 1997 12:2126
    when I do (setting up my Oref Moniker) as you recommend in .-1, 
    Set anAccount = GetObject(DisplayName$)
    
    pops up an error message box
    
    Microsoft Visual C++ Debug Library
    Debug Error!
    Program: D:\VB32\VB32.EXE
    abnormal program termination
    
    (Press Retry to debug the application)
    <abort> <retry> <ignore>
    
    in other words, 
    Set anAccount = GetObject(DisplayName$)
    
    makes VB 4.0 crashing. (not nice)
    
    (I must admit, I cant tell yet if the used Oref Moniker part belonging
    to the .obr file does still point to a valid object / implementation.
    
    I would expect an exception not a VB crash.
    
    Sepp,
    
    
16.3NUTS2U::LITTLEATG/EOS/Object Infrastructure/meThu Mar 06 1997 03:497
    Sepp,
    
    I have a simple Visual Basic bank client that you could look at if you
    like.  It uses the GetObject function to access existing bank acounts.
    
    -tl
    
16.4EMNTAL::STADELMANNSepp @ZUO 760-2609Fri Mar 14 1997 03:265
    tl,
    
    Thank you for your offer! Where can I get it?
    
    Sepp,
16.5vb program to access bank11PAMSRC::PROCTORsay it with objectsThu Mar 20 1997 08:56328
    Sorry for the delay.. It been real busy around here.  
    
    What follows is a mock health club billing program that works against
    the bank11 corba demo.  Just extract the following into club.frm and
    load into vb.
    
    good luck
    
    bob
    ---------------------------------------

VERSION 4.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "Form1"
   ClientHeight    =   7770
   ClientLeft      =   1380
   ClientTop       =   3690
   ClientWidth     =   7920
   ForeColor       =   &H00C00000&
   Height          =   8175
   Left            =   1320
   LinkTopic       =   "Form1"
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   7770
   ScaleWidth      =   7920
   Top             =   3345
   Width           =   8040
   Begin VB.CommandButton ExitCommand 
      Caption         =   "Exit"
      BeginProperty Font 
         name            =   "Arial Black"
         charset         =   0
         weight          =   400
         size            =   12
         underline       =   0   'False
         italic          =   0   'False
         strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5880
      TabIndex        =   14
      Top             =   6720
      Width           =   1455
   End
   Begin VB.ListBox accounts 
      Height          =   2370
      ItemData        =   "Form1.frx":0446
      Left            =   360
      List            =   "Form1.frx":0453
      TabIndex        =   13
      Top             =   2520
      Width           =   2655
   End
   Begin VB.TextBox StatusText 
      BackColor       =   &H00C0C0C0&
      BeginProperty Font 
         name            =   "Arial"
         charset         =   0
         weight          =   700
         size            =   8.25
         underline       =   0   'False
         italic          =   0   'False
         strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C00000&
      Height          =   315
      Left            =   1320
      TabIndex        =   12
      Text            =   "Transaction Formulation"
      Top             =   6840
      Width           =   2895
   End
   Begin VB.CheckBox SquashCheck 
      Caption         =   "Squash"
      Height          =   375
      Left            =   4560
      TabIndex        =   10
      Top             =   4680
      Width           =   1335
   End
   Begin VB.CheckBox SwimCheck 
      Caption         =   "Swimming"
      Height          =   375
      Left            =   4560
      TabIndex        =   9
      Top             =   3960
      Width           =   1335
   End
   Begin VB.CheckBox WeightsCheck 
      Caption         =   "Weights"
      Height          =   375
      Left            =   4560
      TabIndex        =   8
      Top             =   3240
      Width           =   1455
   End
   Begin VB.CheckBox TennisCheck 
      Caption         =   "Tennis"
      Height          =   375
      Left            =   4560
      TabIndex        =   7
      Top             =   2520
      Width           =   1335
   End
   Begin VB.CommandButton Debit 
      Caption         =   "Post Debit"
      BeginProperty Font 
         name            =   "Haettenschweiler"
         charset         =   0
         weight          =   500
         size            =   20.25
         underline       =   0   'False
         italic          =   0   'False
         strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   480
      TabIndex        =   6
      Top             =   5400
      Width           =   2535
   End
   Begin VB.TextBox Total 
      Height          =   375
      Left            =   6120
      TabIndex        =   5
      Text            =   "0"
      Top             =   5760
      Width           =   1095
   End
   Begin VB.TextBox SquashEdit 
      Height          =   375
      Left            =   6120
      TabIndex        =   3
      Text            =   "0"
      Top             =   4680
      Width           =   1095
   End
   Begin VB.TextBox SwimEdit 
      Height          =   375
      Left            =   6120
      TabIndex        =   2
      Text            =   "0"
      Top             =   3960
      Width           =   1095
   End
   Begin VB.TextBox WeightsEdit 
      Height          =   375
      Left            =   6120
      TabIndex        =   1
      Text            =   "0"
      Top             =   3240
      Width           =   1095
   End
   Begin VB.TextBox TennisEdit 
      Height          =   375
      Left            =   6120
      TabIndex        =   0
      Text            =   "0"
      Top             =   2520
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "Member's Accounts"
      Height          =   255
      Left            =   360
      TabIndex        =   15
      Top             =   2280
      Width           =   2535
   End
   Begin VB.Label Label2 
      Caption         =   "Status:"
      BeginProperty Font 
         name            =   "Arial"
         charset         =   0
         weight          =   700
         size            =   12
         underline       =   0   'False
         italic          =   0   'False
         strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   11
      Top             =   6840
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "Total:"
      BeginProperty Font 
         name            =   "MS Sans Serif"
         charset         =   0
         weight          =   700
         size            =   13.5
         underline       =   0   'False
         italic          =   0   'False
         strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4800
      TabIndex        =   4
      Top             =   5760
      Width           =   1095
   End
   Begin VB.Image Image2 
      Appearance      =   0  'Flat
      BorderStyle     =   1  'Fixed Single
      Height          =   1815
      Left            =   960
      Picture         =   "Form1.frx":0481
      Stretch         =   -1  'True
      Top             =   120
      Width           =   6135
   End
   Begin VB.Image Image1 
      Height          =   15
      Left            =   4680
      Picture         =   "Form1.frx":BE03
      Stretch         =   -1  'True
      Top             =   3120
      Width           =   15
   End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Public AccountsList
Private Sub List1_Click()

End Sub


Private Sub Option1_Click()

End Sub


Private Sub Option4_Click()

End Sub


Private Sub Check1_Click()

End Sub


Private Sub Debit_Click()

DisplayName = "@Digital.Obb.Bridge\ADAPTER\OBBObjects\Advertisements\" & accounts

StatusText.ForeColor = &HFF
StatusText.Text = "Transaction Pending"
Refresh

Set SelectedAccount = GetObject(DisplayName)

Dim NewBalance As Single
Dim funds As Single
funds = Int(Total)

SelectedAccount.Withdraw funds, NewBalance

StatusText.ForeColor = &HC00000
StatusText.Text = "Transaction Completed"

End Sub

Private Sub ExitCommand_Click()

End

End Sub


Private Sub Form_Activate()

accounts.ListIndex = 0

End Sub

Private Sub SquashCheck_Click()

If SquashCheck.Value = 0 Then SquashEdit = 0
If SquashCheck.Value = 1 Then SquashEdit = 15

StatusText = "Transaction Formulation"

Total.Text = Int(TennisEdit) + Int(WeightsEdit) + Int(SwimEdit) + Int(SquashEdit)

End Sub

Private Sub SwimCheck_Click()

If SwimCheck.Value = 0 Then SwimEdit = 0
If SwimCheck.Value = 1 Then SwimEdit = 35

StatusText = "Transaction Formulation"

Total.Text = Int(TennisEdit) + Int(WeightsEdit) + Int(SwimEdit) + Int(SquashEdit)

End Sub

Private Sub TennisCheck_Click()

If TennisCheck.Value = 0 Then TennisEdit = 0
If TennisCheck.Value = 1 Then TennisEdit = 65

StatusText = "Transaction Formulation"

Total.Text = Int(TennisEdit) + Int(WeightsEdit) + Int(SwimEdit) + Int(SquashEdit)

End Sub


Private Sub WeightsCheck_Click()

If WeightsCheck.Value = 0 Then WeightsEdit = 0
If WeightsCheck.Value = 1 Then WeightsEdit = 25

StatusText = "Transaction Formulation"

Total.Text = Int(TennisEdit) + Int(WeightsEdit) + Int(SwimEdit) + Int(SquashEdit)

End Sub