Delphi Clinic C++Builder Gate Training & Consultancy Delphi Notes Weblog Dr.Bob's Webshop
Dr.Bob's Kylix Kicks
 Borland C++Builder lost+found #16
See Also: C++Builder Papers and Columns

Hacking the ORB
I recently encountered people that sometimes create CORBA servers and client using Delphi 5 and IDL2PAS. If you propose to them to install C++Builder 5 including Visibroker 4, they start to complain that that will break their possibilities to create such programs. However, I sometimes have this irresistable urge to browse around in DLL's just to see what is going on, and I could not resist the temptation to see if I could make this work.

Browsing around
I have a little tool from the NT resource kit called 'depend'. It shows you dependencies of an executable or a DLL. It also shows you if entry points are missing. When looking at orbpas50.dll, I saw that it references orb_br.dll, one of the support DLLs you need to create CORBA servers and clients.

Line of thought
The next thing I thought of was to retrieve the old orb_br.dll. I renamed orb_br.dll of Visibroker 4 and substituted the one that comes with Visibroker 3.3 and looked at the dependencies of orbpas50.dll again, and lo-and-behold, no more missing entrypoints. Then I gave the Visibroker 3.3 another name, in this case orbpbr.dll, and renamed the Visibroker 4 orb_br.dll to its original name.

Hacking it
Now, the only thing left is to point orbpas50.dll to orbpbr.dll instead of orb_br.dll. I took a hex-editor and changed the text 'ORB_BR.DLL' to 'ORBPBR.DLL'. I did the same thing for orbpas33.dll that comes with the idl2pas package. Then I tried to make a simple CORBA server with Delphi. I then started Visibroker 4 and tried to run it. It ran, and it also showed up in the Visibroker console. When trying a couple of examples from the idl2pas package, they did function normally as far as I could see.

Why it works
Why does this work? Actually, Visibroker 4 still supports the old BOA mechanism that is still used in CORBA servers and clients created in Delphi 5 and C++Builder 5. And servers and clients actually communicate with osagent through calls to CORBA methods. Since the BOA interface did not change and is still present in Visibroker 4, they still function as they should.

Disclaimer
In this case, it is clear that this is a hack. I will not guarantee that it is industry-strenght, but it sort of looks OK to me. However, using the hack in a non-development environment might raise some licensing issues. I suspect that if you need the orb_br.dll of Visibroker 3.3, you need to have a license to do so, and you also need to have a Visibroker 4 license. I advise you to contact Inprise if you want to use this hack. Cheers.


This webpage © 2000-2017 by Bob Swart (aka Dr.Bob - www.drbob42.com). All Rights Reserved.