|
Cool, Matthew!
1.
Matthew Faithfull wrote: On the other hand a single front object for multiple internal objects, all of which can live in the MTA is a very reasonable and potentially useful design.
I think you mean making an MTA thread/component as front end and STA as inner component, and communication between MTA and STA through marshalling, right?
2.
For the performance design you mentioned above, if you say performence improved or superior, it must have some parties to compare to. What is the inferior design you compared to?
3.
"mediocre" you mean good or not good? Sorry for my limited English skill.
regards,
George
|
|
|
|
|
George_George wrote: an MTA thread/component as front end and STA as inner component
No that is the slower design because of all the interappartment calls.
George_George wrote: "mediocre"
means not very good.
If the inner components are free threaded but only ever called on the thread where they were created, by the outer component, then they all live in the MTA but don't have to worry about locking/synchronisation, you only have to do that in one place, in the outer component, plenty of speed and no deadlocks
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
1.
"interappartment calls." you mean marshalling expenses? And message queue expenses for STA?
2.
Let me repeat your great idea to confirm I understand.
You mean using MTA at front end, and using free threaded inner component for worker thread in MTA, right? Since in your design, each component is only touched by one thread, no synchronization and lock issues are needed to be considered and coded, so performance is improved, right?
3.
I am hard to believe such a system with separated components which do not need to share data has any values. In your designed system, the inner components do not need to communicate with each other? At least I think they need to communicate with the single MTA front end component, which there is additional locks on the MTA front end, which degrades performance.
Any comments?
regards,
George
|
|
|
|
|
George_George wrote: 1.
Yes.
George_George wrote: 2.
Yes.
George_George wrote: 3.
The system has value in limited situations such as if you're scaling a single user system up to a multi user system. If each inner component is tied to a one user and can work without much if any modification.
Yes you still need locks in the front end component as I said but only to protect the thread pool and this can usual be done with fairly efficient Critical Section locks. In the system I worked on the only 'communication' between the inner objects was that they shared a database. This was already protected for sharing anyway as it normally would be between multiple users.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
1.
Matthew Faithfull wrote: This was already protected for sharing anyway as it normally would be between multiple users.
You rely on database lock? So, if you rely on database lock, there is no need to add additional lock on your inner component.
2.
I did some research and find MTA component is the same as free threaded component, right? Why do you distinguish them in your previous posts?
regards,
George
|
|
|
|
|
Hi all,
I m using a image list for TreeView.
How can change icon of TreeView Item On the click of CheckBox or Double click on that purticular item.
Thanks in advance.
|
|
|
|
|
You have a few choices. You can use TVM_SETIMAGELIST, with wParam set to TVSIL_STATE. That should replace the actual checkboxes.
Or you can react to NM_CLICK / NM_DBLCLICK, and change the image list index for an item, which gives you added flexibility.
There's a lot of "depends", depending on the finer details of what you're trying to do.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Please can u give some example of code.
|
|
|
|
|
ThatsMe. wrote: Please can u give some example of code
Nope! There's several stages in there.
Look up ON_NOTIFY, and NM_CLICK to write a handler to monitor for clicks.
Then TVM_HITTEST to find out which item was clicked.
Then TVM_SETITEM, with a tvItem.mask = TVIF_IMAGE to change the image index to something else.
Lastly, You may need to invalidate the control.
This is a decent chunk of work, but like most programming jobs, break it into bite size chunks.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
I need get icons 48x48 from system imagelist.
Function SHGetFileInfo can get list of icons 16?16 or 32?32.
But how I can retrieve 48?48?
This is needed for display list of disks in CListCtrl in view Tile...
|
|
|
|
|
Check out SHGetImageList()
|
|
|
|
|
hi
I have a application to display a message box after the application is closed . How can i do that , help me .
with warm regards
K.Guru Moorthy
k.guru moorthy
|
|
|
|
|
Well, if your application is terminated, you can't do anything from it anymore.
You mean that you want to display a message box when the main application window disapeared ? If yes, which kind of application are you doing ? SDI, MDI, dialog based ?
|
|
|
|
|
hullo sir, thanks for replying. it is a vc++ applikason.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
(1) Display the message box when your application is still running.
(2) Press down the Print Screen key on the keyboard.
(3) Close your application.
(4) Open MS Paint .
(5) Paste the image ( CTRL + V ).
(6) Enjoy you Message Box
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
|
|
|
|
|
Create a service which monitor your application and call a MessageBox from your service whenever your application is closed.
|
|
|
|
|
Hi,
Try handling the WM_QUIT message in the application main window. Here you show a messagebox using ::MessageBox API with NULL window handle.
case WM_QUIT :
MessageBox(NULL,"Your Message","Your Message Caption",MB_OK);
i think this will help you.
thanks.
Nitheesh
|
|
|
|
|
Or When you want to exit your program you can run other exe file for show it.
|
|
|
|
|
Hello,
If anyone has any idea about compatibility of Detours with WinCE.
Or any study material anyone can suggest regarding this, please let me know.
Thanks in advance.
|
|
|
|
|
Hi all,
i m working on VC++2005, and my application is SDI type.
i split Mainframe in two parts(in columns),at one side i m using a TreeViewCtrl and other side i m using FormView classes,
i m replacing the views on the LButtonDown of TreeViewCtrl.
OnInitialUpdate function is not calling in FormView calss those are using in Replaceviews.
please anyone can tell me what can i do.
Thanks in advance.
|
|
|
|
|
If you look on www.msj.com, there was an article or two by Paul DiLascia that covered replacing views. Even if it takes a while to find, they're all really good reads, and informative.
I'm pretty sure there's an article or two on codeproject also.
Lastly, have a look to see when OnInitialUpdate is called for the first view. If it's done from the create frame code in MFC, and you're doing some mutant manual version, then the bug is *you're* not calling OnInitialUpdate.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
|
Hi,
The OnInitialUpdate is called only when the view is created. So delete the view you want to replace and then recreate it. Now the OnInitialUpdate will work fine.
thanks
Nitheesh
modified on Friday, April 4, 2008 7:57 AM
|
|
|
|
|
ThatsMe. wrote: OnInitialUpdate function is not calling in FormView calss those are using in Replaceviews.
Do you mean to use OnUpdate() instead?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
If it's like the code I remember, he'll be creating CTwoView, then killing COneView - and each time you create a new one, he's making sure its OnInitialUpdate member is called. Brush Pen creation etc.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|