Archived
A question about setObserversByIdentity in c++ builder vcl form
I want to write a c++ program like IceGridGui in c++ builder 2007 with VCL Form; I use the Ice-3.2.1 version;
I put a button on main form, if I click the button, it would login to icegrid and register observers to monitor the icegrid;
When successfully createAdminSession, it comes to setObserversByIdentity. But program is blocked in setObserversByIdentity, and the main form can not reaction anymore.
But if I write a console application without any VCL , all is ok, it would not be blocked by setObserversByIdentity ; So, I think my setObserversByIdentity code has no problem.
So , I want to know, in c++ builder VCL application, whether I must invoke setObserversByIdentity function on separate Thread ?
my vcl program is in attachment testice.zip, on the file MyAdminSession.cpp
Comments
-
Hello,
Since you're studying Ice and not working on a legacy system, I very much recommend you use the latest version of Ice (Ice 3.7.1) and a recent C++ compiler for Windows, such as Visual Studio 2017. Visual Studio 2017 is free for students and for hobby projects.
Then write your graphical application in C++ or C#. You can make remote Ice calls from the UI thread using async method invocation (AMI). AMI calls are guaranteed to never block. For example, with the Slice to C++11 mapping, you would call setObserversByIdentityAsync:
https://doc.zeroc.com/api/Ice37/cpp11/classIceGrid_1_1AdminSessionPrx.html#afc060d696676472fa28a7ed3b532eb8cSee also:
https://doc.zeroc.com/pages/viewpage.action?pageId=18255302
https://doc.zeroc.com/display/Ice37/Dispatching+Requests+to+User+ThreadsCheers,
Bernard0