Because in the attempt to use BCB 4 to access Nameservice, encountered some strange problems, and Visibroker example can be used to bcc32 normal compilation, I decided to do a program from scratch to see where the problem. Toss all night, the conclusion is to do the server or not the CORBA Server Wizard good. (I still don't understand why?) )
1, file| New, Multitier,corba IDL File:
interface Order{
string Name();
};
Save As Order.idl
2, file| New, Consol Wizard, generates a CONSOL application with no VCL support.
3, project| ADD to Project, select the order.idl,project you just wrote | The Compile.
4, file| New, Miltitier, Corba Object implementation,idl Select the newly written order.idl,interface order, for the sake of simplicity, the other names are not changed. OK, automatically generate OrderServer.cpp.
5, found in the OrderServer.cpp char* orderimpl::name (), in its function body write:
Return "Hi, I am Test corbaserver";
6, File | Save All,unit1.cpp as Tcnserver.cpp,project Save as TCNSERVER.BPR. and make the. A simple CORBA server is done.
7. Test run, then run Osfind.exe in MS-DOS mode (should be in path, otherwise to $ (vbroker) \ Bin), this will display a series of CORBA information:
C:\>osfind
osfind: Found one agent at port 14000
HOST: YANGWU
osfind: Found 1 OADs in your domain
HOST: YANGWU
osfind: Following are the list of Implementations registered with OADs.
HOST: YANGWU
REPOSITORY ID: IDL:CorbaTester/DBServer2Factory:1.0
OBJECT NAME: DBServer2
osfind: Following are the list of Implementations started manually.
HOST: YANGWU
REPOSITORY ID: IDL:Order:1.0
OBJECT NAME: OrderObject
REPOSITORY ID: IDL:visigenic.com/Activation/OAD:1.0
OBJECT NAME: 61.132.58.166