|
ratheeshnair123 wrote: I pushed some string values in to the STL Queue.
Now i need to pop the values from that queue using thread in MFC application.
Nice to know. And what is the question?
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]
|
|
|
|
|
Hi,
i am using MFC application in this application i need to display the received messages from the server (may be a chance for receiving more than one messages at a time) i need to display the received and send messages in the Listbox.
i tried it in normal way, but the UI getting freezed after some time. I can able to log that message. So i tried it in some other way, like using queue
the received messages are added in the queue and at thet time timer is running and one thread will pop the pushed messages in to the ListBox.
Using thread how can i get the pushed value?
Thanks,
Ratheesh.
|
|
|
|
|
You should add the messages to the queue using a worker thread, then notify it to the GUI thread (using, for instance PostMessage ). The GUI thread eventually pops messages from the queue and displays them. of course you've to lock in same way queue access.
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's probably not safe AS-IS. (stl is not by design thread-safe)
I suggest you implement a simple synchronization mechanism (see Thread Synchronization for Beginners[^] )
This signature was proudly tested on animals.
|
|
|
|
|
|
thats nice .. but you might have missed the fact this is primarily a SOURCE CODE/PROBLEM SHARING SITE .. so if you wish to advertise your product, please pay for doing so !!!
'g'
|
|
|
|
|
May I politely ask you to avoid advertising in this forum?
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]
|
|
|
|
|
Sorry, the goal is not to add spams to CodeProject but to contribute to encourage developers to focus more in design ( a free version is sufficient for many c++ projects to detect design problems).
anywhay i deleted the message.
falconI
|
|
|
|
|
Humm ? what are you saling anyways?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi all,
I m creating my application MFC,When i run this application on my PC than its working fine,but when i run this application on diffrent PC than its crash at many diffrent locations.
Please can u tell me how can i get crashing location of application.
is there any software or utility which helps me?
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Read this article very carefully:
http://www.flounder.com/debug_release.htm[^]
It lists many common errors that show up in Release rather than Debug mode, and also how to add symobols so you can work out where things are actually crashing.
As for "many different locations", then try and get just one location at a time by being very consistent in how you get to the crash.
Good luck,
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/[ ^]
|
|
|
|
|
Use Process Dumper tool to get the dump file and analyze it.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Create a crash dump and send it. Will try and analyze it.
Check this link to create a crash dump - Capturing Application Crash Dumps[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
The name of the module and the offset of the exception will be in the users Application Log of the event viewer. Although a crash dump is certainly useful there is no reason to create one.
How to view and manage event logs in Event Viewer in Windows XP[^]
You can use WinDbg to find the corresponding code if you have saved your symbols. It is very important that you use the same symbols at the time of the Release build otherwise you will not find the correct crash location.
Debugging Tools for Windows - Overview[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
Can i use STL queue in MFC application?
How can i use it in my application?
Thanks,
Ratheesh.
|
|
|
|
|
|
Hi All,
i am importing msxml4.dll but i am getting this error:-
"fatal error C1083: Cannot open type library file: 'msxml.dll': No such file or directory"
even though it is present in windows\system32 and i registered it from there.Please help me.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Hi guys
I have a LPCTSTR property in an activex control I'm designing. (I can't change the property to CString or something else unfortunately)
How do I exchange this property with a EditBox control in the property box? I can't just use a CString, even though DDP_Text function asks for a CString type variable. .
m_CaptionText is CString type *value* variable, set for the EditBox control (IDC_CAPTIONTEXT). CaptionText is the property name.
DDP_Text(pDX, IDC_CAPTIONTEXT, m_CaptionText, _T("CaptionText"));
DDX_Text(pDX, IDC_CAPTIONTEXT, m_CaptionText);
Any help would be highly appreciated.
Cheers
|
|
|
|
|
const CString CAPTION_TEXT = _T("CaptionText");//or without const
DDP_Text(pDX, IDC_CAPTIONTEXT, m_CaptionText, CAPTION_TEXT );
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
im using the below code to increase the column width of each item of HeaderCtrl ...
the below code works fine when the font in headerCtrl and ListCtrl is normal(ie font size 10) suppose if increase the font size in ListCtrl and HeaderCtrl the ColumnWidth is not calculated according the Text width..ie the text in the item of headerCtrl is getting ellipsed..
CHeaderCtrl* pHeaderCtrl = GetHeaderCtrl();
SetRedraw(FALSE);
int nColumnCount = pHeaderCtrl->GetItemCount();
for(int i = 0; i < nColumnCount; i++)
{
SetColumnWidth(i, LVSCW_AUTOSIZE);
int nColumnWidth = GetColumnWidth(i);
SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
int nHeaderWidth = GetColumnWidth(i);
SetColumnWidth(i, max(nColumnWidth, nHeaderWidth));
}
SetRedraw(TRUE);
In the above code im planning to set the columnwidth of each item in the header Ctrl based on the max width among the text of item in ListCtrl and the text of item in HeaderCtrl...but when the font is increased it"s not calculated properly..
Please try to help..
|
|
|
|
|
kumar sanghvi wrote: but when the font is increased it"s not calculated properly..
Have you tried using CDC::GetTextExtent[^] to calculate the string width?
Best Wishes,
-David Delaune
|
|
|
|
|
Hi All
How can i copy excel sheet?I have a two excel file(ExcelSource.xls and ExcelDes.xls).ExcelDes.xls have allready two sheet(Sheet1 and Sheet2).Now i try to copy sheet1 from ExcelSource.xls to ExcelDes.xls in sheet3.
Plz give me tips.
Thanks in Advance.
|
|
|
|
|
You said it worked[^], right?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
yes it's working but when i write more than 50thousend rows in sheets(more than one sheet) then it's showing error.
Unhandled exception at 0x7c812a6b in Excel.exe: Microsoft C++ exception: CMemoryException at memory location 0x0237e2b4..
In dbgheap.c line pvBlk = _heap_alloc_dbg_impl(nSize, nBlockUse, szFileName, nLine, errno_tmp);
Can you give me tips for that?
|
|
|
|
|
I'm not sure how is it implemented (I think that it does not free the heap memory until the last bit is read into its buffer). You might want to take a look at the code and modify it to add some sort of paging mechanism.
Have you tried XLW? Is that not working as well?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|