|
You are kidding right ?
I mean, you really think that somebody can explain you Corba in a simple forum reply ?
I didn't mean to sound offending, but it's just that Corba is extremly complex and there's no way you will be able to learn it just by having somebody explain a couple of things. If you really want to go on with Corba (which I'm not really sure is the best option), then I would suggest that you buy a book about it.
If you are open to other alternatives, then I suggest you describe a bit more in details what you are trying to achieve, because communicating between two applications can mean a lot of different things.
|
|
|
|
|
Thank you for your quick reply.
Actually, I have a main application, and 3 other applications.
When the main application receive a incoming call, it will test the option of the receiving stack,
and it will call the correponding application, by sending to it some parameters.
Actually, im searching for the more performing solution.
Thank you for your help,
Regards.
|
|
|
|
|
Are the applications on the same machine or different machines ?
What you have to know about Corba, is that it is used to expose objects (classes) to other applications. This way, from another application, you can access objects that are hosted in your application.
If you have to exchange data (and not really access an object from another application) between the two applications, then I would rather go for something like sockets or shared memory (a standard IPC mechanism).
|
|
|
|
|
Yes the applications are in the same machine.
and i have to send data from an application to another.
Note:
The applications are for phone calls, that's why i'm searching for the best and quick solution.
Thank you again for your time.
|
|
|
|
|
And the applications are written in the same language ?
From what you are saying, I'm really not sure that Corba is the better solution (but I also only have very limited information, so I might be wrong). You said that it is for phone calls, does it mean that you will need to transfer call data (for instance SMS, or digital data, ...) between the applications ?
Anyway, I suggest you take a look at the "Inter-process communication" section[^] here on CP:
|
|
|
|
|
I will write the applications in the same language, (i want to use C++).
Actually, the phone call that i will receive, contain options in it's stack (for exple: it's a fax call).
So i will call the application dedicated to the fax process, and i will send to this application some parameters (like the incoming phone number,...)
|
|
|
|
|
sounds almost like you need to consider something like ICE .. www.zeroc.com/[^]
'g'
|
|
|
|
|
A popular (and free) C++ CORBA implementation is TAO[^].
But I agree with previous posters - CORBA is a complex subject and you should really get a book, such as this one[^]. Good luck.
|
|
|
|
|
A previous response indicated that your applications are on the same machine. If so, then use shared memory queue. This will give you the best performance, the easiest code to write and debug and none of the headaches of CORBA or COM (or TCP/Named Pipes/etc.)
|
|
|
|
|
OK, sounds like a risky proposition to me...
1st, develop some sort of super weapon.
2nd, keep it totally secret, then ask US special forces to transport it somewhere.
3rd, When attacked by CORBA COMMANDOs, ask them politely to hand deliver some messages for you.
4th, Make sure you are a hot babe, then they will only knock you out.
As I said, more than a little risky, and also complicated. You will need to save up a lot of money for an underground lair also...
What, you didn't say COBRA?
Iain,
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi all,
i have made a worker thread and from that worker thread i am calling function to do some processing.
i have started my worker thread using this code
pThread = AfxBeginThread(Thread , (LPVOID) this);
I am terminating that thread on click event of a button, using this code
int ret = ::TerminateThread(pThread->m_hThread,NULL);
My problem is when TerminateThread line is being executed pointer never returns back i can't get its return value and lines after that piece of code is not being executed.
How to resolve this problem??
Thanks in advance...
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: How to resolve this problem??
Don't use TerminateThread, as stated in the documentation . There are much cleaner way to stop a thread than killing it brutaly. You might want to use a flag: a simple boolean that is set by your mean thread and that your worker checks to see if it has to stop. In which case, simply stop your "loop" in the worker thread.
Using TerminateThread is a very very very bad practice and should be avoided at all costs.
|
|
|
|
|
"_$h@nky_" wrote: How to resolve this problem??
Never call TerminateThread : that is the last, last, last resource. See instead [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It seems like you are terminating the same thread that is executing the specified code... Debugging will help you to identify that.
Btw, TerminateThread is not a good practice.
- ns ami -
|
|
|
|
|
ns ami wrote: It seems like you are terminating the same thread that is executing the specified code...
What's the evidence of that?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I tried with a sample...
- ns ami -
|
|
|
|
|
Hence your code shows such a behaviour...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What about trying yourself?
- ns ami -
|
|
|
|
|
I don't need to: I suppose to know both about your code and the OP's one. My mental-diff-tool says they are not the same...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
::TerminateThread( GetCurrentThread(), 0 );
cout << "after termination" << endl;
cout.flush();
This was my sample code...
- ns ami -
|
|
|
|
|
Your hypothesis is actually clever, anyway I cannot see how it fits with OP's introduction:
"_$h@nky_" wrote: i have made a worker thread and from that worker thread i am calling function to do some processing.
i have started my worker thread using this code
pThread = AfxBeginThread(Thread , (LPVOID) this);
I am terminating that thread on click event of a button, using this code
int ret = ::TerminateThread(pThread->m_hThread,NULL);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
- ns ami -
|
|
|
|
|
ns ami wrote: ::TerminateThread( GetCurrentThread(), 0 );
Of course, you are terminating the current thread, so it's normal that nothing after is executing . The OP terminates a thread which is probably not the current thread (we can't be 100% sure about that but chances are big that this is another thread).
EDIT: actually, yes it is a different thread because the OP terminates the thread which was created by calling AfxBeginThread.
|
|
|
|
|
I was just pointing out a possibility that I found.
From OP's code I too believe that he is terminating the thread created with AfxBeginThread. I think debugging is helpful for him to ensure that which thread is being executed.
- ns ami -
|
|
|
|
|
ns ami wrote: I was just pointing out a possibility that I found.
From OP's code I too believe that he is terminating the thread created with AfxBeginThread.
That's not what you were saying in your first message and what this all discussion is about. This is what you said and on what Carlo was arguing with you:
It seems like you are terminating the same thread that is executing the specified code...
|
|
|
|