|
Hi All,
If I have 4 threads created, can I set any one thread to run for a specific amount of time. If yes , if there any APIs available for this.
|
|
|
|
|
I don't think there is any direct API way of doing what you require. I'd suggest that the thread that is to run for only a specific time, should be designed to check elapsed time in a looping fashion along with whatever else it is supposed to do. Once the elapsed time reaches the allowed time to run, it can then end.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
|
To control the thread externally, i.e, from another thread, you can do a SuspendThread[^] on it after the specified time has elapsed.
This is not recommended in cases where the thread being suspended holds locks or synchronization objects.
In such cases you can send events to the thread to suspend itself.
But then the thread must be designed to handle such events.
|
|
|
|
|
i have more than 10 thousand items with more than 100 hierarchy level, creating contextmenu on right click giving problem,.. pls give me some inputs..
modified on Monday, January 10, 2011 9:01 AM
|
|
|
|
|
One word for you; Redesign. Even if you succeed in creating that mess it would look horrible just opening 10K items in a menu, and a contextmenu at that.
|
|
|
|
|
Ignoring the fact if this is userfriendly or not, it shouldn't be impossible to create something like that.
With 100 hierarchy levels and 10000 items, it's not needed to have the actual 10000 items in the menu at the same time. You can add the sub items when their parent is opened, rather than adding everything at once.
e.g.
Visible menu:
File | Edit | View | History | Bookmarks | Tools | Help
That's 7 required visible items. Now when the user clicks on an item, for example Edit, you'd insert the appropriate sub items;
Undo | Redo | Cut | Copy | Paste | Delete | Select all | Find | Find again
Now you've added only 10 items, since you can ignore all the subitems under File, View, History etc.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
I would suggest you have 9,990 too many. Nobody can possibly navigate that many items (nor would they want to) in a main window menu, let alone a context menu. Go back to the drawing board and re-think what you are trying to achieve.
I must get a clever new signature for 2011.
|
|
|
|
|
yogish293 wrote: 0 thousand items with more than 100 hierarchy level,
I hope that is a typo. If not there is something horrible wrong with your design. Having 10K menu entries is simply not the way to design an application. One word comes to mind, Refactor your design.
|
|
|
|
|
I take it there are tons of functions being called by these menu items that are technically the same, but are just applied on different data, with different options, in different modes of operation, etc.. Provided this is true, you should seriously consider all these entries to be replaced by a call to just one dialog box that lets you select all the extra parameters you need. Do that with all menu of your current menu items and see how many individual function calls you end up with - I bet it's less than a 100. If not then this is the most weird application I've ever heard of, apart from MS Word.
|
|
|
|
|
Please consider usability, especially when designing UIs.
I've come to understand that UI design is very involved and it is a winning factor between competing products.
You must first think if you yourself will use such a software.
In this case think of selecting a random menu item every minute.
Run that through your mind for some time and see if you give up using it.
|
|
|
|
|
yogish293 wrote: pls give me some inputs..
You already have so many...
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]
|
|
|
|
|
Think the main rule is that if the user have more than 8 menu items to choose between, then you should consider redesigning the GUI.
|
|
|
|
|
yogish293 wrote: i have more than 10 thousand items with more than 100 hierarchy level, creating contextmenu on right click giving problem
What is the problem?
|
|
|
|
|
Oh MyGod, Does not the sytem error?
|
|
|
|
|
Hi All,
i want a library/dll through which i can convert jpeg images to mpeg4 video format and vice versa.
i googled and found FFMpeg, many sample codes use the exe and do the conversions; i donot want that way, i want any library/dll to be linked to my project and then i will be using the api(s) directly!
Can you please suggest me any open source like or easier that FFMpeg?
Note i am doing this in VC++!
Regards,
Kapardhi
|
|
|
|
|
Generally a list control keeps two states of check box CHECK and UNCHECK
i want 3 states of check box in list control. Is there any sample to use more than one state of check box in list control?
how to do it?
|
|
|
|
|
MKC002 wrote: how to do it?
Have you checked here?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi All,
Im working on Porting project.
We are porting from VS2005 to VS2010.
In one of the project contains the following code snippet
ifstream infile;
infile.fd();
But i cant find any equivalent code for this file descriptor in VS10.
Please help me to solve this.
Thanx.
|
|
|
|
|
Hello everyone, if the file csFilePath opened by other application. The statement, SHGetFileInfo() will throw exception. who knows how to resolve it?
SHFILEINFO sfi;
SHGetFileInfo((LPCTSTR)(csFilePath), 0, sfi, sizeof(SHFILEINFO), SHGFI_PIDL| SHGFI_SYSICONINDEX | SHGFI_ICON);
if (sfi.iIcon != 0)
m_ListCtrlLocalFileList.SetItem(i, 0, LVIF_IMAGE, NULL, sfi.iIcon, 0, 0, 0);
if(sfi.hIcon)
DestroyIcon(sfi.hIcon);
|
|
|
|
|
What kind of exception did you get (I see no exception mentioned in documentation)?
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]
|
|
|
|
|
yu-jian wrote:
SHGetFileInfo((LPCTSTR)(csFilePath), 0, sfi, sizeof(SHFILEINFO), SHGFI_PIDL| SHGFI_SYSICONINDEX | SHGFI_ICON);
You have passed an invalid parameter in the third field, it should be the address of the SHFILEINFO structure, thus:
SHGetFileInfo((LPCTSTR)(csFilePath), 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL| SHGFI_SYSICONINDEX | SHGFI_ICON);
I must get a clever new signature for 2011.
|
|
|
|
|
when copy the code to the codeproject I delete this & signature.
But now the error dispear, after I set the sort property of the CListCtrl to none.
thank you for your reply.
|
|
|
|
|
Hi all
Recently, I learned how to split a window using CSplitterWnd and OnCreateClient.
In my application, I need different window layout (2X2 , 3X3)for different function modules.
function modules are invoked by clicking on a menu item.
I need to show different layouts when the use calling different function modules.
Thanks
|
|
|
|
|
This should work but I'm not sure.
Create 2 views initially.
In one do a 2x2 and in the other do a 3x3.
Now you can try to show/hide the parent view.
|
|
|
|